Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 02e8487

Browse files
committed
kbuild: support 'make modules_sign' with CONFIG_MODULE_SIG_ALL=n
Commit d890f51 ("MODSIGN: Add modules_sign make target") introduced 'make modules_sign' to manually sign modules. Some time later, commit d9d8d7e ("MODSIGN: Add option to not sign modules during modules_install") introduced CONFIG_MODULE_SIG_ALL. If it was disabled, mod_sign_cmd was set to no-op ('true' command). It affected not only 'make modules_install' but also 'make modules_sign'. With CONFIG_MODULE_SIG_ALL=n, neither modules_install nor modules_sign is able to sign modules. Kbuild has kept that behavior, and nobody has complained about it, but I think it is weird. CONFIG_MODULE_SIG_ALL=n should turn off signing only for modules_install. If users want to sign modules manually, modules_sign should be offered. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
1 parent 5e02797 commit 02e8487

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

scripts/Makefile.modinst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ endif
9595
# Signing
9696
# Don't stop modules_install even if we can't sign external modules.
9797
#
98-
ifeq ($(CONFIG_MODULE_SIG_ALL),y)
9998
ifeq ($(filter pkcs11:%, $(CONFIG_MODULE_SIG_KEY)),)
10099
sig-key := $(if $(wildcard $(CONFIG_MODULE_SIG_KEY)),,$(srctree)/)$(CONFIG_MODULE_SIG_KEY)
101100
else
@@ -104,13 +103,15 @@ endif
104103
quiet_cmd_sign = SIGN $@
105104
cmd_sign = scripts/sign-file $(CONFIG_MODULE_SIG_HASH) "$(sig-key)" certs/signing_key.x509 $@ \
106105
$(if $(KBUILD_EXTMOD),|| true)
107-
else
106+
107+
ifeq ($(modules_sign_only),)
108+
109+
# During modules_install, modules are signed only when CONFIG_MODULE_SIG_ALL=y.
110+
ifndef CONFIG_MODULE_SIG_ALL
108111
quiet_cmd_sign :=
109112
cmd_sign := :
110113
endif
111114

112-
ifeq ($(modules_sign_only),)
113-
114115
# Create necessary directories
115116
$(shell mkdir -p $(sort $(dir $(install-y))))
116117

0 commit comments

Comments
 (0)