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, 8 insertions, 0 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index 6fb380567..99cfcec3a 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -1805,15 +1805,23 @@ sub write_grub2 {
$conf{GRUB_GFXPAYLOAD_LINUX} = 'auto' if is_uefi();
$conf{GRUB_DISABLE_RECOVERY} = 'false'; # for 'failsafe' entry
$conf{GRUB_TIMEOUT} = $bootloader->{timeout};
+ renamef($f, $f . ($o_backup_extension || '.old'));
setVarsInSh($f, \%conf);
+ my $f1 = "$::prefix/boot/grub2/grub.cfg";
+ renamef($f1, $f1 . ($o_backup_extension || '.old'));
run_program::rooted($::prefix, 'update-grub2', '2>', \$error) or die "update-grub2 failed: $error";
log::l("update-grub2 logs: $error");
# set default entry:
eval {
+ my $f2 = "$::prefix/boot/grub2/grubenv";
+ cp_af($f2, $f2 . ($o_backup_extension || '.old'));
run_program::rooted($::prefix, 'grub2-set-default', '2>', \$error, $bootloader->{default}) or die "grub2-set-default failed: $error";
};
+ if (my $err = $@) {
+ log::l("error while running grub2-set-default: $err");
+ }
check_enough_space();
write_grub2_install_sh($bootloader, $o_backup_extension);
}