summaryrefslogtreecommitdiffstats
path: root/perl-install/bootloader.pm
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2015-04-08 07:52:40 -0400
committerThierry Vignaud <thierry.vignaud@gmail.com>2015-04-09 06:21:08 -0400
commit32c13f240d965a60c15ad70152b5930faa3caee8 (patch)
tree4a051c8872aeaa65884f13191ac587f1011fc7e5 /perl-install/bootloader.pm
parent3e7995bef00ad7b4381ed0f66eec8bdeb57382b1 (diff)
downloaddrakx-32c13f240d965a60c15ad70152b5930faa3caee8.tar
drakx-32c13f240d965a60c15ad70152b5930faa3caee8.tar.gz
drakx-32c13f240d965a60c15ad70152b5930faa3caee8.tar.bz2
drakx-32c13f240d965a60c15ad70152b5930faa3caee8.tar.xz
drakx-32c13f240d965a60c15ad70152b5930faa3caee8.zip
write /boot/grub2/install.sh like for grub
thus deprecating /boot/grub2/drakboot.conf
Diffstat (limited to 'perl-install/bootloader.pm')
-rw-r--r--perl-install/bootloader.pm19
1 files changed, 14 insertions, 5 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index 531162103..0c6b317ad 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -1791,6 +1791,16 @@ sub write_grub2 {
run_program::rooted($::prefix, 'grub2-set-default', '2>', \$error, $bootloader->{default}) or die "grub2-set-default failed: $error";
};
check_enough_space();
+ write_grub2_install_sh($bootloader, $o_backup_extension);
+}
+
+sub write_grub2_install_sh {
+ my ($bootloader, $o_backup_extension) = @_;
+ my $f = "$::prefix/boot/grub2/install.sh";
+ my $boot = $bootloader->{boot};
+ my @options = $boot =~ /\d$/ ? ('--grub-setup=/bin/true', $boot) : $boot;
+ renamef($f, $f . ($o_backup_extension || '.old'));
+ output_with_perm($f, 0755, join(' ', 'grub2-install', @options));
}
sub write_grub {
@@ -1994,13 +2004,12 @@ sub install_grub2 {
sub install_raw_grub2 {
my ($boot) = @_;
my $error;
- # if (member($boot, map { "/dev/$_->{device}" } @{$all_hds->{hds}}) {
- my @options = $boot =~ /\d$/ ? ('--grub-setup=/bin/true', $boot) : $boot;
- if (!run_program::rooted($::prefix, 'grub2-install', '2>', \$error, @options)) {
- log::explanations("grub2-install failed:\n(grub2-install @options)\nError: <$error>");
+ my $f = '/boot/grub2/install.sh';
+ if (!run_program::rooted($::prefix, "sh", "2>", \$error, $f)) {
+ log::explanations("grub2-install failed:\n(" . cat_($f) . ")\nError: <$error>");
die "grub2-install failed: $error";
}
- setVarsInSh("$::prefix/boot/grub2/drakboot.conf", { boot => $boot });
+ unlink("$::prefix/boot/grub2/drakboot.conf");
}
sub install_grub {