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

Commit 5542938c authored by David Anderson's avatar David Anderson Committed by Automerger Merge Worker
Browse files

DO NOT MERGE: libsnapshot: Fix test failures on certain configurations. am:...

DO NOT MERGE: libsnapshot: Fix test failures on certain configurations. am: 3f96053b am: c287a094 am: 23b206b9

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



Change-Id: I21937ba1f659ec03a1e9d7322e87dcd7735dabd9
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 2064e939 23b206b9
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -3175,7 +3175,8 @@ Return SnapshotManager::CreateUpdateSnapshots(const DeltaArchiveManifest& manife
              << " writer.GetCowVersion(): " << writer.GetCowVersion();

    bool use_compression = IsCompressionEnabled() && dap_metadata.vabc_enabled() &&
                           !device_->IsRecovery() && cow_format_support;
                           !device_->IsRecovery() && cow_format_support &&
                           KernelSupportsCompressedSnapshots();

    std::string compression_algorithm;
    if (use_compression) {
+2 −2
Original line number Diff line number Diff line
@@ -2760,7 +2760,7 @@ bool IsDaemonRequired() {
        return true;
    }

    return IsUserspaceSnapshotsEnabled();
    return IsUserspaceSnapshotsEnabled() && KernelSupportsCompressedSnapshots();
}

bool ShouldUseCompression() {
@@ -2770,7 +2770,7 @@ bool ShouldUseCompression() {
    if (FLAGS_force_config == "vabc") {
        return true;
    }
    return IsCompressionEnabled();
    return IsCompressionEnabled() && KernelSupportsCompressedSnapshots();
}

}  // namespace snapshot
+7 −0
Original line number Diff line number Diff line
@@ -26,7 +26,9 @@
#include <android-base/properties.h>
#include <android-base/strings.h>
#include <fs_mgr/roots.h>
#include <libdm/dm.h>

using android::dm::DeviceMapper;
using android::dm::kSectorSize;
using android::fiemap::FiemapStatus;
using android::fs_mgr::EnsurePathMounted;
@@ -208,5 +210,10 @@ bool IsDmSnapshotTestingEnabled() {
    return android::base::GetBoolProperty("snapuserd.test.dm.snapshots", false);
}

bool KernelSupportsCompressedSnapshots() {
    auto& dm = DeviceMapper::Instance();
    return dm.GetTargetByName("user", nullptr);
}

}  // namespace snapshot
}  // namespace android
+1 −0
Original line number Diff line number Diff line
@@ -129,6 +129,7 @@ std::ostream& operator<<(std::ostream& os, const Now&);
void AppendExtent(google::protobuf::RepeatedPtrField<chromeos_update_engine::Extent>* extents,
                  uint64_t start_block, uint64_t num_blocks);

bool KernelSupportsCompressedSnapshots();
bool IsCompressionEnabled();

bool IsUserspaceSnapshotsEnabled();