[OnePlus 3T ROMs, Kernels, Recoveries, & Other Deve] :
For the homegrowers

How to update NLOS-patched build tree?

NLOS is builded against a heavily patched build tree. If something is changed upstream (los) to one of these repos

build
external/busybox
external/toybox
frameworks/av
frameworks/base
frameworks/native
packages/apps/CMParts
packages/apps/Contacts
packages/apps/ContactsCommon
packages/apps/Dialer
packages/apps/ExactCalculator
packages/apps/LockClock
packages/apps/PackageInstaller
packages/apps/PhoneCommon
packages/apps/Settings
packages/apps/WallpaperPicker
system/sepolicy
vendor/cm
vendor/cmsdk

we need to update our patched forks, too.

To do this some kind of "half-automated" script will help us. This script needs some requirements. After repo syncing with nlos.xml, you have one remote configured (let's take framework/base as example - but these prerequisites needs to be meet for all of the above listed repos): github, which points to git://github.com/nvertigo/android_frameworks_base. On github's web interface fork my repo and add the forked repo as remote it your local repo (if you want to use passwordless push, add your public ssh key to your github account):

#assuming your github account is xxx
git add remote xxx git@github.com:xxx/android_frameworks_base.git
#the xxx after remote is just a local name,myou can choose for whatever you
#want, "magenta_unicorn" would be a valid choice

Now we need to add upstream:

git remote add los https://github.com/LineageOS/android_frameworks_base

Create a local nlos-14.1 branch, and make it follow your own fork:

git checkout -b nlos-14.1 xxx/nlos-14.1
git push -uf xxx nlos-14.1

Now you are ready to run this script (adjust GITUSER to your github's account; script is also attached as file, to avoid whitespace errors due to cut'n'paste):

#!/bin/bash

GITUSER="nvertigo"

REPOS="
build
external/busybox
external/toybox
frameworks/av
frameworks/base
frameworks/native
packages/apps/CMParts
packages/apps/Contacts
packages/apps/ContactsCommon
packages/apps/Dialer
packages/apps/ExactCalculator
packages/apps/LockClock
packages/apps/PackageInstaller
packages/apps/PhoneCommon
packages/apps/Settings
packages/apps/WallpaperPicker
system/sepolicy
vendor/cm
vendor/cmsdk"

for i in $REPOS; do
pushd $i

git fetch los cm-14.1
if [ "$?" -gt "0" ] ; then
read -p "$i: fetch los cm-14.1 failed. STRG-C to abort. ENTER to continue"
fi

git checkout nlos-14.1
if [ "$?" -gt "0" ] ; then
read -p "$i: checkout nlos-14.1 failed. STRG-C to abort. ENTER to continue"
fi

git rebase los/cm-14.1
if [ "$?" -gt "0" ] ; then
read -p "$i: rebase on top of los/cm-14.1 failed. STRG-C to abort. ENTER to continue"
fi

git push -f
if [ "$?" -gt "0" ] ; then
read -p "$i: push -f to $GITUSER failed. STRG-C to abort. ENTER to continue"
fi

popd
done

If an error occurs (most likely while rebasing), the script will not continue, but wait for "ENTER". You can pause the script, and send it to background by the shells job control by pressing "CTRL-z". You'll find yourself droped to the shell, you started the script from. cd to the repo that failed, resolve the conflicts and finish the failed git command (most likely "git add [list of all files with resolved conflicts] && git rebase --continue"). Get the script back running in foreground by just typing "fg" on the shell prompt, and hit "ENTER" to continue the script.

Happy rebasing!