scst: Add support for signing SCST kernel modules

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8593 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2019-09-29 04:42:40 +00:00
parent a4a0317e58
commit 84725029ce
14 changed files with 126 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
#!/bin/bash
# Parse modules.order and sign the modules found in that file.
if [ -z "$KDIR" ]; then
echo "Error: \$KDIR has not been set"
exit 1
fi
scst_dir=$(dirname "$(cd "$(dirname "$0")" && pwd)")
CONFIG_MODULE_SIG_HASH=$(sed -n 's/^CONFIG_MODULE_SIG_HASH="\([^"]*\)"$/\1/p' "${KDIR}/.config")
sed -n 's,kernel/,,p' < modules.order | \
while read -r f; do
echo "Signing $f"
"${KDIR}/scripts/sign-file" "${CONFIG_MODULE_SIG_HASH}" "${scst_dir}/scst/src/certs/scst_module_key.priv" "${scst_dir}/scst/src/certs/scst_module_key.der" "$f" || exit $?
done