Skip to content

Instantly share code, notes, and snippets.

@bjorndown
Created June 24, 2020 11:22
Show Gist options
  • Save bjorndown/11b99dde4d6d6856d922995937a17f28 to your computer and use it in GitHub Desktop.
Save bjorndown/11b99dde4d6d6856d922995937a17f28 to your computer and use it in GitHub Desktop.
#!/bin/sh
set -o errexit
kernel_release=$(uname -r)
private_key_file="private_key.pem"
public_key_file="public_key.der"
find /lib/modules/"${kernel_release}" -name 'vbox*.ko' | while read -r module_path; do
module_name=$(basename -s .ko ${module_path})
echo "Signing ${module_name} ..."
/usr/src/kernels/"${kernel_release}"+debug/scripts/sign-file \
sha256 \
"${private_key_file}" \
"${public_key_file}" \
"${module_path}"
done;
# easiest to first sign all modules, then load them
find /lib/modules/"${kernel_release}" -name 'vbox*.ko' | while read -r module_path; do
module_name=$(basename -s .ko "${module_path}")
echo "Loading ${module_name}"
modprobe "${module_name}"
done;
echo "Checking VBoxManage output: "
VBoxManage --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment