From eb6713daf00d9c9165be730a1b6037f690474976 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Fri, 9 Sep 2022 22:21:01 -0500 Subject: [PATCH] Revert dynamic EFI checks These changes were done carelessly preventing many systems to boot. This reverts 30_uefi-firmware.in as it was before 0eb684e8b, which was the case since it was first created up to 2022-08-18. --- util/grub.d/30_uefi-firmware.in | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/util/grub.d/30_uefi-firmware.in b/util/grub.d/30_uefi-firmware.in index c1731e5bb..d344d3883 100644 --- a/util/grub.d/30_uefi-firmware.in +++ b/util/grub.d/30_uefi-firmware.in @@ -26,15 +26,19 @@ export TEXTDOMAINDIR="@localedir@" . "$pkgdatadir/grub-mkconfig_lib" -LABEL="UEFI Firmware Settings" +EFI_VARS_DIR=/sys/firmware/efi/efivars +EFI_GLOBAL_VARIABLE=8be4df61-93ca-11d2-aa0d-00e098032b8c +OS_INDICATIONS="$EFI_VARS_DIR/OsIndicationsSupported-$EFI_GLOBAL_VARIABLE" -gettext_printf "Adding boot menu entry for UEFI Firmware Settings ...\n" >&2 +if [ -e "$OS_INDICATIONS" ] && \ + [ "$(( $(printf 0x%x \'"$(cat $OS_INDICATIONS | cut -b5)"\') & 1 ))" = 1 ]; then + LABEL="UEFI Firmware Settings" -cat << EOF -fwsetup --is-supported -if [ "\$grub_platform" = "efi" -a "\$?" = 0 ]; then - menuentry '$LABEL' \$menuentry_id_option 'uefi-firmware' { - fwsetup - } -fi + gettext_printf "Adding boot menu entry for UEFI Firmware Settings ...\n" >&2 + + cat << EOF +menuentry '$LABEL' \$menuentry_id_option 'uefi-firmware' { + fwsetup +} EOF +fi -- 2.37.3