Skip to content

Commit

Permalink
feat(build): generate vndklite gapps images
Browse files Browse the repository at this point in the history
  • Loading branch information
ponces committed Oct 21, 2023
1 parent 5a190ff commit 1010bba
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# AOSP GSI
# TrebleDroid AOSP GSI

## Build
To get started with building AOSP GSI, you'll need to get familiar with [Git and Repo](https://source.android.com/source/using-repo.html) as well as [How to build a GSI](https://github.com/phhusson/treble_experimentations/wiki/How-to-build-a-GSI%3F).
Expand Down
26 changes: 17 additions & 9 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,16 @@ buildGappsVariant() {
echo
}

buildVndkliteVariant() {
buildVndkliteVariants() {
echo "--> Building treble_arm64_bvN-vndklite"
cd sas-creator
sudo bash lite-adapter.sh 64 $BD/system-treble_arm64_bvN.img
cp s.img $BD/system-treble_arm64_bvN-vndklite.img
sudo rm -rf s.img d tmp
mv s.img $BD/system-treble_arm64_bvN-vndklite.img
sudo rm -rf d tmp
echo "--> Building treble_arm64_bgN-vndklite"
sudo bash lite-adapter.sh 64 $BD/system-treble_arm64_bgN.img
mv s.img $BD/system-treble_arm64_bgN-vndklite.img
sudo rm -rf d tmp
cd ..
echo
}
Expand All @@ -97,24 +101,28 @@ generatePackages() {
echo "--> Generating packages"
buildDate="$(date +%Y%m%d)"
xz -cv $BD/system-treble_arm64_bvN.img -T0 > $BD/aosp-arm64-ab-vanilla-14.0-$buildDate.img.xz
xz -cv $BD/system-treble_arm64_bvN-vndklite.img -T0 > $BD/aosp-arm64-ab-vndklite-14.0-$buildDate.img.xz
xz -cv $BD/system-treble_arm64_bvN-vndklite.img -T0 > $BD/aosp-arm64-ab-vanilla-vndklite-14.0-$buildDate.img.xz
xz -cv $BD/system-treble_arm64_bgN.img -T0 > $BD/aosp-arm64-ab-gapps-14.0-$buildDate.img.xz
xz -cv $BD/system-treble_arm64_bgN-vndklite.img -T0 > $BD/aosp-arm64-ab-gapps-vndklite-14.0-$buildDate.img.xz
rm -rf $BD/system-*.img
echo
}

generateOta() {
echo "--> Generating OTA file"
version="$(date +v%Y.%m.%d)"
buildDate="$(date +%Y%m%d)"
timestamp="$START"
json="{\"version\": \"$version\",\"date\": \"$timestamp\",\"variants\": ["
find $BD/ -name "aosp-*" | sort | {
find $BD/ -name "aosp-*-14.0-$buildDate.img.xz" | sort | {
while read file; do
filename="$(basename $file)"
if [[ $filename == *"vanilla"* ]]; then
name="treble_arm64_bvN"
elif [[ $filename == *"vndklite"* ]]; then
if [[ $filename == *"vanilla-vndklite"* ]]; then
name="treble_arm64_bvN-vndklite"
elif [[ $filename == *"gapps-vndklite"* ]]; then
name="treble_arm64_bgN-vndklite"
elif [[ $filename == *"vanilla"* ]]; then
name="treble_arm64_bvN"
else
name="treble_arm64_bgN"
fi
Expand All @@ -137,7 +145,7 @@ setupEnv
buildTrebleApp
buildVanillaVariant
buildGappsVariant
buildVndkliteVariant
buildVndkliteVariants
generatePackages
generateOta

Expand Down

0 comments on commit 1010bba

Please sign in to comment.