File tree Expand file tree Collapse file tree 3 files changed +46
-0
lines changed
Expand file tree Collapse file tree 3 files changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -316,3 +316,27 @@ zephyr_library_sources(
316316 ${BOOT_DIR} /zephyr/nrf_cleanup.c
317317)
318318endif ()
319+
320+ if (CONFIG_BOOT_IMAGE_ACCESS_HOOKS)
321+
322+ if (IS_ABSOLUTE ${CONFIG_BOOT_IMAGE_ACCESS_HOOKS_FILE} )
323+ if (EXISTS ${CONFIG_BOOT_IMAGE_ACCESS_HOOKS_FILE} )
324+ set (HOOKS_FILE ${CONFIG_BOOT_IMAGE_ACCESS_HOOKS_FILE} )
325+ endif ()
326+ elseif ((DEFINED CONF_DIR) AND
327+ (EXISTS ${CONF_DIR} /${CONFIG_BOOT_IMAGE_ACCESS_HOOKS_FILE} ))
328+ set (HOOKS_FILE ${CONF_DIR} /${CONFIG_BOOT_SIGNATURE_KEY_FILE} )
329+ else (EXISTS ${BOOT_DIR} /zephyr/${CONFIG_BOOT_IMAGE_ACCESS_HOOKS_FILE} )
330+ set (HOOKS_FILE ${BOOT_DIR} /zephyr/${CONFIG_BOOT_IMAGE_ACCESS_HOOKS_FILE} )
331+ endif ()
332+
333+
334+ if (DEFINED HOOKS_FILE)
335+ zephyr_library_sources(
336+ ${HOOKS_FILE}
337+ )
338+ else ()
339+ message (WARNING "Can't access hooks implementation file." )
340+ endif ()
341+
342+ endif ()
Original file line number Diff line number Diff line change @@ -631,6 +631,24 @@ config BOOT_WATCHDOG_FEED
631631 Enables implementation of MCUBOOT_WATCHDOG_FEED() macro which is
632632 used to feed watchdog while doing time consuming operations.
633633
634+ config BOOT_IMAGE_ACCESS_HOOKS
635+ bool "Enable hooks for overriding MCUboot's native routines"
636+ help
637+ Allow to provide procedures for override or extend native
638+ MCUboot's routines required for access the image data and the image
639+ update.
640+
641+ config BOOT_IMAGE_ACCESS_HOOKS_FILE
642+ string "Hooks implementation file path"
643+ depends on BOOT_IMAGE_ACCESS_HOOKS
644+ help
645+ Path to the file which implements hooks.
646+ You can use either absolute or relative path.
647+ In case relative path is used, the build system assumes that it starts
648+ from the directory where the MCUBoot KConfig configuration file is
649+ located. If the key file is not there, the build system uses relative
650+ path that starts from the zephyr port cmake directory (boot/zephyr/).
651+
634652endmenu
635653
636654config MCUBOOT_DEVICE_SETTINGS
Original file line number Diff line number Diff line change 162162#define MCUBOOT_MGMT_CUSTOM_IMG_LIST
163163#endif
164164
165+ #ifdef CONFIG_BOOT_IMAGE_ACCESS_HOOKS
166+ #define MCUBOOT_IMAGE_ACCESS_HOOKS
167+ #endif
168+
165169/*
166170 * The configuration option enables direct image upload with the
167171 * serial recovery.
You can’t perform that action at this time.
0 commit comments