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

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

Merge "libsnapshot: Move snapshot metadata to super partition." into main am:...

Merge "libsnapshot: Move snapshot metadata to super partition." into main am: 40f2bfd6 am: fb0a0cc6

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



Change-Id: I0672bb08b91b41227a04eaff13bfe930312cd4f5
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 0244db85 fb0a0cc6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -186,6 +186,7 @@ cc_binary {
        "libprotobuf-cpp-lite",
        "libsparse",
        "libutils",
        "libselinux",
    ],

    static_libs: [
+0 −2
Original line number Diff line number Diff line
@@ -80,10 +80,8 @@

using namespace std::chrono_literals;

bool fs_mgr_set_blk_ro(const std::string& blockdev, bool readonly = true);
bool fs_mgr_is_device_unlocked();

bool fs_mgr_is_ext4(const std::string& blk_device);
bool fs_mgr_is_f2fs(const std::string& blk_device);

bool fs_mgr_filesystem_available(const std::string& filesystem);
+6 −0
Original line number Diff line number Diff line
@@ -104,6 +104,12 @@ int fs_mgr_setup_verity(android::fs_mgr::FstabEntry* fstab, bool wait_for_verity
// returned. Otherwise, it will use the current slot.
std::string fs_mgr_get_super_partition_name(int slot = -1);

// Set readonly for the block device
bool fs_mgr_set_blk_ro(const std::string& blockdev, bool readonly = true);

// Check if the block device has ext4 filesystem
bool fs_mgr_is_ext4(const std::string& blk_device);

enum FsMgrUmountStatus : int {
    SUCCESS = 0,
    ERROR_UNKNOWN = 1 << 0,
+3 −0
Original line number Diff line number Diff line
@@ -46,6 +46,7 @@ cc_defaults {
        "libfstab",
        "libsnapuserd_client",
        "libz",
        "libselinux",
    ],
    header_libs: [
        "libfiemap_headers",
@@ -91,6 +92,7 @@ filegroup {
        "partition_cow_creator.cpp",
        "return.cpp",
        "utility.cpp",
        "scratch_super.cpp",
    ],
}

@@ -351,6 +353,7 @@ cc_binary {
    ],
    srcs: [
        "snapshotctl.cpp",
        "scratch_super.cpp",
    ],
    static_libs: [
        "libbrotli",
+18 −1
Original line number Diff line number Diff line
@@ -13,6 +13,7 @@
// limitations under the License.

#include "device_info.h"
#include "scratch_super.h"

#include <android-base/logging.h>
#include <fs_mgr.h>
@@ -37,8 +38,24 @@ constexpr bool kIsRecovery = true;
constexpr bool kIsRecovery = false;
#endif

DeviceInfo::DeviceInfo() {
    std::string scratch_device = android::snapshot::GetScratchOtaMetadataPartition();
    if (!scratch_device.empty()) {
        std::string scratch_metadata =
                android::snapshot::MapScratchOtaMetadataPartition(scratch_device);
        if (!scratch_metadata.empty()) {
            SetMetadataDir(scratch_metadata);
            SetTempMetadata();
        }
    }
}

std::string DeviceInfo::GetMetadataDir() const {
    return "/metadata/ota"s;
    return metadata_dir_;
}

void DeviceInfo::SetMetadataDir(const std::string& value) {
    metadata_dir_ = value;
}

std::string DeviceInfo::GetSlotSuffix() const {
Loading