• If you are experiencing issues logging in, we moved to a new and more secure software and older account passwords were not able to be migrated. We recommend trying to reset your password, then contacting us if there are issues.
  • Nearly done! Migration cleanup is mostly done. There are a small number of issues left that we continue to work on, but all the heavy lifting is done. We still would love to hear feedback over at this thread and also check out the new XDA app! Thanks and we hope you enjoy the new forums, and thanks for your support of XDA <3

[ROM][LineageOS 14.1][substratum] for Moto G LTE [peregrine]

MSe1969

Elite Member
Dec 16, 2016
1,371
2,511
113
Frankfurt Rhine-Main metropolitan region
Hi,

this is my unofficial LineageOS 14.1 build for the Moto G LTE (peregrine) device with current security patches, microG patch and substratum support.

As announced here, LineageOS has discontinued to deliver official 14.1 builds in the course of providing LineageOS 16.0 builds, but the 14.1 tree will continue to be maintained for security patches by the community (I am one of these contibutors, btw). So this build will continue.

As the pregerine and the falcon device belong to the same device family and share the same kernel, the build is in fact very similar to my 'falcon' builds, so you may also want to browse in my XDA falcon thread to obtain further information.


The build has got the following features:
  • LineageOS 14.1 with current security patches (from official LineageOS repositories)
  • Security string 2020-11-05, AOSP tag 7.2.1_r36
  • Adapted LineageOS Jelly Browser (additionally having Startpage and Qwant as search engines)
  • Root is not included and would need to be flashed separately
  • Patched for the use of the substratum theme engine (the substratum app and the themes need to be downloaded separately)
  • System certificates taken from AOSP Oreo branch
  • Kernel forked from LineageOS and updated with many security patches
  • OTA Support
  • Enforcing SELinux

There are two build variants available:

A. Default LineageOS 14.1 with substratum and microG patch
  • Patched for the use of microG - you can either flash Gapps or manually install microG as apps (or use neither of those)
  • Android System Webview M86
Download here

B. Hardened build with pre-installed microG and F-Droid, patched for substratum
For the security/privacy focused. It has to be said that microG seems to run better if it is pre-installed.
  • Pre-installed microG same as the LineageOS for microG project
  • Pre-installed AuroraStore / AuroraServices
  • Additional security hardening features listed below
  • SQLite 'secure delete' feature enabled
  • Access to /proc/net blocked for user apps
  • Bundled netmonitor app to allow network monitoring
  • Enhanced Privacy Guard: Switches for motion sensors and other sensors available
  • Oreo backport: SET_TIME_ZONE permission restricted to system apps
  • Oreo backport: Access to timers in /proc restricted
  • Cloudflare as default DNS (instead of Google)
  • Privacy-preferred default settings
  • No submission of IMSI/phone number to Google when GPS is in use
  • Bromite System Webview M86
Download here

Source Code links
LineageOS: https://github.com/LineageOS
Kernel: https://github.com/lin14-mGoms/android_kernel_motorola_msm8226/tree/mse_v1
microG patches:
(1) https://github.com/microg/android_p...aster/patches/android_frameworks_base-N.patch
(2) https://github.com/microg/android_p...aster/patches/android_frameworks_base-N.patch
Patches for Substratum: https://github.com/LineageOMS
local manifest: https://github.com/lin14-mGoms/local_manifests/tree/cm-14.1-oms

Installation Instructions

YOU ARE RESPONSIBLE SOLELY YOURSELF FOR ANY ACTIONS YOU DO WITH YOUR DEVICE !!!
Please note - I won't explain any single aspect (e.g. how to install 'fastboot' on your PC or troubleshoot USB connectivity issues under Windows). Search the net and consult the search engine of your choice or look here in XDA, there is plenty information available.

Pre-Requisites
  • Get familiar with the hardware keys of the Motorola Moto G LTE (peregrine) device, especially how to enter fastboot mode (switch phone off hold power + volume down together for about 3 seconds) and recovery mode (in fastboot mode, switch with volume down key to the reboot recovery option and select with volume up key)
  • Have fastboot and adb installed on your PC and make sure, you can connect via USB to your device in fastboot mode and via adb
  • Download the most current .ZIP file of this ROM and place it to your phone's internal memory
  • An unlocked bootloader (read the warnings carefully and backup your data!)
  • Your bootloader must at least be on version 41.18 (find out via fastboot getvar version-bootloader) - if your bootloader is below that version, the ROM will refuse to install. In that case, you need to upgrade the BL first. See e.g. here for more info. (I currently do not find the link, which I have used some years back, but the provided link should be helpful, too)

