Loading core/Makefile +15 −9 Original line number Diff line number Diff line Loading @@ -4536,21 +4536,27 @@ $(PROGUARD_DICT_ZIP) : endif # TARGET_BUILD_APPS # ----------------------------------------------------------------- # super partition image (dist) ifeq (true,$(PRODUCT_BUILD_SUPER_PARTITION)) # BOARD_SUPER_PARTITION_SIZE must be defined to build super image. ifneq ($(BOARD_SUPER_PARTITION_SIZE),) ifeq (true,$(PRODUCT_USE_DYNAMIC_PARTITIONS)) # Dump variables used by build_super_image.py. # Dump variables used by build_super_image.py (for building super.img and super_empty.img). # $(1): output file define dump-super-image-info $(call dump-dynamic-partitions-info,$(1)) $(if $(filter true,$(AB_OTA_UPDATER)), \ echo "ab_update=true" >> $(1)) endef endif # PRODUCT_USE_DYNAMIC_PARTITIONS # ----------------------------------------------------------------- # super partition image (dist) ifeq (true,$(PRODUCT_BUILD_SUPER_PARTITION)) # BOARD_SUPER_PARTITION_SIZE must be defined to build super image. ifneq ($(BOARD_SUPER_PARTITION_SIZE),) ifneq (true,$(PRODUCT_RETROFIT_DYNAMIC_PARTITIONS)) # For real devices and for dist builds, build super image from target files to an intermediate directory. Loading Loading @@ -4631,7 +4637,7 @@ endif # PRODUCT_BUILD_SUPER_PARTITION == "true" # ----------------------------------------------------------------- # super empty image ifeq (true,$(PRODUCT_BUILD_SUPER_PARTITION)) ifeq (true,$(PRODUCT_USE_DYNAMIC_PARTITIONS)) ifneq ($(BOARD_SUPER_PARTITION_SIZE),) INSTALLED_SUPERIMAGE_EMPTY_TARGET := $(PRODUCT_OUT)/super_empty.img Loading @@ -4647,7 +4653,7 @@ $(INSTALLED_SUPERIMAGE_EMPTY_TARGET): $(LPMAKE) $(BUILD_SUPER_IMAGE) $(call dist-for-goals,dist_files,$(INSTALLED_SUPERIMAGE_EMPTY_TARGET)) endif # BOARD_SUPER_PARTITION_SIZE != "" endif # PRODUCT_BUILD_SUPER_PARTITION == "true" endif # PRODUCT_USE_DYNAMIC_PARTITIONS == "true" # ----------------------------------------------------------------- Loading core/config.mk +2 −6 Original line number Diff line number Diff line Loading @@ -890,17 +890,13 @@ ifeq ($(PRODUCT_USE_DYNAMIC_PARTITIONS),true) # Must not be empty. # - BOARD_{GROUP}_PARTITION_PARTITION_LIST: the list of partitions that belongs to this group. # If empty, no partitions belong to this group, and the sum of sizes is effectively 0. $(foreach group,$(call to-upper,$(BOARD_SUPER_PARTITION_GROUPS)), \ $(eval BOARD_$(group)_PARTITION_LIST ?=) \ $(eval .KATI_READONLY := BOARD_$(group)_PARTITION_LIST) \ ) ifeq ($(PRODUCT_BUILD_SUPER_PARTITION),true) $(foreach group,$(call to-upper,$(BOARD_SUPER_PARTITION_GROUPS)), \ $(eval BOARD_$(group)_SIZE := $(strip $(BOARD_$(group)_SIZE))) \ $(if $(BOARD_$(group)_SIZE),,$(error BOARD_$(group)_SIZE must not be empty)) \ $(eval .KATI_READONLY := BOARD_$(group)_SIZE) \ $(eval BOARD_$(group)_PARTITION_LIST ?=) \ $(eval .KATI_READONLY := BOARD_$(group)_PARTITION_LIST) \ ) endif # PRODUCT_BUILD_SUPER_PARTITION # BOARD_*_PARTITION_LIST: a list of the following tokens valid_super_partition_list := system vendor product product_services odm Loading tools/releasetools/add_img_to_target_files.py +2 −1 Original line number Diff line number Diff line Loading @@ -888,10 +888,11 @@ def AddImagesToTargetFiles(filename): banner("vbmeta") AddVBMeta(output_zip, partitions, "vbmeta", vbmeta_partitions) if OPTIONS.info_dict.get("build_super_partition") == "true": if OPTIONS.info_dict.get("use_dynamic_partitions") == "true": banner("super_empty") AddSuperEmpty(output_zip) if OPTIONS.info_dict.get("build_super_partition") == "true": if OPTIONS.info_dict.get( "build_retrofit_dynamic_partitions_ota_package") == "true": banner("super split images") Loading tools/releasetools/merge_target_files.py +3 −3 Original line number Diff line number Diff line Loading @@ -526,9 +526,9 @@ def process_misc_info_txt(framework_target_files_temp_dir, list_prefix='super_', list_suffix='_partition_list') merged_dict.update(merged_dynamic_partitions_dict) # Ensure that add_img_to_target_files rebuilds super_empty.img. This flag # may have been set to false in the partial builds to prevent duplicate # building of super.img and super_empty.img. # Ensure that add_img_to_target_files rebuilds super split images for # devices that retrofit dynamic partitions. This flag may have been set to # false in the partial builds to prevent duplicate building of super.img. merged_dict['build_super_partition'] = 'true' # Replace <image>_selinux_fc values with framework or vendor file_contexts.bin Loading tools/releasetools/test_merge_target_files.py +32 −0 Original line number Diff line number Diff line Loading @@ -174,6 +174,38 @@ class MergeTargetFilesTest(test_utils.ReleaseToolsTestCase): } self.assertEqual(merged_dict, expected_merged_dict) def test_merge_dynamic_partition_info_dicts_IgnoringFrameworkGroupSize(self): framework_dict = { 'super_partition_groups': 'group_a', 'dynamic_partition_list': 'system', 'super_group_a_list': 'system', 'super_group_a_size': '5000', } vendor_dict = { 'super_partition_groups': 'group_a group_b', 'dynamic_partition_list': 'vendor product', 'super_group_a_list': 'vendor', 'super_group_a_size': '1000', 'super_group_b_list': 'product', 'super_group_b_size': '2000', } merged_dict = merge_dynamic_partition_info_dicts( framework_dict=framework_dict, vendor_dict=vendor_dict, size_prefix='super_', size_suffix='_size', list_prefix='super_', list_suffix='_list') expected_merged_dict = { 'super_partition_groups': 'group_a group_b', 'dynamic_partition_list': 'system vendor product', 'super_group_a_list': 'system vendor', 'super_group_a_size': '1000', 'super_group_b_list': 'product', 'super_group_b_size': '2000', } self.assertEqual(merged_dict, expected_merged_dict) def test_process_apex_keys_apk_certs_ReturnsTrueIfNoConflicts(self): output_dir = common.MakeTempDir() os.makedirs(os.path.join(output_dir, 'META')) Loading Loading
core/Makefile +15 −9 Original line number Diff line number Diff line Loading @@ -4536,21 +4536,27 @@ $(PROGUARD_DICT_ZIP) : endif # TARGET_BUILD_APPS # ----------------------------------------------------------------- # super partition image (dist) ifeq (true,$(PRODUCT_BUILD_SUPER_PARTITION)) # BOARD_SUPER_PARTITION_SIZE must be defined to build super image. ifneq ($(BOARD_SUPER_PARTITION_SIZE),) ifeq (true,$(PRODUCT_USE_DYNAMIC_PARTITIONS)) # Dump variables used by build_super_image.py. # Dump variables used by build_super_image.py (for building super.img and super_empty.img). # $(1): output file define dump-super-image-info $(call dump-dynamic-partitions-info,$(1)) $(if $(filter true,$(AB_OTA_UPDATER)), \ echo "ab_update=true" >> $(1)) endef endif # PRODUCT_USE_DYNAMIC_PARTITIONS # ----------------------------------------------------------------- # super partition image (dist) ifeq (true,$(PRODUCT_BUILD_SUPER_PARTITION)) # BOARD_SUPER_PARTITION_SIZE must be defined to build super image. ifneq ($(BOARD_SUPER_PARTITION_SIZE),) ifneq (true,$(PRODUCT_RETROFIT_DYNAMIC_PARTITIONS)) # For real devices and for dist builds, build super image from target files to an intermediate directory. Loading Loading @@ -4631,7 +4637,7 @@ endif # PRODUCT_BUILD_SUPER_PARTITION == "true" # ----------------------------------------------------------------- # super empty image ifeq (true,$(PRODUCT_BUILD_SUPER_PARTITION)) ifeq (true,$(PRODUCT_USE_DYNAMIC_PARTITIONS)) ifneq ($(BOARD_SUPER_PARTITION_SIZE),) INSTALLED_SUPERIMAGE_EMPTY_TARGET := $(PRODUCT_OUT)/super_empty.img Loading @@ -4647,7 +4653,7 @@ $(INSTALLED_SUPERIMAGE_EMPTY_TARGET): $(LPMAKE) $(BUILD_SUPER_IMAGE) $(call dist-for-goals,dist_files,$(INSTALLED_SUPERIMAGE_EMPTY_TARGET)) endif # BOARD_SUPER_PARTITION_SIZE != "" endif # PRODUCT_BUILD_SUPER_PARTITION == "true" endif # PRODUCT_USE_DYNAMIC_PARTITIONS == "true" # ----------------------------------------------------------------- Loading
core/config.mk +2 −6 Original line number Diff line number Diff line Loading @@ -890,17 +890,13 @@ ifeq ($(PRODUCT_USE_DYNAMIC_PARTITIONS),true) # Must not be empty. # - BOARD_{GROUP}_PARTITION_PARTITION_LIST: the list of partitions that belongs to this group. # If empty, no partitions belong to this group, and the sum of sizes is effectively 0. $(foreach group,$(call to-upper,$(BOARD_SUPER_PARTITION_GROUPS)), \ $(eval BOARD_$(group)_PARTITION_LIST ?=) \ $(eval .KATI_READONLY := BOARD_$(group)_PARTITION_LIST) \ ) ifeq ($(PRODUCT_BUILD_SUPER_PARTITION),true) $(foreach group,$(call to-upper,$(BOARD_SUPER_PARTITION_GROUPS)), \ $(eval BOARD_$(group)_SIZE := $(strip $(BOARD_$(group)_SIZE))) \ $(if $(BOARD_$(group)_SIZE),,$(error BOARD_$(group)_SIZE must not be empty)) \ $(eval .KATI_READONLY := BOARD_$(group)_SIZE) \ $(eval BOARD_$(group)_PARTITION_LIST ?=) \ $(eval .KATI_READONLY := BOARD_$(group)_PARTITION_LIST) \ ) endif # PRODUCT_BUILD_SUPER_PARTITION # BOARD_*_PARTITION_LIST: a list of the following tokens valid_super_partition_list := system vendor product product_services odm Loading
tools/releasetools/add_img_to_target_files.py +2 −1 Original line number Diff line number Diff line Loading @@ -888,10 +888,11 @@ def AddImagesToTargetFiles(filename): banner("vbmeta") AddVBMeta(output_zip, partitions, "vbmeta", vbmeta_partitions) if OPTIONS.info_dict.get("build_super_partition") == "true": if OPTIONS.info_dict.get("use_dynamic_partitions") == "true": banner("super_empty") AddSuperEmpty(output_zip) if OPTIONS.info_dict.get("build_super_partition") == "true": if OPTIONS.info_dict.get( "build_retrofit_dynamic_partitions_ota_package") == "true": banner("super split images") Loading
tools/releasetools/merge_target_files.py +3 −3 Original line number Diff line number Diff line Loading @@ -526,9 +526,9 @@ def process_misc_info_txt(framework_target_files_temp_dir, list_prefix='super_', list_suffix='_partition_list') merged_dict.update(merged_dynamic_partitions_dict) # Ensure that add_img_to_target_files rebuilds super_empty.img. This flag # may have been set to false in the partial builds to prevent duplicate # building of super.img and super_empty.img. # Ensure that add_img_to_target_files rebuilds super split images for # devices that retrofit dynamic partitions. This flag may have been set to # false in the partial builds to prevent duplicate building of super.img. merged_dict['build_super_partition'] = 'true' # Replace <image>_selinux_fc values with framework or vendor file_contexts.bin Loading
tools/releasetools/test_merge_target_files.py +32 −0 Original line number Diff line number Diff line Loading @@ -174,6 +174,38 @@ class MergeTargetFilesTest(test_utils.ReleaseToolsTestCase): } self.assertEqual(merged_dict, expected_merged_dict) def test_merge_dynamic_partition_info_dicts_IgnoringFrameworkGroupSize(self): framework_dict = { 'super_partition_groups': 'group_a', 'dynamic_partition_list': 'system', 'super_group_a_list': 'system', 'super_group_a_size': '5000', } vendor_dict = { 'super_partition_groups': 'group_a group_b', 'dynamic_partition_list': 'vendor product', 'super_group_a_list': 'vendor', 'super_group_a_size': '1000', 'super_group_b_list': 'product', 'super_group_b_size': '2000', } merged_dict = merge_dynamic_partition_info_dicts( framework_dict=framework_dict, vendor_dict=vendor_dict, size_prefix='super_', size_suffix='_size', list_prefix='super_', list_suffix='_list') expected_merged_dict = { 'super_partition_groups': 'group_a group_b', 'dynamic_partition_list': 'system vendor product', 'super_group_a_list': 'system vendor', 'super_group_a_size': '1000', 'super_group_b_list': 'product', 'super_group_b_size': '2000', } self.assertEqual(merged_dict, expected_merged_dict) def test_process_apex_keys_apk_certs_ReturnsTrueIfNoConflicts(self): output_dir = common.MakeTempDir() os.makedirs(os.path.join(output_dir, 'META')) Loading