diff --git a/Dockerfile b/Dockerfile index d9e506394b63d6fd41d5ffb69d6bb3b90699712b..dfcbec2bdba6070851d471fcc1b19bf7833658b9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -100,6 +100,12 @@ ENV RECOVERY_IMG false # Assume device does not use vendor_boot as recovery by default ENV VBOOT_IS_RECOVERY false +# Assume device does not need additional files for recovery to boot. +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 + # Ship with Minimal Apps ENV MINIMAL_APPS false diff --git a/src/build.sh b/src/build.sh index a3848a5465628a3556caaff1b0a3ba77f2132119..738ff9708ffe207ed03c65859cf0d09e2e95f1f4 100755 --- a/src/build.sh +++ b/src/build.sh @@ -325,6 +325,28 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then if [ "$RECOVERY_IMG" = true ]; then RECOVERY_IMG_NAME="recovery-${build%.*}.img" + DTBO_IMG_NAME="dtbo-${build%.*}.img" + SUPER_EMPTY_IMG_NAME="super_empty-${build%.*}.img" + VBMETA_IMG_NAME="vbmeta-${build%.*}.img" + VENDOR_BOOT_IMG_NAME="vendor_boot-${build%.*}.img" + + if [ "$RECOVERY_NEEDS_SUPPORT_IMG" = true ]; then + cp -a obj/PACKAGING/target_files_intermediates/lineage_*/IMAGES/dtbo.img "$DTBO_IMG_NAME" + cp -a obj/PACKAGING/target_files_intermediates/lineage_*/IMAGES/super_empty.img "$SUPER_EMPTY_IMG_NAME" + cp -a obj/PACKAGING/target_files_intermediates/lineage_*/IMAGES/vbmeta.img "$VBMETA_IMG_NAME" + sha256sum "$DTBO_IMG_NAME" > "$DTBO_IMG_NAME.sha256sum" + sha256sum "$SUPER_EMPTY_IMG_NAME" > "$SUPER_EMPTY_IMG_NAME.sha256sum" + sha256sum "$VBMETA_IMG_NAME" > "$VBMETA_IMG_NAME.sha256sum" + mv "$DTBO_IMG_NAME"* "$ZIP_DIR/$zipsubdir/" + mv "$SUPER_EMPTY_IMG_NAME"* "$ZIP_DIR/$zipsubdir/" + mv "$VBMETA_IMG_NAME"* "$ZIP_DIR/$zipsubdir/" + fi + + if [ "$RECOVERY_NEEDS_VENDOR_BOOT_IMG" = true ]; then + cp -a obj/PACKAGING/target_files_intermediates/lineage_*/IMAGES/vendor_boot.img "$VENDOR_BOOT_IMG_NAME" + sha256sum "$VENDOR_BOOT_IMG_NAME" > "$VENDOR_BOOT_IMG_NAME.sha256sum" + mv "$VENDOR_BOOT_IMG_NAME"* "$ZIP_DIR/$zipsubdir/" + fi if [ "$VBOOT_IS_RECOVERY" = true ]; then cp -a obj/PACKAGING/target_files_intermediates/lineage_*/IMAGES/vendor_boot.img "$RECOVERY_IMG_NAME"