diff --git a/core/Makefile b/core/Makefile index 1b2b7041e1..06ac70ec81 100644 --- a/core/Makefile +++ b/core/Makefile @@ -3426,6 +3426,8 @@ define dump-dynamic-partitions-info echo "lpmake=$(notdir $(LPMAKE))" >> $(1) $(if $(filter true,$(PRODUCT_BUILD_SUPER_PARTITION)), $(if $(BOARD_SUPER_PARTITION_SIZE), \ echo "build_super_partition=true" >> $(1))) + $(if $(filter true,$(BOARD_BUILD_RETROFIT_DYNAMIC_PARTITIONS_OTA_PACKAGE)), \ + echo "build_retrofit_dynamic_partitions_ota_package=true" >> $(1)) echo "super_metadata_device=$(BOARD_SUPER_PARTITION_METADATA_DEVICE)" >> $(1) $(if $(BOARD_SUPER_PARTITION_BLOCK_DEVICES), \ echo "super_block_devices=$(BOARD_SUPER_PARTITION_BLOCK_DEVICES)" >> $(1)) @@ -3886,7 +3888,7 @@ $(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) \ .PHONY: otapackage otapackage: $(INTERNAL_OTA_PACKAGE_TARGET) -ifeq ($(PRODUCT_RETROFIT_DYNAMIC_PARTITIONS),true) +ifeq ($(BOARD_BUILD_RETROFIT_DYNAMIC_PARTITIONS_OTA_PACKAGE),true) name := $(TARGET_PRODUCT) ifeq ($(TARGET_BUILD_TYPE),debug) name := $(name)_debug @@ -3912,7 +3914,7 @@ $(INTERNAL_OTA_RETROFIT_DYNAMIC_PARTITIONS_PACKAGE_TARGET): $(BUILT_TARGET_FILES otapackage otardppackage: $(INTERNAL_OTA_RETROFIT_DYNAMIC_PARTITIONS_PACKAGE_TARGET) -endif # PRODUCT_RETROFIT_DYNAMIC_PARTITIONS +endif # BOARD_BUILD_RETROFIT_DYNAMIC_PARTITIONS_OTA_PACKAGE endif # build_ota_package diff --git a/core/config.mk b/core/config.mk index fdaaba9f13..c0a159dce6 100644 --- a/core/config.mk +++ b/core/config.mk @@ -1058,6 +1058,19 @@ endif # The metadata device must be supplied to init via the kernel command-line. BOARD_KERNEL_CMDLINE += androidboot.super_partition=$(BOARD_SUPER_PARTITION_METADATA_DEVICE) +BOARD_BUILD_RETROFIT_DYNAMIC_PARTITIONS_OTA_PACKAGE := true + +# If "vendor" is listed as one of the dynamic partitions but without its image available (e.g. an +# AOSP target built without vendor image), don't build the retrofit full OTA package. Because we +# won't be able to build meaningful super_* images for retrofitting purpose. +ifneq (,$(filter vendor,$(BOARD_SUPER_PARTITION_PARTITION_LIST))) +ifndef BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE +ifndef BOARD_PREBUILT_VENDORIMAGE +BOARD_BUILD_RETROFIT_DYNAMIC_PARTITIONS_OTA_PACKAGE := +endif # BOARD_PREBUILT_VENDORIMAGE +endif # BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE +endif # BOARD_SUPER_PARTITION_PARTITION_LIST + else # PRODUCT_RETROFIT_DYNAMIC_PARTITIONS # For normal devices, we populate BOARD_SUPER_PARTITION_BLOCK_DEVICES so the @@ -1079,11 +1092,13 @@ endif ifneq ($(BOARD_SUPER_PARTITION_METADATA_DEVICE),super) BOARD_KERNEL_CMDLINE += androidboot.super_partition=$(BOARD_SUPER_PARTITION_METADATA_DEVICE) endif +BOARD_BUILD_RETROFIT_DYNAMIC_PARTITIONS_OTA_PACKAGE := endif # PRODUCT_RETROFIT_DYNAMIC_PARTITIONS endif # BOARD_SUPER_PARTITION_SIZE .KATI_READONLY := BOARD_SUPER_PARTITION_BLOCK_DEVICES .KATI_READONLY := BOARD_SUPER_PARTITION_METADATA_DEVICE +.KATI_READONLY := BOARD_BUILD_RETROFIT_DYNAMIC_PARTITIONS_OTA_PACKAGE $(foreach device,$(call to-upper,$(BOARD_SUPER_PARTITION_BLOCK_DEVICES)), \ $(eval BOARD_SUPER_PARTITION_$(device)_DEVICE_SIZE := $(strip $(BOARD_SUPER_PARTITION_$(device)_DEVICE_SIZE))) \ diff --git a/tools/releasetools/add_img_to_target_files.py b/tools/releasetools/add_img_to_target_files.py index 1872a58127..da5ea4aa1a 100755 --- a/tools/releasetools/add_img_to_target_files.py +++ b/tools/releasetools/add_img_to_target_files.py @@ -859,11 +859,12 @@ def AddImagesToTargetFiles(filename): banner("vbmeta") AddVBMeta(output_zip, partitions, "vbmeta", vbmeta_partitions) - if OPTIONS.info_dict.get("build_super_partition"): + if OPTIONS.info_dict.get("build_super_partition") == "true": banner("super_empty") AddSuperEmpty(output_zip) - if OPTIONS.info_dict.get("dynamic_partition_retrofit") == "true": + if OPTIONS.info_dict.get( + "build_retrofit_dynamic_partitions_ota_package") == "true": banner("super split images") AddSuperSplit(output_zip)