2018-09-10 21:44:12 -04:00
|
|
|
set(COMPONENT_SRCS "src/bootloader_clock.c"
|
|
|
|
"src/bootloader_common.c"
|
|
|
|
"src/bootloader_flash.c"
|
2019-07-05 08:21:36 -04:00
|
|
|
"src/bootloader_flash_config.c"
|
2018-09-10 21:44:12 -04:00
|
|
|
"src/bootloader_random.c"
|
|
|
|
"src/bootloader_sha.c"
|
|
|
|
"src/bootloader_utility.c"
|
|
|
|
"src/esp_image_format.c"
|
|
|
|
"src/flash_encrypt.c"
|
|
|
|
"src/flash_partitions.c"
|
|
|
|
"src/flash_qio_mode.c"
|
|
|
|
"src/secure_boot.c"
|
|
|
|
"src/secure_boot_signatures.c")
|
2018-01-11 21:49:13 -05:00
|
|
|
|
|
|
|
if(${BOOTLOADER_BUILD})
|
2018-08-16 01:01:43 -04:00
|
|
|
set(COMPONENT_ADD_INCLUDEDIRS "include include_bootloader")
|
2018-03-22 02:27:10 -04:00
|
|
|
set(COMPONENT_REQUIRES)
|
2018-11-18 22:36:19 -05:00
|
|
|
set(COMPONENT_PRIV_REQUIRES spi_flash micro-ecc efuse)
|
2018-09-30 00:27:06 -04:00
|
|
|
list(APPEND COMPONENT_SRCS "src/bootloader_init.c")
|
2018-10-19 15:02:55 -04:00
|
|
|
|
|
|
|
if(CONFIG_SECURE_SIGNED_APPS)
|
|
|
|
get_filename_component(secure_boot_verification_key
|
|
|
|
"signature_verification_key.bin"
|
|
|
|
ABSOLUTE BASE_DIR "${CMAKE_BINARY_DIR}")
|
|
|
|
if(CONFIG_SECURE_BOOT_BUILD_SIGNED_BINARIES)
|
|
|
|
add_custom_command(OUTPUT "${secure_boot_verification_key}"
|
|
|
|
COMMAND ${ESPSECUREPY}
|
|
|
|
extract_public_key --keyfile "${secure_boot_signing_key}"
|
|
|
|
"${secure_boot_verification_key}"
|
|
|
|
DEPENDS gen_secure_boot_signing_key
|
|
|
|
VERBATIM)
|
|
|
|
else()
|
|
|
|
get_filename_component(orig_secure_boot_verification_key
|
|
|
|
"${CONFIG_SECURE_BOOT_VERIFICATION_KEY}"
|
|
|
|
ABSOLUTE BASE_DIR "${main_project_path}")
|
|
|
|
if(NOT EXISTS ${orig_secure_boot_verification_key})
|
|
|
|
message(FATAL_ERROR
|
|
|
|
"Secure Boot Verification Public Key ${CONFIG_SECURE_BOOT_VERIFICATION_KEY} does not exist."
|
|
|
|
"\nThis can be extracted from the private signing key."
|
|
|
|
"\nSee docs/security/secure-boot.rst for details.")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_custom_command(OUTPUT "${secure_boot_verification_key}"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy "${orig_secure_boot_verification_key}"
|
|
|
|
"${secure_boot_verification_key}"
|
|
|
|
DEPENDS "${orig_secure_boot_verification_key}"
|
|
|
|
VERBATIM)
|
|
|
|
endif()
|
|
|
|
set(COMPONENT_EMBED_FILES "${secure_boot_verification_key}")
|
|
|
|
set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
|
|
|
APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
|
|
|
|
"${secure_boot_verification_key}")
|
|
|
|
endif()
|
2018-01-11 21:49:13 -05:00
|
|
|
else()
|
2018-02-26 23:45:30 -05:00
|
|
|
set(COMPONENT_ADD_INCLUDEDIRS "include")
|
2018-08-16 01:01:43 -04:00
|
|
|
set(COMPONENT_PRIV_INCLUDEDIRS "include_bootloader")
|
2018-03-22 02:27:10 -04:00
|
|
|
set(COMPONENT_REQUIRES)
|
2018-11-18 22:36:19 -05:00
|
|
|
set(COMPONENT_PRIV_REQUIRES spi_flash mbedtls micro-ecc efuse)
|
2018-01-11 21:49:13 -05:00
|
|
|
endif()
|
|
|
|
|
|
|
|
register_component()
|