From cf1343d0350a0a9079e677459319b72263c8333e Mon Sep 17 00:00:00 2001 From: KarlKTorp Date: Thu, 5 Sep 2024 12:18:05 +0200 Subject: [PATCH] Allow bootstrapping for multiple images Signed-off-by: Karl Kristian Dyrholm Torp --- boot/bootutil/src/loader.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/boot/bootutil/src/loader.c b/boot/bootutil/src/loader.c index 3f0793388..9cb9ffe21 100644 --- a/boot/bootutil/src/loader.c +++ b/boot/bootutil/src/loader.c @@ -1960,8 +1960,7 @@ boot_prepare_image_for_update(struct boot_loader_state *state, rc = boot_read_image_headers(state, !boot_status_is_reset(bs), bs); #ifdef MCUBOOT_BOOTSTRAP /* When bootstrapping it's OK to not have image magic in the primary slot */ - if (rc != 0 && (BOOT_CURR_IMG(state) != BOOT_PRIMARY_SLOT || - boot_check_header_erased(state, BOOT_PRIMARY_SLOT) != 0)) { + if (rc != 0 && boot_check_header_erased(state, BOOT_PRIMARY_SLOT) != 0) { #else if (rc != 0) { #endif