Install TWRP recovery
If you come from stock ROM and have just unlocked your boot loader, this is the next thing to do. If you have already a working custom recovery on your device, there is no necessity to replace it.
However - I recommend to use the TWRP recovery. The following instructions are based on TWRP.
To install TWRP, download the TWRP.img file (Note: replace "TWRP.img" in the following instructions with the real file name) from this section to your PC, get it into 'fastboot mode', connect the device via USB to your PC and enter the following command on your PC:
Code:
fastboot flash recovery TWRP.img
Afterwards, directly boot into 'recovery mode' (see above) - I recommend not to boot the phone's Android system after having flashed TWRP. Once TWRP has been launched, you may decide to reboot your phone and install the ROM at any time later. But the first boot after flashing TWRP should be TWRP in recovery mode.

Advanced Wipe
ONLY perform the steps described here, if you come from Stock ROM or a different Custom ROM!
Boot into recovery mode. In TWRP, choose "Wipe", "Advanced" and specify "Dalvik", "System", "Cache" and "Data" to be wiped.
Make sure NOT to wipe "Internal memory" (or "SD Card", if shown). Swipe to confirm the deletion and get back into the main menu.

GApps (only for build variant A - do not flash on build variant B!)
You have the choice: a. Use microG - b. Flash GApps - c. Neither of those (obviously, you cannot combine those options!)
'microG' is installed simply by installing the respective apps, no flashing necessary. If you wish to have GApps, they need to be flashed together with the ROM. Download GApps in that case only from opengapps.org and put the .ZIP also to the Internal memory of your device. Choose ARM as platform, Android 7.1 and the flavor of your choice. I strongly recommend "pico" for two reasons:
1. The Moto G LTE has not much internal memory (8 GB) and GApps are notoriously known to waste a lot of space
2. It leaves you the most freedom to only install, what you really need; you can later download and still install all the Google products you want from the play store, so you do not need to live with pre-installed Google stuff you have no use for.
The 'microG patch' in this ROM has no negative impact on installing Gapps.

