diff --git a/99-grub-mkconfig.install b/99-grub-mkconfig.install old mode 100644 new mode 100755 index b14fc82a..57e2cd21 --- a/99-grub-mkconfig.install +++ b/99-grub-mkconfig.install @@ -9,16 +9,22 @@ ARCH=$(uname -m) [[ -f /etc/default/grub ]] && . /etc/default/grub # Can't assume a BLS capable bootloader on ppc64 -if [[ x$GRUB_ENABLE_BLSCFG != xfalse && +if [[ x$GRUB_ENABLE_BLSCFG = xtrue && $ARCH != "ppc64" && $ARCH != "ppc64le" ]]; then exit 0 fi COMMAND="$1" +grub_cfg=/boot/grub2/grub.cfg +if mountpoint -q /boot/efi; then + os_name=$(grep ^ID= /etc/os-release | sed -e 's/^ID=//' -e 's/rhel/redhat/' -e 's/\"//g') + grub_cfg=/boot/efi/EFI/$os_name/grub.cfg +fi + case "$COMMAND" in add|remove) - grub2-mkconfig --no-grubenv-update -o /boot/grub2/grub.cfg >& /dev/null + grub2-mkconfig --no-grubenv-update -o $grub_cfg >& /dev/null ;; *) ;; diff --git a/grub2.spec b/grub2.spec index fbad1422..7b894341 100644 --- a/grub2.spec +++ b/grub2.spec @@ -7,7 +7,7 @@ Name: grub2 Epoch: 1 Version: 2.02 -Release: 158%{?dist} +Release: 159%{?dist} Summary: Bootloader with support for Linux, Multiboot and more Group: System Environment/Base License: GPLv3+ @@ -523,6 +523,10 @@ fi %endif %changelog +* Tue Nov 12 2024 Leo Sandoval - 2.02-159 +- Fix default behavior when GRUB_ENABLE_BLSCFG is not present +- Resolves: #RHEL-4319 + * Thu Sep 19 2024 Leo Sandoval - 2.02-158 - grub-mkconfig.in: turn off executable owner bit - Resolves: #RHEL-58835