提交 6cd110a9 编写于 作者: S Satoru Takeuchi 提交者: Steven Rostedt (VMware)

ktest: Take submenu into account for grub2 menus

grub-reboot selects the submenu's first menuentry (title is "1>0") rather than ktest's
menuentry (title is "2") by mistake.

===
$ sudo cat /boot/grub/grub.cfg  | grep -E "^menuentry|^submenu"
...
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option '...' {
...
submenu 'Advanced options for Ubuntu' $menuentry_id_option '...' {
...
menuentry 'ktest' {
...
===

Correct it by taking submenu entries into account in get_grub2_index().

Link: http://lkml.kernel.org/r/87poaje4as.wl-satoru.takeuchi@gmail.comSigned-off-by: NSatoru Takeuchi <satoru.takeuchi@gmail.com>
Signed-off-by: NSteven Rostedt (VMware) <rostedt@goodmis.org>
上级 c2d84ddb
......@@ -1872,7 +1872,7 @@ sub get_grub2_index {
$grub_number++;
$found = 1;
last;
} elsif (/^menuentry\s/) {
} elsif (/^menuentry\s|^submenu\s/) {
$grub_number++;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册