Skip to content

Instantly share code, notes, and snippets.

@dunmaksim
Created August 17, 2022 06:04
Show Gist options
  • Select an option

  • Save dunmaksim/6ceddd25c8e278c5b6bba38eaf2de600 to your computer and use it in GitHub Desktop.

Select an option

Save dunmaksim/6ceddd25c8e278c5b6bba38eaf2de600 to your computer and use it in GitHub Desktop.
echo "Sign NVIDIA and ORACLE kernel modules for using them with EFI mode in Debian Linux"
VERSION="$(uname -r)"
SHORT_VERSION="$(uname -r | cut -d . -f 1-2)"
MODULES_DIR=/lib/modules/${VERSION}
KBUILD_DIR=/usr/lib/linux-kbuild-${SHORT_VERSION}
cd "${MODULES_DIR}/updates/dkms"
for i in *.ko ; do
echo "Signing file ${i}"
sudo "${KBUILD_DIR}"/scripts/sign-file sha256 /root/MOK.priv /root/MOK.der "$i"
done
cd "${MODULES_DIR}/misc"
for i in *.ko ; do
echo "Signing file ${i}"
sudo "${KBUILD_DIR}"/scripts/sign-file sha256 /root/MOK.priv /root/MOK.der "$i"
done
update-initramfs -u -k all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment