From 02170d815e4e0856414cd527e707740ab5741d46 Mon Sep 17 00:00:00 2001 From: KonstantinKondrashov Date: Sat, 10 Apr 2021 20:45:25 +0800 Subject: [PATCH] bootloader: Fix error in Make build system when signature options is on --- components/bootloader/Makefile.projbuild | 2 ++ components/bootloader_support/component.mk | 32 ++++++++++++++++------ 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/components/bootloader/Makefile.projbuild b/components/bootloader/Makefile.projbuild index 0b2f1ef20c..a936c69a99 100644 --- a/components/bootloader/Makefile.projbuild +++ b/components/bootloader/Makefile.projbuild @@ -17,6 +17,8 @@ CONFIG_SECURE_BOOT_SIGNING_KEY ?= SECURE_BOOT_SIGNING_KEY=$(abspath $(call dequote,$(CONFIG_SECURE_BOOT_SIGNING_KEY))) export SECURE_BOOT_SIGNING_KEY # used by bootloader_support component +BOOTLOADER_SIGNED_BIN ?= + # Has a matching value in bootloader_support esp_flash_partitions.h BOOTLOADER_OFFSET := 0x1000 diff --git a/components/bootloader_support/component.mk b/components/bootloader_support/component.mk index ecf90dd359..5e38a230e7 100644 --- a/components/bootloader_support/component.mk +++ b/components/bootloader_support/component.mk @@ -7,7 +7,9 @@ else COMPONENT_PRIV_INCLUDEDIRS := include_bootloader endif -COMPONENT_SRCDIRS := src +COMPONENT_SRCDIRS := src \ + src/secure_boot_v2 \ + src/secure_boot_v1 ifndef IS_BOOTLOADER_BUILD COMPONENT_SRCDIRS += src/idf # idf sub-directory contains platform agnostic IDF versions @@ -33,15 +35,27 @@ COMPONENT_OBJEXCLUDE += src/bootloader_flash_config_esp32s2.o \ src/bootloader_random_esp32s3.o \ src/bootloader_random_esp32c3.o -ifndef CONFIG_SECURE_SIGNED_APPS_ECDSA_SCHEME -COMPONENT_OBJEXCLUDE += src/secure_boot_v1/secure_boot_signatures_bootloader.o \ - src/secure_boot_v1/secure_boot_signatures_app.o -endif +ifdef IS_BOOTLOADER_BUILD + ifndef CONFIG_SECURE_SIGNED_APPS_ECDSA_SCHEME + COMPONENT_OBJEXCLUDE += src/secure_boot_v1/secure_boot_signatures_bootloader.o + endif -ifndef CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME -COMPONENT_OBJEXCLUDE += src/secure_boot_v2/secure_boot_signatures_bootloader.o \ - src/secure_boot_v2/secure_boot_signatures_app.o -endif + ifndef CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME + COMPONENT_OBJEXCLUDE += src/secure_boot_v2/secure_boot_signatures_bootloader.o + endif + COMPONENT_OBJEXCLUDE += src/secure_boot_v1/secure_boot_signatures_app.o \ + src/secure_boot_v2/secure_boot_signatures_app.o +else + ifndef CONFIG_SECURE_SIGNED_APPS_ECDSA_SCHEME + COMPONENT_OBJEXCLUDE += src/secure_boot_v1/secure_boot_signatures_app.o + endif + + ifndef CONFIG_SECURE_SIGNED_APPS_RSA_SCHEME + COMPONENT_OBJEXCLUDE += src/secure_boot_v2/secure_boot_signatures_app.o + endif + COMPONENT_OBJEXCLUDE += src/secure_boot_v1/secure_boot_signatures_bootloader.o \ + src/secure_boot_v2/secure_boot_signatures_bootloader.o +endif # IS_BOOTLOADER_BUILD ifndef CONFIG_SECURE_BOOT COMPONENT_OBJEXCLUDE += src/$(IDF_TARGET)/secure_boot.o