diff options
author | dakkar <dakkar@thenautilus.net> | 2018-07-13 09:56:16 +0100 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2018-07-13 09:56:16 +0100 |
commit | 51179e2339edce30927d94b033118319be7b19f3 (patch) | |
tree | 9f5bcde55d31a7976ed2d95d08010e0c12ad7b6a /build.sh | |
download | dakkar-android-huawei-m5-51179e2339edce30927d94b033118319be7b19f3.tar.gz dakkar-android-huawei-m5-51179e2339edce30927d94b033118319be7b19f3.tar.bz2 dakkar-android-huawei-m5-51179e2339edce30927d94b033118319be7b19f3.zip |
first attempt
Diffstat (limited to 'build.sh')
-rw-r--r-- | build.sh | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..60e33b6 --- /dev/null +++ b/build.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +# mostly copied from github.com:phhusson/treble_experimentations +set -e + +thisdir="$(readlink -f "$(dirname "$0")")" + +release_name="$(date +%y%m%d)" +mkdir -p release/"$release_name" + +jobs=$(nproc) + +repo init -u https://github.com/LineageOS/android.git -b lineage-15.1 + +function clone_or_checkout() { + local dir="$1" + local repo="$2" + local branch="$3" + + if [[ -d "$dir" ]];then + ( + cd "$dir" + git fetch + git reset --hard + git checkout origin/"$branch" + ) + else + git clone "$repo" "$dir" -b "$branch" + fi +} + +clone_or_checkout .repo/local_manifests "$thisdir" master +clone_or_checkout dakkar-patches "$thisdir" master +clone_or_checkout patches https://github.com/phhusson/treble_patches android-8.1 + +repo sync -c -j$jobs --force-sync + +rm -f device/*/sepolicy/common/private/genfs_contexts + +bash "$thidir/apply-patches.sh" patches +bash "$thidir/apply-patches.sh" dakkar-patches + +. build/envsetup.sh + +lunch treble_dakkar_m5 +make WITHOUT_CHECK_API=true BUILD_NUMBER="$release_name" installclean +make WITHOUT_CHECK_API=true BUILD_NUMBER="$release_name" -j$jobs systemimage +make WITHOUT_CHECK_API=true BUILD_NUMBER="$release_name" vndk-test-sepolicy +cp $OUT/system.img release/"$release_name"/system-dakkar-m5.img |