summaryrefslogtreecommitdiffstats
path: root/perl-install/bootloader.pm
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2016-07-17 10:35:09 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2016-07-17 15:59:47 +0200
commitfbc399721879746f2cc69208dba3a42b290b0a7d (patch)
treecf95d56c48e4e31d8e79aa898c6d010f7e91f228 /perl-install/bootloader.pm
parentafb0a1e932d2566e2118211168baa62d66385141 (diff)
downloaddrakx-fbc399721879746f2cc69208dba3a42b290b0a7d.tar
drakx-fbc399721879746f2cc69208dba3a42b290b0a7d.tar.gz
drakx-fbc399721879746f2cc69208dba3a42b290b0a7d.tar.bz2
drakx-fbc399721879746f2cc69208dba3a42b290b0a7d.tar.xz
drakx-fbc399721879746f2cc69208dba3a42b290b0a7d.zip
grub2: fix not being able to edit default cmdline
Keep default append value (aka /etc/default/grub's GRUB_CMDLINE_LINUX_DEFAULT into {default_append} variable) Always use the value passed as now write_grub2_sysconfig() is only called after having offered to display the default cmdline value On first run (during installer) or when migrating from grub-legacy or lilo, we get the first entry's parameters Thus resolving mga#18952
Diffstat (limited to 'perl-install/bootloader.pm')
-rw-r--r--perl-install/bootloader.pm7
1 files changed, 3 insertions, 4 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index d511bf6be..b99db9f83 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -307,6 +307,8 @@ sub read_grub2() {
return if is_empty_hash_ref(\%bootloader) & !-s "$::prefix/boot/grub2/grub.cfg";
my %h = getVarsFromSh("$::prefix/etc/default/grub");
$bootloader{timeout} = $h{GRUB_TIMEOUT};
+ # on first run (during installer) or when migrating from grub-legacy or lilo:
+ $bootloader{default_append} ||= $::isInstall ? get_grub2_append(\%bootloader) : $h{GRUB_CMDLINE_LINUX_DEFAULT};
$bootloader{entries} = [];
my $entry;
my $f = "$::prefix/boot/grub2/grub.cfg";
@@ -1870,10 +1872,7 @@ sub write_grub2_sysconfig {
my $f = "$::prefix/etc/default/grub";
my %conf = getVarsFromSh($f);
- # First installation or migration from grub-legacy/lilo?
- if (! -f get_grub2_install_sh()) {
- $conf{GRUB_CMDLINE_LINUX_DEFAULT} = get_grub2_append($bootloader);
- }
+ $conf{GRUB_CMDLINE_LINUX_DEFAULT} = $bootloader->{default_append} || get_grub2_append($bootloader);
$conf{GRUB_GFXPAYLOAD_LINUX} = 'auto' if is_uefi();
$conf{GRUB_DISABLE_RECOVERY} = 'false'; # for 'failsafe' entry
$conf{GRUB_DEFAULT} ||= 'saved'; # for default entry but do not overwrite user choice