summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2013-05-31 09:34:44 +0000
committerThierry Vignaud <thierry.vignaud@gmail.com>2013-12-14 14:01:03 +0100
commit345282d57034a0b9e395ddf7c5fbbe7d5fcfca94 (patch)
tree53354900b4aff9124b13b483a9c7160e96ba158e
parent240fcf80e71c45512caadbd31555c71bd1744e8c (diff)
downloaddrakx-345282d57034a0b9e395ddf7c5fbbe7d5fcfca94.tar
drakx-345282d57034a0b9e395ddf7c5fbbe7d5fcfca94.tar.gz
drakx-345282d57034a0b9e395ddf7c5fbbe7d5fcfca94.tar.bz2
drakx-345282d57034a0b9e395ddf7c5fbbe7d5fcfca94.tar.xz
drakx-345282d57034a0b9e395ddf7c5fbbe7d5fcfca94.zip
(write_grub2) read/save choosen default entry
-rw-r--r--perl-install/NEWS1
-rw-r--r--perl-install/bootloader.pm10
-rw-r--r--perl-install/install/NEWS1
3 files changed, 12 insertions, 0 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS
index 772c1b497..ea136b3ce 100644
--- a/perl-install/NEWS
+++ b/perl-install/NEWS
@@ -1,6 +1,7 @@
- ensure files are installed for nfs (mga#10301)
- drakboot:
o fix displaying need to install acpi* packages when they're already installed
+ o read/save choosen default entry
- finish-install:
kbluetooth is replaced by bluedevil, (#10082)
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index 74601d740..dea5bf0bd 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -252,6 +252,11 @@ sub read_grub2 {
}
}
+ # get default entry:
+ foreach (run_program::rooted_get_stdout($::prefix, qw(grub2-editenv list))) {
+ $bootloader{default} = $1 if /saved_entry=(.*)/;
+ }
+
$bootloader{method} = 'grub2';
\%bootloader;
}
@@ -1813,6 +1818,11 @@ sub write_grub2 {
my $grub2_cfg = '/boot/grub2/grub.cfg';
run_program::rooted($::prefix, 'grub2-mkconfig', '2>', \$error, '-o', $grub2_cfg) or die "grub2-mkconfig failed: $error";
+
+ # set default entry:
+ eval {
+ run_program::rooted($::prefix, 'grub2-set-default', '2>', \$error, $bootloader->{default}) or die "grub2-mkconfig failed: $error";
+ };
}
sub write_grub {
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS
index b06abfb26..e5934e6e4 100644
--- a/perl-install/install/NEWS
+++ b/perl-install/install/NEWS
@@ -1,5 +1,6 @@
- bootloader:
o fix displaying need to install acpi* packages when they're already installed
+ o read/save choosen default entry
Version 15.54 - 17 May 2013