Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eabe405e91 | ||
|
|
246520de0b | ||
|
|
5ecf530ffb | ||
|
|
de01a6f9a1 | ||
|
|
470e8fae7d | ||
|
|
4a1518f08e | ||
|
|
6a343a619d | ||
|
|
a2fed94d14 | ||
|
|
c981584ef2 |
@@ -3,28 +3,32 @@
|
|||||||
|
|
||||||
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. Create a new working directory for your LineageOS build and navigate to it:
|
First, open a new Terminal window, which defaults to your home directory. Clone the modified treble_experimentations repo there:
|
||||||
|
|
||||||
mkdir lineage-19.x-build-gsi; cd lineage-19.x-build-gsi
|
git clone https://github.com/AndyCGYan/treble_experimentations
|
||||||
|
|
||||||
|
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-19.1 --git-lfs
|
repo init -u https://github.com/LineageOS/android.git -b lineage-18.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-19.1
|
git clone https://github.com/AndyCGYan/lineage_build_unified lineage_build_unified -b lineage-18.1
|
||||||
git clone https://github.com/AndyCGYan/lineage_patches_unified lineage_patches_unified -b lineage-19.1
|
git clone https://github.com/AndyCGYan/lineage_patches_unified lineage_patches_unified -b lineage-18.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 A64VN A64VS A64GN 64VN 64VS 64GN
|
bash lineage_build_unified/buildbot_unified.sh treble 32B 32BO A64B A64BG A64BO 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: VNDKLite and Secure targets are generated from built images instead of source-built - refer to [sas-creator](https://github.com/AndyCGYan/sas-creator).
|
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).
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ shopt -s nullglob
|
|||||||
for project in $(cd $patches; echo *);do
|
for project in $(cd $patches; echo *);do
|
||||||
p="$(tr _ / <<<$project |sed -e 's;platform/;;g')"
|
p="$(tr _ / <<<$project |sed -e 's;platform/;;g')"
|
||||||
[ "$p" == build ] && p=build/make
|
[ "$p" == build ] && p=build/make
|
||||||
[ "$p" == frameworks/proto/logging ] && p=frameworks/proto_logging
|
|
||||||
[ "$p" == treble/app ] && p=treble_app
|
|
||||||
[ "$p" == vendor/hardware/overlay ] && p=vendor/hardware_overlay
|
[ "$p" == vendor/hardware/overlay ] && p=vendor/hardware_overlay
|
||||||
[ "$p" == vendor/partner/gms ] && p=vendor/partner_gms
|
[ "$p" == vendor/partner/gms ] && p=vendor/partner_gms
|
||||||
pushd $p
|
pushd $p
|
||||||
|
|||||||
+40
-80
@@ -1,6 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
echo ""
|
echo ""
|
||||||
echo "LineageOS 19.x Unified Buildbot"
|
echo "LineageOS 18.x Unified Buildbot"
|
||||||
|
echo "ATTENTION: this script syncs repo on each run"
|
||||||
echo "Executing in 5 seconds - CTRL-C to exit"
|
echo "Executing in 5 seconds - CTRL-C to exit"
|
||||||
echo ""
|
echo ""
|
||||||
sleep 5
|
sleep 5
|
||||||
@@ -20,19 +21,11 @@ then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
NOSYNC=false
|
|
||||||
PERSONAL=false
|
PERSONAL=false
|
||||||
for var in "${@:2}"
|
if [ ${!#} == "personal" ]
|
||||||
do
|
then
|
||||||
if [ ${var} == "nosync" ]
|
PERSONAL=true
|
||||||
then
|
fi
|
||||||
NOSYNC=true
|
|
||||||
fi
|
|
||||||
if [ ${var} == "personal" ]
|
|
||||||
then
|
|
||||||
PERSONAL=true
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Abort early on error
|
# Abort early on error
|
||||||
set -eE
|
set -eE
|
||||||
@@ -46,31 +39,22 @@ 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() {
|
echo "Preparing local manifests"
|
||||||
echo "Preparing local manifests"
|
mkdir -p .repo/local_manifests
|
||||||
mkdir -p .repo/local_manifests
|
cp ./lineage_build_unified/local_manifests_${MODE}/*.xml .repo/local_manifests
|
||||||
cp ./lineage_build_unified/local_manifests_${MODE}/*.xml .repo/local_manifests
|
echo ""
|
||||||
echo ""
|
|
||||||
|
|
||||||
echo "Syncing repos"
|
echo "Syncing repos"
|
||||||
repo sync -c --force-sync --no-clone-bundle --no-tags -j$(nproc --all)
|
repo sync -c --force-sync --no-clone-bundle --no-tags -j$(nproc --all)
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
echo "Setting up build environment"
|
echo "Setting up build environment"
|
||||||
source build/envsetup.sh &> /dev/null
|
source build/envsetup.sh &> /dev/null
|
||||||
mkdir -p ~/build-output
|
mkdir -p ~/build-output
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
repopick -t twelve-burnin -r -f
|
|
||||||
repopick 321337 -r -f # Deprioritize important developer notifications
|
|
||||||
repopick 321338 -r -f # Allow disabling important developer notifications
|
|
||||||
repopick 321339 -r -f # Allow disabling USB notifications
|
|
||||||
repopick 329229 -r -f # Alter model name to avoid SafetyNet HW attestation enforcement
|
|
||||||
repopick 329230 -r -f # keystore: Block key attestation for SafetyNet
|
|
||||||
repopick 331534 -r -f # SystemUI: Add support to add/remove QS tiles with one tap
|
|
||||||
repopick 331791 -r -f # Skip checking SystemUI's permission for observing sensor privacy
|
|
||||||
}
|
|
||||||
|
|
||||||
apply_patches() {
|
apply_patches() {
|
||||||
echo "Applying patch group ${1}"
|
echo "Applying patch group ${1}"
|
||||||
@@ -91,75 +75,51 @@ finalize_device() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
finalize_treble() {
|
finalize_treble() {
|
||||||
|
rm -f device/*/sepolicy/common/private/genfs_contexts
|
||||||
cd device/phh/treble
|
cd device/phh/treble
|
||||||
git clean -fdx
|
git clean -fdx
|
||||||
bash generate.sh lineage
|
bash generate.sh lineage
|
||||||
cd ../../..
|
cd ../../..
|
||||||
cd treble_app
|
|
||||||
bash build.sh release
|
|
||||||
cp TrebleApp.apk ../vendor/hardware_overlay/TrebleApp/app.apk
|
|
||||||
cd ..
|
|
||||||
cd vendor/hardware_overlay
|
|
||||||
git add TrebleApp/app.apk
|
|
||||||
git commit -m "[TEMP] Up TrebleApp to $BUILD_DATE"
|
|
||||||
cd ../..
|
|
||||||
}
|
}
|
||||||
|
|
||||||
build_device() {
|
build_device() {
|
||||||
if [ ${1} == "arm64" ]
|
brunch ${1}
|
||||||
then
|
mv $OUT/lineage-*.zip ~/build-output/lineage-18.1-$BUILD_DATE-UNOFFICIAL-${1}$($PERSONAL && echo "-personal" || echo "").zip
|
||||||
lunch lineage_arm64-userdebug
|
|
||||||
make -j$(lscpu -b -p=Core,Socket | grep -v '^#' | sort -u | wc -l) systemimage
|
|
||||||
mv $OUT/system.img ~/build-output/lineage-19.1-$BUILD_DATE-UNOFFICIAL-arm64$(${PERSONAL} && echo "-personal" || echo "").img
|
|
||||||
else
|
|
||||||
brunch ${1}
|
|
||||||
mv $OUT/lineage-*.zip ~/build-output/lineage-19.1-$BUILD_DATE-UNOFFICIAL-${1}$($PERSONAL && echo "-personal" || echo "").zip
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
build_treble() {
|
build_treble() {
|
||||||
case "${1}" in
|
case "${1}" in
|
||||||
("A64VN") TARGET=a64_bvN;;
|
("32B") TARGET=arm_bvS;;
|
||||||
("A64VS") TARGET=a64_bvS;;
|
("32BO") TARGET=arm_boS;;
|
||||||
("A64GN") TARGET=a64_bgN;;
|
("A64B") TARGET=a64_bvS;;
|
||||||
("64VN") TARGET=arm64_bvN;;
|
("A64BG") TARGET=a64_bgS;;
|
||||||
("64VS") TARGET=arm64_bvS;;
|
("A64BO") TARGET=a64_boS;;
|
||||||
("64GN") TARGET=arm64_bgN;;
|
("64B") TARGET=arm64_bvS;;
|
||||||
|
("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.1-$BUILD_DATE-UNOFFICIAL-${TARGET}$(${PERSONAL} && echo "-personal" || echo "").img
|
|
||||||
make vndk-test-sepolicy
|
make vndk-test-sepolicy
|
||||||
|
mv $OUT/system.img ~/build-output/lineage-18.1-$BUILD_DATE-UNOFFICIAL-${TARGET}$(${PERSONAL} && echo "-personal" || echo "").img
|
||||||
}
|
}
|
||||||
|
|
||||||
if ${NOSYNC}
|
echo "Applying patches"
|
||||||
|
prep_${MODE}
|
||||||
|
apply_patches patches_platform
|
||||||
|
apply_patches patches_${MODE}
|
||||||
|
if ${PERSONAL}
|
||||||
then
|
then
|
||||||
echo "ATTENTION: syncing/patching skipped!"
|
apply_patches patches_platform_personal
|
||||||
echo ""
|
apply_patches patches_${MODE}_personal
|
||||||
echo "Setting up build environment"
|
|
||||||
source build/envsetup.sh &> /dev/null
|
|
||||||
echo ""
|
|
||||||
else
|
|
||||||
prep_build
|
|
||||||
echo "Applying patches"
|
|
||||||
prep_${MODE}
|
|
||||||
apply_patches patches_platform
|
|
||||||
apply_patches patches_${MODE}
|
|
||||||
if ${PERSONAL}
|
|
||||||
then
|
|
||||||
apply_patches patches_platform_personal
|
|
||||||
apply_patches patches_${MODE}_personal
|
|
||||||
fi
|
|
||||||
finalize_${MODE}
|
|
||||||
echo ""
|
|
||||||
fi
|
fi
|
||||||
|
finalize_${MODE}
|
||||||
|
echo ""
|
||||||
|
|
||||||
for var in "${@:2}"
|
for var in "${@:2}"
|
||||||
do
|
do
|
||||||
if [ ${var} == "nosync" ] || [ ${var} == "personal" ]
|
if [ ${var} == "personal" ]
|
||||||
then
|
then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<manifest>
|
<manifest>
|
||||||
<project name="phhusson/vendor_hardware_overlay" path="vendor/hardware_overlay" remote="github" revision="pie" />
|
<project name="phhusson/vendor_hardware_overlay" path="vendor/hardware_overlay" remote="github" revision="pie" />
|
||||||
<project name="phhusson/device_phh_treble" path="device/phh/treble" remote="github" revision="android-12.0" />
|
<project name="phhusson/device_phh_treble" path="device/phh/treble" remote="github" revision="android-11.0" />
|
||||||
<project name="phhusson/vendor_vndk-tests" path="vendor/vndk-tests" remote="github" revision="master" />
|
<project name="phhusson/vendor_vndk-tests" path="vendor/vndk-tests" remote="github" revision="master" />
|
||||||
<project name="phhusson/vendor_interfaces" path="vendor/interfaces" remote="github" revision="android-11.0" />
|
<project name="phhusson/vendor_interfaces" path="vendor/interfaces" remote="github" revision="android-11.0" />
|
||||||
<project name="phhusson/vendor_lptools" path="vendor/lptools" remote="github" revision="master" />
|
|
||||||
<project name="phhusson/vendor_magisk" path="vendor/magisk" remote="github" revision="android-10.0" />
|
<project name="phhusson/vendor_magisk" path="vendor/magisk" remote="github" revision="android-10.0" />
|
||||||
<project name="TrebleDroid/treble_app" path="treble_app" remote="github" revision="master" />
|
|
||||||
<remote name="gitlab" fetch="https://gitlab.com/" />
|
<remote name="gitlab" fetch="https://gitlab.com/" />
|
||||||
<project name="davi.sh/gms-android-12" path="vendor/partner_gms" remote="gitlab" revision="master" />
|
<project name="00p513-dev/partner_gms" path="vendor/partner_gms" remote="gitlab" revision="11" />
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|||||||
Reference in New Issue
Block a user