From 44133204aedcfaeae32e4c91f104e1929cd80ab5 Mon Sep 17 00:00:00 2001 From: Omkar Chandorkar Date: Tue, 24 Jan 2023 17:21:17 +0530 Subject: [PATCH 1/2] build: Add support for using vendor_boot as recovery Signed-off-by: Omkar Chandorkar --- Dockerfile | 2 ++ src/build.sh | 14 +++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0e96372..8ad81bf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -97,6 +97,8 @@ ENV DELETE_OLD_LOGS 0 # Save recovery image ENV RECOVERY_IMG false +# Assume device does not use vendor_boot as recovery by default +ENV VBOOT_IS_RECOVERY false # Ship with Minimal Apps ENV MINIMAL_APPS false diff --git a/src/build.sh b/src/build.sh index dcdf492..c30c5ce 100755 --- a/src/build.sh +++ b/src/build.sh @@ -322,11 +322,15 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then RECOVERY_IMG_NAME="recovery-${build%.*}.img" - if [ -f "recovery.img" ]; then - cp -a recovery.img "$RECOVERY_IMG_NAME" - else - cp -a boot.img "$RECOVERY_IMG_NAME" - fi + if [ "$VBOOT_IS_RECOVERY" = true ]; then + cp -a vendor_boot.img "$RECOVERY_IMG_NAME" + else + if [ -f "recovery.img" ]; then + cp -a recovery.img "$RECOVERY_IMG_NAME" + else + cp -a boot.img "$RECOVERY_IMG_NAME" + fi + fi sha256sum "$RECOVERY_IMG_NAME" > "$RECOVERY_IMG_NAME.sha256sum" mv "$RECOVERY_IMG_NAME"* "$ZIP_DIR/$zipsubdir/" -- GitLab From 8571c55b3a1aaa6244c008dc46dc8ac8a699051e Mon Sep 17 00:00:00 2001 From: Omkar Chandorkar Date: Tue, 24 Jan 2023 17:22:46 +0530 Subject: [PATCH 2/2] build.sh: Use spaces for indentation everywhere - more consistent with rest of the script Signed-off-by: Omkar Chandorkar --- src/build.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/build.sh b/src/build.sh index c30c5ce..5a20079 100755 --- a/src/build.sh +++ b/src/build.sh @@ -296,14 +296,14 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then cd .. fi if [ "$BUILD_SUPER_IMAGE" = true ]; then - find . -maxdepth 1 \( -name '*.img' -o -name '*_scatter.txt' -o -name '*.bin' \) -type f $(printf "! -name %s " $(echo "$SKIP_DYNAMIC_IMAGES")) -exec zip "$ZIP_DIR/$zipsubdir/IMG-$build" {} \; + find . -maxdepth 1 \( -name '*.img' -o -name '*_scatter.txt' -o -name '*.bin' \) -type f $(printf "! -name %s " $(echo "$SKIP_DYNAMIC_IMAGES")) -exec zip "$ZIP_DIR/$zipsubdir/IMG-$build" {} \; 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' -o -name '*_scatter.txt' -o -name '*.bin' \) -type f ! -name vendor.img -exec zip "$ZIP_DIR/$zipsubdir/IMG-$build" {} \; else find . -maxdepth 1 \( -name '*.img' -o -name '*_scatter.txt' -o -name '*.bin' \) -type f -exec zip "$ZIP_DIR/$zipsubdir/IMG-$build" {} \; - fi + fi cd "$ZIP_DIR/$zipsubdir" || return 1 sha256sum "IMG-$build" > "IMG-$build.sha256sum" md5sum "IMG-$build" > "IMG-$build.md5sum" @@ -318,7 +318,7 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then cd "${OUT}" || return 1 fi - if [ "$RECOVERY_IMG" = true ]; then + if [ "$RECOVERY_IMG" = true ]; then RECOVERY_IMG_NAME="recovery-${build%.*}.img" @@ -334,7 +334,7 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then sha256sum "$RECOVERY_IMG_NAME" > "$RECOVERY_IMG_NAME.sha256sum" mv "$RECOVERY_IMG_NAME"* "$ZIP_DIR/$zipsubdir/" - fi + fi done #with only systemimage, we don't have a e-*.zip -- GitLab