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

Commit 1cf2d804 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 12896565 from 91529c15 to 25Q2-release

Change-Id: I90148d404faaf6b80c5cc32374ce4eaaccea868c
parents b2fa045d 91529c15
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ class ImageManagerBinder final : public IImageManager {
                                  std::string* dev) override;
    FiemapStatus ZeroFillNewImage(const std::string& name, uint64_t bytes) override;
    bool RemoveAllImages() override;
    bool DisableAllImages() override;
    bool DisableImage(const std::string& name) override;
    bool RemoveDisabledImages() override;
    bool GetMappedImageDevice(const std::string& name, std::string* device) override;
@@ -194,6 +195,9 @@ bool ImageManagerBinder::RemoveAllImages() {
    }
    return true;
}
bool ImageManagerBinder::DisableAllImages() {
    return true;
}

bool ImageManagerBinder::DisableImage(const std::string& name) {
    auto status = manager_->disableImage(name);
+17 −0
Original line number Diff line number Diff line
@@ -655,6 +655,23 @@ bool ImageManager::RemoveAllImages() {
    return ok && RemoveAllMetadata(metadata_dir_);
}

bool ImageManager::DisableAllImages() {
    if (!MetadataExists(metadata_dir_)) {
        return true;
    }
    auto metadata = OpenMetadata(metadata_dir_);
    if (!metadata) {
        return false;
    }

    bool ok = true;
    for (const auto& partition : metadata->partitions) {
        auto partition_name = GetPartitionName(partition);
        ok &= DisableImage(partition_name);
    }
    return ok;
}

bool ImageManager::Validate() {
    auto metadata = OpenMetadata(metadata_dir_);
    if (!metadata) {
+5 −0
Original line number Diff line number Diff line
@@ -127,6 +127,10 @@ class IImageManager {
    // Find and remove all images and metadata for this manager.
    virtual bool RemoveAllImages() = 0;

    // Finds and marks all images for deletion upon next reboot. This is used during recovery since
    // we cannot mount /data
    virtual bool DisableAllImages() = 0;

    virtual bool UnmapImageIfExists(const std::string& name);

    // Returns whether DisableImage() was called.
@@ -158,6 +162,7 @@ class ImageManager final : public IImageManager {
    bool MapImageWithDeviceMapper(const IPartitionOpener& opener, const std::string& name,
                                  std::string* dev) override;
    bool RemoveAllImages() override;
    bool DisableAllImages() override;
    bool DisableImage(const std::string& name) override;
    bool RemoveDisabledImages() override;
    bool GetMappedImageDevice(const std::string& name, std::string* device) override;
+15 −1
Original line number Diff line number Diff line
@@ -374,11 +374,15 @@ cc_binary {
    srcs: [
        "snapshotctl.cpp",
        "scratch_super.cpp",
        "android/snapshot/snapshot.proto",
    ],
    static_libs: [
        "libbrotli",
        "libfstab",
        "libz",
        "libavb",
        "libfs_avb",
        "libcrypto_static",
        "update_metadata-protos",
    ],
    shared_libs: [
@@ -488,7 +492,10 @@ cc_binary {
    host_supported: true,
    device_supported: false,

    srcs: ["libsnapshot_cow/create_cow.cpp"],
    srcs: [
        "libsnapshot_cow/create_cow.cpp",
        "android/snapshot/snapshot.proto",
    ],

    cflags: [
        "-Wall",
@@ -498,14 +505,21 @@ cc_binary {
    static_libs: [
        "liblog",
        "libbase",
        "libfstab",
        "libext4_utils",
        "libsnapshot_cow",
        "libcrypto",
        "libbrotli",
        "libz",
        "libdm",
        "liblz4",
        "libzstd",
        "libgflags",
        "libavb",
        "libext2_uuid",
        "libfs_avb",
        "libcrypto",
        "libprotobuf-cpp-lite",
    ],
    shared_libs: [
    ],
+11 −0
Original line number Diff line number Diff line
@@ -283,3 +283,14 @@ message SnapshotMergeReport {
    // Size of v3 operation buffer. Needs to be determined during writer initialization
    uint64 estimated_op_count_max = 14;
}

message VerityHash {
  // Partition name
  string partition_name = 1;

  // Salt used for verity hashes
  string salt = 2;

  // sha256 hash values of each block in the image
  repeated bytes block_hash = 3;
}
Loading