From ac067264eb40516379cd1d7d3ac3bdb0cf211d58 Mon Sep 17 00:00:00 2001 From: Jackeagle Date: Fri, 22 Sep 2023 12:32:31 +0530 Subject: [PATCH] build: Add support to include boot.img in recovery-IMG.zip Signed-off-by: Jackeagle --- Dockerfile | 3 +++ Dockerfile.community | 3 +++ src/build.sh | 7 +++++++ 3 files changed, 13 insertions(+) diff --git a/Dockerfile b/Dockerfile index f72404e..4646276 100644 --- a/Dockerfile +++ b/Dockerfile @@ -106,6 +106,9 @@ ENV RECOVERY_NEEDS_SUPPORT_IMG false # Assume device does not use vendor_boot for recovery to boot by default. ENV RECOVERY_NEEDS_VENDOR_BOOT_IMG false +# Assume device does not use boot.img for recovery to boot by default. +ENV RECOVERY_NEEDS_BOOT_IMG false + # Assume device does not use DTBO for recovery to boot by default. ENV RECOVERY_NEEDS_DTBO_IMG false diff --git a/Dockerfile.community b/Dockerfile.community index 159af97..d56d1ed 100644 --- a/Dockerfile.community +++ b/Dockerfile.community @@ -114,6 +114,9 @@ ENV RECOVERY_NEEDS_SUPPORT_IMG false # Assume device does not use vendor_boot for recovery to boot by default. ENV RECOVERY_NEEDS_VENDOR_BOOT_IMG false +# Assume device does not use boot.img for recovery to boot by default. +ENV RECOVERY_NEEDS_BOOT_IMG false + # Assume device does not use DTBO for recovery to boot by default. ENV RECOVERY_NEEDS_DTBO_IMG false diff --git a/src/build.sh b/src/build.sh index 4852e0d..d7b5fd9 100755 --- a/src/build.sh +++ b/src/build.sh @@ -317,6 +317,7 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then fi if [ "$RECOVERY_IMG" = true ]; then + BOOT_IMG_NAME="boot-${build%.*}.img" DTBO_IMG_NAME="dtbo-${build%.*}.img" SUPER_EMPTY_IMG_NAME="super_empty-${build%.*}.img" VBMETA_IMG_NAME="vbmeta-${build%.*}.img" @@ -326,6 +327,9 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then if [ "$RECOVERY_NEEDS_SUPPORT_IMG" = true ]; then # Copy the files specified by the flags + if [ "$RECOVERY_NEEDS_BOOT_IMG" = true ]; then + cp -a obj/PACKAGING/target_files_intermediates/lineage_*/IMAGES/boot.img "$BOOT_IMG_NAME" + fi if [ "$RECOVERY_NEEDS_DTBO_IMG" = true ]; then cp -a obj/PACKAGING/target_files_intermediates/lineage_*/IMAGES/dtbo.img "$DTBO_IMG_NAME" fi @@ -349,6 +353,9 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then # Conditionally include files in zip command based on flags files_to_zip=("$RECOVERY_IMG_NAME") + if [ "$RECOVERY_NEEDS_BOOT_IMG" = true ]; then + files_to_zip+=("$BOOT_IMG_NAME") + fi if [ "$RECOVERY_NEEDS_DTBO_IMG" = true ]; then files_to_zip+=("$DTBO_IMG_NAME") fi -- GitLab