summaryrefslogtreecommitdiffstats
path: root/mod-sign.sh
diff options
context:
space:
mode:
authorKyle McMartin <kmcmarti@redhat.com>2013-01-25 13:53:02 -0500
committerKyle McMartin <kmcmarti@redhat.com>2013-01-25 15:32:18 -0500
commitd0a8cf569b30a0a9318aa47d59405efe5afb519a (patch)
tree534de91d1ed82c0ef250960a4bcba30d83f4a8ee /mod-sign.sh
parent0f6d46f6c8e2f447947be9d94ebc13d604ba6755 (diff)
downloadkernel-d0a8cf569b30a0a9318aa47d59405efe5afb519a.tar.gz
kernel-d0a8cf569b30a0a9318aa47d59405efe5afb519a.tar.xz
kernel-d0a8cf569b30a0a9318aa47d59405efe5afb519a.zip
sign all modules with the extras signing script
Diffstat (limited to 'mod-sign.sh')
-rwxr-xr-xmod-sign.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/mod-sign.sh b/mod-sign.sh
new file mode 100755
index 000000000..cae259298
--- /dev/null
+++ b/mod-sign.sh
@@ -0,0 +1,28 @@
+#! /bin/bash
+
+# The modules_sign target checks for corresponding .o files for every .ko that
+# is signed. This doesn't work for package builds which re-use the same build
+# directory for every flavour, and the .config may change between flavours.
+# So instead of using this script to just sign lib/modules/$KernelVer/extra,
+# sign all .ko in the buildroot.
+
+# This essentially duplicates the 'modules_sign' Kbuild target and runs the
+# same commands for those modules.
+
+moddir=$1
+
+modules=`find $moddir -name *.ko`
+
+MODSECKEY="./signing_key.priv"
+MODPUBKEY="./signing_key.x509"
+
+for mod in $modules
+do
+ dir=`dirname $mod`
+ file=`basename $mod`
+
+ ./scripts/sign-file ${MODSECKEY} ${MODPUBKEY} ${dir}/${file} \
+ ${dir}/${file}.signed
+ mv ${dir}/${file}.signed ${dir}/${file}
+ rm -f ${dir}/${file}.{sig,dig}
+done