]> xenbits.xensource.com Git - people/iwj/osstest.git/commitdiff
host examination: bootloader: edit all grub2 menu entries
authorIan Jackson <ian.jackson@eu.citrix.com>
Wed, 17 May 2017 22:22:16 +0000 (23:22 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 18 May 2017 11:01:17 +0000 (12:01 +0100)
edit all the menuentry and submenu entries.

This is a good idea because in princple the first menu and submenu
entries in the autogenerated grub.cfg might be in a function which is
not actually called.

The resulting grub menu now looks even sillier.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
ts-examine-serial-pre

index 86f332f61479e2d1257fd5230aaad7bb62d7c077..90037c6a36b1890801466c1a59114929b397029c 100755 (executable)
@@ -80,12 +80,9 @@ sub bootloader () {
     } else {
        # no support for grub1
        $edit->('/boot/grub/grub.cfg', sub {
-            my %done;
             while (<::EI>) {
-               s{^(\s* ( menuentry | submenu ) \s+
-                     (['"]) )( [^'"]+ \3) }{
-                    $done{$2}++ ? $& : "$1$c $4"
-                }xe;
+               s{^(\s* (?: menuentry | submenu ) \s+
+                     (['"]) )( [^'"]+ \2) }{$1$c $3}x;
                print ::EO;
            }
        });