2016-11-01 19:41:58 -04:00
|
|
|
COMPONENT_ADD_INCLUDEDIRS := include
|
|
|
|
|
|
|
|
ifdef IS_BOOTLOADER_BUILD
|
2018-07-02 22:18:20 -04:00
|
|
|
# share "include_bootloader" headers with bootloader main component
|
|
|
|
COMPONENT_ADD_INCLUDEDIRS += include_bootloader
|
|
|
|
else
|
|
|
|
COMPONENT_PRIV_INCLUDEDIRS := include_bootloader
|
2016-11-01 19:41:58 -04:00
|
|
|
endif
|
|
|
|
|
|
|
|
COMPONENT_SRCDIRS := src
|
|
|
|
|
2016-11-03 02:33:30 -04:00
|
|
|
#
|
|
|
|
# Secure boot signing key support
|
|
|
|
#
|
2016-11-24 22:09:26 -05:00
|
|
|
ifdef CONFIG_SECURE_BOOT_ENABLED
|
2016-11-03 02:33:30 -04:00
|
|
|
|
2016-11-04 01:05:00 -04:00
|
|
|
# this path is created relative to the component build directory
|
2016-11-03 02:33:30 -04:00
|
|
|
SECURE_BOOT_VERIFICATION_KEY := $(abspath signature_verification_key.bin)
|
|
|
|
|
2016-12-18 21:06:21 -05:00
|
|
|
ifdef CONFIG_SECURE_BOOT_BUILD_SIGNED_BINARIES
|
|
|
|
# verification key derived from signing key.
|
|
|
|
$(SECURE_BOOT_VERIFICATION_KEY): $(SECURE_BOOT_SIGNING_KEY) $(SDKCONFIG_MAKEFILE)
|
2016-11-03 02:33:30 -04:00
|
|
|
$(ESPSECUREPY) extract_public_key --keyfile $< $@
|
2016-12-18 21:06:21 -05:00
|
|
|
else
|
|
|
|
# find the configured public key file
|
|
|
|
ORIG_SECURE_BOOT_VERIFICATION_KEY := $(call resolvepath,$(call dequote,$(CONFIG_SECURE_BOOT_VERIFICATION_KEY)),$(PROJECT_PATH))
|
|
|
|
|
|
|
|
$(ORIG_SECURE_BOOT_VERIFICATION_KEY):
|
|
|
|
@echo "Secure boot verification public key '$@' missing."
|
|
|
|
@echo "This can be extracted from the private signing key, see"
|
|
|
|
@echo "docs/security/secure-boot.rst for details."
|
|
|
|
exit 1
|
|
|
|
|
|
|
|
# copy it into the build dir, so the secure boot verification key has
|
|
|
|
# a predictable file name
|
|
|
|
$(SECURE_BOOT_VERIFICATION_KEY): $(ORIG_SECURE_BOOT_VERIFICATION_KEY) $(SDKCONFIG_MAKEFILE)
|
|
|
|
$(summary) CP $< $@
|
|
|
|
cp $< $@
|
|
|
|
endif
|
2016-11-04 01:05:00 -04:00
|
|
|
|
|
|
|
COMPONENT_EXTRA_CLEAN += $(SECURE_BOOT_VERIFICATION_KEY)
|
|
|
|
|
|
|
|
COMPONENT_EMBED_FILES := $(SECURE_BOOT_VERIFICATION_KEY)
|
|
|
|
|
2016-11-03 02:33:30 -04:00
|
|
|
endif
|