Initial unified commit for Android 11

This commit is contained in:
Andy CrossGate Yan 2021-08-08 05:07:31 +00:00
commit c981584ef2
6 changed files with 200 additions and 0 deletions

35
README.md Normal file
View 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.

133
buildbot_unified.sh Executable file
View File

@ -0,0 +1,133 @@
#!/bin/bash
echo ""
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 ""
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 ""
echo "Setting up build environment"
source build/envsetup.sh &> /dev/null
mkdir -p ~/build-output
echo ""
repopick 289372 # Messaging: Add "Mark as read" quick action for message notifications
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-18.1-$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
make vndk-test-sepolicy
mv $OUT/system.img ~/build-output/lineage-18.1-$BUILD_DATE-UNOFFICIAL-${TARGET}$(${PERSONAL} && echo "-personal" || echo "").img
}
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 ""

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="LineageOS/android_device_google_blueline" path="device/google/blueline" remote="github" />
<project name="AndyCGYan/android_device_google_crosshatch" path="device/google/crosshatch" remote="github" />
<project name="LineageOS/android_kernel_google_msm-4.9" path="kernel/google/msm-4.9" remote="github" />
<project name="razorloves/proprietary_vendor_google" path="vendor/google" remote="github" />
</manifest>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="AndyCGYan/android_device_oneplus_instantnoodle" path="device/oneplus/instantnoodle" remote="github" />
<project name="LineageOS/android_device_oneplus_sm8250-common" path="device/oneplus/sm8250-common" remote="github" />
<project name="LineageOS/android_device_oneplus_common" path="device/oneplus/common" remote="github" />
<project name="LineageOS/android_kernel_oneplus_sm8250" path="kernel/oneplus/sm8250" remote="github" />
<project name="TheMuppets/proprietary_vendor_oneplus" path="vendor/oneplus" remote="github" />
</manifest>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote fetch="https://gitlab.pixelexperience.org" name="gitlab-pe" />
<project name="AndyCGYan/device_xiaomi_raphael" path="device/xiaomi/raphael" remote="github" />
<project name="PixelExperience-Devices/kernel_xiaomi_raphael" path="kernel/xiaomi/raphael" remote="github" revision="eleven" />
<!-- <project name="kdrag0n/proton-clang" path="prebuilts/clang/host/linux-x86/clang-proton" remote="github" revision="master" /> -->
<project name="android/vendor-blobs/vendor_xiaomi_raphael" path="vendor/xiaomi/raphael" remote="gitlab-pe" revision="eleven" />
<project name="PixelExperience/packages_resources_devicesettings-custom" path="packages/resources/devicesettings-custom" remote="github" revision="eleven" />
</manifest>

View File

@ -0,0 +1,8 @@
<?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-11.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" />
</manifest>