]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
templates: Enable fwsetup on EFI platforms only
authorDimitri John Ledkov <dimitri.ledkov@canonical.com>
Tue, 29 Nov 2022 22:13:27 +0000 (22:13 +0000)
committerDaniel Kiper <daniel.kiper@oracle.com>
Wed, 7 Dec 2022 22:38:26 +0000 (23:38 +0100)
Only perform call to fwsetup if one is on EFI platform. On all other
platforms fwsetup command does not exists, and thus returns 0 and
a useless uefi-firmware menu entry gets generated.

Signed-off-by: Dimitri John Ledkov <dimitri.ledkov@canonical.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
util/grub.d/30_uefi-firmware.in

index c1731e5bbbb33191f11eadc7773bf944be1ef1ac..1c2365ddbd3517e0bc9b9aa16abac5b361198876 100644 (file)
@@ -31,10 +31,12 @@ LABEL="UEFI Firmware Settings"
 gettext_printf "Adding boot menu entry for UEFI Firmware Settings ...\n" >&2
 
 cat << EOF
-fwsetup --is-supported
-if [ "\$grub_platform" = "efi" -a "\$?" = 0 ]; then
-       menuentry '$LABEL' \$menuentry_id_option 'uefi-firmware' {
-               fwsetup
-       }
+if [ "\$grub_platform" = "efi" ]; then
+       fwsetup --is-supported
+       if [ "\$?" = 0 ]; then
+               menuentry '$LABEL' \$menuentry_id_option 'uefi-firmware' {
+                       fwsetup
+               }
+       fi
 fi
 EOF