summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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))) {