Loading core/Makefile +4 −4 Original line number Diff line number Diff line Loading @@ -6629,7 +6629,7 @@ 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)) ifeq ($(words $(BOARD_SUPER_PARTITION_BLOCK_DEVICES)),1) # For real devices and for dist builds, build super image from target files to an intermediate directory. INTERNAL_SUPERIMAGE_DIST_TARGET := $(call intermediates-dir-for,PACKAGING,super.img)/super.img Loading @@ -6647,7 +6647,7 @@ endif .PHONY: superimage_dist superimage_dist: $(INTERNAL_SUPERIMAGE_DIST_TARGET) endif # PRODUCT_RETROFIT_DYNAMIC_PARTITIONS != "true" endif # $(words $(BOARD_SUPER_PARTITION_BLOCK_DEVICES)) == 1 endif # BOARD_SUPER_PARTITION_SIZE != "" endif # PRODUCT_BUILD_SUPER_PARTITION == "true" Loading @@ -6656,7 +6656,7 @@ endif # PRODUCT_BUILD_SUPER_PARTITION == "true" ifeq (true,$(PRODUCT_BUILD_SUPER_PARTITION)) ifneq ($(BOARD_SUPER_PARTITION_SIZE),) ifneq (true,$(PRODUCT_RETROFIT_DYNAMIC_PARTITIONS)) ifeq ($(words $(BOARD_SUPER_PARTITION_BLOCK_DEVICES)),1) # Build super.img by using $(INSTALLED_*IMAGE_TARGET) to $(1) # $(1): built image path Loading Loading @@ -6711,7 +6711,7 @@ superimage-nodeps supernod: | $(INSTALLED_SUPERIMAGE_DEPENDENCIES) $(call build-superimage-target,$(INSTALLED_SUPERIMAGE_TARGET),\ $(call intermediates-dir-for,PACKAGING,superimage-nodeps)/misc_info.txt) endif # PRODUCT_RETROFIT_DYNAMIC_PARTITIONS != "true" endif # $(words $(BOARD_SUPER_PARTITION_BLOCK_DEVICES)) == 1 endif # BOARD_SUPER_PARTITION_SIZE != "" endif # PRODUCT_BUILD_SUPER_PARTITION == "true" Loading tools/releasetools/add_img_to_target_files.py +4 −0 Original line number Diff line number Diff line Loading @@ -667,6 +667,10 @@ def AddSuperEmpty(output_zip): build_super_image.BuildSuperImage(OPTIONS.info_dict, img.name) img.Write() unsparse_img = OutputFile(output_zip, OPTIONS.input_tmp, "IMAGES", "unsparse_super_empty.img") build_super_image.BuildSuperImage(OPTIONS.info_dict, unsparse_img.name, force_non_sparse=True) unsparse_img.Write() def AddSuperSplit(output_zip): """Create split super_*.img and store it in output_zip.""" Loading tools/releasetools/build_super_image.py +5 −5 Original line number Diff line number Diff line Loading @@ -62,14 +62,14 @@ def GetArgumentsForImage(partition, group, image=None): image_size = sparse_img.GetImagePartitionSize(image) if image else 0 cmd = ["--partition", "{}:readonly:{}:{}".format(partition, image_size, group)] "{}:none:{}:{}".format(partition, image_size, group)] if image: cmd += ["--image", "{}={}".format(partition, image)] return cmd def BuildSuperImageFromDict(info_dict, output): def BuildSuperImageFromDict(info_dict, output, force_non_sparse=False): cmd = [info_dict["lpmake"], "--metadata-size", "65536", Loading Loading @@ -133,7 +133,7 @@ def BuildSuperImageFromDict(info_dict, output): cmd += GetArgumentsForImage(partition + "_b", group + "_b", other_image) if info_dict.get("build_non_sparse_super_partition") != "true": if info_dict.get("build_non_sparse_super_partition") != "true" and not force_non_sparse: cmd.append("--sparse") cmd += ["--output", output] Loading Loading @@ -178,11 +178,11 @@ def BuildSuperImageFromTargetFiles(inp, out): return BuildSuperImageFromExtractedTargetFiles(input_tmp, out) def BuildSuperImage(inp, out): def BuildSuperImage(inp, out, force_non_sparse=False): if isinstance(inp, dict): logger.info("Building super image from info dict...") return BuildSuperImageFromDict(inp, out) return BuildSuperImageFromDict(inp, out, force_non_sparse=False) if isinstance(inp, str): if os.path.isdir(inp): Loading tools/releasetools/common.py +10 −2 Original line number Diff line number Diff line Loading @@ -3724,6 +3724,9 @@ class DynamicPartitionsDifference(object): if progress_dict is None: progress_dict = {} self._have_super_empty = \ info_dict.get("build_super_empty_partition") == "true" self._build_without_vendor = build_without_vendor self._remove_all_before_apply = False if source_info_dict is None: Loading Loading @@ -3821,6 +3824,11 @@ class DynamicPartitionsDifference(object): ZipWrite(output_zip, op_list_path, "dynamic_partitions_op_list") script.Comment('Update dynamic partition metadata') if self._have_super_empty: script.AppendExtra('assert(update_dynamic_partitions(' 'package_extract_file("dynamic_partitions_op_list"), ' 'package_extract_file("unsparse_super_empty.img")));') else: script.AppendExtra('assert(update_dynamic_partitions(' 'package_extract_file("dynamic_partitions_op_list")));') Loading tools/releasetools/non_ab_ota.py +9 −0 Original line number Diff line number Diff line Loading @@ -245,6 +245,15 @@ else if get_stage("%(bcb_dev)s") == "3/3" then progress_dict["system"] = system_progress if target_info.get('use_dynamic_partitions') == "true": # Add non-sparse super empty image to OTA package if it exists if target_info.get('build_super_empty_partition') == "true": unsparse_super_empty_image_name = "unsparse_super_empty.img" unsparse_super_empty_image_path = os.path.join(OPTIONS.input_tmp, "IMAGES", unsparse_super_empty_image_name) unsparse_super_empty_image = common.File.FromLocalFile( unsparse_super_empty_image_name, unsparse_super_empty_image_path) common.ZipWriteStr(output_zip, unsparse_super_empty_image_name, unsparse_super_empty_image.data) # Use empty source_info_dict to indicate that all partitions / groups must # be re-added. dynamic_partitions_diff = common.DynamicPartitionsDifference( Loading Loading
core/Makefile +4 −4 Original line number Diff line number Diff line Loading @@ -6629,7 +6629,7 @@ 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)) ifeq ($(words $(BOARD_SUPER_PARTITION_BLOCK_DEVICES)),1) # For real devices and for dist builds, build super image from target files to an intermediate directory. INTERNAL_SUPERIMAGE_DIST_TARGET := $(call intermediates-dir-for,PACKAGING,super.img)/super.img Loading @@ -6647,7 +6647,7 @@ endif .PHONY: superimage_dist superimage_dist: $(INTERNAL_SUPERIMAGE_DIST_TARGET) endif # PRODUCT_RETROFIT_DYNAMIC_PARTITIONS != "true" endif # $(words $(BOARD_SUPER_PARTITION_BLOCK_DEVICES)) == 1 endif # BOARD_SUPER_PARTITION_SIZE != "" endif # PRODUCT_BUILD_SUPER_PARTITION == "true" Loading @@ -6656,7 +6656,7 @@ endif # PRODUCT_BUILD_SUPER_PARTITION == "true" ifeq (true,$(PRODUCT_BUILD_SUPER_PARTITION)) ifneq ($(BOARD_SUPER_PARTITION_SIZE),) ifneq (true,$(PRODUCT_RETROFIT_DYNAMIC_PARTITIONS)) ifeq ($(words $(BOARD_SUPER_PARTITION_BLOCK_DEVICES)),1) # Build super.img by using $(INSTALLED_*IMAGE_TARGET) to $(1) # $(1): built image path Loading Loading @@ -6711,7 +6711,7 @@ superimage-nodeps supernod: | $(INSTALLED_SUPERIMAGE_DEPENDENCIES) $(call build-superimage-target,$(INSTALLED_SUPERIMAGE_TARGET),\ $(call intermediates-dir-for,PACKAGING,superimage-nodeps)/misc_info.txt) endif # PRODUCT_RETROFIT_DYNAMIC_PARTITIONS != "true" endif # $(words $(BOARD_SUPER_PARTITION_BLOCK_DEVICES)) == 1 endif # BOARD_SUPER_PARTITION_SIZE != "" endif # PRODUCT_BUILD_SUPER_PARTITION == "true" Loading
tools/releasetools/add_img_to_target_files.py +4 −0 Original line number Diff line number Diff line Loading @@ -667,6 +667,10 @@ def AddSuperEmpty(output_zip): build_super_image.BuildSuperImage(OPTIONS.info_dict, img.name) img.Write() unsparse_img = OutputFile(output_zip, OPTIONS.input_tmp, "IMAGES", "unsparse_super_empty.img") build_super_image.BuildSuperImage(OPTIONS.info_dict, unsparse_img.name, force_non_sparse=True) unsparse_img.Write() def AddSuperSplit(output_zip): """Create split super_*.img and store it in output_zip.""" Loading
tools/releasetools/build_super_image.py +5 −5 Original line number Diff line number Diff line Loading @@ -62,14 +62,14 @@ def GetArgumentsForImage(partition, group, image=None): image_size = sparse_img.GetImagePartitionSize(image) if image else 0 cmd = ["--partition", "{}:readonly:{}:{}".format(partition, image_size, group)] "{}:none:{}:{}".format(partition, image_size, group)] if image: cmd += ["--image", "{}={}".format(partition, image)] return cmd def BuildSuperImageFromDict(info_dict, output): def BuildSuperImageFromDict(info_dict, output, force_non_sparse=False): cmd = [info_dict["lpmake"], "--metadata-size", "65536", Loading Loading @@ -133,7 +133,7 @@ def BuildSuperImageFromDict(info_dict, output): cmd += GetArgumentsForImage(partition + "_b", group + "_b", other_image) if info_dict.get("build_non_sparse_super_partition") != "true": if info_dict.get("build_non_sparse_super_partition") != "true" and not force_non_sparse: cmd.append("--sparse") cmd += ["--output", output] Loading Loading @@ -178,11 +178,11 @@ def BuildSuperImageFromTargetFiles(inp, out): return BuildSuperImageFromExtractedTargetFiles(input_tmp, out) def BuildSuperImage(inp, out): def BuildSuperImage(inp, out, force_non_sparse=False): if isinstance(inp, dict): logger.info("Building super image from info dict...") return BuildSuperImageFromDict(inp, out) return BuildSuperImageFromDict(inp, out, force_non_sparse=False) if isinstance(inp, str): if os.path.isdir(inp): Loading
tools/releasetools/common.py +10 −2 Original line number Diff line number Diff line Loading @@ -3724,6 +3724,9 @@ class DynamicPartitionsDifference(object): if progress_dict is None: progress_dict = {} self._have_super_empty = \ info_dict.get("build_super_empty_partition") == "true" self._build_without_vendor = build_without_vendor self._remove_all_before_apply = False if source_info_dict is None: Loading Loading @@ -3821,6 +3824,11 @@ class DynamicPartitionsDifference(object): ZipWrite(output_zip, op_list_path, "dynamic_partitions_op_list") script.Comment('Update dynamic partition metadata') if self._have_super_empty: script.AppendExtra('assert(update_dynamic_partitions(' 'package_extract_file("dynamic_partitions_op_list"), ' 'package_extract_file("unsparse_super_empty.img")));') else: script.AppendExtra('assert(update_dynamic_partitions(' 'package_extract_file("dynamic_partitions_op_list")));') Loading
tools/releasetools/non_ab_ota.py +9 −0 Original line number Diff line number Diff line Loading @@ -245,6 +245,15 @@ else if get_stage("%(bcb_dev)s") == "3/3" then progress_dict["system"] = system_progress if target_info.get('use_dynamic_partitions') == "true": # Add non-sparse super empty image to OTA package if it exists if target_info.get('build_super_empty_partition') == "true": unsparse_super_empty_image_name = "unsparse_super_empty.img" unsparse_super_empty_image_path = os.path.join(OPTIONS.input_tmp, "IMAGES", unsparse_super_empty_image_name) unsparse_super_empty_image = common.File.FromLocalFile( unsparse_super_empty_image_name, unsparse_super_empty_image_path) common.ZipWriteStr(output_zip, unsparse_super_empty_image_name, unsparse_super_empty_image.data) # Use empty source_info_dict to indicate that all partitions / groups must # be re-added. dynamic_partitions_diff = common.DynamicPartitionsDifference( Loading