diff --git a/Dockerfile b/Dockerfile index 617990fd8d57a76bd271f022ace1b67f7fb437ef..5303fee09a137882268b1defd423c0d3c02387f6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -99,6 +99,9 @@ ENV MINIMAL_APPS false # Force an eng build even when device name doesn't contain -eng ENV ENG_BUILD false +#Save intermediate system.img even when not in out folder +ENV BACKUP_INTERMEDIATE_SYSTEM_IMG false + # You can optionally specify a USERSCRIPTS_DIR volume containing these scripts: # * begin.sh, run at the very beginning diff --git a/src/build.sh b/src/build.sh index ab233deb8fb6e14a621ed9fa9bf646b9ee0aff9c..de42948da57acb96cd8574ceedf068186e6fb2f9 100755 --- a/src/build.sh +++ b/src/build.sh @@ -222,6 +222,13 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then md5sum "IMG-$build" > "IMG-$build.md5sum" cd "$source_dir/out/target/product/${DEVICE}" || return 1 fi + if [ "$BACKUP_INTERMEDIATE_SYSTEM_IMG" = true ]; then + mv obj/PACKAGING/target_files_intermediates/lineage*/IMAGES/system.img ./ + zip "$ZIP_DIR/$zipsubdir/SYSTEM-$build" system.img + cd $ZIP_DIR/$zipsubdir + sha256sum "SYSTEM-$build" > "SYSTEM-$build.sha256sum" + md5sum "SYSTEM-$build" > "SYSTEM-$build.md5sum" + fi if [ "$RECOVERY_IMG" = true ]; then if [ -f "recovery.img" ]; then