Skip to content

Commit 6ba8ecf

Browse files
danieljordan10gregkh
authored andcommitted
ktest.pl: Avoid false positives with grub2 skip regex
[ Upstream commit 2351e8c ] 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]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 5d5e3b4 commit 6ba8ecf

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
@@ -2043,7 +2043,7 @@ sub get_grub_index {
20432043
} elsif ($reboot_type eq "grub2") {
20442044
$command = "cat $grub_file";
20452045
$target = '^\s*menuentry.*' . $grub_menu_qt;
2046-
$skip = '^\s*menuentry';
2046+
$skip = '^\s*menuentry\s';
20472047
$submenu = '^\s*submenu\s';
20482048
} elsif ($reboot_type eq "grub2bls") {
20492049
$command = $grub_bls_get;

0 commit comments

Comments
 (0)