diff --git a/core/Makefile b/core/Makefile index 54b290ae41..2e5370812e 100644 --- a/core/Makefile +++ b/core/Makefile @@ -2094,6 +2094,7 @@ endif # BUILDING_RAMDISK_IMAGE # # Note: it's intentional to skip signing for boot-debug.img, because it # can only be used if the device is unlocked with verification error. +ifdef BUILDING_BOOT_IMAGE ifneq ($(strip $(TARGET_NO_KERNEL)),true) ifneq ($(strip $(BOARD_KERNEL_BINARIES)),) INSTALLED_DEBUG_BOOTIMAGE_TARGET := $(foreach k,$(subst kernel,boot-debug,$(BOARD_KERNEL_BINARIES)), \ @@ -2148,6 +2149,7 @@ bootimage_debug-nodeps: $(MKBOOTIMG) $(foreach b,$(INSTALLED_DEBUG_BOOTIMAGE_TARGET),$(call build-debug-bootimage-target,$b)) endif # TARGET_NO_KERNEL +endif # BUILDING_BOOT_IMAGE ifeq ($(BUILDING_VENDOR_BOOT_IMAGE),true) ifeq ($(BUILDING_RAMDISK_IMAGE),true) diff --git a/core/board_config.mk b/core/board_config.mk index 95d8af88f0..05b6b29c16 100644 --- a/core/board_config.mk +++ b/core/board_config.mk @@ -342,23 +342,29 @@ endif # Are we building a boot image BUILDING_BOOT_IMAGE := -ifeq ($(BOARD_USES_RECOVERY_AS_BOOT),true) - BUILDING_BOOT_IMAGE := -else ifeq ($(PRODUCT_BUILD_BOOT_IMAGE),) - ifdef BOARD_BOOTIMAGE_PARTITION_SIZE +ifeq ($(PRODUCT_BUILD_BOOT_IMAGE),) + ifeq ($(BOARD_USES_RECOVERY_AS_BOOT),true) + BUILDING_BOOT_IMAGE := + else ifdef BOARD_BOOTIMAGE_PARTITION_SIZE BUILDING_BOOT_IMAGE := true endif else ifeq ($(PRODUCT_BUILD_BOOT_IMAGE),true) - BUILDING_BOOT_IMAGE := true + ifeq ($(BOARD_USES_RECOVERY_AS_BOOT),true) + $(warning *** PRODUCT_BUILD_BOOT_IMAGE is true, but so is BOARD_USES_RECOVERY_AS_BOOT.) + $(warning *** Skipping building boot image.) + BUILDING_BOOT_IMAGE := + else + BUILDING_BOOT_IMAGE := true + endif endif .KATI_READONLY := BUILDING_BOOT_IMAGE # Are we building a recovery image BUILDING_RECOVERY_IMAGE := -ifeq ($(BOARD_USES_RECOVERY_AS_BOOT),true) - BUILDING_RECOVERY_IMAGE := true -else ifeq ($(PRODUCT_BUILD_RECOVERY_IMAGE),) - ifdef BOARD_RECOVERYIMAGE_PARTITION_SIZE +ifeq ($(PRODUCT_BUILD_RECOVERY_IMAGE),) + ifeq ($(BOARD_USES_RECOVERY_AS_BOOT),true) + BUILDING_RECOVERY_IMAGE := true + else ifdef BOARD_RECOVERYIMAGE_PARTITION_SIZE ifeq (,$(filter true, $(TARGET_NO_KERNEL) $(TARGET_NO_RECOVERY))) BUILDING_RECOVERY_IMAGE := true endif @@ -372,7 +378,14 @@ endif BUILDING_VENDOR_BOOT_IMAGE := ifdef BOARD_BOOT_HEADER_VERSION ifneq ($(call math_gt_or_eq,$(BOARD_BOOT_HEADER_VERSION),3),) - ifneq ($(TARGET_NO_VENDOR_BOOT),true) + ifneq ($(TARGET_NO_VENDOR_BOOT),) + $(warning TARGET_NO_VENDOR_BOOT has been deprecated. Please use PRODUCT_BUILD_VENDOR_BOOT_IMAGE.) + ifneq ($(TARGET_NO_VENDOR_BOOT),true) + BUILDING_VENDOR_BOOT_IMAGE := true + endif + else ifeq ($(PRODUCT_BUILD_VENDOR_BOOT_IMAGE),) + BUILDING_VENDOR_BOOT_IMAGE := true + else ifeq ($(PRODUCT_BUILD_VENDOR_BOOT_IMAGE),true) BUILDING_VENDOR_BOOT_IMAGE := true endif endif diff --git a/core/product.mk b/core/product.mk index 624501ea85..666e39049a 100644 --- a/core/product.mk +++ b/core/product.mk @@ -380,6 +380,7 @@ _product_single_value_vars += PRODUCT_BUILD_RAMDISK_IMAGE _product_single_value_vars += PRODUCT_BUILD_USERDATA_IMAGE _product_single_value_vars += PRODUCT_BUILD_RECOVERY_IMAGE _product_single_value_vars += PRODUCT_BUILD_BOOT_IMAGE +_product_single_value_vars += PRODUCT_BUILD_VENDOR_BOOT_IMAGE _product_single_value_vars += PRODUCT_BUILD_VBMETA_IMAGE # List of boot jars delivered via apex