zephyr: direct inclusion of the hooks file
This patch removes CONFIG_BOOT_IMAGE_ACCESS_HOOKS_FILE option which was used to point to hooks implementation file. It is better that the project customization is up to add required files instead. This gives more flexibility in provisioning these sources (there may be multiple files). This also simplifies Kconfig options. In order to keep possibility for build-test the Hooks feature hooks_sample.c will be included into the build if commandline will specify -DTEST_BOOT_IMAGE_ACCESS_HOOKS=Y option. Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
This commit is contained in:
parent
09e2bd70fd
commit
1c150c6092
|
@ -17,27 +17,12 @@ zephyr_library_sources(
|
||||||
../src/bootutil_public.c
|
../src/bootutil_public.c
|
||||||
)
|
)
|
||||||
|
|
||||||
if(CONFIG_BOOT_IMAGE_ACCESS_HOOKS)
|
# Sensitivity to the TEST_BOOT_IMAGE_ACCESS_HOOKS define is implemented for
|
||||||
if(NOT CONFIG_BOOT_IMAGE_ACCESS_HOOKS_FILE STREQUAL "")
|
# allowing the test-build with the hooks feature enabled.
|
||||||
if(IS_ABSOLUTE ${CONFIG_BOOT_IMAGE_ACCESS_HOOKS_FILE})
|
if(TEST_BOOT_IMAGE_ACCESS_HOOKS)
|
||||||
if(EXISTS ${CONFIG_BOOT_IMAGE_ACCESS_HOOKS_FILE})
|
zephyr_library_sources(
|
||||||
set(HOOKS_FILE ${CONFIG_BOOT_IMAGE_ACCESS_HOOKS_FILE})
|
${APPLICATION_SOURCE_DIR}/hooks_sample.c
|
||||||
endif()
|
)
|
||||||
elseif((DEFINED CONF_DIR) AND
|
|
||||||
(EXISTS ${CONF_DIR}/${CONFIG_BOOT_IMAGE_ACCESS_HOOKS_FILE}))
|
|
||||||
set(HOOKS_FILE ${CONF_DIR}/${CONFIG_BOOT_IMAGE_ACCESS_HOOKS_FILE})
|
|
||||||
else(EXISTS ${APPLICATION_SOURCE_DIR}/${CONFIG_BOOT_IMAGE_ACCESS_HOOKS_FILE})
|
|
||||||
set(HOOKS_FILE ${APPLICATION_SOURCE_DIR}/${CONFIG_BOOT_IMAGE_ACCESS_HOOKS_FILE})
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(DEFINED HOOKS_FILE)
|
|
||||||
zephyr_library_sources(
|
|
||||||
${HOOKS_FILE}
|
|
||||||
)
|
|
||||||
else()
|
|
||||||
message(STATUS "No hooks implementation file.")
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
zephyr_library_link_libraries(MCUBOOT_BOOTUTIL)
|
zephyr_library_link_libraries(MCUBOOT_BOOTUTIL)
|
||||||
|
|
|
@ -569,18 +569,8 @@ config BOOT_IMAGE_ACCESS_HOOKS
|
||||||
help
|
help
|
||||||
Allow to provide procedures for override or extend native
|
Allow to provide procedures for override or extend native
|
||||||
MCUboot's routines required for access the image data and the image
|
MCUboot's routines required for access the image data and the image
|
||||||
update.
|
update. It is up to the project customization to add required source
|
||||||
|
files to the build.
|
||||||
config BOOT_IMAGE_ACCESS_HOOKS_FILE
|
|
||||||
string "Hooks implementation file path"
|
|
||||||
depends on BOOT_IMAGE_ACCESS_HOOKS
|
|
||||||
help
|
|
||||||
Path to the file which implements hooks.
|
|
||||||
You can use either absolute or relative path.
|
|
||||||
In case relative path is used, the build system assumes that it starts
|
|
||||||
from the directory where the MCUBoot KConfig configuration file is
|
|
||||||
located. If the key file is not there, the build system uses relative
|
|
||||||
path that starts from the zephyr port cmake directory (boot/zephyr/).
|
|
||||||
|
|
||||||
config MCUBOOT_ACTION_HOOKS
|
config MCUBOOT_ACTION_HOOKS
|
||||||
bool "Enable hooks for responding to MCUboot status changes"
|
bool "Enable hooks for responding to MCUboot status changes"
|
||||||
|
|
|
@ -4,4 +4,3 @@ CONFIG_FLASH_SIMULATOR=y
|
||||||
CONFIG_FLASH_SIMULATOR_UNALIGNED_READ=y
|
CONFIG_FLASH_SIMULATOR_UNALIGNED_READ=y
|
||||||
|
|
||||||
CONFIG_BOOT_IMAGE_ACCESS_HOOKS=y
|
CONFIG_BOOT_IMAGE_ACCESS_HOOKS=y
|
||||||
CONFIG_BOOT_IMAGE_ACCESS_HOOKS_FILE="hooks_sample.c"
|
|
||||||
|
|
|
@ -44,6 +44,7 @@ tests:
|
||||||
sample.bootloader.mcuboot.hooks_multi:
|
sample.bootloader.mcuboot.hooks_multi:
|
||||||
extra_args: DTC_OVERLAY_FILE=./boards/nrf52840dk_ram_multi.overlay
|
extra_args: DTC_OVERLAY_FILE=./boards/nrf52840dk_ram_multi.overlay
|
||||||
OVERLAY_CONFIG=./boards/nrf52840dk_hooks_sample_overlay.conf
|
OVERLAY_CONFIG=./boards/nrf52840dk_hooks_sample_overlay.conf
|
||||||
|
TEST_BOOT_IMAGE_ACCESS_HOOKS=Y
|
||||||
platform_allow: nrf52840dk_nrf52840
|
platform_allow: nrf52840dk_nrf52840
|
||||||
integration_platforms:
|
integration_platforms:
|
||||||
- nrf52840dk_nrf52840
|
- nrf52840dk_nrf52840
|
||||||
|
|
Loading…
Reference in New Issue