Skip to content

Commit 22b856b

Browse files
committed
bootutil_public: allow to confirm padded image without copy-done flag
This patch is for fixing: zephyrproject-rtos/zephyr#34683 copy-done flag is used to design completely copied image. It is used to recognize whether need to complete image upgrade. If image is running then: 1) it was already verified and copied by MCUboot copy-done flag is set for sure. 2) or it was programmed directly using programming interface For case 2) when image contains magic but not copy-done flag it was impossible to confirm it. This patch removes needs of having copy-done flag set while confirming. This make API behavior similar to situation when the not-padded image was programmed. Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
1 parent c932b32 commit 22b856b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

boot/bootutil/src/bootutil_public.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -583,11 +583,10 @@ boot_set_confirmed(void)
583583
goto done;
584584
}
585585

586-
if (state_primary_slot.copy_done == BOOT_FLAG_UNSET) {
587-
/* Swap never completed. This is unexpected. */
588-
rc = BOOT_EBADVECT;
589-
goto done;
590-
}
586+
/* Intentionally do not check copy_done flag
587+
* so can confirm a padded image which was programed using a programing
588+
* interface.
589+
*/
591590

592591
if (state_primary_slot.image_ok != BOOT_FLAG_UNSET) {
593592
/* Already confirmed. */

0 commit comments

Comments
 (0)