summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2015-04-08 07:53:40 -0400
committerThierry Vignaud <thierry.vignaud@gmail.com>2015-04-09 06:21:09 -0400
commitd92876fa3cecab53b46a513e22d9a9fc9fb6be02 (patch)
tree68e112614aba355bfd7ac3b2cab425f8d9b2918e
parent32c13f240d965a60c15ad70152b5930faa3caee8 (diff)
downloaddrakx-d92876fa3cecab53b46a513e22d9a9fc9fb6be02.tar
drakx-d92876fa3cecab53b46a513e22d9a9fc9fb6be02.tar.gz
drakx-d92876fa3cecab53b46a513e22d9a9fc9fb6be02.tar.bz2
drakx-d92876fa3cecab53b46a513e22d9a9fc9fb6be02.tar.xz
drakx-d92876fa3cecab53b46a513e22d9a9fc9fb6be02.zip
grub2: read boot device from install.sh
instead of from deprecated drakboot.conf
-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 0c6b317ad..a64b5dc59 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -292,6 +292,9 @@ Read back GRUB2 config + C</boot/grub2/drakboot.conf>
sub read_grub2() {
my %bootloader = getVarsFromSh("$::prefix/boot/grub2/drakboot.conf");
+ if (is_empty_hash_ref(\%bootloader)) {
+ %bootloader = read_grub2_install_sh();
+ }
my %h = getVarsFromSh("$::prefix/etc/default/grub");
$bootloader{timeout} = $h{GRUB_TIMEOUT};
$bootloader{entries} = [];
@@ -323,6 +326,15 @@ sub read_grub2() {
\%bootloader;
}
+sub read_grub2_install_sh() {
+ my $s = cat_("$::prefix/boot/grub2/install.sh");
+ my %h;
+ if ($s =~ m!(/dev/\S+)!m) {
+ $h{boot} = $1;
+ }
+ %h;
+}
+
=item read_grub($fstab)
Reads back Grub Legacy config.