# Secure Boot support # We are supposed to end up in this file only when running with enabled Secure Boot set grml_orig_prefix=$prefix export grml_orig_prefix set grml_orig_root=$root export grml_orig_root search.file %BOOT_FILE% root set prefix=($root)/boot/grub/ # this is a simple test to identify whether GRUB is running in Secure Boot mode # or not; "wrmsr" is in the list of disabled_mods of GRUB and is supposed to be # invoked with two arguments (and if not fails with exit code 18), but when # running under Secure Boot it fails with: "error: Secure Boot forbits loading # module from [...]/boot/grub/x86_64-efi/wrmsr.mod" + returns with exit code 30 wrmsr if [ $? = 30 ] ; 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 if [ -e /boot/grub/grub.cfg ] ; then configfile /boot/grub/grub.cfg else echo "ERROR: It looks like SecureBoot is enabled but reading GRUB configuration failed. Please execute the following commands and provide the output to the Grml team: echo \$prefix echo \$root echo \$grml_orig_prefix echo \$grml_orig_root search.file /boot/grub/grub.cfg Hint: Create a screenshot or a picture with your digital camera or mobile phone." fi