From faf75d2a7f6723f6f5dbae6979978b4dc8daa5d3 Mon Sep 17 00:00:00 2001 From: vinceliuice Date: Sat, 12 Oct 2024 01:02:38 +0800 Subject: [PATCH] Update install.sh --- install.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index 7e1eba8..f8fca70 100755 --- a/install.sh +++ b/install.sh @@ -354,14 +354,21 @@ updating_grub() { grub2-mkconfig -o /boot/grub2/grub.cfg # Check for Fedora (regular or Atomic) elif has_command dnf || has_command rpm-ostree; then - # Check for UEFI - if [[ -f /boot/efi/EFI/fedora/grub.cfg ]]; then - prompt -s "Find config file on /boot/efi/EFI/fedora/grub.cfg ...\n" - grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg # Check for BIOS - elif [[ -f /boot/grub2/grub.cfg ]]; then + if [[ -f /boot/grub2/grub.cfg ]]; then prompt -s "Find config file on /boot/grub2/grub.cfg ...\n" grub2-mkconfig -o /boot/grub2/grub.cfg + # Check for UEFI + elif [[ -f /boot/efi/EFI/fedora/grub.cfg ]]; then + prompt -s "Find config file on /boot/efi/EFI/fedora/grub.cfg ...\n" + grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg + fi + + if [[ -f /boot/grub2/grub.cfg && -f /boot/efi/EFI/fedora/grub.cfg ]]; then + prompt -w "Under EFI, GRUB2 looks for its configuration in /boot/efi/EFI/fedora/grub.cfg,\n however the postinstall script of grub2-common installs a small shim which chains to the standard configuration at /boot/grub2/grub.cfg which is generated above.\n To reset this shim to defaults, delete the existing /boot/efi/EFI/fedora/grub.cfg and then reinstall grub2-common." + + prompt -i "sudo rm -f /boot/efi/EFI/fedora/grub.cfg" + prompt -i "sudo dnf reinstall grub2-common" fi fi