dingjian / rpms / kernel-rt

Forked from rpms/kernel-rt 4 years ago
Clone

Blame SOURCES/sign-modules

ab7326
#! /bin/bash
ab7326
ab7326
moddir=$1
ab7326
ab7326
modules=`find $moddir -name *.ko`
ab7326
ab7326
MODSECKEY="./signing_key.priv"
ab7326
MODPUBKEY="./signing_key.x509"
ab7326
ab7326
for mod in $modules
ab7326
do
ab7326
    dir=`dirname $mod`
ab7326
    file=`basename $mod`
ab7326
ab7326
    ./scripts/sign-file sha256 ${MODSECKEY} ${MODPUBKEY} ${dir}/${file}
ab7326
    rm -f ${dir}/${file}.{sig,dig}
ab7326
done
ab7326
ab7326
RANDOMMOD=$(find $moddir -type f -name '*.ko' | sort -R | tail -n 1)
ab7326
if [ "~Module signature appended~" != "$(tail -c 28 $RANDOMMOD)" ]; then
ab7326
	echo "*** Modules are unsigned! ***"
ab7326
	exit 1
ab7326
fi
ab7326
ab7326
exit 0