X-Git-Url: https://git.grml.org/?p=grml-autoconfig.git;a=blobdiff_plain;f=autoconfig.functions;h=fa750447ff06d5a5b9b4c1902ae387a1ab8a3c86;hp=1c5c46b1b45877f88522ae9a91e70eb5f303db51;hb=8f3149578aab5ac4a0bd477f3cd9add47122e65c;hpb=4dca8013673e8de2bf8adc4fa45eb31eda1bc78a diff --git a/autoconfig.functions b/autoconfig.functions index 1c5c46b..fa75044 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -540,6 +540,27 @@ config_kernel(){ } # }}} +# {{{ secure boot +config_secureboot(){ + if [ -x /usr/bin/mokutil ] ; then + local secstate=$(mokutil --sb-state 2>/dev/null) # "SecureBoot enabled" + if [ -n "$secstate" ] ; then + einfo "SecureBoot is enabled" ; eend 0 + else + ewarn "SecureBoot not detected" ; eend 0 + fi + else + if modprobe efivars &>/dev/null ; then + if od -An -t u1 /sys/firmware/efi/vars/SecureBoot-*/data 2>/dev/null | grep -q 1 ; then + einfo "SecureBoot is enabled" ; eend 0 + else + ewarn "SecureBoot not detected" ; eend 0 + fi + fi + fi +} +# }}} + # {{{ timezone config_timezone(){ # don't touch the files if running from harddisk: