summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2020-06-21 10:41:27 +0100
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2020-06-21 16:10:32 +0100
commit0baa58de6ff2b3ea3ebe6e09035a9643af4e0768 (patch)
treef14920691f8f0c3c178d80bd050e7f0ee369a183 /perl-install
parentfc9f51f730ddc30e521ee8c14f1a8588e63caa30 (diff)
downloaddrakx-0baa58de6ff2b3ea3ebe6e09035a9643af4e0768.tar
drakx-0baa58de6ff2b3ea3ebe6e09035a9643af4e0768.tar.gz
drakx-0baa58de6ff2b3ea3ebe6e09035a9643af4e0768.tar.bz2
drakx-0baa58de6ff2b3ea3ebe6e09035a9643af4e0768.tar.xz
drakx-0baa58de6ff2b3ea3ebe6e09035a9643af4e0768.zip
Simplify UEFI bootloader detection.
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/bootloader.pm20
1 files changed, 10 insertions, 10 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index 2d2b9c540..4e8fba097 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -296,8 +296,17 @@ sub read {
@devs = split(',', $bootloader->{'raid-extra-boot'});
}
+ #- if $bootloader->{boot} is undefined, @devs contains a single undef element
my ($type) = map {
- if (m!/fd\d+$!) {
+ if (is_uefi()) {
+ if (-e "$::prefix/boot/refind_linux.conf") {
+ 'refind';
+ } elsif (-f "$::prefix/boot/EFI/EFI/mageia/grub" . uefi_type() . ".efi") {
+ 'grub2';
+ } else {
+ ()
+ }
+ } elsif (m!/fd\d+$!) {
warn "not checking the method on floppy, assuming $main_method is right\n";
$main_method;
} elsif (member($main_method, qw(cromwell uboot))) {
@@ -306,8 +315,6 @@ sub read {
} elsif (my $type = partition_table::raw::typeOfMBR($_)) {
warn "typeOfMBR $type on $_ for method $main_method\n" if $ENV{DEBUG};
$type;
- } elsif (-e "$::prefix/boot/refind_linux.conf") {
- 'refind';
} else { () }
} @devs;
@@ -315,13 +322,6 @@ sub read {
return $bootloader if read_($bootloader);
}
}
- # still no boot loader found? let's check for ESP if using UEFI:
- if (is_uefi()) {
- if (-f "/boot/EFI/EFI/mageia/grubx64.efi" || -f "/boot/EFI/EFI/mageia/grubia32.efi" || -f "/boot/efi/EFI/mageia/grubaa64.efi") {
- my $bootloader = bootloader::read_grub2();
- return $bootloader if read_($bootloader);
- }
- }
}
sub read_ {