Skip to content

Commit

Permalink
mxgrub: Fix check if GRUB is installed on ESP
Browse files Browse the repository at this point in the history
The condition checked for a directory, but it’s a file, and therefore
GRUB was always installed anew on the ESP. With the fixed condition it
works now.

    $ sudo mxgrub mariux-5.12.0-381
    mount -L ESP /boot/efi
    GRUB for UEFI is already installed.
    umount /boot/efi
    GRUB is already installed in MBR.
    grub-editenv - set chosen=all-other-kernel>mariux-5.12.0-381

Resolves: #180
  • Loading branch information
pmenzel committed May 5, 2021
1 parent ee8f825 commit 94a94bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mxgrub/mxgrub
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ sub cmd_install {

if (has_esp) {
sys 'mount','-L','ESP','/boot/efi';
if (-d '/boot/efi/EFI/grub/grubx64.efi') {
if (-e '/boot/efi/EFI/grub/grubx64.efi') {
print "GRUB for UEFI is already installed.\n";
}
else {
Expand Down

0 comments on commit 94a94bf

Please sign in to comment.