From 3ed148d0455b5dcd2759c9c2866071bac708ad79 Mon Sep 17 00:00:00 2001 From: Jackeagle Date: Wed, 3 May 2023 00:00:37 -0400 Subject: [PATCH] build.sh: Add support for Additional images required for recovery to boot - Some devices like alioth, instantnoodle, instantnoodlep, kebab, lemonade, lemonadep, troika require additional images like vendor_boot and dtbo for recovery to boot. Flags added: RECOVERY_NEEDS_SUPPORT_IMG will copy dtbo,vbmeta,super_empty images RECOVERY_NEEDS_VENDOR_BOOT_IMG will copy vendor_boot image Signed-off-by: Jackeagle --- Dockerfile | 6 ++++++ src/build.sh | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/Dockerfile b/Dockerfile index d9e5063..dfcbec2 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 a3848a5..738ff97 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" -- GitLab