summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2016-06-22 02:05:25 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2016-06-22 02:24:24 +0200
commit9e49ca02c5207d900ce75132b1311a082e604736 (patch)
tree8ffa054669358098af27c9be12d2d3825598f8c1
parentbee315d23c17623a69d1bd3dc4f8c75eb5ec465d (diff)
downloaddrakx-9e49ca02c5207d900ce75132b1311a082e604736.tar
drakx-9e49ca02c5207d900ce75132b1311a082e604736.tar.gz
drakx-9e49ca02c5207d900ce75132b1311a082e604736.tar.bz2
drakx-9e49ca02c5207d900ce75132b1311a082e604736.tar.xz
drakx-9e49ca02c5207d900ce75132b1311a082e604736.zip
better state machine
needed for next commit
-rw-r--r--perl-install/bootloader.pm8
1 files changed, 5 insertions, 3 deletions
diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm
index 463f9edf5..2f379bd0b 100644
--- a/perl-install/bootloader.pm
+++ b/perl-install/bootloader.pm
@@ -316,7 +316,6 @@ sub read_grub2() {
foreach (cat_utf8($f)) {
next if /^#/;
if (/menuentry\s+['"]([^']+)["']/) {
- push @{$bootloader{entries}}, $entry if $entry;
$entry = { label => $1 };
} elsif (/linux\s+(\S+)\s+(.*)?/ || /module\s+(\S+vmlinu\S+)\s+(.*)?/) {
$entry->{type} = 'image';
@@ -328,10 +327,13 @@ sub read_grub2() {
}
} elsif (/initrd\s+(\S+)/ || /module\s+(\S+initrd\S+)\s+(.*)?/) {
$entry->{initrd} = $1;
+ } elsif (/}/) {
+ if ($entry) {
+ push @{$bootloader{entries}}, $entry ;
+ undef $entry;
+ }
}
}
- # last entry:
- push @{$bootloader{entries}}, $entry if $entry;
# get default entry:
foreach (run_program::rooted_get_stdout($::prefix, qw(grub2-editenv list))) {