Skip to contentSkip to conversation

certs: Fix build error when CONFIG_MODULE_SIG_KEY is PKCS#11 URI

PATCH In review Masahiro Yamada 2 participants 3 messages Jan 20, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 certs: Fix build error when CONFIG_MODULE_SIG_KEY is PKCS#11 URI

When CONFIG_MODULE_SIG_KEY is PKCS#11 URL (pkcs11:*), signing_key.x509 fails to build:

certs/Makefile:77: *** target pattern contains no '%'. Stop.

Due to the typo, $(X509_DEP) contains a colon.

Fix it.

Fixes b8c96a6b466c ("certs: simplify $(srctree)/ handling and remove config_filename macro")

---

 certs/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
certs/Makefile +1 -1
index f7041c29a2e0..0c459cfd09df 100644
@@ -68,7 +68,7 @@ $(obj)/x509.genkey:
 endif # CONFIG_MODULE_SIG_KEY
 
 # If CONFIG_MODULE_SIG_KEY isn't a PKCS#11 URI, depend on it
-ifneq ($(filter-out pkcs11:%, %(CONFIG_MODULE_SIG_KEY)),)
+ifneq ($(filter-out pkcs11:%, $(CONFIG_MODULE_SIG_KEY)),)
 X509_DEP := $(CONFIG_MODULE_SIG_KEY)
 endif
 
Signature · 1 line
2.32.0
#1 lore raw

PATCH 2/2 certs: Fix build error when CONFIG_MODULE_SIG_KEY is empty

Since b8c96a6b466c ("certs: simplify $(srctree)/ handling and remove config_filename macro"), when CONFIG_MODULE_SIG_KEY is empty, signing_key.x509 fails to build:

CERT certs/signing_key.x509
Usage: extract-cert <source> <dest>
make[1]: *** [certs/Makefile:78: certs/signing_key.x509] Error 2
make: *** [Makefile:1831: certs] Error 2

Pass "" to the first argument of extract-cert to fix the build error.

Fixes b8c96a6b466c ("certs: simplify $(srctree)/ handling and remove config_filename macro")

---

 certs/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
certs/Makefile +1 -1
index 0c459cfd09df..3ea7fe60823f 100644
@@ -75,7 +75,7 @@ endif
 $(obj)/system_certificates.o: $(obj)/signing_key.x509
 
 $(obj)/signing_key.x509: $(X509_DEP) $(obj)/extract-cert FORCE
-	$(call if_changed,extract_certs,$(if $(X509_DEP),$<,$(CONFIG_MODULE_SIG_KEY)))
+	$(call if_changed,extract_certs,$(if $(CONFIG_MODULE_SIG_KEY),$(if $(X509_DEP),$<,$(CONFIG_MODULE_SIG_KEY)),""))
 endif # CONFIG_MODULE_SIG
 
 targets += signing_key.x509
Signature · 1 line
2.32.0
Tested-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] certs: Fix build error when CONFIG_MODULE_SIG_KEY is empty

Quoted 9 lines · Masahiro Yamada

Since b8c96a6b466c ("certs: simplify $(srctree)/ handling and remove config_filename macro"), when CONFIG_MODULE_SIG_KEY is empty, signing_key.x509 fails to build:

CERT certs/signing_key.x509
Usage: extract-cert <source> <dest>
make[1]: *** [certs/Makefile:78: certs/signing_key.x509] Error 2
make: *** [Makefile:1831: certs] Error 2

Quoted 6 lines

Pass "" to the first argument of extract-cert to fix the build error.

Fixes b8c96a6b466c ("certs: simplify $(srctree)/ handling and remove config_filename macro")

Thank you for the quick fix.

Michal

Quoted 21 lines

---

 certs/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
certs/Makefile +1 -1
index 0c459cfd09df..3ea7fe60823f 100644
@@ -75,7 +75,7 @@ endif
 $(obj)/system_certificates.o: $(obj)/signing_key.x509
 
 $(obj)/signing_key.x509: $(X509_DEP) $(obj)/extract-cert FORCE
-	$(call if_changed,extract_certs,$(if $(X509_DEP),$<,$(CONFIG_MODULE_SIG_KEY)))
+	$(call if_changed,extract_certs,$(if $(CONFIG_MODULE_SIG_KEY),$(if $(X509_DEP),$<,$(CONFIG_MODULE_SIG_KEY)),""))
 endif # CONFIG_MODULE_SIG
 
 targets += signing_key.x509
Signature · 1 line
2.32.0