here's the script for signing kernel modules of any existing kernel version
#!/bin/bash ###### # https://github.com/Canonical-kernel/Ubuntu-kernel/blob/master/Documentation/module-signing.txt ###### kernelName=`uname -r` echo echo "currently installed kernels:" ls -d /usr/src/linux-headers-* echo echo "currently booted kernel: \"$kernelName\"" echo -n "which kernel to sign? " read kernelName echo $kernelName
echo echo "signing modules for kernel \"$kernelName\" (`mokutil --sb-state`)" echo
for module in /lib/modules/${kernelName}/updates/dkms/*.ko ; do echo -ne "\t-" $module tail -n1 $module | grep -aq '~Module signature appended~' > /dev/null if [ $? -eq 1 ]; then sudo /usr/src/linux-headers-${kernelName}/scripts/sign-file sha256 ./MOK-selfsigned-kernel-module.priv ./MOK-selfsigned-kernel-module.der ${module} echo " ... OK" else echo " ... skipped" fi done
here's the script for signing kernel modules of any existing kernel version
#!/bin/bash /github. com/Canonical- kernel/ Ubuntu- kernel/ blob/master/ Documentation/ module- signing. txt linux-headers- *
######
# https:/
######
kernelName=`uname -r`
echo
echo "currently installed kernels:"
ls -d /usr/src/
echo
echo "currently booted kernel: \"$kernelName\""
echo -n "which kernel to sign? "
read kernelName
echo $kernelName
echo
echo "signing modules for kernel \"$kernelName\" (`mokutil --sb-state`)"
echo
for module in /lib/modules/ ${kernelName} /updates/ dkms/*. ko ; do linux-headers- ${kernelName} /scripts/ sign-file sha256 ./MOK-selfsigne d-kernel- module. priv ./MOK-selfsigne d-kernel- module. der ${module}
echo -ne "\t-" $module
tail -n1 $module | grep -aq '~Module signature appended~' > /dev/null
if [ $? -eq 1 ]; then
sudo /usr/src/
echo " ... OK"
else
echo " ... skipped"
fi
done