zephyr/share/sysbuild/image_configurations/BOOTLOADER_image_default.cmake
Jamie McCrae bd6d43d4c8 sysbuild: bootloader: Fix setting application Kconfig in MCUboot
Fixes wrongly setting configuration to generate an unsigned image
in the MCUboot configuration when this does not apply to MCUboot

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-11-22 17:32:33 +01:00

30 lines
1,004 B
CMake

# Copyright (c) 2023 Nordic Semiconductor
#
# SPDX-License-Identifier: Apache-2.0
# This sysbuild CMake file sets the sysbuild controlled settings as properties
# on Zephyr MCUboot / bootloader image.
set(keytypes CONFIG_BOOT_SIGNATURE_TYPE_NONE
CONFIG_BOOT_SIGNATURE_TYPE_RSA
CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256
CONFIG_BOOT_SIGNATURE_TYPE_ED25519)
if(SB_CONFIG_BOOT_SIGNATURE_TYPE_NONE)
set(keytype CONFIG_BOOT_SIGNATURE_TYPE_NONE)
elseif(SB_CONFIG_BOOT_SIGNATURE_TYPE_RSA)
set(keytype CONFIG_BOOT_SIGNATURE_TYPE_RSA)
elseif(SB_CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256)
set(keytype CONFIG_BOOT_SIGNATURE_TYPE_ECDSA_P256)
elseif(SB_CONFIG_BOOT_SIGNATURE_TYPE_ED25519)
set(keytype CONFIG_BOOT_SIGNATURE_TYPE_ED25519)
endif()
foreach(loopkeytype ${keytypes})
if("${loopkeytype}" STREQUAL "${keytype}")
set_config_bool(${ZCMAKE_APPLICATION} ${loopkeytype} y)
else()
set_config_bool(${ZCMAKE_APPLICATION} ${loopkeytype} n)
endif()
endforeach()