From 394df160fec1998f06fd789eb1067c9474343741 Mon Sep 17 00:00:00 2001 From: Jamie McCrae Date: Fri, 23 Aug 2024 08:51:11 +0100 Subject: [PATCH] booutil: swap_scratch: Do not check sectors with compression When compression is used, it allows for the secondary slot to be smaller than the primary slot, therefore do not ensure that the number of sectors in each slot are the same Signed-off-by: Jamie McCrae --- boot/bootutil/src/swap_scratch.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/boot/bootutil/src/swap_scratch.c b/boot/bootutil/src/swap_scratch.c index 2cdb91a49..2fcf76f69 100644 --- a/boot/bootutil/src/swap_scratch.c +++ b/boot/bootutil/src/swap_scratch.c @@ -218,12 +218,14 @@ boot_slots_compatible(struct boot_loader_state *state) #endif } +#ifndef MCUBOOT_DECOMPRESS_IMAGES if ((i != num_sectors_primary) || (j != num_sectors_secondary) || (primary_slot_sz != secondary_slot_sz)) { BOOT_LOG_WRN("Cannot upgrade: slots are not compatible"); return 0; } +#endif return 1; }