2022-11-18 10:41:12 +00:00
|
|
|
#!/bin/bash
|
|
|
|
# Elevate script
|
|
|
|
if [ ! "$UID" -eq 0 ]
|
|
|
|
then
|
2023-01-23 14:55:10 +00:00
|
|
|
sudo bash "$BASH_SOURCE";
|
2022-11-18 10:41:12 +00:00
|
|
|
else
|
2023-01-23 14:55:10 +00:00
|
|
|
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
|