Commit 03dc9a09 authored by Fabio Utzig's avatar Fabio Utzig Committed by Fabio Utzig
Browse files

Avoid touching the swap status area in overwrite-only

The swap status area is used to maintain information that allows
recovery when interrupted in the middle of a swap. This area has no
usefulness when doing a overwrite-only upgrade, which always copies the
entire slot.

Signed-off-by: default avatarFabio Utzig <utzig@apache.org>
parent 29af9fee
Loading
Loading
Loading
Loading
+6
Changes for boot/bootutil/src/loader.c: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -476,6 +476,11 @@ boot_read_status(struct boot_status *bs)

    memset(bs, 0, sizeof *bs);

#ifdef MCUBOOT_OVERWRITE_ONLY
    /* Overwrite-only doesn't make use of the swap status area. */
    return 0;
#endif

    status_loc = boot_status_source();
    switch (status_loc) {
    case BOOT_STATUS_SOURCE_NONE:
@@ -502,6 +507,7 @@ boot_read_status(struct boot_status *bs)
    rc = boot_read_status_bytes(fap, bs);

    flash_area_close(fap);

    return rc;
}