Merge "Add 16K artifacts to PREBUILT_IMAGES/ dir of target_files" am: 8485145bd7

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

Change-Id: I36815cfa877645e242d40a3b4b4cadd0e50a6ef5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot 2023-05-23 03:30:56 +00:00 committed by Automerger Merge Worker
commit f6d61bd3c1
2 changed files with 17 additions and 3 deletions

View file

@ -6001,6 +6001,8 @@ $(BUILT_TARGET_FILES_DIR): \
$(INSTALLED_RAMDISK_TARGET) \
$(INSTALLED_DTBIMAGE_TARGET) \
$(INSTALLED_2NDBOOTLOADER_TARGET) \
$(BUILT_RAMDISK_16K_TARGET) \
$(BUILT_KERNEL_16K_TARGET) \
$(BOARD_PREBUILT_DTBOIMAGE) \
$(BOARD_PREBUILT_RECOVERY_DTBOIMAGE) \
$(BOARD_RECOVERY_ACPIO) \
@ -6344,6 +6346,14 @@ ifdef BOARD_PREBUILT_DTBOIMAGE
$(hide) mkdir -p $(zip_root)/PREBUILT_IMAGES
$(hide) cp $(INSTALLED_DTBOIMAGE_TARGET) $(zip_root)/PREBUILT_IMAGES/
endif # BOARD_PREBUILT_DTBOIMAGE
ifdef BUILT_KERNEL_16K_TARGET
$(hide) mkdir -p $(zip_root)/PREBUILT_IMAGES
$(hide) cp $(BUILT_KERNEL_16K_TARGET) $(zip_root)/PREBUILT_IMAGES/
endif # BUILT_KERNEL_16K_TARGET
ifdef BUILT_RAMDISK_16K_TARGET
$(hide) mkdir -p $(zip_root)/PREBUILT_IMAGES
$(hide) cp $(BUILT_RAMDISK_16K_TARGET) $(zip_root)/PREBUILT_IMAGES/
endif # BUILT_RAMDISK_16K_TARGET
ifeq ($(BOARD_USES_PVMFWIMAGE),true)
$(hide) mkdir -p $(zip_root)/PREBUILT_IMAGES
$(hide) cp $(INSTALLED_PVMFWIMAGE_TARGET) $(zip_root)/PREBUILT_IMAGES/

View file

@ -122,10 +122,14 @@ def EntriesForUserImages(input_file):
]
with zipfile.ZipFile(input_file) as input_zip:
namelist = input_zip.namelist()
if 'PREBUILT_IMAGES/kernel_16k' in namelist:
entries.append('PREBUILT_IMAGES/kernel_16k:kernel_16k')
if 'PREBUILT_IMAGES/ramdisk_16k.img' in namelist:
entries.append('PREBUILT_IMAGES/ramdisk_16k.img:ramdisk_16k.img')
for image_path in [name for name in namelist if name.startswith('IMAGES/')]:
image = os.path.basename(image_path)
if OPTIONS.bootable_only and image not in('boot.img', 'recovery.img', 'bootloader', 'init_boot.img'):
if OPTIONS.bootable_only and image not in ('boot.img', 'recovery.img', 'bootloader', 'init_boot.img'):
continue
if not image.endswith('.img') and image != 'bootloader':
continue
@ -173,8 +177,8 @@ def RebuildAndWriteSuperImages(input_file, output_file):
logger.info('Writing super.img to archive...')
with zipfile.ZipFile(
output_file, 'a', compression=zipfile.ZIP_DEFLATED,
allowZip64=True) as output_zip:
output_file, 'a', compression=zipfile.ZIP_DEFLATED,
allowZip64=True) as output_zip:
common.ZipWrite(output_zip, super_file, 'super.img')