Allow host cow_converter to change compression param
This allows OEMs to quickly check estimated cow size using a different
compression algorithm
Test: th
Bug: 308909158
Change-Id: I8a57298172aa73af894d2e3fc7c4bb29dfdad309
diff --git a/aosp/cow_converter.cc b/aosp/cow_converter.cc
index 80d161f..1ec3540 100644
--- a/aosp/cow_converter.cc
+++ b/aosp/cow_converter.cc
@@ -39,6 +39,10 @@
"",
"Comma separated list of partitions to extract, leave empty for "
"extracting all partitions");
+DEFINE_string(vabc_compression_param,
+ "",
+ "Compression parameter for VABC. Default is use what's specified "
+ "in OTA package");
namespace chromeos_update_engine {
@@ -66,6 +70,9 @@
android::snapshot::CowOptions options{
.block_size = static_cast<uint32_t>(manifest.block_size()),
.compression = dap.vabc_compression_param()};
+ if (!FLAGS_vabc_compression_param.empty()) {
+ options.compression = FLAGS_vabc_compression_param;
+ }
auto cow_writer = android::snapshot::CreateCowWriter(
dap.cow_version(), options, std::move(output_fd));
TEST_AND_RETURN_FALSE(cow_writer);