Skip to content

Commit

Permalink
Allow bootstrapping for multiple images
Browse files Browse the repository at this point in the history
When bootstrapping all images could have the primary slot erased

Signed-off-by: Karl Kristian Dyrholm Torp <[email protected]>
  • Loading branch information
KarlKTorp authored and nordicjm committed Nov 18, 2024
1 parent d59ae34 commit eb94206
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions boot/bootutil/src/loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit eb94206

Please sign in to comment.