[Moto G 4G Android Development] sevenrock:
These are my current build steps, updated from my last post.

To begin with you need to LineageOS source code

repo init -u git://github.com/LineageOS/android.git -b lineage-16.0
mkdir .repo/local_manifests

Into the just created directory .repo/local_manifests you put this file called local_manifest.xml

<?xml version="1.0" encoding="UTF-8"?>
<manifest>

<project path="device/motorola/peregrine" name="sevenrock/android_device_motorola_peregrine" remote="github" revision="lineage-16.0" />
<project path="device/motorola/msm8226-common" name="sevenrock/android_device_motorola_msm8226-common" remote="github" revision="lineage-16.0" />
<project path="kernel/motorola/msm8226" name="RenanQueiroz/android_kernel_motorola_msm8226" remote="github" revision="lineage-16.0" />
<project path="vendor/motorola" name="RenanQueiroz/proprietary_vendor_motorola" remote="github" revision="lineage-16.0" />

<project path="device/qcom/common" name="LineageOS/android_device_qcom_common" revision="lineage-15.1" remote="github"/>
<project path="packages/apps/Snap" name="LineageOS/android_packages_apps_Snap" />
<project path="packages/resources/devicesettings" name="LineageOS/android_packages_resources_devicesettings" remote="github"/>
<project path="system/extras/su" name="LineageOS/android_system_extras_su" />
<project path="system/qcom" name="LineageOS/android_system_qcom" groups="qcom" />
<project path="vendor/qcom/opensource/cryptfs_hw" name="LineageOS/android_vendor_qcom_opensource_cryptfs_hw" />

</manifest>

My github repos are based on

https://github.com/sevenrock/android_device_motorola_peregrine <- https://github.com/MotoDevelopment/android_device_motorola_falcon.git

https://github.com/sevenrock/android_device_motorola_msm8226-common <- https://github.com/MotoDevelopment/android_device_motorola_msm8226-common.git

Then start the download and get some coffee/tea/whatever, it will take some time

repo sync -c -j 8

After you downloaded the vanilla LineageOS code we start patching it, but before

you should always reset it to vanilla state and resync:

rm -rf out/
repo forall -c 'git reset --hard ; git clean -fdx'
repo sync --force-sync -c -j8

After that you apply the current patches

python vendor/lineage/build/tools/repopick.py \
224813 \
225213 \
226148 226154 226236 \
227108 227120 227260 227261 227821 \
229401 229612 \
230151 230229 230230 230231 230232 230233 230237 230610 230642 230755 \
233911 \
234020 234021 234168 234190 234351 234353 234544 234613 234649 234832 234861 234868 234884

for i in \
pie-mode-bits \
pie-su \
pie-powermenu \
pie-trust-interface \
lineagehw-hidl \
pie-hw-fde \
pie-privacy-guard \
pie-hide-night-display \
torch-colorz \
pie-qcom-sepolicy \
fbe-wrapped-key \
pie-expanded-desktop \
pie-battery-styles \
wifi-dual-interface \
pie-fde-crash-fix \
pie-qc-telephony-ext \
p-display-shrink \
pie-lineage-iosched-sepolicies \
pie-qsap \
; \
do
python vendor/lineage/build/tools/repopick.py -t $i
done

python vendor/lineage/build/tools/repopick.py -p -t \
bt-sbc-hd-dualchannel-pie

python vendor/lineage/build/tools/repopick.py -p -t \
pie-snap

python vendor/lineage/build/tools/repopick.py \
234837

To start the build issue these commands:

source build/envsetup.sh && croot && WITH_SU=true brunch peregrine

If you do not want your ROM to be rooted just omit "WITH_SU=true".

With "WITH_SU=true" you do not need any other package to root your phone.

New since my last post are working zram, root and appops/Privacy guard. I am pretty

happy now with this fully encryptable ROM and switched to it from los-14.1 as my daily

driver. In the first days it was pretty rough due to lmk killing important apps but porting

current zram code solved the problem.

Updated 181127: Removed qsap patch and updated patch list