From ca734124f9f2a310628e30e071675d5338409d2c Mon Sep 17 00:00:00 2001 From: Tad Date: Mon, 23 Sep 2019 12:45:00 -0400 Subject: [PATCH] Generate factory image if needed by device --- Scripts/Common/Functions.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Scripts/Common/Functions.sh b/Scripts/Common/Functions.sh index c9a2935a..27fdf24b 100644 --- a/Scripts/Common/Functions.sh +++ b/Scripts/Common/Functions.sh @@ -184,9 +184,12 @@ processRelease() { echo $INCREMENTAL_ID > $OUT_DIR/$PREFIX-target_files.zip.id; #Image - #echo -e "\e[0;32mCreating fastboot image\e[0m"; - #build/tools/releasetools/img_from_target_files $OUT_DIR/$PREFIX-target_files.zip \ - # $OUT_DIR/$PREFIX-img.zip || exit 1; + if [ ! -f $OUT_DIR/recovery.img ]; then + echo -e "\e[0;32mCreating fastboot image\e[0m"; + build/tools/releasetools/img_from_target_files $OUT_DIR/$PREFIX-target_files.zip \ + $OUT_DIR/$PREFIX-img.zip || exit 1; + md5sum $OUT_DIR/$PREFIX-img.zip > $OUT_DIR/$PREFIX-img.zip.md5sum; + fi #OTA echo -e "\e[0;32mCreating OTA\e[0m"; @@ -215,11 +218,13 @@ processRelease() { echo -e "\e[0;32mCopying files to archive\e[0m"; mkdir -vp $ARCHIVE; mkdir -vp $ARCHIVE/target_files; + mkdir -vp $ARCHIVE/factory; mkdir -vp $ARCHIVE/incrementals; - cp -v $OUT_DIR/$PREFIX-target_files.* $ARCHIVE/target_files/; + cp -v $OUT_DIR/$PREFIX-target_files.zip* $ARCHIVE/target_files/; + cp -v $OUT_DIR/$PREFIX-img.zip* $ARCHIVE/factory/ || true; cp -v $OUT_DIR/$PREFIX-ota.zip* $ARCHIVE/; - cp -v $OUT_DIR/$PREFIX-incremental_*.zip* $ARCHIVE/incrementals/; + cp -v $OUT_DIR/$PREFIX-incremental_*.zip* $ARCHIVE/incrementals/ || true; fi; echo -e "\e[0;32mRelease processing complete\e[0m"; }