diff --git a/Dockerfile b/Dockerfile index f72404e1685b05132afa49c994b39c8acd2dfbe3..46462767febb9f7b92e03c505fc5e878c8efde40 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 159af972edcb47ba3b69f5d0eed61fbf00442951..d56d1ed888951905312e859ee2b47d0c168d925e 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 4852e0df2e0b14fbf8cd209fa53d87484b818944..d7b5fd90a52ffe834cdc5b57aad1c9626276025e 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