fix(scripts): Fedora/RHEL usan /boot/grub2/grub.cfg, no el wrapper EFI

Desde Fedora 34 / RHEL 9, /boot/efi/EFI/<distro>/grub.cfg es un wrapper
que sourcea /boot/grub2/grub.cfg — y grub2-mkconfig se niega a
sobreescribirlo ("will overwrite the GRUB wrapper. Please run [...] on
/boot/grub2/grub.cfg instead"). Mi loop de detección lo encontraba
primero y fallaba. Apuntamos directo al canónico.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
sergio
2026-05-23 00:25:18 +00:00
parent 89117f47cc
commit 5edd8de917
2 changed files with 7 additions and 27 deletions
+1 -10
View File
@@ -39,16 +39,7 @@ fi
if command -v update-grub >/dev/null 2>&1; then
update-grub
elif command -v grub2-mkconfig >/dev/null 2>&1; then
GRUB_CFG=""
for cand in /boot/efi/EFI/fedora/grub.cfg \
/boot/efi/EFI/redhat/grub.cfg \
/boot/efi/EFI/centos/grub.cfg \
/boot/efi/EFI/almalinux/grub.cfg \
/boot/efi/EFI/rocky/grub.cfg \
/boot/grub2/grub.cfg; do
if [ -f "$cand" ] || [ -L "$cand" ]; then GRUB_CFG="$cand"; break; fi
done
grub2-mkconfig -o "${GRUB_CFG:-/boot/grub2/grub.cfg}"
grub2-mkconfig -o /boot/grub2/grub.cfg
elif command -v grub-mkconfig >/dev/null 2>&1; then
grub-mkconfig -o /boot/grub/grub.cfg
fi