component.mk 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. COMPONENT_ADD_INCLUDEDIRS := include
  2. ifdef IS_BOOTLOADER_BUILD
  3. # share "include_bootloader" headers with bootloader main component
  4. COMPONENT_ADD_INCLUDEDIRS += include_bootloader
  5. else
  6. COMPONENT_PRIV_INCLUDEDIRS := include_bootloader
  7. endif
  8. COMPONENT_SRCDIRS := src
  9. ifndef IS_BOOTLOADER_BUILD
  10. COMPONENT_SRCDIRS += src/idf # idf sub-directory contains platform agnostic IDF versions
  11. else
  12. COMPONENT_SRCDIRS += src/$(IDF_TARGET) # one sub-dir per chip
  13. endif
  14. ifndef IS_BOOTLOADER_BUILD
  15. COMPONENT_OBJEXCLUDE := src/bootloader_init.o \
  16. src/bootloader_panic.o \
  17. src/bootloader_clock_loader.o \
  18. src/bootloader_console.o \
  19. src/bootloader_console_loader.o
  20. endif
  21. COMPONENT_OBJEXCLUDE += src/bootloader_flash_config_esp32s2.o \
  22. src/bootloader_flash_config_esp32s3.o \
  23. src/bootloader_efuse_esp32s2.o \
  24. src/bootloader_efuse_esp32s3.o \
  25. ifndef CONFIG_SECURE_SIGNED_APPS_ECDSA_SCHEME
  26. ifndef CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME
  27. COMPONENT_OBJEXCLUDE += src/$(IDF_TARGET)/secure_boot_signatures.o \
  28. src/idf/secure_boot_signatures.o
  29. endif
  30. endif
  31. ifndef CONFIG_SECURE_BOOT
  32. COMPONENT_OBJEXCLUDE += src/$(IDF_TARGET)/secure_boot.o
  33. endif
  34. #
  35. # Secure boot signing key support
  36. #
  37. ifdef CONFIG_SECURE_SIGNED_APPS
  38. ifdef CONFIG_SECURE_SIGNED_APPS_ECDSA_SCHEME
  39. # this path is created relative to the component build directory
  40. SECURE_BOOT_VERIFICATION_KEY := $(abspath signature_verification_key.bin)
  41. ifdef CONFIG_SECURE_BOOT_BUILD_SIGNED_BINARIES
  42. # verification key derived from signing key.
  43. $(SECURE_BOOT_VERIFICATION_KEY): $(SECURE_BOOT_SIGNING_KEY) $(SDKCONFIG_MAKEFILE)
  44. $(ESPSECUREPY) extract_public_key --keyfile $< $@
  45. else
  46. # find the configured public key file
  47. ORIG_SECURE_BOOT_VERIFICATION_KEY := $(call resolvepath,$(call dequote,$(CONFIG_SECURE_BOOT_VERIFICATION_KEY)),$(PROJECT_PATH))
  48. $(ORIG_SECURE_BOOT_VERIFICATION_KEY):
  49. @echo "Secure boot verification public key '$@' missing."
  50. @echo "This can be extracted from the private signing key, see"
  51. @echo "docs/security/secure-boot-v1.rst for details."
  52. exit 1
  53. # copy it into the build dir, so the secure boot verification key has
  54. # a predictable file name
  55. $(SECURE_BOOT_VERIFICATION_KEY): $(ORIG_SECURE_BOOT_VERIFICATION_KEY) $(SDKCONFIG_MAKEFILE)
  56. $(summary) CP $< $@
  57. cp $< $@
  58. endif #CONFIG_SECURE_BOOT_BUILD_SIGNED_BINARIES
  59. COMPONENT_EXTRA_CLEAN += $(SECURE_BOOT_VERIFICATION_KEY)
  60. COMPONENT_EMBED_FILES := $(SECURE_BOOT_VERIFICATION_KEY)
  61. endif #CONFIG_SECURE_SIGNED_APPS_ECDSA_SCHEME
  62. endif #CONFIG_SECURE_SIGNED_APPS