diff --git a/boot/mynewt/mcuboot_config/include/mcuboot_config/mcuboot_config.h b/boot/mynewt/mcuboot_config/include/mcuboot_config/mcuboot_config.h index c7a267149..4de915cb5 100644 --- a/boot/mynewt/mcuboot_config/include/mcuboot_config/mcuboot_config.h +++ b/boot/mynewt/mcuboot_config/include/mcuboot_config/mcuboot_config.h @@ -26,6 +26,9 @@ #else #define MCUBOOT_IMAGE_NUMBER 1 #endif +#if MYNEWT_VAL(BOOTUTIL_VERSION_CMP_USE_BUILD_NUMBER) +#define MCUBOOT_VERSION_CMP_USE_BUILD_NUMBER +#endif #if MYNEWT_VAL(BOOT_SERIAL) #define MCUBOOT_SERIAL 1 #endif diff --git a/boot/mynewt/mcuboot_config/syscfg.yml b/boot/mynewt/mcuboot_config/syscfg.yml index a6c9714ae..50761c7c9 100644 --- a/boot/mynewt/mcuboot_config/syscfg.yml +++ b/boot/mynewt/mcuboot_config/syscfg.yml @@ -94,6 +94,14 @@ syscfg.defs: - version - security_counter value: none + BOOTUTIL_VERSION_CMP_USE_BUILD_NUMBER: + description: > + Use build number while comparing image version. + By default, the image version comparison relies only on version major, + minor and revision. Enable this option to take into account the build + number as well. + This only affect builds with BOOTUTIL_DOWNGRADE_PREVENTION set to version. + value: 0 BOOTUTIL_HW_ROLLBACK_PROT: description: > Prevent undesirable/malicious software downgrades. When this option is