Allow bootstrapping for multiple images
When bootstrapping all images could have the primary slot erased
Signed-off-by: Karl Kristian Dyrholm Torp <kdt@polytech.com>
diff --git a/boot/bootutil/src/loader.c b/boot/bootutil/src/loader.c
index 1303394..8efdf0f 100644
--- a/boot/bootutil/src/loader.c
+++ b/boot/bootutil/src/loader.c
@@ -1929,8 +1929,7 @@
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