From e33e8a86852326da32bb95965e1a9bed11600c12 Mon Sep 17 00:00:00 2001 From: Daniel Zheng Date: Wed, 29 Mar 2023 04:20:48 +0000 Subject: [PATCH] Added check to copy AVB footer is_logical shouldn't work in bootloader for some devices, so we also need to check using should_flash_in_userspace to see if partition is dynamic Test: tested to flash {partition} on raven and checked to see avb footers are not copied from dynamic partitions Change-Id: Iabb3ea535fa80b26cf1c08040beb3d4ea5e8c2ae --- fastboot/fastboot.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp index e76cbc5ad..42269fe94 100644 --- a/fastboot/fastboot.cpp +++ b/fastboot/fastboot.cpp @@ -1197,7 +1197,8 @@ 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 || is_logical(partition)) { + if (buf->sz < AVB_FOOTER_SIZE || is_logical(partition) || + should_flash_in_userspace(partition)) { return; } // If overflows and negative, it should be < buf->sz.