Skip to content

Commit cdb6345

Browse files
committed
cmake: Handle VID and CID in NCS
Add handling of VID and CID values in NCS-specific signing scripts. Ref: NCSDK-34175 Signed-off-by: Tomasz Chyrowicz <[email protected]>
1 parent 04e6f16 commit cdb6345

File tree

4 files changed

+38
-0
lines changed

4 files changed

+38
-0
lines changed

cmake/sysbuild/image_signing.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,14 @@ function(zephyr_mcuboot_tasks)
133133
set(imgtool_extra -k "${keyfile}" ${imgtool_extra})
134134
endif()
135135

136+
if(CONFIG_MCUBOOT_IMGTOOL_UUID_VID)
137+
set(imgtool_extra ${imgtool_extra} --vid "${CONFIG_MCUBOOT_IMGTOOL_UUID_VID_NAME}")
138+
endif()
139+
140+
if(CONFIG_MCUBOOT_IMGTOOL_UUID_CID)
141+
set(imgtool_extra ${imgtool_extra} --cid "${CONFIG_MCUBOOT_IMGTOOL_UUID_CID_NAME}")
142+
endif()
143+
136144
set(imgtool_args ${imgtool_extra})
137145

138146
# Extensionless prefix of any output file.

cmake/sysbuild/image_signing_firmware_loader.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,14 @@ function(zephyr_mcuboot_tasks)
9595
set(imgtool_extra -k "${keyfile}" ${imgtool_extra})
9696
endif()
9797

98+
if(CONFIG_MCUBOOT_IMGTOOL_UUID_VID)
99+
set(imgtool_extra ${imgtool_extra} --vid "${CONFIG_MCUBOOT_IMGTOOL_UUID_VID_NAME}")
100+
endif()
101+
102+
if(CONFIG_MCUBOOT_IMGTOOL_UUID_CID)
103+
set(imgtool_extra ${imgtool_extra} --cid "${CONFIG_MCUBOOT_IMGTOOL_UUID_CID_NAME}")
104+
endif()
105+
98106
set(imgtool_args ${imgtool_extra})
99107

100108
# Extensionless prefix of any output file.

cmake/sysbuild/image_signing_split.cmake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,14 @@ function(zephyr_mcuboot_tasks)
135135
set(imgtool_extra -k "${keyfile}" ${imgtool_extra})
136136
endif()
137137

138+
if(CONFIG_MCUBOOT_IMGTOOL_UUID_VID)
139+
set(imgtool_extra ${imgtool_extra} --vid "${CONFIG_MCUBOOT_IMGTOOL_UUID_VID_NAME}")
140+
endif()
141+
142+
if(CONFIG_MCUBOOT_IMGTOOL_UUID_CID)
143+
set(imgtool_extra ${imgtool_extra} --cid "${CONFIG_MCUBOOT_IMGTOOL_UUID_CID_NAME}")
144+
endif()
145+
138146
set(imgtool_args ${imgtool_extra})
139147

140148
# Extensionless prefix of any output file.

cmake/sysbuild/sign_nrf54h20.cmake

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,20 @@ function(mcuboot_sign_merged_nrf54h20 merged_hex main_image)
124124
set(imgtool_args)
125125
endif()
126126

127+
# Fetch VID and CID values from the main image Kconfig.
128+
set(CONFIG_MCUBOOT_IMGTOOL_UUID_VID)
129+
set(CONFIG_MCUBOOT_IMGTOOL_UUID_CID)
130+
sysbuild_get(CONFIG_MCUBOOT_IMGTOOL_UUID_VID IMAGE ${main_image} VAR CONFIG_MCUBOOT_IMGTOOL_UUID_VID KCONFIG)
131+
sysbuild_get(CONFIG_MCUBOOT_IMGTOOL_UUID_CID IMAGE ${main_image} VAR CONFIG_MCUBOOT_IMGTOOL_UUID_CID KCONFIG)
132+
133+
if(CONFIG_MCUBOOT_IMGTOOL_UUID_VID)
134+
set(imgtool_extra ${imgtool_extra} --vid "${CONFIG_MCUBOOT_IMGTOOL_UUID_VID_NAME}")
135+
endif()
136+
137+
if(CONFIG_MCUBOOT_IMGTOOL_UUID_CID)
138+
set(imgtool_extra ${imgtool_extra} --cid "${CONFIG_MCUBOOT_IMGTOOL_UUID_CID_NAME}")
139+
endif()
140+
127141
# Fetch version and flags from the main image Kconfig.
128142
set(CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION)
129143
set(CONFIG_MCUBOOT_GENERATE_CONFIRMED_IMAGE)

0 commit comments

Comments
 (0)