From 3a9809b30ef7f9512b765450eb404ee836106257 Mon Sep 17 00:00:00 2001 From: Leo Sandoval Date: Thu, 5 Sep 2024 12:37:59 -0600 Subject: [PATCH] load EFI commands inside test expressions Resolves: #2305291 Signed-off-by: Leo Sandoval --- ...EFI-commands-inside-test-expressions.patch | 44 +++++++++++++++++++ grub.patches | 3 +- grub2.spec | 6 ++- 3 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 0275-load-EFI-commands-inside-test-expressions.patch diff --git a/0275-load-EFI-commands-inside-test-expressions.patch b/0275-load-EFI-commands-inside-test-expressions.patch new file mode 100644 index 0000000..137890e --- /dev/null +++ b/0275-load-EFI-commands-inside-test-expressions.patch @@ -0,0 +1,44 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Leo Sandoval +Date: Wed, 4 Sep 2024 13:25:23 -0600 +Subject: [PATCH] load EFI commands inside test expressions + +These two commands may fail interrumping the normal boot process, +so placing these inside test expressions is a safer approach. + +Resolves: #2305291 +Suggested-by: Kan-Ru Chen: +Signed-off-by: Leo Sandoval +--- + util/grub.d/25_bli.in | 4 +++- + util/grub.d/30_uefi-firmware.in | 3 +-- + 2 files changed, 4 insertions(+), 3 deletions(-) + +diff --git a/util/grub.d/25_bli.in b/util/grub.d/25_bli.in +index 26e27a019..00a8d7159 100644 +--- a/util/grub.d/25_bli.in ++++ b/util/grub.d/25_bli.in +@@ -19,6 +19,8 @@ set -e + + cat << EOF + if [ "\$grub_platform" = "efi" ]; then +- insmod bli ++ if [ ! insmod bli ]; then ++ echo "bli module not available" ++ fi + fi + EOF +diff --git a/util/grub.d/30_uefi-firmware.in b/util/grub.d/30_uefi-firmware.in +index 1c2365ddb..1ef31e08f 100644 +--- a/util/grub.d/30_uefi-firmware.in ++++ b/util/grub.d/30_uefi-firmware.in +@@ -32,8 +32,7 @@ gettext_printf "Adding boot menu entry for UEFI Firmware Settings ...\n" >&2 + + cat << EOF + if [ "\$grub_platform" = "efi" ]; then +- fwsetup --is-supported +- if [ "\$?" = 0 ]; then ++ if [ fwsetup --is-supported ]; then + menuentry '$LABEL' \$menuentry_id_option 'uefi-firmware' { + fwsetup + } diff --git a/grub.patches b/grub.patches index bf76063..f096b8d 100644 --- a/grub.patches +++ b/grub.patches @@ -271,4 +271,5 @@ Patch0270: 0270-grub2-mkconfig-Ensure-grub-cfg-stub-is-not-overwritt.patch Patch0271: 0271-grub2-mkconfig-Simplify-os_name-detection.patch Patch0272: 0272-grub-mkconfig-Remove-check-for-mount-point-for-grub-.patch Patch0273: 0273-efi-api.h-include-missing-__grub_efi_api-macros-on-E.patch -Patch0274: 0274-grub-core-net-arp.c-fix-variable-name.patch \ No newline at end of file +Patch0274: 0274-grub-core-net-arp.c-fix-variable-name.patch +Patch0275: 0275-load-EFI-commands-inside-test-expressions.patch \ No newline at end of file diff --git a/grub2.spec b/grub2.spec index 58b7ff3..f4c00ca 100644 --- a/grub2.spec +++ b/grub2.spec @@ -17,7 +17,7 @@ Name: grub2 Epoch: 1 Version: 2.12 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Bootloader with support for Linux, Multiboot and more License: GPL-3.0-or-later URL: http://www.gnu.org/software/grub/ @@ -560,6 +560,10 @@ mv ${EFI_HOME}/grub.cfg.stb ${EFI_HOME}/grub.cfg %endif %changelog +* Thu Sep 5 2024 Leo Sandoval - 2.12-6 +- load EFI commands inside test expressions +- Resolves: #2305291 + * Thu Aug 29 2024 Leo Sandoval - 2.12-5 - Fix netbooting regressions introduced at 2.12-1 - Resolves: #2303727