Skip to content

Commit 2351e8c

Browse files
danieljordan10rostedt
authored andcommitted
ktest.pl: Avoid false positives with grub2 skip regex
Some distros have grub2 config files with the lines if [ x"${feature_menuentry_id}" = xy ]; then menuentry_id_option="--id" else menuentry_id_option="" fi which match the skip regex defined for grub2 in get_grub_index(): $skip = '^\s*menuentry'; These false positives cause the grub number to be higher than it should be, and the wrong kernel can end up booting. Grub documents the menuentry command with whitespace between it and the title, so make the skip regex reflect this. Link: https://lore.kernel.org/[email protected] Signed-off-by: Daniel Jordan <[email protected]> Acked-by: John 'Warthog9' Hawley (Tenstorrent) <[email protected]> Signed-off-by: Steven Rostedt <[email protected]>
1 parent d441734 commit 2351e8c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/testing/ktest/ktest.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2056,7 +2056,7 @@ sub get_grub_index {
20562056
} elsif ($reboot_type eq "grub2") {
20572057
$command = "cat $grub_file";
20582058
$target = '^\s*menuentry.*' . $grub_menu_qt;
2059-
$skip = '^\s*menuentry';
2059+
$skip = '^\s*menuentry\s';
20602060
$submenu = '^\s*submenu\s';
20612061
} elsif ($reboot_type eq "grub2bls") {
20622062
$command = $grub_bls_get;

0 commit comments

Comments
 (0)