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

Commit e8c61e99 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "fs_mgr: support 'check_at_most_once' for dm-verity" am: 79e0890f

Original change: https://android-review.googlesource.com/c/platform/system/core/+/1717670

Change-Id: Ida32a10c5e49b07df92a8252412678af1d260741
parents 52cbc2a3 79e0890f
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -109,6 +109,10 @@ void DmTargetVerity::IgnoreZeroBlocks() {
    optional_args_.emplace_back("ignore_zero_blocks");
}

void DmTargetVerity::CheckAtMostOnce() {
    optional_args_.emplace_back("check_at_most_once");
}

std::string DmTargetVerity::GetParameterString() const {
    std::string base = android::base::Join(base_args_, " ");
    if (optional_args_.empty()) {
+1 −0
Original line number Diff line number Diff line
@@ -127,6 +127,7 @@ class DmTargetVerity final : public DmTarget {
    void UseFec(const std::string& device, uint32_t num_roots, uint32_t num_blocks, uint32_t start);
    void SetVerityMode(const std::string& mode);
    void IgnoreZeroBlocks();
    void CheckAtMostOnce();

    std::string name() const override { return "verity"; }
    std::string GetParameterString() const override;
+4 −0
Original line number Diff line number Diff line
@@ -92,6 +92,10 @@ bool ConstructVerityTable(const FsAvbHashtreeDescriptor& hashtree_desc,
    // Always use ignore_zero_blocks.
    target.IgnoreZeroBlocks();

    if (hashtree_desc.flags & AVB_HASHTREE_DESCRIPTOR_FLAGS_CHECK_AT_MOST_ONCE) {
        target.CheckAtMostOnce();
    }

    LINFO << "Built verity table: '" << target.GetParameterString() << "'";

    return table->AddTarget(std::make_unique<android::dm::DmTargetVerity>(target));