From 0539c9b0d10dab3358775cd3578c473aaf05f335 Mon Sep 17 00:00:00 2001 From: Andrew Gunnerson Date: Wed, 13 Feb 2019 21:22:17 -0500 Subject: [PATCH] mbtool: installer_util.cpp: Set maximum compression level for ramdisk Signed-off-by: Andrew Gunnerson --- mbtool/src/recovery/installer_util.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mbtool/src/recovery/installer_util.cpp b/mbtool/src/recovery/installer_util.cpp index 648f73f27..ee20e5dab 100644 --- a/mbtool/src/recovery/installer_util.cpp +++ b/mbtool/src/recovery/installer_util.cpp @@ -223,6 +223,13 @@ bool InstallerUtil::pack_ramdisk(const std::string &input_dir, archive_write_set_bytes_per_block(aout.get(), 512); + // Enable maximum compression for each supported filter + if (archive_write_set_filter_option( + aout.get(), nullptr, "compression-level", "9") != ARCHIVE_OK) { + LOGW("%s: Failed to set compression level: %s", + output_file.c_str(), archive_error_string(aout.get())); + } + // Open output file if (archive_write_open_filename(aout.get(), output_file.c_str()) != ARCHIVE_OK) {