From 4e14323a3119e9ef04fc82a9cc1eb338a6d9b081 Mon Sep 17 00:00:00 2001 From: Paul Trautrim Date: Tue, 13 Aug 2019 16:30:57 +0900 Subject: [PATCH] Add PRODUCT_BUILD_VBMETA_IMAGE to control vbmeta generation In line with the existing PRODUCT_BUILD_*_IMAGE variables, add a flag to control whether vbmeta is generated. Bug: 139328573 Test: manual Change-Id: Id71026f9b0de9019e82e8ef594e718a4b0f3628f --- core/Makefile | 2 ++ core/board_config.mk | 7 +++++++ core/product.mk | 1 + 3 files changed, 10 insertions(+) diff --git a/core/Makefile b/core/Makefile index 6ced0275ad..d486c8e33e 100644 --- a/core/Makefile +++ b/core/Makefile @@ -3396,6 +3396,7 @@ define build-vbmetaimage-target $(hide) rm -rf $(AVB_CHAIN_KEY_DIR) endef +ifdef BUILDING_VBMETA_IMAGE INSTALLED_VBMETAIMAGE_TARGET := $(BUILT_VBMETAIMAGE_TARGET) $(INSTALLED_VBMETAIMAGE_TARGET): PRIVATE_AVB_VBMETA_SIGNING_ARGS := \ --algorithm $(BOARD_AVB_ALGORITHM) --key $(BOARD_AVB_KEY_PATH) @@ -3420,6 +3421,7 @@ $(INSTALLED_VBMETAIMAGE_TARGET): \ .PHONY: vbmetaimage-nodeps vbmetaimage-nodeps: $(build-vbmetaimage-target) +endif # BUILDING_VBMETA_IMAGE endif # BOARD_AVB_ENABLE diff --git a/core/board_config.mk b/core/board_config.mk index db60ceed4e..a6aef87e9b 100644 --- a/core/board_config.mk +++ b/core/board_config.mk @@ -358,6 +358,13 @@ else ifeq ($(PRODUCT_BUILD_USERDATA_IMAGE),true) endif .KATI_READONLY := BUILDING_USERDATA_IMAGE +# Are we building a vbmeta image +BUILDING_VBMETA_IMAGE := true +ifeq ($(PRODUCT_BUILD_VBMETA_IMAGE),false) + BUILDING_VBMETA_IMAGE := +endif +.KATI_READONLY := BUILDING_VBMETA_IMAGE + ########################################### # Now we can substitute with the real value of TARGET_COPY_OUT_VENDOR ifeq ($(TARGET_COPY_OUT_VENDOR),$(_vendor_path_placeholder)) diff --git a/core/product.mk b/core/product.mk index 3d547191c8..b410e5e20d 100644 --- a/core/product.mk +++ b/core/product.mk @@ -361,6 +361,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_VBMETA_IMAGE _product_list_vars += PRODUCT_UPDATABLE_BOOT_MODULES _product_list_vars += PRODUCT_UPDATABLE_BOOT_LOCATIONS