[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_msm8226-common" />

<!-- LineageOS repos -->
<project path="packages/resources/devicesettings" name="LineageOS/android_packages_resources_devicesettings" remote="github"/>
<project path="system/qcom" name="LineageOS/android_system_qcom" groups="qcom" />

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

https://github.com/sevenrock/android_kernel_motorola_msm8226 <- https://github.com/RenanQueiroz/android_kernel_motorola_msm8226

https://github.com/sevenrock/proprietary_vendor_motorola/tree/lineage-16.0_msm8226-common <- https://github.com/MotoDevelopment/android_device_motorola_msm8226-common

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 if you ran a build before:

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 \
227120 \
231518 \
230229 230230 230231 230232 230233 230235 230236 230237 230239 230610 230642 \
234544 234611 234613 234649 234832 234837 234884 234886 \
235128 235196 235258 235402 \
236134 236156 236522 236765 \
237125 237226 237740 237741 237743 237859 237957 237958 \
238056 238057 238059

for i in \
lineagehw-hidl \
torch-colorz \
pie-qcom-sepolicy \
pie-battery-styles \
pie-linked-volumes \
pie-qcom-wfd \
; \
do
python vendor/lineage/build/tools/repopick.py -t $i
done

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.

A lot of topics, namely appops and su, were committed upstream so the list of

additionally needed patches got smaller.

My repo produces a ROM with zram enabled, if you do not like that please

revert the two top-most commits from the msm8226-common repo:

https://github.com/sevenrock/android_device_motorola_msm8226-common/commits/lineage-16.0