summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin-whitaker.me.uk>2020-06-15 11:01:25 +0100
committerMartin Whitaker <mageia@martin-whitaker.me.uk>2020-06-16 17:01:10 +0100
commit8fca7cfca3baa1639e316c8307dd20479cbe8d1d (patch)
tree9150ee13f37c47c6acc177d812d9ccbccbe954ea
parenteec464addb2fc99de508dbe990aa4cd899d6419b (diff)
downloaddrakx-8fca7cfca3baa1639e316c8307dd20479cbe8d1d.tar
drakx-8fca7cfca3baa1639e316c8307dd20479cbe8d1d.tar.gz
drakx-8fca7cfca3baa1639e316c8307dd20479cbe8d1d.tar.bz2
drakx-8fca7cfca3baa1639e316c8307dd20479cbe8d1d.tar.xz
drakx-8fca7cfca3baa1639e316c8307dd20479cbe8d1d.zip
Add option to install GRUB2 as EFI default/fallback bootloader.
i.e. in \EFI\BOOT instead of in \EFI\mageia. This should be used if installing on a removable device, and provides a workaround for buggy BIOSs that don't respect the EFI NVRAM settings.
-rw-r--r--perl-install/any.pm4
-rw-r--r--perl-install/bootloader.pm7
2 files changed, 10 insertions, 1 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index 0d58f95cb..c3ab97eb7 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -729,6 +729,10 @@ sub setupBootloader__grub2 {
{ text => N("Probe Foreign OS"), val => \$os_prober, type => 'bool',
help => N("If grub2 takes too long to install, you can use this option to skip detecting other OSes and make it fast"),
},
+ if_(is_uefi(),
+ { text => N("Install in /EFI/BOOT (workaround for some BIOSs)"),
+ val => \$b->{removable}, type => 'bool' },
+ ),
]);
if ($res) {
$b->{entries} = $b2->{entries};
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index fe69db7af..2d2b9c540 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -417,6 +417,7 @@ sub read_grub2_install_sh() {
$h{boot} = $1;
}
$h{no_esp_or_mbr} = $s =~ m!--grub-setup=/bin/true!;
+ $h{removable} = $s =~ m!--removable!;
%h;
}
@@ -2125,7 +2126,11 @@ sub write_grub2_install_sh {
my $boot = $bootloader->{boot};
my @options;
if (is_uefi()) {
- push @options, qw(--bootloader-id=tmp --no-nvram) if $bootloader->{no_esp_or_mbr};
+ if ($bootloader->{no_esp_or_mbr}) {
+ push @options, qw(--bootloader-id=tmp --no-nvram);
+ } elsif ($bootloader->{removable}) {
+ push @options, '--removable';
+ }
} else {
@options = $bootloader->{no_esp_or_mbr} ? ('--grub-setup=/bin/true', $boot) : $boot;
}