PortValhalla/scripts/Debian/Drivers/SurfaceBook2/SecureBoot/sign-modules.sh

16 lines
331 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";
2022-11-18 10:41:12 +00:00
else
keyDir="/var/lib/shim-signed/mok";
keyFile="$keyDir/MOK.priv";
pubFile="$keyDir/MOK.der";
2022-11-18 10:41:12 +00:00
for file in $(find /lib/modules /var/lib/dkms -name *.ko);
do
2023-01-23 15:11:51 +00:00
kmodsign sha512 "$keyFile" "$pubFile" "$file";
2022-11-18 10:41:12 +00:00
done
fi