Install the ROM
In the TWRP main menu, choose "Install". A file manager appears to let you navigate to your internal memory (path /sdcard).
Choose the .ZIP file of this ROM and swipe to flash. If you update from a previous version of this ROM, you don't need to perform a wipe. If in that case, you had GApps already installed before the update, there is no need to flash them again. They will be automatically restored during the flash process.
If you come from a different ROM (or stock firmware), make sure that you have performed the Wipe steps above. If you want to install GApps, flash them directly after the ROM, do not reboot in between. (Note: If you wish to get rid of previously installed GApps, navigate to TWRP's file manager in the Advanced section of the main menu, go to path /system/addon.d and delete the file 70-gapps.sh, before flashing the ROM update)
When finished flashing, return to the main menu, choose "Reboot" and then "System", which will cause your phone to boot into Lineage OS 14.1 - be patient, the first boot after flashing a new ROM takes quite long!


Credits
Android Open Source project (AOSP)
LineageOS project
microG project
Substratum team


XDA:DevDB Information
[ROM][LineageOS 14.1][substratum] for Moto G LTE [peregrine], ROM for the Moto G

Contributors
MSe1969
Source Code: https://github.com/lin14-mGoms/local_manifests

ROM OS Version: 7.x Nougat
ROM Kernel: Linux 3.4.x

Version Information
Status: Stable
Stable Release Date: 2020-10-12

Created 2019-09-12
Last Updated 2020-11-08
 

MSe1969

Elite Member
Dec 16, 2016
1,371
2,511
113
Frankfurt Rhine-Main metropolitan region
Change Log

November 08th, 2020
  • ASB Security string 2020-11-05
  • Fix of AOSP E-Mail widget
  • Fix for CVE-2020-15999
  • Standard flavor only: System Webview on 86.0.4240.185
  • microG flavor only: Bromite Webview on 86.0.4240.181
  • microG flavor only: Updated microG with fixes in GCM and EN API
  • microG flavor only: Replaced weak F-Droid signatures with ROM's V2 signatures

October 12th, 2020
  • ASB Security string 2020-10-05
  • Updated TimeService.apk
  • microG flavor only: Bromite Webview on 86.0.4240.73
  • microG flavor only: updated microG with included Exposure notification API (for Covid tracing apps)

September 14th, 2020
  • ASB Security string 2020-09-05
  • Standard flavor only: System Webview on 85.0.4183.101
  • microG flavor only: Bromite Webview on 85.0.4183.86

August 9th, 2020
  • ASB Security string 2020-08-05
  • Standard flavor only: System Webview on 84.0.4147.89
  • microG flavor only: Bromite Webview on 84.0.4147.113

July 12th, 2020
  • ASB Security string 2020-07-05
  • microG flavor only: updated prebuilt microG GmsCore fom /e/ project to fix FCM registration issues
  • microG flavor only: F-Droid updated to 1.8 / F-Droid privileged extension updated to 0.2.11
  • microG flavor only: Aurorastore updated to 3.2.9 / AuroraServices updated to 1.0.6

June 09th, 2020
  • ASB Security string 2020-06-05
  • Standard flavor only: System Webview on 81.0.4044.138
  • microG flavor only: Bromite Webview on 83.0.4103.76

May 07th, 2020
  • ASB Security string 2020-05-05
  • Standard flavor only: System Webview on 81.0.4044.117
  • microG flavor only: Bromite Webview on 81.0.4044.127
  • microG flavor only: AuroraStore updated to 3.2.8

April 10th, 2020
  • ASB Security string 2020-04-05
  • Fix for CVE-2020-8597 (external/ppp)
  • Kernel: CVE-2019-10638 siphash 128bit for IP generation
  • Standard flavor only: System Webview on 80.0.3987.132
  • microG flavor only: Bromite Webview on 81.0.4044.76
  • microG flavor only: AuroraStore updated to 3.2.4

March 07th, 2020
  • ASB Security string 2020-03-05
  • Standard flavor only: System Webview on 80.0.3987.117
  • microG flavor only: Bromite Webview on 80.0.3987.118
  • microG flavor only: AuroraStore updated to 3.2.0
  • microG flavor only: Added Netguard app (F-Droid version) to SELinux domain allowing to access /proc/net

February 07th, 2020
  • ASB Security string 2020-02-01
  • Standard flavor only: System Webview on 79.0.3945.136
  • microG flavor only: Bromite Webview on 79.0.3945.139
  • microG flavor only: AuroraStore updated to 3.1.8

January 13th, 2020
  • ASB Security string 2020-01-05
  • Standard flavor only: System Webview on 79.0.3945.116
  • microG flavor only: Bromite Webview on 79.0.3945.107
  • microG flavor only: AuroraStore updated to 3.1.7
  • microG flavor only: AuroraServices updated to 1.0.5

December 7th, 2019
  • ASB Security string 2019-12-05
  • Standard flavor only: System Webview on 78.0.3904.96
  • microG flavor only: AuroraStore updated to 3.1.5 (variant B only)

November 10th, 2019
  • ASB Security string 2019-11-05
  • microG flavor only: Bromite Webview on 78.0.3904.72
  • microG flavor only: microG GMS core updated to 0.2.9

October 15th, 2019
  • ASB Security string 2019-10-05
  • Standard flavor only: System Webview on 77.0.3865.92
  • microG flavor only: Bromite Webview on 77.0.3865.104
  • microG flavor only: AuroraStore updated to 3.1.3

September 12th, 2019
Initial creation - same approach like in my Moto G (falcon) thread
  • Security string 2019-09-05
  • AOSP tag 7.2.1_r36
  • System certificates from Oreo AOSP branch
  • Patched repositories according to LineageOMS project to support substratum
  • OTA Support
  • Build variant A - Standard LineageOS 14.1 with microG and substratum patches
  • Android System Webview M76
  • Build variant B - hardened microG build with substratum patches and additional security hardening
  • Bromite System Webview M76
  • Prebuilt microG and F-Droid
  • Prebuilt Aurora Store (with AuroraServices)
 
Last edited:

MSe1969

Elite Member
Dec 16, 2016
1,371
2,511
113
Frankfurt Rhine-Main metropolitan region
Tips and Tricks

microG installation on build variant A
The ROM (build variant A) is patched for the use of microG, but it does not contain the microG system components.
The best way to obtain them is to install the F-Droid store as app store and to include the microG repository as described on the microG Download page, where you will also find links for the direct download of the .apk files.
Please refer to the official installation instructions. However, there are three pieces of information, which are explained on the microG pages, but unfortunately not directly in the installation instructions, so I would like to point them out here:
  1. Download the latest 'unstable' Gms Core version to avoid "outdated play services" warnings
  2. The Location Provider functionality is included in Gms Core, but also available as separate application. I recommend Gms Core - however, the explanation is not included in Gms Core, but only here
  3. To grant the signature spoofing permission, go to Settings - Apps - Advanced (the 'gear' icon) - App Permissions - Spoof package signature; it is not possible when you enter the individual app's permissions menu
  4. Make sure to grant all permissions to the location and microG apps (best via running the self-test)


Install substratum
This ROM is patched to support the substratum theme engine, so no root required because of substratum (different from unpatched ROMs). Simply download and install the substratum theme engine from the play store (or look further down, if you don't use GApps) and also the theme(s), you wish to use. For any support with regards to substratum itself and the themes, please search on XDA in the respective forums. You may of course also ask here in this thread and I hope people participating here will answer, but I am no substratum expert, so please do not expect too much support from my side, when it comes to substratum details.
Btw, the ROM also works without substratum, so you can simply use it without, e.g. because of the microG patch.


Getting the substratum app without GApps
Without GApps, no official Play store . . . - but: When you search in XDA / the internet or simply install F-Droid (and for example search for "play store" in F-Droid), you will find a suitable alternative . . . ;)


Root
Although not needed for substratum, there are many further valid reasons why root is needed (I myself also use it). The most popular options are:
Note that I cannot and will not support any issues related to Magisk and/or SuperSU


Details about the build variant B (hardened microG build)
The security hardening features of the 2nd build variant are described here
 
Last edited:

MSe1969

Elite Member
Dec 16, 2016
1,371
2,511
113
Frankfurt Rhine-Main metropolitan region
If you come from an official LineageOS 14.1 build and you would like to "dirty-flash" the 'Standard' build (variant A) - i.e. no wipe to keep your stuff (my recommendation is to do a clean install, see OP) - these instructions on the LineageOS Wiki are helpful. I will however not further explain this, you need to know, what you are doing (if you don't understand these instructions, it really is better and in your own interest, if you don't do it)
For build variant B, I really recommend a clean flash!
 

MSe1969

Elite Member
Dec 16, 2016
1,371
2,511
113
Frankfurt Rhine-Main metropolitan region
Have you tested the gyroscope? In previous los 14.1 builds there was the rotation issue...
Not sure what you mean - Rotation seems to work normally. (Have to admit however that so far I have only built for falcon and the peregrine was only recently donated to me - but difference between falcon and peregrine in regards to building is only the device repo, rest including device-common and kernel is the same - and I've never noticed such an issue with falcon)
 

MaCianz

Senior Member
Dec 13, 2017
125
39
0
Not sure what you mean - Rotation seems to work normally. (Have to admit however that so far I have only built for falcon and the peregrine was only recently donated to me - but difference between falcon and peregrine in regards to building is only the device repo, rest including device-common and kernel is the same - and I've never noticed such an issue with falcon)
I mean... Automatic rotation didn't worked for me in los 14.1...anyway, will test and report:good:
 
  • Like
Reactions: MSe1969

sdembiske

Elite Member
Jan 4, 2015
1,222
1,519
113
I mean... Automatic rotation didn't worked for me in los 14.1...anyway, will test and report:good:
I build and maintain an unofficial LOS 14.1 for Moto G LTE Peregrine that is based off the original official local manifest files with no added changes other than those reviewed, verified and committed by LineageOS Gerrit (e.g., latest security patches, etc.). I have no issues with the Gyroscope rotation, nor I have I had any reports of this issue by other members who have downloaded my build.

So ... I suspect the issue resides with your cell phone, either from installing a custom rom other than one based on Lineage, a corruption that has developed in your data, a conflict with another app or a hardware issue that would necessitate a replacement of that particular sensor. There are many apps on Play Store that can be used to re-calibrate the gyroscope sensor if you haven't tried that. As well, if you have not done a full clean flash: in TWRP wipe Cache, Dalvik cache, System and importantly, format data > Yes (i.e., not just a wipe in other words - making sure you back up your data and copy all your pictures, videos etc., over to your pc/laptop first), then try that. Then re-install the rom, open gapps etc.
 
Last edited:

MaCianz

Senior Member
Dec 13, 2017
125
39
0
I build and maintain an unofficial LOS 14.1 for Moto G LTE Peregrine that is based off the original official local manifest files with no added changes other than those reviewed, verified and committed by LineageOS Gerrit (e.g., latest security patches, etc.). I have no issues with the Gyroscope rotation, nor I have I had any reports of this issue by other members who have downloaded my build.

So ... I suspect the issue resides with your cell phone, either from installing a custom rom other than one based on Lineage, a corruption that has developed in your data, a conflict with another app or a hardware issue that would necessitate a replacement of that particular sensor. There are many apps on Play Store that can be used to re-calibrate the gyroscope sensor if you haven't tried that. As well, if you have not done a full clean flash: in TWRP wipe Cache, Dalvik cache, System and importantly, format data > Yes (i.e., not just a wipe in other words - making sure you back up your data and copy all your pictures, videos etc., over to your pc/laptop first), then try that. Then re-install the rom, open gapps etc.
I've done everything...and found out that it's something related to custom kernels.
los 14.1+gapps = rotation ok.
Los 14.1+gapps+any custom kernel(zer0 bye, kaminari, valkirye etc.) = no rotation working.
Anyway...it's not a big deal so i'll keep it like that.
 
  • Like
Reactions: sdembiske

MSe1969

Elite Member
Dec 16, 2016
1,371
2,511
113
Frankfurt Rhine-Main metropolitan region
I've done everything...and found out that it's something related to custom kernels.
los 14.1+gapps = rotation ok.
Los 14.1+gapps+any custom kernel(zer0 bye, kaminari, valkirye etc.) = no rotation working.
Anyway...it's not a big deal so i'll keep it like that.
Just as info: This ROM uses a Fork of the "original" LineageOS Moto msm8226 kernel - with further security patches only (as the LineageOS kernel hasn't been updated since longer time).
The feedback given in my parallel "falcon" thread was positive and also I do not have the impression that the device behavior indicates looking for an alternative kernel...
So if your motivation to use a 3rd party custom kernel is mainly driven by the security patching aspect, you may want to give this ROM's delivered kernel a try.
 
  • Like
Reactions: MaCianz

sdembiske

Elite Member
Jan 4, 2015
1,222
1,519
113
I've done everything...and found out that it's something related to custom kernels.
los 14.1+gapps = rotation ok.
Los 14.1+gapps+any custom kernel(zer0 bye, kaminari, valkirye etc.) = no rotation working.
Anyway...it's not a big deal so i'll keep it like that.
The kernel is just one aspect in the android sensor system, so yes it could be related to the kernel but not in all cases. You could see if a 'virtual' gyroscope app on Play Store could help in your case.

The diagram I've attached presents a great overview of the android sensor framework system (while it displays the
accelerometer sensor in the last frame, it is the same process for the gyroscope):
 

Attachments

Last edited:
  • Like
Reactions: MaCianz

MaCianz

Senior Member
Dec 13, 2017
125
39
0
Just as info: This ROM uses a Fork of the "original" LineageOS Moto msm8226 kernel - with further security patches only (as the LineageOS kernel hasn't been updated since longer time).
The feedback given in my parallel "falcon" thread was positive and also I do not have the impression that the device behavior indicates looking for an alternative kernel...
So if your motivation to use a 3rd party custom kernel is mainly driven by the security patching aspect, you may want to give this ROM's delivered kernel a try.
Nope...i use custom kernels for overclock and underclock:silly:

The kernel is just one aspect in the android sensor system, so yes it could be related to the kernel but not in all cases. You could see if a 'virtual' gyroscope app on Play Store could help in your case.

The diagram I've attached presents a great overview of the android sensor framework system (while it displays the
accelerometer sensor in the last frame, it is the same process for the gyroscope):
I used cpu-z for checking the sensor status, gyroscope was showing correctly x,y,z values.
With custom kernel values were fixed to 0.0.
Anyway, will check if there is some workaround(except flashing stock kernel :eek: )
 
Last edited:

Os_A

Senior Member
Jul 9, 2013
52
14
0
Thank you MSe1969 for bringing this ROM to peregrine. I have both falcon and peregrine in the family and was using the falcon variant of your ROM, which is stable and smooth. Props to you my friend.
 
  • Like
Reactions: MSe1969

Pupet_Master

Elite Member
Nov 10, 2014
1,607
752
113
Daedalus:GlobalNode:HUB
Nope...i use custom kernels for overclock and underclock:silly:


I used cpu-z for checking the sensor status, gyroscope was showing correctly x,y,z values.
With custom kernel values were fixed to 0.0.
Anyway, will check if there is some workaround(except flashing stock kernel :eek: )
Custom kernels for moto g lte are quite old, o would say stock forma the latest Roma have newer drivers that the Roms need
 
  • Like
Reactions: MaCianz

MSe1969

Elite Member
Dec 16, 2016
1,371
2,511
113
Frankfurt Rhine-Main metropolitan region
Hi all,
new builds are available for download with ASB Security String 2019-10-05:

A. Default LineageOS 14.1 with substratum and microG patch
https://www.androidfilehost.com/?fid=1899786940962610093
- System Webview updated to 77.0.3865.92

B. Hardened build with pre-installed microG and F-Droid, patched for substratum
https://www.androidfilehost.com/?fid=1899786940962610092
- Bromite Webview updated to 77.0.3865.104
- AuroraStore updated to 3.1.3

If you are on the September build of this ROM, the updater app will also offer an OTA update.

Regards, M.
 
Last edited: