diff --git a/Dockerfile b/Dockerfile index 22f8c63b23659410b5189896730e7e53f4b6bfe5..b5fe4167a154eee234980db0a13f7fec28c5b717 100644 --- a/Dockerfile +++ b/Dockerfile @@ -100,6 +100,9 @@ ENV DELETE_OLD_LOGS 0 # Requires ZIP_SUBDIR. ENV OPENDELTA_BUILDS_JSON '' +# Save recovery image +ENV RECOVERY_IMG false + # You can optionally specify a USERSCRIPTS_DIR volume containing these scripts: # * begin.sh, run at the very beginning # * before.sh, run after the syncing and patching, before starting the builds diff --git a/src/build.sh b/src/build.sh index 3ce4622a8c0e14678ee33f8a995928432b00831c..323d9c657cf286a20ceed0670c372bf53f23358a 100755 --- a/src/build.sh +++ b/src/build.sh @@ -243,6 +243,14 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then sha256sum "IMG-$build" > "IMG-$build.sha256sum" md5sum "IMG-$build" > "IMG-$build.md5sum" fi + + if [ "$RECOVERY_IMG" = true ]; then + if [ -f "recovery.img" ]; then + cp -a recovery.img "$ZIP_DIR/$zipsubdir/recovery-${build%.*}img" + else + cp -a boot.img "$ZIP_DIR/$zipsubdir/recovery-${build%.*}img" + fi + fi done cd "$source_dir"