From: Michael Prokop Date: Tue, 29 May 2018 22:01:00 +0000 (+0200) Subject: Update GRUB test for Secure Boot support X-Git-Tag: v0.32.0~2 X-Git-Url: https://git.grml.org/?p=grml-live.git;a=commitdiff_plain;h=c35a30b42bac4de7089f936d6917b246ade6d5c5 Update GRUB test for Secure Boot support cpuid with the recent Ubuntu GRUB no longer fails, so instead let's invoke `probe` with an incomplete command line, which returns fine in SecureBoot boot environment while it fails in full GRUB session with an error message. --- diff --git a/templates/boot/grub/grmlenv.cfg b/templates/boot/grub/grmlenv.cfg index fe779ee..ef37872 100644 --- a/templates/boot/grub/grmlenv.cfg +++ b/templates/boot/grub/grmlenv.cfg @@ -1,11 +1,12 @@ # this is a simple test to identify whether it looks like the Secure Boot enabled/signed -# GRUB is running or if it's a full featured GRUB version, the former doesn't allow running cpuid -if cpuid ; then - echo "It looks like Secure Boot is NOT enabled." - set grml_secureboot=false - export grml_secureboot -else +# GRUB is running or if it's a full featured GRUB version, the former doesn't +# fail with invalid usage, while the later will fail with "error: device name required." +if probe ; then echo "It looks like Secure Boot is enabled." set grml_secureboot=true export grml_secureboot +else + echo "It looks like Secure Boot is NOT enabled." + set grml_secureboot=false + export grml_secureboot fi