Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8603df26 authored by Daniel Rosenberg's avatar Daniel Rosenberg
Browse files

libsnapshot: Support cluster_ops in make_cow_from_ab_ota

Allows make_cow_from_ab_ota to specify cluster sizes with the
-cluster_ops flag.

Bug: 172026020
Test: make_cow_from_ab_ota -cluster_ops [n] [source] [dest folder]
Change-Id: Ia3aa8b3bb602944a9d4e9954be37afb262caf060
parent d97386c3
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ static constexpr uint64_t kBlockSize = 4096;

DEFINE_string(source_tf, "", "Source target files (dir or zip file) for incremental payloads");
DEFINE_string(compression, "gz", "Compression type to use (none or gz)");
DEFINE_uint32(cluster_ops, 0, "Number of Cow Ops per cluster (0 or >1)");

void MyLogger(android::base::LogId, android::base::LogSeverity severity, const char*, const char*,
              unsigned int, const char* message) {
@@ -189,6 +190,7 @@ bool PayloadConverter::ProcessPartition(const PartitionUpdate& update) {
    CowOptions options;
    options.block_size = kBlockSize;
    options.compression = FLAGS_compression;
    options.cluster_ops = FLAGS_cluster_ops;

    writer_ = std::make_unique<CowWriter>(options);
    if (!writer_->Initialize(std::move(fd))) {