component.mk 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. #
  10. # Secure boot signing key support
  11. #
  12. ifdef CONFIG_SECURE_BOOT_ENABLED
  13. # this path is created relative to the component build directory
  14. SECURE_BOOT_VERIFICATION_KEY := $(abspath signature_verification_key.bin)
  15. ifdef CONFIG_SECURE_BOOT_BUILD_SIGNED_BINARIES
  16. # verification key derived from signing key.
  17. $(SECURE_BOOT_VERIFICATION_KEY): $(SECURE_BOOT_SIGNING_KEY) $(SDKCONFIG_MAKEFILE)
  18. $(ESPSECUREPY) extract_public_key --keyfile $< $@
  19. else
  20. # find the configured public key file
  21. ORIG_SECURE_BOOT_VERIFICATION_KEY := $(call resolvepath,$(call dequote,$(CONFIG_SECURE_BOOT_VERIFICATION_KEY)),$(PROJECT_PATH))
  22. $(ORIG_SECURE_BOOT_VERIFICATION_KEY):
  23. @echo "Secure boot verification public key '$@' missing."
  24. @echo "This can be extracted from the private signing key, see"
  25. @echo "docs/security/secure-boot.rst for details."
  26. exit 1
  27. # copy it into the build dir, so the secure boot verification key has
  28. # a predictable file name
  29. $(SECURE_BOOT_VERIFICATION_KEY): $(ORIG_SECURE_BOOT_VERIFICATION_KEY) $(SDKCONFIG_MAKEFILE)
  30. $(summary) CP $< $@
  31. cp $< $@
  32. endif
  33. COMPONENT_EXTRA_CLEAN += $(SECURE_BOOT_VERIFICATION_KEY)
  34. COMPONENT_EMBED_FILES := $(SECURE_BOOT_VERIFICATION_KEY)
  35. endif