diff --git a/Dockerfile b/Dockerfile index b9fd7279be894eaf3b18b21f5e91d929e6a0e04a..d48350c1f47d8607e8e3bbe722aa5e29b41ff925 100644 --- a/Dockerfile +++ b/Dockerfile @@ -153,11 +153,11 @@ RUN apt-get -qq update RUN apt-get -qqy upgrade RUN apt-get install -y bc bison bsdmainutils build-essential ccache cgpt clang cron \ - curl flex g++-multilib gcc-multilib git git-lfs gnupg gperf imagemagick kmod \ + curl flex g++-multilib gcc-multilib git git-lfs gnupg gperf imagemagick img2simg kmod \ lib32ncurses5-dev libncurses5 lib32readline-dev lib32z1-dev libtinfo5 liblz4-tool \ libncurses5-dev libsdl1.2-dev libssl-dev libxml2 \ libxml2-utils lsof lzop maven openjdk-8-jdk pngcrush \ - procps python python3 rsync schedtool squashfs-tools software-properties-common wget xdelta3 xsltproc xxd yasm \ + procps python python3 rsync schedtool simg2img squashfs-tools software-properties-common wget xdelta3 xsltproc xxd yasm \ zip zlib1g-dev RUN curl https://storage.googleapis.com/git-repo-downloads/repo > /usr/local/bin/repo diff --git a/src/build.sh b/src/build.sh index 365de7060cee27db74e0b1172df4988f4cb95576..4e0aa2c7a6a3bc77859a19cc938d9742daa1d471 100755 --- a/src/build.sh +++ b/src/build.sh @@ -256,7 +256,11 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then if [ "$BUILD_SUPER_IMAGE" = true ]; then SKIP_DYNAMIC_IMAGES="odm.img product.img system.img system_ext.img vendor.img" find . -maxdepth 1 -name '*.img' -type f $(printf "! -name %s " $(echo "$SKIP_DYNAMIC_IMAGES")) -exec zip "$ZIP_DIR/$zipsubdir/IMG-$build" {} \; - else + elif [ "$SPARSE_PREBUILT_VENDOR_IMAGE" = true ]; then + echo "Sparsing prebuilt vendor image" + img2simg vendor.img vendor-sparsed.img || return 1 + find . -maxdepth 1 -name '*.img' -type f ! -name vendor.img -exec zip "$ZIP_DIR/$zipsubdir/IMG-$build" {} \; + else find . -maxdepth 1 -name '*.img' -type f -exec zip "$ZIP_DIR/$zipsubdir/IMG-$build" {} \; fi cd "$ZIP_DIR/$zipsubdir" || return 1