Commit eb942067 authored by Karl Kristian Dyrholm Torp's avatar Karl Kristian Dyrholm Torp Committed by Jamie
Browse files

Allow bootstrapping for multiple images

When bootstrapping all images could have the primary slot erased

Signed-off-by: default avatarKarl Kristian Dyrholm Torp <kdt@polytech.com>
parent d59ae346
Loading
Loading
Loading
Loading
+1 −2
Changes for boot/bootutil/src/loader.c: 1 added line, 2 removed lines.
Original line number Diff line number Diff line
@@ -1929,8 +1929,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