]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ktest.pl: Avoid false positives with grub2 skip regex
authorDaniel Jordan <daniel.m.jordan@oracle.com>
Wed, 4 Sep 2024 17:55:30 +0000 (13:55 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Oct 2024 13:11:50 +0000 (15:11 +0200)
commitee603aae244e15a616da38940e47bf48c3a25913
tree2942400355f62f95353becada059fa67c13ca949
parentb85e6e461b6d176f1b4c145e82daeb5164506f11
ktest.pl: Avoid false positives with grub2 skip regex

[ Upstream commit 2351e8c65404aabc433300b6bf90c7a37e8bbc4d ]

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/20240904175530.84175-1-daniel.m.jordan@oracle.com
Signed-off-by: Daniel Jordan <daniel.m.jordan@oracle.com>
Acked-by: John 'Warthog9' Hawley (Tenstorrent) <warthog9@eaglescrag.net>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/testing/ktest/ktest.pl