cmake: some formatting fixes
Do not include bootloader in flash target when secure boot is enabled. Emit signing warning on all cases where signed apps are enabled (secure boot and signed images) Follow convention of capital letters for SECURE_BOOT_SIGNING_KEY variable, since it is relevant to other components, not just bootloader. Pass signing key and verification key via config, not requiring bootloader to know parent app dir. Misc. variables name corrections
This commit is contained in:
parent
047cf71c01
commit
9b350f9ecc
25 changed files with 491 additions and 467 deletions
|
@ -1,7 +1,9 @@
|
||||||
set(srcs "app_trace.c"
|
set(srcs
|
||||||
|
"app_trace.c"
|
||||||
"app_trace_util.c"
|
"app_trace_util.c"
|
||||||
"host_file_io.c"
|
"host_file_io.c"
|
||||||
"gcov/gcov_rtio.c")
|
"gcov/gcov_rtio.c")
|
||||||
|
|
||||||
set(include_dirs "include")
|
set(include_dirs "include")
|
||||||
|
|
||||||
if(CONFIG_SYSVIEW_ENABLE)
|
if(CONFIG_SYSVIEW_ENABLE)
|
||||||
|
@ -10,7 +12,8 @@ if(CONFIG_SYSVIEW_ENABLE)
|
||||||
sys_view/SEGGER
|
sys_view/SEGGER
|
||||||
sys_view/Sample/OS)
|
sys_view/Sample/OS)
|
||||||
|
|
||||||
list(APPEND srcs "sys_view/SEGGER/SEGGER_SYSVIEW.c"
|
list(APPEND srcs
|
||||||
|
"sys_view/SEGGER/SEGGER_SYSVIEW.c"
|
||||||
"sys_view/Sample/Config/SEGGER_SYSVIEW_Config_FreeRTOS.c"
|
"sys_view/Sample/Config/SEGGER_SYSVIEW_Config_FreeRTOS.c"
|
||||||
"sys_view/Sample/OS/SEGGER_SYSVIEW_FreeRTOS.c"
|
"sys_view/Sample/OS/SEGGER_SYSVIEW_FreeRTOS.c"
|
||||||
"sys_view/esp32/SEGGER_RTT_esp32.c"
|
"sys_view/esp32/SEGGER_RTT_esp32.c"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
idf_component_register(SRCS "esp_ota_ops.c" "esp_app_desc.c"
|
idf_component_register(SRCS "esp_ota_ops.c"
|
||||||
|
"esp_app_desc.c"
|
||||||
INCLUDE_DIRS "include"
|
INCLUDE_DIRS "include"
|
||||||
REQUIRES spi_flash partition_table bootloader_support)
|
REQUIRES spi_flash partition_table bootloader_support)
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
set(srcs "src/bootloader_clock.c"
|
set(srcs
|
||||||
|
"src/bootloader_clock.c"
|
||||||
"src/bootloader_common.c"
|
"src/bootloader_common.c"
|
||||||
"src/bootloader_flash.c"
|
"src/bootloader_flash.c"
|
||||||
"src/bootloader_random.c"
|
"src/bootloader_random.c"
|
||||||
|
@ -11,7 +12,8 @@ if(BOOTLOADER_BUILD)
|
||||||
set(include_dirs "include" "include_bootloader")
|
set(include_dirs "include" "include_bootloader")
|
||||||
set(requires soc) #unfortunately the header directly uses SOC registers
|
set(requires soc) #unfortunately the header directly uses SOC registers
|
||||||
set(priv_requires micro-ecc spi_flash efuse)
|
set(priv_requires micro-ecc spi_flash efuse)
|
||||||
list(APPEND srcs "src/bootloader_init.c"
|
list(APPEND srcs
|
||||||
|
"src/bootloader_init.c"
|
||||||
"src/${IDF_TARGET}/bootloader_sha.c"
|
"src/${IDF_TARGET}/bootloader_sha.c"
|
||||||
"src/${IDF_TARGET}/flash_encrypt.c"
|
"src/${IDF_TARGET}/flash_encrypt.c"
|
||||||
"src/${IDF_TARGET}/secure_boot_signatures.c"
|
"src/${IDF_TARGET}/secure_boot_signatures.c"
|
||||||
|
@ -51,7 +53,8 @@ if(BOOTLOADER_BUILD)
|
||||||
"${secure_boot_verification_key}")
|
"${secure_boot_verification_key}")
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
list(APPEND srcs "src/idf/bootloader_sha.c"
|
list(APPEND srcs
|
||||||
|
"src/idf/bootloader_sha.c"
|
||||||
"src/idf/secure_boot_signatures.c")
|
"src/idf/secure_boot_signatures.c")
|
||||||
set(include_dirs "include")
|
set(include_dirs "include")
|
||||||
set(priv_include_dirs "include_bootloader")
|
set(priv_include_dirs "include_bootloader")
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
set(include_dirs port/include port/include/coap libcoap/include libcoap/include/coap2)
|
set(include_dirs port/include port/include/coap libcoap/include libcoap/include/coap2)
|
||||||
|
|
||||||
set(srcs "libcoap/src/address.c"
|
set(srcs
|
||||||
|
"libcoap/src/address.c"
|
||||||
"libcoap/src/async.c"
|
"libcoap/src/async.c"
|
||||||
"libcoap/src/block.c"
|
"libcoap/src/block.c"
|
||||||
"libcoap/src/coap_event.c"
|
"libcoap/src/coap_event.c"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
set(srcs "can.c"
|
set(srcs
|
||||||
|
"can.c"
|
||||||
"gpio.c"
|
"gpio.c"
|
||||||
"i2c.c"
|
"i2c.c"
|
||||||
"i2s.c"
|
"i2s.c"
|
||||||
|
|
|
@ -7,7 +7,8 @@ if(EXISTS "${COMPONENT_DIR}/${soc_name}")
|
||||||
set(include_dirs include ${soc_name}/include)
|
set(include_dirs include ${soc_name}/include)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
list(APPEND srcs "src/esp_efuse_api.c"
|
list(APPEND srcs
|
||||||
|
"src/esp_efuse_api.c"
|
||||||
"src/esp_efuse_fields.c"
|
"src/esp_efuse_fields.c"
|
||||||
"src/esp_efuse_utility.c")
|
"src/esp_efuse_utility.c")
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,8 @@ if(BOOTLOADER_BUILD)
|
||||||
target_linker_script(${COMPONENT_LIB} INTERFACE "ld/esp32.peripherals.ld")
|
target_linker_script(${COMPONENT_LIB} INTERFACE "ld/esp32.peripherals.ld")
|
||||||
else()
|
else()
|
||||||
# Regular app build
|
# Regular app build
|
||||||
set(srcs "brownout.c"
|
set(srcs
|
||||||
|
"brownout.c"
|
||||||
"cache_err_int.c"
|
"cache_err_int.c"
|
||||||
"cache_sram_mmu.c"
|
"cache_sram_mmu.c"
|
||||||
"clk.c"
|
"clk.c"
|
||||||
|
|
|
@ -6,5 +6,5 @@ idf_component_register(SRCS "src/httpd_main.c"
|
||||||
"src/util/ctrl_sock.c"
|
"src/util/ctrl_sock.c"
|
||||||
INCLUDE_DIRS "include"
|
INCLUDE_DIRS "include"
|
||||||
PRIV_INCLUDE_DIRS "src/port/esp32" "src/util"
|
PRIV_INCLUDE_DIRS "src/port/esp32" "src/util"
|
||||||
REQUIRES nghttp
|
REQUIRES nghttp # for http_parser.h
|
||||||
PRIV_REQUIRES lwip) # for http_parser.h
|
PRIV_REQUIRES lwip)
|
||||||
|
|
|
@ -1,24 +1,21 @@
|
||||||
idf_build_get_property(idf_target IDF_TARGET)
|
idf_build_get_property(idf_target IDF_TARGET)
|
||||||
idf_build_get_property(build_dir BUILD_DIR)
|
|
||||||
|
|
||||||
set(srcs
|
|
||||||
"src/coexist.c"
|
|
||||||
"src/fast_crypto_ops.c"
|
|
||||||
"src/lib_printf.c"
|
|
||||||
"src/mesh_event.c"
|
|
||||||
"src/phy_init.c"
|
|
||||||
"src/restore.c"
|
|
||||||
"src/wifi_init.c")
|
|
||||||
|
|
||||||
if(NOT CONFIG_ESP32_NO_BLOBS)
|
if(NOT CONFIG_ESP32_NO_BLOBS)
|
||||||
set(ldfragments "linker.lf")
|
set(ldfragments "linker.lf")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
idf_component_register(SRCS "${srcs}"
|
idf_component_register(SRCS "src/coexist.c"
|
||||||
|
"src/fast_crypto_ops.c"
|
||||||
|
"src/lib_printf.c"
|
||||||
|
"src/mesh_event.c"
|
||||||
|
"src/phy_init.c"
|
||||||
|
"src/restore.c"
|
||||||
|
"src/wifi_init.c"
|
||||||
INCLUDE_DIRS "include" "${idf_target}/include"
|
INCLUDE_DIRS "include" "${idf_target}/include"
|
||||||
PRIV_REQUIRES wpa_supplicant nvs_flash
|
PRIV_REQUIRES wpa_supplicant nvs_flash
|
||||||
LDFRAGMENTS "${ldfragments}")
|
LDFRAGMENTS "${ldfragments}")
|
||||||
|
|
||||||
|
idf_build_get_property(build_dir BUILD_DIR)
|
||||||
target_link_libraries(${COMPONENT_LIB} PUBLIC "-L ${CMAKE_CURRENT_SOURCE_DIR}/lib_${idf_target}")
|
target_link_libraries(${COMPONENT_LIB} PUBLIC "-L ${CMAKE_CURRENT_SOURCE_DIR}/lib_${idf_target}")
|
||||||
|
|
||||||
if(NOT CONFIG_ESP32_NO_BLOBS)
|
if(NOT CONFIG_ESP32_NO_BLOBS)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
set(srcs "src/diskio.c"
|
idf_component_register(SRCS "src/diskio.c"
|
||||||
"src/diskio_rawflash.c"
|
"src/diskio_rawflash.c"
|
||||||
"src/diskio_sdmmc.c"
|
"src/diskio_sdmmc.c"
|
||||||
"src/diskio_wl.c"
|
"src/diskio_wl.c"
|
||||||
|
@ -7,8 +7,6 @@ set(srcs "src/diskio.c"
|
||||||
"src/ffunicode.c"
|
"src/ffunicode.c"
|
||||||
"src/vfs_fat.c"
|
"src/vfs_fat.c"
|
||||||
"src/vfs_fat_sdmmc.c"
|
"src/vfs_fat_sdmmc.c"
|
||||||
"src/vfs_fat_spiflash.c")
|
"src/vfs_fat_spiflash.c"
|
||||||
|
|
||||||
idf_component_register(SRCS "${srcs}"
|
|
||||||
INCLUDE_DIRS src
|
INCLUDE_DIRS src
|
||||||
REQUIRES wear_levelling sdmmc)
|
REQUIRES wear_levelling sdmmc)
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
# The following five lines of boilerplate have to be in your project's
|
# The following five lines of boilerplate have to be in your project's
|
||||||
# CMakeLists in this exact order for cmake to work correctly
|
# CMakeLists in this exact order for cmake to work correctly
|
||||||
set(srcs "common/esp_modbus_master.c"
|
set(srcs
|
||||||
|
"common/esp_modbus_master.c"
|
||||||
"common/esp_modbus_slave.c"
|
"common/esp_modbus_slave.c"
|
||||||
"modbus/mb.c"
|
"modbus/mb.c"
|
||||||
"modbus/mb_m.c"
|
"modbus/mb_m.c"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
set(srcs "croutine.c"
|
set(srcs
|
||||||
|
"croutine.c"
|
||||||
"event_groups.c"
|
"event_groups.c"
|
||||||
"FreeRTOS-openocd.c"
|
"FreeRTOS-openocd.c"
|
||||||
"list.c"
|
"list.c"
|
||||||
|
@ -14,6 +15,7 @@ set(srcs "croutine.c"
|
||||||
"xtensa_overlay_os_hook.c"
|
"xtensa_overlay_os_hook.c"
|
||||||
"xtensa_vector_defaults.S"
|
"xtensa_vector_defaults.S"
|
||||||
"xtensa_vectors.S")
|
"xtensa_vectors.S")
|
||||||
|
|
||||||
# app_trace is required by FreeRTOS headers only when CONFIG_SYSVIEW_ENABLE=y,
|
# app_trace is required by FreeRTOS headers only when CONFIG_SYSVIEW_ENABLE=y,
|
||||||
# but requirements can't depend on config options, so always require it.
|
# but requirements can't depend on config options, so always require it.
|
||||||
idf_component_register(SRCS "${srcs}"
|
idf_component_register(SRCS "${srcs}"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
set(srcs "heap_caps.c"
|
set(srcs
|
||||||
|
"heap_caps.c"
|
||||||
"heap_caps_init.c"
|
"heap_caps_init.c"
|
||||||
"multi_heap.c")
|
"multi_heap.c")
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
set(SRC libsodium/src/libsodium)
|
set(SRC libsodium/src/libsodium)
|
||||||
# Derived from libsodium/src/libsodium/Makefile.am
|
# Derived from libsodium/src/libsodium/Makefile.am
|
||||||
# (ignoring the !MINIMAL set)
|
# (ignoring the !MINIMAL set)
|
||||||
set(srcs "${SRC}/crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c"
|
set(srcs
|
||||||
|
"${SRC}/crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c"
|
||||||
"${SRC}/crypto_aead/xchacha20poly1305/sodium/aead_xchacha20poly1305.c"
|
"${SRC}/crypto_aead/xchacha20poly1305/sodium/aead_xchacha20poly1305.c"
|
||||||
"${SRC}/crypto_auth/crypto_auth.c"
|
"${SRC}/crypto_auth/crypto_auth.c"
|
||||||
"${SRC}/crypto_auth/hmacsha256/auth_hmacsha256.c"
|
"${SRC}/crypto_auth/hmacsha256/auth_hmacsha256.c"
|
||||||
|
@ -116,10 +117,12 @@ set(srcs "${SRC}/crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c"
|
||||||
"port/randombytes_esp32.c")
|
"port/randombytes_esp32.c")
|
||||||
|
|
||||||
if(CONFIG_LIBSODIUM_USE_MBEDTLS_SHA)
|
if(CONFIG_LIBSODIUM_USE_MBEDTLS_SHA)
|
||||||
list(APPEND srcs "port/crypto_hash_mbedtls/crypto_hash_sha256_mbedtls.c"
|
list(APPEND srcs
|
||||||
|
"port/crypto_hash_mbedtls/crypto_hash_sha256_mbedtls.c"
|
||||||
"port/crypto_hash_mbedtls/crypto_hash_sha512_mbedtls.c")
|
"port/crypto_hash_mbedtls/crypto_hash_sha512_mbedtls.c")
|
||||||
else()
|
else()
|
||||||
list(APPEND srcs "${SRC}/crypto_hash/sha256/cp/hash_sha256_cp.c"
|
list(APPEND srcs
|
||||||
|
"${SRC}/crypto_hash/sha256/cp/hash_sha256_cp.c"
|
||||||
"${SRC}/crypto_hash/sha512/cp/hash_sha512_cp.c")
|
"${SRC}/crypto_hash/sha512/cp/hash_sha512_cp.c")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,8 @@ set(include_dirs
|
||||||
port/esp32/include/arch
|
port/esp32/include/arch
|
||||||
)
|
)
|
||||||
|
|
||||||
set(srcs "apps/dhcpserver/dhcpserver.c"
|
set(srcs
|
||||||
|
"apps/dhcpserver/dhcpserver.c"
|
||||||
"apps/ping/esp_ping.c"
|
"apps/ping/esp_ping.c"
|
||||||
"apps/ping/ping.c"
|
"apps/ping/ping.c"
|
||||||
"apps/sntp/sntp.c"
|
"apps/sntp/sntp.c"
|
||||||
|
@ -91,7 +92,8 @@ set(srcs "apps/dhcpserver/dhcpserver.c"
|
||||||
"port/esp32/netif/wlanif.c")
|
"port/esp32/netif/wlanif.c")
|
||||||
|
|
||||||
if(CONFIG_LWIP_PPP_SUPPORT)
|
if(CONFIG_LWIP_PPP_SUPPORT)
|
||||||
list(APPEND srcs "lwip/src/netif/ppp/auth.c"
|
list(APPEND srcs
|
||||||
|
"lwip/src/netif/ppp/auth.c"
|
||||||
"lwip/src/netif/ppp/ccp.c"
|
"lwip/src/netif/ppp/ccp.c"
|
||||||
"lwip/src/netif/ppp/chap-md5.c"
|
"lwip/src/netif/ppp/chap-md5.c"
|
||||||
"lwip/src/netif/ppp/chap-new.c"
|
"lwip/src/netif/ppp/chap-new.c"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
set(srcs "heap.c"
|
set(srcs
|
||||||
|
"heap.c"
|
||||||
"locks.c"
|
"locks.c"
|
||||||
"poll.c"
|
"poll.c"
|
||||||
"pthread.c"
|
"pthread.c"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
set(srcs "nghttp2/lib/nghttp2_buf.c"
|
set(srcs
|
||||||
|
"nghttp2/lib/nghttp2_buf.c"
|
||||||
"nghttp2/lib/nghttp2_callbacks.c"
|
"nghttp2/lib/nghttp2_callbacks.c"
|
||||||
"nghttp2/lib/nghttp2_debug.c"
|
"nghttp2/lib/nghttp2_debug.c"
|
||||||
"nghttp2/lib/nghttp2_frame.c"
|
"nghttp2/lib/nghttp2_frame.c"
|
||||||
|
|
|
@ -2,7 +2,8 @@ set(include_dirs include/common
|
||||||
include/security
|
include/security
|
||||||
include/transports)
|
include/transports)
|
||||||
set(priv_include_dirs proto-c src/common src/simple_ble)
|
set(priv_include_dirs proto-c src/common src/simple_ble)
|
||||||
set(srcs "src/common/protocomm.c"
|
set(srcs
|
||||||
|
"src/common/protocomm.c"
|
||||||
"src/security/security0.c"
|
"src/security/security0.c"
|
||||||
"src/security/security1.c"
|
"src/security/security1.c"
|
||||||
"proto-c/constants.pb-c.c"
|
"proto-c/constants.pb-c.c"
|
||||||
|
|
|
@ -9,7 +9,8 @@ if(EXISTS "${COMPONENT_DIR}/${soc_name}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
list(APPEND include_dirs include)
|
list(APPEND include_dirs include)
|
||||||
list(APPEND srcs "src/memory_layout_utils.c"
|
list(APPEND srcs
|
||||||
|
"src/memory_layout_utils.c"
|
||||||
"src/lldesc.c"
|
"src/lldesc.c"
|
||||||
"src/hal/spi_hal.c"
|
"src/hal/spi_hal.c"
|
||||||
"src/hal/spi_hal_iram.c"
|
"src/hal/spi_hal_iram.c"
|
||||||
|
|
|
@ -4,7 +4,8 @@ if(BOOTLOADER_BUILD)
|
||||||
# need other parts of this component
|
# need other parts of this component
|
||||||
set(srcs "spi_flash_rom_patch.c")
|
set(srcs "spi_flash_rom_patch.c")
|
||||||
else()
|
else()
|
||||||
set(srcs "cache_utils.c"
|
set(srcs
|
||||||
|
"cache_utils.c"
|
||||||
"flash_mmap.c"
|
"flash_mmap.c"
|
||||||
"flash_ops.c"
|
"flash_ops.c"
|
||||||
"partition.c"
|
"partition.c"
|
||||||
|
@ -14,8 +15,7 @@ else()
|
||||||
"spi_flash_chip_issi.c"
|
"spi_flash_chip_issi.c"
|
||||||
"spi_flash_os_func_app.c"
|
"spi_flash_os_func_app.c"
|
||||||
"spi_flash_os_func_noos.c"
|
"spi_flash_os_func_noos.c"
|
||||||
"memspi_host_driver.c"
|
"memspi_host_driver.c")
|
||||||
)
|
|
||||||
if(NOT CONFIG_SPI_FLASH_USE_LEGACY_IMPL)
|
if(NOT CONFIG_SPI_FLASH_USE_LEGACY_IMPL)
|
||||||
list(APPEND srcs "esp_flash_api.c")
|
list(APPEND srcs "esp_flash_api.c")
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
set(srcs "unity/src/unity.c"
|
set(srcs
|
||||||
|
"unity/src/unity.c"
|
||||||
"unity_port_esp32.c")
|
"unity_port_esp32.c")
|
||||||
|
|
||||||
if(CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL)
|
if(CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL)
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
set(srcs "port/os_xtensa.c"
|
set(srcs
|
||||||
|
"port/os_xtensa.c"
|
||||||
"src/crypto/aes-cbc.c"
|
"src/crypto/aes-cbc.c"
|
||||||
"src/crypto/aes-internal-dec.c"
|
"src/crypto/aes-internal-dec.c"
|
||||||
"src/crypto/aes-internal-enc.c"
|
"src/crypto/aes-internal-enc.c"
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
idf_build_get_property(target IDF_TARGET)
|
idf_build_get_property(target IDF_TARGET)
|
||||||
idf_component_register(SRCS "eri.c" "trax.c" "debug_helpers.c" "debug_helpers_asm.S"
|
idf_component_register(SRCS "debug_helpers.c"
|
||||||
|
"debug_helpers_asm.S"
|
||||||
|
"eri.c"
|
||||||
|
"trax.c"
|
||||||
INCLUDE_DIRS include ${target}/include
|
INCLUDE_DIRS include ${target}/include
|
||||||
LDFRAGMENTS linker.lf
|
LDFRAGMENTS linker.lf
|
||||||
PRIV_REQUIRES soc)
|
PRIV_REQUIRES soc)
|
||||||
|
|
Loading…
Reference in a new issue