summaryrefslogtreecommitdiffstats
path: root/perl-install/bootloader.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2013-02-27 06:40:09 +0000
committerThierry Vignaud <tv@mageia.org>2013-02-27 06:40:09 +0000
commit391be023560b677b5b51bb4e664619a589d7c9a5 (patch)
treeeaa056381dbfcc85cb0657889ca3de8ef92df61f /perl-install/bootloader.pm
parent94bf8374a5ee847592471087fd6090a690c8cff4 (diff)
downloaddrakx-391be023560b677b5b51bb4e664619a589d7c9a5.tar
drakx-391be023560b677b5b51bb4e664619a589d7c9a5.tar.gz
drakx-391be023560b677b5b51bb4e664619a589d7c9a5.tar.bz2
drakx-391be023560b677b5b51bb4e664619a589d7c9a5.tar.xz
drakx-391be023560b677b5b51bb4e664619a589d7c9a5.zip
set default parameters in grub2 config (mga#9177)
Diffstat (limited to 'perl-install/bootloader.pm')
-rw-r--r--perl-install/bootloader.pm12
1 files changed, 12 insertions, 0 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index f7d13ac5c..0a3363d52 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -1794,6 +1794,18 @@ sub crypt_grub_password {
sub write_grub2 {
my ($bootloader, $_all_hds, $o_backup_extension) = @_;
my $error;
+
+ # set default parameters:
+ my ($entry) = grep { $_->{kernel_or_dev} =~ /vmlin/ } @{$bootloader->{entries}};
+ my $append = $entry->{append};
+ $append =~ s/root=\S+//;
+ $append =~ s/\bro\b//;
+
+ my $f = "$::prefix/etc/default/grub";
+ my %conf = getVarsFromSh($f);
+ $conf{GRUB_CMDLINE_LINUX_DEFAULT} = $append;
+ setVarsInSh($f, \%conf);
+
my $grub2_cfg = '/boot/grub2/grub.cfg';
run_program::rooted($::prefix, 'grub2-mkconfig', '2>', \$error, '-o', $grub2_cfg) or die "grub2-mkconfig failed: $error";
}