File tree Expand file tree Collapse file tree 1 file changed +22
-4
lines changed
Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -11,15 +11,33 @@ if [ "${EUID}" -ne 0 ]; then
1111 exit 1
1212fi
1313
14- echo " Configuring MOK for DKMS kernel modules."
15- update-secureboot-policy --enroll-key
14+ if command -v mortar-compilesigninstall & > /dev/null; then
15+ HAS_MORTAR=true
16+ else
17+ HAS_MORTAR=false
18+ fi
19+
20+ if [ " ${HAS_MORTAR} " = " true" ]; then
21+ echo " Configuring DKMS to use the Mortar MOK key."
22+ sed -i ' s@^# mok_signing_key=/var/lib/dkms/mok.key@mok_signing_key="/etc/mortar/private/db.key"@g; s@^# mok_certificate=/var/lib/dkms/mok.pub@mok_certificate="/etc/mortar/private/db.crt"@g' " /etc/dkms/framework.conf"
23+ else
24+ echo " Currently enrolled MOK keys:"
25+ mokutil --list-enrolled
26+ echo " Configuring MOK for DKMS kernel modules."
27+ update-secureboot-policy --enroll-key
28+ echo " New MOK keys:"
29+ mokutil --list-new
30+ fi
31+
1632echo " Updating initramfs."
1733update-initramfs -u
1834
19- if command -v mortar-compilesigninstall & > /dev/null ; then
20- echo " Mortar detected. Running mortar-compilesigninstall."
35+ if [ " ${HAS_MORTAR} " = " true " ] ; then
36+ echo " Running mortar-compilesigninstall to update the EFI file ."
2137 mortar-compilesigninstall
38+ echo " DKMS MOK configuration ready. You should now reboot."
2239else
2340 echo " Updating GRUB configuration."
2441 update-grub
42+ echo " DKMS MOK configuration ready. You should now reboot and then input the MOK password to enroll the key."
2543fi
You can’t perform that action at this time.
0 commit comments