Skip to content

Commit

Permalink
suit: Fix JINJA path usage in suit.cmake file
Browse files Browse the repository at this point in the history
In the suit.cmake file there are no token replacements
for the JINJA template files and due to that the
INPUT_ENVELOPE_JINJA_FILE variable uses the wrong value while
it uses the CMake variable from a prj.conf file.

For example setting the
`CONFIG_SUIT_ENVELOPE_TEMPLATE="${ZEPHYR_NRF_MODULE_DIR}.yaml.
jinja2` kconfig provides the wrong path to the SUIT
generator.

To fix it, I added a simple string configuration.

Signed-off-by: Arkadiusz Balys <arkadiusz.balys@nordicsemi.no>
  • Loading branch information
ArekBalysNordic authored and rlubos committed Jul 15, 2024
1 parent b329309 commit f3c1fb4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmake/sysbuild/suit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ function(suit_create_package)
endif()

sysbuild_get(INPUT_ENVELOPE_JINJA_FILE IMAGE ${image} VAR CONFIG_SUIT_ENVELOPE_TEMPLATE KCONFIG)
string(CONFIGURE "${INPUT_ENVELOPE_JINJA_FILE}" INPUT_ENVELOPE_JINJA_FILE)
suit_set_absolute_or_relative_path(${INPUT_ENVELOPE_JINJA_FILE} ${app_config_dir} INPUT_ENVELOPE_JINJA_FILE)
sysbuild_get(target IMAGE ${image} VAR CONFIG_SUIT_ENVELOPE_TARGET KCONFIG)
sysbuild_get(BINARY_DIR IMAGE ${image} VAR APPLICATION_BINARY_DIR CACHE)
Expand Down Expand Up @@ -182,6 +183,7 @@ function(suit_create_package)
# create root envelope if defined
if(DEFINED INPUT_ROOT_ENVELOPE_JINJA_FILE AND NOT INPUT_ROOT_ENVELOPE_JINJA_FILE STREQUAL "")
set(ROOT_NAME ${SB_CONFIG_SUIT_ENVELOPE_ROOT_ARTIFACT_NAME})
string(CONFIGURE "${INPUT_ROOT_ENVELOPE_JINJA_FILE}" INPUT_ROOT_ENVELOPE_JINJA_FILE)
suit_set_absolute_or_relative_path(${INPUT_ROOT_ENVELOPE_JINJA_FILE} ${app_config_dir} INPUT_ROOT_ENVELOPE_JINJA_FILE)
set(ROOT_ENVELOPE_YAML_FILE ${SUIT_ROOT_DIRECTORY}${ROOT_NAME}.yaml)
set(ROOT_ENVELOPE_SUIT_FILE ${SUIT_ROOT_DIRECTORY}${ROOT_NAME}.suit)
Expand Down

0 comments on commit f3c1fb4

Please sign in to comment.