Merge "Add build flags for legacy EROFS support."

This commit is contained in:
Treehugger Robot 2022-04-16 05:10:04 +00:00 committed by Gerrit Code Review
commit 80d2c8f7a7
2 changed files with 9 additions and 0 deletions

View file

@ -1765,8 +1765,12 @@ ifneq ($(filter \
$(BOARD_SYSTEM_DLKMIMAGE_FILE_SYSTEM_TYPE) \
,erofs),)
INTERNAL_USERIMAGES_DEPS += $(MKEROFS)
ifeq ($(BOARD_EROFS_USE_LEGACY_COMPRESSION),true)
BOARD_EROFS_COMPRESSOR ?= "lz4"
else
BOARD_EROFS_COMPRESSOR ?= "lz4hc,9"
endif
endif
ifneq ($(filter \
$(BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE) \
@ -1912,6 +1916,7 @@ $(if $(INTERNAL_USERIMAGES_SPARSE_F2FS_FLAG),$(hide) echo "f2fs_sparse_flag=$(IN
$(if $(BOARD_EROFS_COMPRESSOR),$(hide) echo "erofs_default_compressor=$(BOARD_EROFS_COMPRESSOR)" >> $(1))
$(if $(BOARD_EROFS_PCLUSTER_SIZE),$(hide) echo "erofs_pcluster_size=$(BOARD_EROFS_PCLUSTER_SIZE)" >> $(1))
$(if $(BOARD_EROFS_SHARE_DUP_BLOCKS),$(hide) echo "erofs_share_dup_blocks=$(BOARD_EROFS_SHARE_DUP_BLOCKS)" >> $(1))
$(if $(BOARD_EROFS_USE_LEGACY_COMPRESSION),$(hide) echo "erofs_use_legacy_compression=$(BOARD_EROFS_USE_LEGACY_COMPRESSION)" >> $(1))
$(if $(BOARD_EXT4_SHARE_DUP_BLOCKS),$(hide) echo "ext4_share_dup_blocks=$(BOARD_EXT4_SHARE_DUP_BLOCKS)" >> $(1))
$(if $(BOARD_FLASH_LOGICAL_BLOCK_SIZE), $(hide) echo "flash_logical_block_size=$(BOARD_FLASH_LOGICAL_BLOCK_SIZE)" >> $(1))
$(if $(BOARD_FLASH_ERASE_BLOCK_SIZE), $(hide) echo "flash_erase_block_size=$(BOARD_FLASH_ERASE_BLOCK_SIZE)" >> $(1))

View file

@ -348,6 +348,8 @@ def BuildImageMkfs(in_dir, prop_dict, out_file, target_out, fs_config):
build_command.extend(["-C", prop_dict["erofs_pcluster_size"]])
if "erofs_share_dup_blocks" in prop_dict:
build_command.extend(["--chunksize", "4096"])
if "erofs_use_legacy_compression" in prop_dict:
build_command.extend(["-E", "legacy-compress"])
build_command.extend([out_file, in_dir])
if "erofs_sparse_flag" in prop_dict and not disable_sparse:
@ -653,6 +655,7 @@ def ImagePropFromGlobalDict(glob_dict, mount_point):
"erofs_pcluster_size",
"erofs_share_dup_blocks",
"erofs_sparse_flag",
"erofs_use_legacy_compression",
"squashfs_sparse_flag",
"system_f2fs_compress",
"system_f2fs_sldc_flags",
@ -698,6 +701,7 @@ def ImagePropFromGlobalDict(glob_dict, mount_point):
(True, "avb_{}_hashtree_enable", "avb_hashtree_enable"),
(True, "avb_{}_key_path", "avb_key_path"),
(True, "avb_{}_salt", "avb_salt"),
(True, "erofs_use_legacy_compression", "erofs_use_legacy_compression"),
(True, "ext4_share_dup_blocks", "ext4_share_dup_blocks"),
(True, "{}_base_fs_file", "base_fs_file"),
(True, "{}_disable_sparse", "disable_sparse"),