summaryrefslogtreecommitdiffstats
path: root/perl-install/bootloader.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2013-02-27 06:40:05 +0000
committerThierry Vignaud <tv@mageia.org>2013-02-27 06:40:05 +0000
commit94bf8374a5ee847592471087fd6090a690c8cff4 (patch)
tree7ca12a5ed008a748ac8e7e2710aed68f0ad86a13 /perl-install/bootloader.pm
parent47f3c781cf4bcdcedb0c76f101dcb41d38a86a20 (diff)
downloaddrakx-94bf8374a5ee847592471087fd6090a690c8cff4.tar
drakx-94bf8374a5ee847592471087fd6090a690c8cff4.tar.gz
drakx-94bf8374a5ee847592471087fd6090a690c8cff4.tar.bz2
drakx-94bf8374a5ee847592471087fd6090a690c8cff4.tar.xz
drakx-94bf8374a5ee847592471087fd6090a690c8cff4.zip
(read_grub2) read more of grub2 config
(needed for next commit)
Diffstat (limited to 'perl-install/bootloader.pm')
-rw-r--r--perl-install/bootloader.pm15
1 files changed, 14 insertions, 1 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index ccea86a63..f7d13ac5c 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -235,7 +235,20 @@ sub read {
sub read_grub2 {
my %bootloader = getVarsFromSh("$::prefix/boot/grub2/drakboot.conf");
- $bootloader{entries} = [ map { if_(/menuentry\s+['"]([^']+)["']/, { label => $1 }) } cat_("$::prefix/boot/grub2/grub.cfg") ];
+ $bootloader{entries} = [];
+ my $entry;
+ foreach (cat_("$::prefix/boot/grub2/grub.cfg")) {
+ next if /^#/;
+ if (/menuentry\s+['"]([^']+)["']/) {
+ push @{$bootloader{entries}}, $entry if $entry;
+ $entry = { label => $1 };
+ } elsif (/linux\s+(\S+)\s+(.*)?/) {
+ @$entry{qw(kernel_or_dev append)} = ($1, $2);
+ } elsif (/initrd\s+(\S+)/) {
+ $entry->{initrd} = $1;
+ }
+ }
+
$bootloader{method} = 'grub2';
\%bootloader;
}