Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 67911682 authored by Jooyung Han's avatar Jooyung Han
Browse files

target-files: Support erofs_compress_hints

erofs_compress_hints files should be copied into target-files and then
sign_target_files_apks should use them from the target-files.

Bug: 357721652
Test: m target-files-package (with aosp/3204257)
Test: sign_target_files_apks <target_file> signed-target-files.zip
Change-Id: Id55000004ecb72ea8fec19bfbe144c9b4d3f06cb
parent fa476051
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
@@ -6883,6 +6883,33 @@ ifdef BOARD_KERNEL_PAGESIZE
	$(hide) echo "$(BOARD_KERNEL_PAGESIZE)" > $(zip_root)/INIT_BOOT/pagesize
endif # BOARD_KERNEL_PAGESIZE
endif # BUILDING_INIT_BOOT_IMAGE
ifdef BOARD_EROFS_COMPRESS_HINTS
	$(hide) cp $(BOARD_EROFS_COMPRESS_HINTS) $(zip_root)/META/erofs_default_compress_hints.txt
endif
ifdef BOARD_SYSTEMIMAGE_EROFS_COMPRESS_HINTS
	$(hide) cp $(BOARD_SYSTEMIMAGE_EROFS_COMPRESS_HINTS) $(zip_root)/META/system_erofs_compress_hints.txt
endif
ifdef BOARD_SYSTEM_EXTIMAGE_EROFS_COMPRESS_HINTS
	$(hide) cp $(BOARD_SYSTEM_EXTIMAGE_EROFS_COMPRESS_HINTS) $(zip_root)/META/system_ext_erofs_compress_hints.txt
endif
ifdef BOARD_PRODUCTIMAGE_EROFS_COMPRESS_HINTS
	$(hide) cp $(BOARD_PRODUCTIMAGE_EROFS_COMPRESS_HINTS) $(zip_root)/META/product_erofs_compress_hints.txt
endif
ifdef BOARD_VENDORIMAGE_EROFS_COMPRESS_HINTS
	$(hide) cp $(BOARD_VENDORIMAGE_EROFS_COMPRESS_HINTS) $(zip_root)/META/vendor_erofs_compress_hints.txt
endif
ifdef BOARD_ODMIMAGE_EROFS_COMPRESS_HINTS
	$(hide) cp $(BOARD_ODMIMAGE_EROFS_COMPRESS_HINTS) $(zip_root)/META/odm_erofs_compress_hints.txt
endif
ifdef BOARD_VENDOR_DLKMIMAGE_EROFS_COMPRESS_HINTS
	$(hide) cp $(BOARD_VENDOR_DLKMIMAGE_EROFS_COMPRESS_HINTS) $(zip_root)/META/vendor_dlkm_erofs_compress_hints.txt
endif
ifdef BOARD_ODM_DLKMIMAGE_EROFS_COMPRESS_HINTS
	$(hide) cp $(BOARD_ODM_DLKMIMAGE_EROFS_COMPRESS_HINTS) $(zip_root)/META/odm_dlkm_erofs_compress_hints.txt
endif
ifdef BOARD_SYSTEM_DLKMIMAGE_EROFS_COMPRESS_HINTS
	$(hide) cp $(BOARD_SYSTEM_DLKMIMAGE_EROFS_COMPRESS_HINTS) $(zip_root)/META/system_dlkm_erofs_compress_hints.txt
endif
ifneq ($(INSTALLED_VENDOR_BOOTIMAGE_TARGET),)
	$(call fs_config,$(zip_root)/VENDOR_BOOT/RAMDISK,) > $(zip_root)/META/vendor_boot_filesystem_config.txt
endif
+22 −2
Original line number Diff line number Diff line
@@ -907,9 +907,10 @@ def LoadInfoDict(input_file, repacking=False):
    d["root_fs_config"] = os.path.join(
        input_file, "META", "root_filesystem_config.txt")

    partitions = ["system", "vendor", "system_ext", "product", "odm",
                  "vendor_dlkm", "odm_dlkm", "system_dlkm"]
    # Redirect {partition}_base_fs_file for each of the named partitions.
    for part_name in ["system", "vendor", "system_ext", "product", "odm",
                      "vendor_dlkm", "odm_dlkm", "system_dlkm"]:
    for part_name in partitions:
      key_name = part_name + "_base_fs_file"
      if key_name not in d:
        continue
@@ -922,6 +923,25 @@ def LoadInfoDict(input_file, repacking=False):
            "Failed to find %s base fs file: %s", part_name, base_fs_file)
        del d[key_name]

    # Redirecting helper for optional properties like erofs_compress_hints
    def redirect_file(prop, filename):
      if prop not in d:
        return
      config_file = os.path.join(input_file, "META/" + filename)
      if os.path.exists(config_file):
        d[prop] = config_file
      else:
        logger.warning(
            "Failed to find %s fro %s", filename, prop)
        del d[key_name]

    # Redirect erofs_[default_]compress_hints files
    redirect_file("erofs_default_compress_hints",
                  "erofs_default_compress_hints.txt")
    for part in partitions:
      redirect_file(part + "_erofs_compress_hints",
                    part + "_erofs_compress_hints.txt")

  def makeint(key):
    if key in d:
      d[key] = int(d[key], 0)