Skip to content

Commit 98951ba

Browse files
tejlmandcarlescufi
authored andcommitted
sysbuild: disable partition manager / child image when sysbuild is used
Sysbuild and parent / child image are mutual exclusive. Thus it is not possible to use both at the same time. In parent / child image, the partition manager is invoked in the parent image, and also in each domain image. With sysbuild, the partition manager is invoked in sysbuild. Therefore when building images through sysbuild, then partition manager must be disabled in the image build. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
1 parent 7772d67 commit 98951ba

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

cmake/multi_image.cmake

+9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
55
#
66

7+
if(SYSBUILD)
8+
# Sysbuild and child-image are mutual exclusive, so if sysbuild is used disable child-image
9+
function(add_child_image)
10+
set(CONFIG_USE_PARTITION_MANAGER n CACHE INTERNAL "")
11+
# ignore, sysbuild is in use.
12+
endfunction()
13+
return()
14+
endif()
15+
716
if(IMAGE_NAME)
817
set_shared(IMAGE ${IMAGE_NAME} PROPERTY KERNEL_HEX_NAME ${KERNEL_HEX_NAME})
918
set_shared(IMAGE ${IMAGE_NAME} PROPERTY ZEPHYR_BINARY_DIR ${ZEPHYR_BINARY_DIR})

modules/mcuboot/CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ add_subdirectory(${ZEPHYR_MCUBOOT_MODULE_DIR}/boot/bootutil/zephyr
22
${CMAKE_CURRENT_BINARY_DIR}/boot/bootutil/zephyr
33
)
44

5+
if(SYSBUILD)
6+
# Code below is partition manager w/ child image support, thus return when
7+
# sysbuild is used.
8+
return()
9+
endif()
10+
511
if (CONFIG_MCUBOOT)
612
if (CONFIG_NRF53_MULTI_IMAGE_UPDATE)
713
set_shared(IMAGE ${IMAGE_NAME} PROPERTY NRF53_MULTI_IMAGE_UPDATE

subsys/CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ add_subdirectory_ifdef(CONFIG_BT bluetooth)
88

99
add_subdirectory_ifdef(CONFIG_BOOTLOADER_MCUBOOT bootloader/bl_override)
1010
add_subdirectory_ifdef(CONFIG_IS_SECURE_BOOTLOADER bootloader)
11-
add_subdirectory_ifdef(CONFIG_SECURE_BOOT bootloader/image)
11+
if(NOT SYSBUILD)
12+
add_subdirectory_ifdef(CONFIG_SECURE_BOOT bootloader/image)
13+
endif()
1214
add_subdirectory_ifdef(CONFIG_SECURE_BOOT_CRYPTO bootloader/bl_crypto)
1315
add_subdirectory_ifdef(CONFIG_SECURE_BOOT_VALIDATION bootloader/bl_validation)
1416
add_subdirectory_ifdef(CONFIG_SECURE_BOOT_STORAGE bootloader/bl_storage)

0 commit comments

Comments
 (0)