Add build property to enable fscompression

Bug: 162253911
Bug: 110272315
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
Change-Id: I3cb7d0a055a7f83c9d0321d2b16f11f40a74f7aa
Merged-In: I3cb7d0a055a7f83c9d0321d2b16f11f40a74f7aa
This commit is contained in:
Jaegeuk Kim 2020-10-12 19:50:05 -07:00
parent f2ef765168
commit ed754fb339
2 changed files with 5 additions and 0 deletions

View File

@ -1335,6 +1335,7 @@ $(if $(filter $(2),userdata),\
$(if $(BOARD_USERDATAIMAGE_PARTITION_SIZE),$(hide) echo "userdata_size=$(BOARD_USERDATAIMAGE_PARTITION_SIZE)" >> $(1))
$(if $(PRODUCT_FS_CASEFOLD),$(hide) echo "needs_casefold=$(PRODUCT_FS_CASEFOLD)" >> $(1))
$(if $(PRODUCT_QUOTA_PROJID),$(hide) echo "needs_projid=$(PRODUCT_QUOTA_PROJID)" >> $(1))
$(if $(PRODUCT_FS_COMPRESSION),$(hide) echo "needs_compress=$(PRODUCT_FS_COMPRESSION)" >> $(1))
$(hide) echo "userdata_selinux_fc=$(SELINUX_FC)" >> $(1)
$(hide) echo "building_userdata_image=$(BUILDING_USERDATA_IMAGE)" >> $(1)
)

View File

@ -250,6 +250,7 @@ def BuildImageMkfs(in_dir, prop_dict, out_file, target_out, fs_config):
run_e2fsck = False
needs_projid = prop_dict.get("needs_projid", 0)
needs_casefold = prop_dict.get("needs_casefold", 0)
needs_compress = prop_dict.get("needs_compress", 0)
if fs_type.startswith("ext"):
build_command = [prop_dict["ext_mkuserimg"]]
@ -337,6 +338,8 @@ def BuildImageMkfs(in_dir, prop_dict, out_file, target_out, fs_config):
build_command.append("--prjquota")
if (needs_casefold):
build_command.append("--casefold")
if (needs_compress):
build_command.append("--compression")
else:
raise BuildImageError(
"Error: unknown filesystem type: {}".format(fs_type))
@ -610,6 +613,7 @@ def ImagePropFromGlobalDict(glob_dict, mount_point):
copy_prop("userdata_selinux_fc", "selinux_fc")
copy_prop("needs_casefold", "needs_casefold")
copy_prop("needs_projid", "needs_projid")
copy_prop("needs_compress", "needs_compress")
elif mount_point == "cache":
copy_prop("cache_fs_type", "fs_type")
copy_prop("cache_size", "partition_size")