From 9ca4009fc810fd8ef4825c5e5cc7ad8d745cf279 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Mon, 23 Mar 2020 18:17:07 +0100 Subject: (install_raw_grub2) rename /boot/efi as /boot/EFI Mageia mounts the ESP as /boot/EFI and thes grub2 looks at /boot/EFI/EFI But some windows installation end in having /boot/EFI/efi (lowercase) Rename the directory as upercase if needed so that grub2-install doesn't fail (mga#22395) --- perl-install/bootloader.pm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'perl-install/bootloader.pm') diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index e7b6eab5d..4eedc6f04 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -2334,6 +2334,10 @@ sub install_grub2 { sub install_raw_grub2() { my $error; my $f = '/boot/grub2/install.sh'; + my ($right_dir, $bad_dir) = ("$::prefix/boot/EFI/EFI/", "$::prefix/boot/EFI/efi/"); + if (-e $bad_dir && ! -e $right_dir) { + renamef($bad_dir, $right_dir); + } if (!run_program::rooted($::prefix, "sh", "2>", \$error, $f)) { log::explanations("grub2-install failed:\n(" . cat_($f) . ")\nError: <$error>"); die "grub2-install failed: $error"; -- cgit v1.2.1