Skip to content

Instantly share code, notes, and snippets.

@pedropombeiro
Last active March 23, 2019 23:42
Show Gist options
  • Save pedropombeiro/b9bd3a87d72a7e9c3df3ee6809762610 to your computer and use it in GitHub Desktop.
Save pedropombeiro/b9bd3a87d72a7e9c3df3ee6809762610 to your computer and use it in GitHub Desktop.
Sign vbox modules (/root/module-signing/)
#!/bin/bash
function signModule() {
modfile=$1
signScript="/usr/src/linux-headers-$(uname -r)/scripts/sign-file"
echo "Signing $modfile"
if [ ! -f $signScript ]; then
echo "Could not find $signScript, exiting"
exit 1
fi
$signScript sha256 \
/root/module-signing/MOK.priv \
/root/module-signing/MOK.der "$modfile"
}
for modfile in $(dirname $(modinfo -n vboxdrv))/*.ko; do
echo "Signing $modfile"
signModule "$modfile"
done
signModule "$(modinfo -n vmmon)"
signModule "$(modinfo -n vmnet)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment