ktest: take submenu into account
PATCH 1/1 ktest: take submenu into account
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().
Signed-off-by Satoru Takeuchi <[email protected]>
--- tools/testing/ktest/ktest.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/ktest/ktest.pl +1 -1
@@ -1821,7 +1821,7 @@ sub get_grub2_index { $grub_number++; $found = 1; last; - } elsif (/^menuentry\s/) { + } elsif (/^menuentry\s|^submenu\s/) { $grub_number++; } }
Signature · 1 line
2.7.4
Steven Rostedt
maintainerQuoted 14 lines · On Fri, 22 Sep 2017 13:38:19 +0900 Satoru Takeuchi <[email protected]>…
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' { ... ===
Quoted 3 lines
Correct it by taking submenu entries into account in
get_grub2_index().Signed-off-by Satoru Takeuchi <[email protected]>
Thanks for sending this. I was traveling (Embedded and Kernel Recipes) and just saw this email now. I'll add it to my priority todo list. I'll look at it and if all goes well, it should make the next merge window.
-- Steve
Quoted 17 lines
--- tools/testing/ktest/ktest.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/testing/ktest/ktest.pl +1
-1@@ -1821,7 +1821,7 @@ sub get_grub2_index { $grub_number++; $found = 1; last; - } elsif (/^menuentry\s/) { + } elsif (/^menuentry\s|^submenu\s/) { $grub_number++; } }