summaryrefslogtreecommitdiffstats
path: root/perl-install/bootloader.pm
diff options
context:
space:
mode:
authorThomas Backlund <tmb@mageia.org>2012-12-17 19:07:47 +0000
committerThomas Backlund <tmb@mageia.org>2012-12-17 19:07:47 +0000
commit7fd2efcef961711a995a89c3245a972a136e2463 (patch)
treeddec8283adaf6df350b93f1914b5b4647fd1a6ea /perl-install/bootloader.pm
parente5660bf092c9a54871d60b7eaf9393133d509e2e (diff)
downloaddrakx-7fd2efcef961711a995a89c3245a972a136e2463.tar
drakx-7fd2efcef961711a995a89c3245a972a136e2463.tar.gz
drakx-7fd2efcef961711a995a89c3245a972a136e2463.tar.bz2
drakx-7fd2efcef961711a995a89c3245a972a136e2463.tar.xz
drakx-7fd2efcef961711a995a89c3245a972a136e2463.zip
fix installing grub2 from live session (blino)
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) = @_;