From 51179e2339edce30927d94b033118319be7b19f3 Mon Sep 17 00:00:00 2001 From: dakkar Date: Fri, 13 Jul 2018 09:56:16 +0100 Subject: first attempt --- build.sh | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 build.sh (limited to 'build.sh') 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 -- cgit v1.2.3