PortValhalla/scripts/PopOS/secure-boot/sign-modules.sh

16 lines
320 B
Bash
Raw Normal View History

2022-11-18 10:41:12 +00:00
#!/bin/bash
# Elevate script
if [ ! "$UID" -eq 0 ]
then
sudo bash "$BASH_SOURCE"
else
keyDir="/var/lib/shim-signed/mok"
keyFile="$keyDir/MOK.priv"
pubFile="$keyDir/MOK.der"
for file in $(find /lib/modules /var/lib/dkms -name *.ko);
do
kmodsign sha512 $keyFile $pubFile $file
done
fi