From 087654e41a1d02c283643682b6c5b22114c2798b Mon Sep 17 00:00:00 2001 From: Jackeagle Date: Thu, 26 Oct 2023 15:14:46 +0530 Subject: [PATCH] docker: Add support for vendor_kernel_boot images - All latest Pixel devices have a new partition called vendor_kernel_boot which is required for recovery to boot properly. Signed-off-by: Jackeagle --- Dockerfile | 3 +++ Dockerfile.community | 3 +++ src/build.sh | 10 +++++++++- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4646276..fde2d8c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -118,6 +118,9 @@ ENV RECOVERY_NEEDS_VBMETA_IMG false # Assume device does not use super_image for recovery to boot by default. ENV RECOVERY_NEEDS_SUPER_IMG false +# Assume device does not use vendor_kernel_boot for recovery to boot by default. +ENV RECOVERY_NEEDS_VENDOR_KERNEL_BOOT_IMG false + # Ship with Minimal Apps ENV MINIMAL_APPS false diff --git a/Dockerfile.community b/Dockerfile.community index d56d1ed..115097c 100644 --- a/Dockerfile.community +++ b/Dockerfile.community @@ -126,6 +126,9 @@ ENV RECOVERY_NEEDS_VBMETA_IMG false # Assume device does not use super_image for recovery to boot by default. ENV RECOVERY_NEEDS_SUPER_IMG false +# Assume device does not use vendor_kernel_boot for recovery to boot by default. +ENV RECOVERY_NEEDS_VENDOR_KERNEL_BOOT_IMG false + # Force an eng build even when device name doesn't contain -eng ENV ENG_BUILD false diff --git a/src/build.sh b/src/build.sh index a634d94..6e3aba4 100755 --- a/src/build.sh +++ b/src/build.sh @@ -322,6 +322,7 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then SUPER_EMPTY_IMG_NAME="super_empty-${build%.*}.img" VBMETA_IMG_NAME="vbmeta-${build%.*}.img" VENDOR_BOOT_IMG_NAME="vendor_boot-${build%.*}.img" + VENDOR_KERNEL_BOOT_IMG_NAME="vendor_kernel_boot-${build%.*}.img" RECOVERY_IMG_NAME="recovery-${build%.*}.img" RECOVERY_ZIP_NAME="recovery-IMG-${build%.*}.zip" @@ -347,6 +348,10 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then cp -a obj/PACKAGING/target_files_intermediates/lineage_*/IMAGES/super_empty.img "$SUPER_EMPTY_IMG_NAME" sha256sum "$SUPER_EMPTY_IMG_NAME" > "$SUPER_EMPTY_IMG_NAME.sha256sum" fi + if [ "$RECOVERY_NEEDS_VENDOR_KERNEL_BOOT_IMG" = true ]; then + cp -a obj/PACKAGING/target_files_intermediates/lineage_*/IMAGES/vendor_kernel_boot.img "$VENDOR_KERNEL_BOOT_IMG_NAME" + sha256sum "$VENDOR_KERNEL_BOOT_IMG_NAME" > "$VENDOR_KERNEL_BOOT_IMG_NAME.sha256sum" + fi if [ "$VBOOT_IS_RECOVERY" = true ]; then cp -a obj/PACKAGING/target_files_intermediates/lineage_*/IMAGES/vendor_boot.img "$RECOVERY_IMG_NAME" @@ -382,7 +387,10 @@ if [ -n "${BRANCH_NAME}" ] && [ -n "${DEVICE}" ]; then files_to_zip+=("$SUPER_EMPTY_IMG_NAME") files_to_zip+=("$SUPER_EMPTY_IMG_NAME.sha256sum") fi - + if [ "$RECOVERY_NEEDS_VENDOR_KERNEL_BOOT_IMG" = true ]; then + files_to_zip+=("$VENDOR_KERNEL_BOOT_IMG_NAME") + files_to_zip+=("$VENDOR_KERNEL_BOOT_IMG_NAME.sha256sum") + fi # Zip command zip "$RECOVERY_ZIP_NAME" "${files_to_zip[@]}" sha256sum "$RECOVERY_ZIP_NAME" > "$RECOVERY_ZIP_NAME.sha256sum" -- GitLab