Initial unified commit for Android 12
This commit is contained in:
commit
d18babde5a
35
README.md
Normal file
35
README.md
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
|
||||||
|
## Building PHH-based LineageOS GSIs ##
|
||||||
|
|
||||||
|
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:
|
||||||
|
|
||||||
|
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:
|
||||||
|
|
||||||
|
repo init -u https://github.com/LineageOS/android.git -b lineage-18.1
|
||||||
|
|
||||||
|
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_patches_unified lineage_patches_unified -b lineage-18.1
|
||||||
|
|
||||||
|
Finally, start the build script - for example, to build for all supported archs:
|
||||||
|
|
||||||
|
bash lineage_build_unified/buildbot_unified.sh treble 32B A64B 64B
|
||||||
|
|
||||||
|
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).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
This script is also used to make device-specific and/or personal builds. To do so, understand the script, and try the `device` and `personal` keywords.
|
140
buildbot_unified.sh
Executable file
140
buildbot_unified.sh
Executable file
@ -0,0 +1,140 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
echo ""
|
||||||
|
echo "LineageOS 19.x Unified Buildbot"
|
||||||
|
echo "ATTENTION: this script syncs repo on each run"
|
||||||
|
echo "Executing in 5 seconds - CTRL-C to exit"
|
||||||
|
echo ""
|
||||||
|
sleep 5
|
||||||
|
|
||||||
|
if [ $# -lt 2 ]
|
||||||
|
then
|
||||||
|
echo "Not enough arguments - exiting"
|
||||||
|
echo ""
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
MODE=${1}
|
||||||
|
if [ ${MODE} != "device" ] && [ ${MODE} != "treble" ]
|
||||||
|
then
|
||||||
|
echo "Invalid mode - exiting"
|
||||||
|
echo ""
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
PERSONAL=false
|
||||||
|
if [ ${!#} == "personal" ]
|
||||||
|
then
|
||||||
|
PERSONAL=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Abort early on error
|
||||||
|
set -eE
|
||||||
|
trap '(\
|
||||||
|
echo;\
|
||||||
|
echo \!\!\! An error happened during script execution;\
|
||||||
|
echo \!\!\! Please check console output for bad sync,;\
|
||||||
|
echo \!\!\! failed patch application, etc.;\
|
||||||
|
echo\
|
||||||
|
)' ERR
|
||||||
|
|
||||||
|
START=`date +%s`
|
||||||
|
BUILD_DATE="$(date +%Y%m%d)"
|
||||||
|
WITHOUT_CHECK_API=true
|
||||||
|
WITH_SU=true
|
||||||
|
|
||||||
|
echo "Preparing local manifests"
|
||||||
|
mkdir -p .repo/local_manifests
|
||||||
|
cp ./lineage_build_unified/local_manifests_${MODE}/*.xml .repo/local_manifests
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
echo "Syncing repos"
|
||||||
|
repo sync -c --force-sync --no-clone-bundle --no-tags -j$(nproc --all)
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
./vendor/lineage/build/tools/repopick.py -t twelve-monet
|
||||||
|
./vendor/lineage/build/tools/repopick.py 317119 # Unset BOARD_EXT4_SHARE_DUP_BLOCKS
|
||||||
|
./vendor/lineage/build/tools/repopick.py 317574 -f # ThemePicker: Grant missing wallpaper permissions
|
||||||
|
./vendor/lineage/build/tools/repopick.py 317602 # Keyguard: don't use large clock on landscape
|
||||||
|
./vendor/lineage/build/tools/repopick.py 317606 # LineageParts: Temporary hax
|
||||||
|
./vendor/lineage/build/tools/repopick.py 317608 # Support for device specific key handlers
|
||||||
|
./vendor/lineage/build/tools/repopick.py 317609 # Allow adjusting progress on touch events.
|
||||||
|
./vendor/lineage/build/tools/repopick.py 318037 # Statusbar: show vibration icon in collapsed statusbar
|
||||||
|
|
||||||
|
echo "Setting up build environment"
|
||||||
|
source build/envsetup.sh &> /dev/null
|
||||||
|
mkdir -p ~/build-output
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
apply_patches() {
|
||||||
|
echo "Applying patch group ${1}"
|
||||||
|
bash ~/treble_experimentations/apply-patches.sh ./lineage_patches_unified/${1}
|
||||||
|
}
|
||||||
|
|
||||||
|
prep_device() {
|
||||||
|
:
|
||||||
|
}
|
||||||
|
|
||||||
|
prep_treble() {
|
||||||
|
apply_patches patches_treble_prerequisite
|
||||||
|
apply_patches patches_treble_phh
|
||||||
|
}
|
||||||
|
|
||||||
|
finalize_device() {
|
||||||
|
:
|
||||||
|
}
|
||||||
|
|
||||||
|
finalize_treble() {
|
||||||
|
rm -f device/*/sepolicy/common/private/genfs_contexts
|
||||||
|
cd device/phh/treble
|
||||||
|
git clean -fdx
|
||||||
|
bash generate.sh lineage
|
||||||
|
cd ../../..
|
||||||
|
}
|
||||||
|
|
||||||
|
build_device() {
|
||||||
|
brunch ${1}
|
||||||
|
mv $OUT/lineage-*.zip ~/build-output/lineage-19.0-$BUILD_DATE-UNOFFICIAL-${1}$($PERSONAL && echo "-personal" || echo "").zip
|
||||||
|
}
|
||||||
|
|
||||||
|
build_treble() {
|
||||||
|
case "${1}" in
|
||||||
|
#("32B") TARGET=treble_arm_bvS;;
|
||||||
|
("A64B") TARGET=treble_a64_bvS;;
|
||||||
|
("64B") TARGET=treble_arm64_bvS;;
|
||||||
|
(*) echo "Invalid target - exiting"; exit 1;;
|
||||||
|
esac
|
||||||
|
lunch ${TARGET}-userdebug
|
||||||
|
make installclean
|
||||||
|
make -j$(nproc --all) systemimage
|
||||||
|
mv $OUT/system.img ~/build-output/lineage-19.0-$BUILD_DATE-UNOFFICIAL-${TARGET}$(${PERSONAL} && echo "-personal" || echo "").img
|
||||||
|
make vndk-test-sepolicy
|
||||||
|
}
|
||||||
|
|
||||||
|
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 ""
|
||||||
|
|
||||||
|
for var in "${@:2}"
|
||||||
|
do
|
||||||
|
if [ ${var} == "personal" ]
|
||||||
|
then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
echo "Starting $(${PERSONAL} && echo "personal " || echo "")build for ${MODE} ${var}"
|
||||||
|
build_${MODE} ${var}
|
||||||
|
done
|
||||||
|
ls ~/build-output | grep 'lineage' || true
|
||||||
|
|
||||||
|
END=`date +%s`
|
||||||
|
ELAPSEDM=$(($(($END-$START))/60))
|
||||||
|
ELAPSEDS=$(($(($END-$START))-$ELAPSEDM*60))
|
||||||
|
echo "Buildbot completed in $ELAPSEDM minutes and $ELAPSEDS seconds"
|
||||||
|
echo ""
|
10
local_manifests_treble/manifest.xml
Normal file
10
local_manifests_treble/manifest.xml
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<manifest>
|
||||||
|
<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/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_magisk" path="vendor/magisk" remote="github" revision="android-10.0" />
|
||||||
|
<remove-project name="platform/packages/apps/Gallery2" />
|
||||||
|
<project name="LineageOS/android_packages_apps_Gallery2" path="packages/apps/Gallery2" remote="github" revision="lineage-18.1" />
|
||||||
|
</manifest>
|
Loading…
x
Reference in New Issue
Block a user