lkml.org 
[lkml]   [2012]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH v2] MODSIGN: Only sign modules if built in-tree
When building out-of-tree modules, the current modules_install target
will attempt to sign them if module signing is enabled. This will only
work if the signing keys are present in the build tree. That will
often not be the case for modules that are built out-of-tree against
distribution kernel development packages. This distros will not include
the signing keys, and build errors such as:

INSTALL /home/bruno/rpmbuild/BUILD/dahdi-linux-2.6.1/drivers/dahdi/dahdi_dya
mic_eth.ko
Can't read private key
make[2]: *** [/home/bruno/rpmbuild/BUILD/dahdi-linux-2.6.1/drivers/dahdi/dah
di_dynamic.ko] Error 2

will prevent such modules from successfully being installed. This changes
the mod_sign_cmd to only sign the modules if they are built in-tree. Those
built externally can sign them manually.

Reported-by: Bruno Wolff III <bruno@wolff.to>
Suggested-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Josh Boyer <jwboyer@redhat.com>
---
Makefile | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 14c93b3..7e27d51 100644
--- a/Makefile
+++ b/Makefile
@@ -722,8 +722,14 @@ export mod_strip_cmd
ifeq ($(CONFIG_MODULE_SIG),y)
MODSECKEY = ./signing_key.priv
MODPUBKEY = ./signing_key.x509
+ifeq ($(KBUILD_EXTMOD),)
+SIGNFAIL = false
+else
+# External builds might not have a signing key, don't break module_install.
+SIGNFAIL = true
+endif # KBUILD_EXTMOD
export MODPUBKEY
-mod_sign_cmd = perl $(srctree)/scripts/sign-file $(MODSECKEY) $(MODPUBKEY)
+mod_sign_cmd = $(SIGNFAIL) || perl $(srctree)/scripts/sign-file $(MODSECKEY) $(MODPUBKEY)
else
mod_sign_cmd = true
endif
--
1.7.12.1


\
 
 \ /
  Last update: 2012-11-02 14:21    [W:0.050 / U:3.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site