ignatenkobrain / rpms / kernel

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