Add compressor options for squashfs system images
Change-Id: I2a75f8754273f6e00b96ba6aca6741c4388f5da8
(cherry picked from commit f86e7eeabc9721034d2c4af3b2827d93c2d23f6b)
diff --git a/tools/releasetools/build_image.py b/tools/releasetools/build_image.py
index 8934c77..32c0ee4 100755
--- a/tools/releasetools/build_image.py
+++ b/tools/releasetools/build_image.py
@@ -275,6 +275,10 @@
build_command.extend(["-m", prop_dict["mount_point"]])
if "selinux_fc" in prop_dict:
build_command.extend(["-c", prop_dict["selinux_fc"]])
+ if "squashfs_compressor" in prop_dict:
+ build_command.extend(["-z", prop_dict["squashfs_compressor"]])
+ if "squashfs_compressor_opt" in prop_dict:
+ build_command.extend(["-zo", prop_dict["squashfs_compressor_opt"]])
elif fs_type.startswith("f2fs"):
build_command = ["mkf2fsuserimg.sh"]
build_command.extend([out_file, prop_dict["partition_size"]])
@@ -414,6 +418,8 @@
copy_prop("system_root_image", "system_root_image")
copy_prop("ramdisk_dir", "ramdisk_dir")
copy_prop("has_ext4_reserved_blocks", "has_ext4_reserved_blocks")
+ copy_prop("system_squashfs_compressor", "squashfs_compressor")
+ copy_prop("system_squashfs_compressor_opt", "squashfs_compressor_opt")
elif mount_point == "data":
# Copy the generic fs type first, override with specific one if available.
copy_prop("fs_type", "fs_type")