summaryrefslogtreecommitdiffstats
path: root/perl-install/bootloader.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/bootloader.pm')
-rw-r--r--perl-install/bootloader.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index dd0b25551..cecd5aa4c 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -1970,9 +1970,13 @@ sub restore_previous_MBR_bootloader {
sub install_grub2 {
my ($bootloader, $_all_hds) = @_;
my $error;
- run_program::rooted($::prefix, 'grub2-install', '2>', \$error, $bootloader->{boot}) or die "grub2 failed: $error";
+ my $grub2_cfg = "/boot/grub2/grub.cfg";
+ if (!-s "$::prefix/$grub2_cfg") {
+ run_program::rooted($::prefix, 'grub2-mkconfig', '2>', \$error, '-o', $grub2_cfg) or die "grub2-mkconfig failed: $error";
+ }
+ run_program::rooted($::prefix, 'grub2-install', '2>', \$error, $bootloader->{boot}) or die "grub2-install failed: $error";
}
-
+
sub install_grub {
my ($bootloader, $all_hds) = @_;