diff options
author | Paweł Grabas <pawel.grabas@volvocars.com> | 2021-03-04 13:11:25 +0100 |
---|---|---|
committer | Kamaljeet Maini <kamaljeet@google.com> | 2022-02-08 22:40:06 +0000 |
commit | ff9cfac08e11aa58ae470f991a8de298afb45e5b (patch) | |
tree | 7e054af84f52ef2078386f3f90faa3cc741f14a4 | |
parent | eb710bfa72ad6461ab147f77d8873c561efa1010 (diff) |
Allow disabling AVB on special vbmeta partitions
The vbmeta partition might have additional prefix
(e.g., guest_vbmeta_a) on some virtual machine
environment. Allowing rewriting the disable-verity/
disable-verification bits in the vbmeta image upon
flash under such use case.
Bug: https://partnerissuetracker.corp.google.com/u/1/issues/181791553
Test: manual tests with different names of vbmeta partition
Change-Id: Iacadaf587fce1e1e7fef946f56bbfc7f4e8233d8
-rw-r--r-- | fastboot/fastboot.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp index fde1dab84..39d86f9b3 100644 --- a/fastboot/fastboot.cpp +++ b/fastboot/fastboot.cpp @@ -1084,7 +1084,11 @@ static void flash_buf(const std::string& partition, struct fastboot_buffer *buf) // Rewrite vbmeta if that's what we're flashing and modification has been requested. if (g_disable_verity || g_disable_verification) { - if (partition == "vbmeta" || partition == "vbmeta_a" || partition == "vbmeta_b") { + // The vbmeta partition might have additional prefix if running in virtual machine + // e.g., guest_vbmeta_a. + if (android::base::EndsWith(partition, "vbmeta") || + android::base::EndsWith(partition, "vbmeta_a") || + android::base::EndsWith(partition, "vbmeta_b")) { rewrite_vbmeta_buffer(buf, false /* vbmeta_in_boot */); } else if (!has_vbmeta_partition() && (partition == "boot" || partition == "boot_a" || partition == "boot_b")) { |