cmake: mcuboot: Add Kconfig for passing west sign arguments

The commit adds CONFIG_MCUBOOT_CMAKE_WEST_SIGN_PARAMS Kconfig
option to allow passing arguments to west sign.
The option is used to pass arguments that immediately follow
west sign in cmake invocations and replaces hardcoded
"--quiet" parameter, but defaults to the "--quiet" value to
keep current behaviour.
New Kconfig option allows to pass arguments to west sign
without modifying cmake/mcuboot.cmake.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
This commit is contained in:
Dominik Ermel 2023-03-22 10:28:05 +00:00 committed by Carles Cufí
parent 97fe4833d8
commit 1cc7e41438
2 changed files with 15 additions and 1 deletions

View file

@ -791,6 +791,18 @@ config BOOTLOADER_MCUBOOT
if BOOTLOADER_MCUBOOT
config MCUBOOT_CMAKE_WEST_SIGN_PARAMS
string "Extra parameters to west sign"
default "--quiet"
help
Parameters that are passed by cmake to west sign, just after
the command, before all other parameters needed for image
signing.
By default this is set to "--quiet" to prevent extra, non-error,
diagnostic messages from west sign. This does not affect signing
tool for which extra parameters are passed with
MCUBOOT_EXTRA_IMGTOOL_ARGS.
config MCUBOOT_SIGNATURE_KEY_FILE
string "Path to the mcuboot signing key file"
default ""

View file

@ -71,7 +71,9 @@ function(zephyr_mcuboot_tasks)
endif()
# Basic 'west sign' command and output format independent arguments.
set(west_sign ${WEST} sign --quiet --tool imgtool
separate_arguments(west_sign_extra UNIX_COMMAND ${CONFIG_MCUBOOT_CMAKE_WEST_SIGN_PARAMS})
set(west_sign ${WEST} sign ${west_sign_extra}
--tool imgtool
--tool-path "${imgtool_path}"
--build-dir "${APPLICATION_BINARY_DIR}")