Changes for March 2022

- 19.1, update readme for it too
- Proper target names #2
- Remove obsolete envvars
- Include apply_patches.sh from treble_experimentations
This commit is contained in:
Andy CrossGate Yan 2022-03-16 07:00:18 +00:00
parent a05ed4168e
commit 884974a470
3 changed files with 51 additions and 34 deletions

View File

@ -3,32 +3,28 @@
To get started with building LineageOS GSI, you'll need to get familiar with [Git and Repo](https://source.android.com/source/using-repo.html), and set up your environment by referring to [LineageOS Wiki](https://wiki.lineageos.org/devices/redfin/build) (mainly "Install the build packages") and [How to build a GSI](https://github.com/phhusson/treble_experimentations/wiki/How-to-build-a-GSI%3F). To get started with building LineageOS GSI, you'll need to get familiar with [Git and Repo](https://source.android.com/source/using-repo.html), and set up your environment by referring to [LineageOS Wiki](https://wiki.lineageos.org/devices/redfin/build) (mainly "Install the build packages") and [How to build a GSI](https://github.com/phhusson/treble_experimentations/wiki/How-to-build-a-GSI%3F).
First, open a new Terminal window, which defaults to your home directory. Clone the modified treble_experimentations repo there: First, open a new Terminal window, which defaults to your home directory. Create a new working directory for your LineageOS build and navigate to it:
git clone https://github.com/AndyCGYan/treble_experimentations mkdir lineage-19.x-build-gsi; cd lineage-19.x-build-gsi
Create a new working directory for your LineageOS build and navigate to it:
mkdir lineage-18.x-build-gsi; cd lineage-18.x-build-gsi
Initialize your LineageOS workspace: Initialize your LineageOS workspace:
repo init -u https://github.com/LineageOS/android.git -b lineage-18.1 repo init -u https://github.com/LineageOS/android.git -b lineage-19.1
Clone both this and the patches repos: Clone both this and the patches repos:
git clone https://github.com/AndyCGYan/lineage_build_unified lineage_build_unified -b lineage-18.1 git clone https://github.com/AndyCGYan/lineage_build_unified lineage_build_unified -b lineage-19.1
git clone https://github.com/AndyCGYan/lineage_patches_unified lineage_patches_unified -b lineage-18.1 git clone https://github.com/AndyCGYan/lineage_patches_unified lineage_patches_unified -b lineage-19.1
Finally, start the build script - for example, to build for all supported archs: Finally, start the build script - for example, to build for all supported archs:
bash lineage_build_unified/buildbot_unified.sh treble 32B A64B 64B bash lineage_build_unified/buildbot_unified.sh treble A64B A64BG 64B 64BG
Be sure to update the cloned repos from time to time! Be sure to update the cloned repos from time to time!
--- ---
Note: A-only and VNDKLite targets are generated from AB images instead of source-built - refer to [sas-creator](https://github.com/AndyCGYan/sas-creator). Note: VNDKLite and Secure targets are generated from built images instead of source-built - refer to [sas-creator](https://github.com/AndyCGYan/sas-creator).
--- ---

30
apply_patches.sh Normal file
View File

@ -0,0 +1,30 @@
#!/bin/bash
set -e
patches="$(readlink -f -- $1)"
shopt -s nullglob
for project in $(cd $patches; echo *);do
p="$(tr _ / <<<$project |sed -e 's;platform/;;g')"
[ "$p" == build ] && p=build/make
[ "$p" == vendor/partner/gms ] && p=vendor/partner_gms
pushd $p
git clean -fdx; git reset --hard
for patch in $patches/$project/*.patch;do
if git apply --check $patch;then
git am $patch
elif patch -f -p1 --dry-run < $patch > /dev/null;then
#This will fail
git am $patch || true
patch -f -p1 < $patch
git add -u
git am --continue
else
echo "Failed applying $patch"
exit 1
fi
done
popd
done

View File

@ -46,8 +46,6 @@ echo\
START=`date +%s` START=`date +%s`
BUILD_DATE="$(date +%Y%m%d)" BUILD_DATE="$(date +%Y%m%d)"
WITHOUT_CHECK_API=true
WITH_SU=true
prep_build() { prep_build() {
echo "Preparing local manifests" echo "Preparing local manifests"
@ -64,21 +62,9 @@ prep_build() {
mkdir -p ~/build-output mkdir -p ~/build-output
echo "" echo ""
repopick -t twelve-monet repopick -Q "status:open+project:LineageOS/android_packages_apps_Trebuchet+branch:lineage-19.1"
repopick -Q "status:open+project:LineageOS/android_packages_apps_AudioFX+branch:lineage-19.0"
repopick -Q "status:open+project:LineageOS/android_packages_apps_Etar+branch:lineage-19.0"
repopick -Q "status:open+project:LineageOS/android_packages_apps_Trebuchet+branch:lineage-19.0+NOT+317783+NOT+318747"
repopick -t twelve-burnin repopick -t twelve-burnin
repopick -t twelve-buttons
repopick -t twelve-fingerprint repopick -t twelve-fingerprint
repopick -t twelve-volume-panel-location
repopick -t twelve-swap-volume-buttons
repopick -t twelve-camera-button
repopick -t twelve-navbar-runtime-toggle
repopick -t twelve-buttons-lights
repopick -t twelve-keyboard-lights
repopick -t twelve-statusbar-brightness-and-qs-slider
repopick -t twelve-powermenu
repopick 321337 # Deprioritize important developer notifications repopick 321337 # Deprioritize important developer notifications
repopick 321338 # Allow disabling important developer notifications repopick 321338 # Allow disabling important developer notifications
repopick 321339 # Allow disabling USB notifications repopick 321339 # Allow disabling USB notifications
@ -86,7 +72,7 @@ prep_build() {
apply_patches() { apply_patches() {
echo "Applying patch group ${1}" echo "Applying patch group ${1}"
bash ~/treble_experimentations/apply-patches.sh ./lineage_patches_unified/${1} bash ./lineage_build_unified/apply_patches.sh ./lineage_patches_unified/${1}
} }
prep_device() { prep_device() {
@ -115,25 +101,25 @@ build_device() {
then then
lunch lineage_arm64-userdebug lunch lineage_arm64-userdebug
make -j$(nproc --all) systemimage make -j$(nproc --all) systemimage
mv $OUT/system.img ~/build-output/lineage-19.0-$BUILD_DATE-UNOFFICIAL-arm64$(${PERSONAL} && echo "-personal" || echo "").img mv $OUT/system.img ~/build-output/lineage-19.1-$BUILD_DATE-UNOFFICIAL-arm64$(${PERSONAL} && echo "-personal" || echo "").img
else else
brunch ${1} brunch ${1}
mv $OUT/lineage-*.zip ~/build-output/lineage-19.0-$BUILD_DATE-UNOFFICIAL-${1}$($PERSONAL && echo "-personal" || echo "").zip mv $OUT/lineage-*.zip ~/build-output/lineage-19.1-$BUILD_DATE-UNOFFICIAL-${1}$($PERSONAL && echo "-personal" || echo "").zip
fi fi
} }
build_treble() { build_treble() {
case "${1}" in case "${1}" in
("A64B") TARGET=treble_a64_bvS;; ("A64B") TARGET=a64_bvS;;
("A64BG") TARGET=treble_a64_bgS;; ("A64BG") TARGET=a64_bgS;;
("64B") TARGET=treble_arm64_bvS;; ("64B") TARGET=arm64_bvS;;
("64BG") TARGET=treble_arm64_bgS;; ("64BG") TARGET=arm64_bgS;;
(*) echo "Invalid target - exiting"; exit 1;; (*) echo "Invalid target - exiting"; exit 1;;
esac esac
lunch lineage_${TARGET}-userdebug lunch lineage_${TARGET}-userdebug
make installclean make installclean
make -j$(nproc --all) systemimage make -j$(nproc --all) systemimage
mv $OUT/system.img ~/build-output/lineage-19.0-$BUILD_DATE-UNOFFICIAL-${TARGET}$(${PERSONAL} && echo "-personal" || echo "").img mv $OUT/system.img ~/build-output/lineage-19.1-$BUILD_DATE-UNOFFICIAL-${TARGET}$(${PERSONAL} && echo "-personal" || echo "").img
make vndk-test-sepolicy make vndk-test-sepolicy
} }
@ -170,6 +156,11 @@ do
build_${MODE} ${var} build_${MODE} ${var}
done done
ls ~/build-output | grep 'lineage' || true ls ~/build-output | grep 'lineage' || true
if [ ${MODE} == "treble" ]
then
echo "OTA timestamp: $START"
echo ""
fi
END=`date +%s` END=`date +%s`
ELAPSEDM=$(($(($END-$START))/60)) ELAPSEDM=$(($(($END-$START))/60))