util/grub.d/30_uefi-firmware.in: Re-arrange if conditions
PATCH 1/1 util/grub.d/30_uefi-firmware.in: Re-arrange if conditions
Only perform call to fwsetup if one is on EFI platform. On all other platorms fwsetup command does not exists, and thus returns 0 and a useless uefi-firmware menuentry gets generated.
Signed-off-by Dimitri John Ledkov <[email protected]>
--- util/grub.d/30_uefi-firmware.in | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
util/grub.d/30_uefi-firmware.in +7 -5
@@ -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
Signature · 1 line
2.34.1
Quoted 5 lines · Dimitri John Ledkov
Only perform call to fwsetup if one is on EFI platform. On all other platorms fwsetup command does not exists, and thus returns 0 and a useless uefi-firmware menuentry gets generated.
Signed-off-by Dimitri John Ledkov <[email protected]>
Reviewed-by Daniel Kiper <[email protected]>
Thank you!
Daniel