[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>

<!-- Motorola repos -->
<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="sevenrock/android_kernel_motorola_msm8226" remote="github" revision="lineage-16.0" />
<project path="vendor/motorola" name="sevenrock/proprietary_vendor_motorola" remote="github" revision="lineage-16.0" />

<!-- LineageOS repos -->
<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 \
230229 230230 230231 230232 230233 230237 230610 230642 \
233911 \
234168 234190 234351 234353 234544 234613 234649 234832 235402 234837 234861 234884 \
235128 235177

for i in \
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-qsap \
; \
do
python vendor/lineage/build/tools/repopick.py -t $i
done

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

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 is working video playback in instagram and whatsapp,

kernel updates for tmpfile support and some wifi stuff.