Merge "Generate incremental OTAs for 16K/4K boot option" into main am: bf25b080d6

Original change: https://android-review.googlesource.com/c/platform/build/+/2768738

Change-Id: I7631a823ad6174c13325367ec4ffad71ba25c665
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot 2023-11-08 00:32:52 +00:00 committed by Automerger Merge Worker
commit 2718d6a4f3
2 changed files with 16 additions and 4 deletions

View file

@ -1167,13 +1167,16 @@ bootimage_16k: $(BUILT_BOOTIMAGE_16K_TARGET)
.PHONY: bootimage_16k
BUILT_BOOT_OTA_PACKAGE_16K := $(PRODUCT_OUT)/boot_ota_16k.zip
$(BUILT_BOOT_OTA_PACKAGE_16K): $(OTA_FROM_RAW_IMG) $(BUILT_BOOTIMAGE_16K_TARGET) $(DEFAULT_SYSTEM_DEV_CERTIFICATE).pk8
$(BUILT_BOOT_OTA_PACKAGE_16K): $(OTA_FROM_RAW_IMG) $(BUILT_BOOTIMAGE_16K_TARGET) $(INSTALLED_BOOTIMAGE_TARGET) $(DEFAULT_SYSTEM_DEV_CERTIFICATE).pk8
$(OTA_FROM_RAW_IMG) --package_key $(DEFAULT_SYSTEM_DEV_CERTIFICATE) \
--max_timestamp `cat $(BUILD_DATETIME_FILE)` \
--path $(HOST_OUT) \
--partition_name boot \
--output $@ \
$(BUILT_BOOTIMAGE_16K_TARGET)
$(if $(BOARD_16K_OTA_USE_INCREMENTAL),\
$(INSTALLED_BOOTIMAGE_TARGET):$(BUILT_BOOTIMAGE_16K_TARGET),\
$(BUILT_BOOTIMAGE_16K_TARGET)\
)
boototapackage_16k: $(BUILT_BOOT_OTA_PACKAGE_16K)
.PHONY: boototapackage_16k
@ -1503,13 +1506,16 @@ endif # my_installed_prebuilt_gki_apex not defined
ifneq ($(BOARD_KERNEL_PATH_16K),)
BUILT_BOOT_OTA_PACKAGE_4K := $(PRODUCT_OUT)/boot_ota_4k.zip
$(BUILT_BOOT_OTA_PACKAGE_4K): $(OTA_FROM_RAW_IMG) $(INSTALLED_BOOTIMAGE_TARGET) $(DEFAULT_SYSTEM_DEV_CERTIFICATE).pk8
$(BUILT_BOOT_OTA_PACKAGE_4K): $(OTA_FROM_RAW_IMG) $(INSTALLED_BOOTIMAGE_TARGET) $(BUILT_BOOTIMAGE_16K_TARGET) $(DEFAULT_SYSTEM_DEV_CERTIFICATE).pk8
$(OTA_FROM_RAW_IMG) --package_key $(DEFAULT_SYSTEM_DEV_CERTIFICATE) \
--max_timestamp `cat $(BUILD_DATETIME_FILE)` \
--path $(HOST_OUT) \
--partition_name boot \
--output $@ \
$(INSTALLED_BOOTIMAGE_TARGET)
$(if $(BOARD_16K_OTA_USE_INCREMENTAL),\
$(BUILT_BOOTIMAGE_16K_TARGET):$(INSTALLED_BOOTIMAGE_TARGET),\
$(INSTALLED_BOOTIMAGE_TARGET)\
)
boototapackage_4k: $(BUILT_BOOT_OTA_PACKAGE_4K)
.PHONY: boototapackage_4k

View file

@ -68,6 +68,11 @@ def main(argv):
if args.verbose:
logger.setLevel(logging.INFO)
logger.info(args)
old_imgs = [""] * len(args.images)
for (i, img) in enumerate(args.images):
if ":" in img:
old_imgs[i], args.images[i] = img.split(":", maxsplit=1)
if not args.partition_names:
args.partition_names = [os.path.os.path.splitext(os.path.basename(path))[
0] for path in args.images]
@ -79,6 +84,7 @@ def main(argv):
cmd.append("--partition_names=" + ",".join(args.partition_names))
cmd.append("--dynamic_partition_info_file=" +
dynamic_partition_info_file.name)
cmd.append("--old_partitions=" + ",".join(old_imgs))
cmd.append("--new_partitions=" + ",".join(args.images))
cmd.append("--out_file=" + unsigned_payload.name)
cmd.append("--is_partial_update")