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

Commit 9de906ce authored by Daniel Zheng's avatar Daniel Zheng Committed by Automerger Merge Worker
Browse files

Merge "Removed hardcoded check to copy AVB Footer" am: 51a36614 am:...

Merge "Removed hardcoded check to copy AVB Footer" am: 51a36614 am: 46199324 am: 7838f358 am: 20efe8c8

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



Change-Id: I295cfa94c23c55eac3b08dd804c4f1af76aa79b4
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 80730834 20efe8c8
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -1202,10 +1202,9 @@ static uint64_t get_partition_size(const std::string& partition) {
}

static void copy_avb_footer(const std::string& partition, struct fastboot_buffer* buf) {
    if (buf->sz < AVB_FOOTER_SIZE) {
    if (buf->sz < AVB_FOOTER_SIZE || is_logical(partition)) {
        return;
    }

    // If overflows and negative, it should be < buf->sz.
    int64_t partition_size = static_cast<int64_t>(get_partition_size(partition));

@@ -1259,11 +1258,7 @@ void flash_partition_files(const std::string& partition, const std::vector<Spars

static void flash_buf(const std::string& partition, struct fastboot_buffer* buf,
                      const bool apply_vbmeta) {
    if (partition == "boot" || partition == "boot_a" || partition == "boot_b" ||
        partition == "init_boot" || partition == "init_boot_a" || partition == "init_boot_b" ||
        partition == "recovery" || partition == "recovery_a" || partition == "recovery_b") {
    copy_avb_footer(partition, buf);
    }

    // Rewrite vbmeta if that's what we're flashing and modification has been requested.
    if (g_disable_verity || g_disable_verification) {