Skip to content

Commit a4e17a8

Browse files
rbmarliererostedt
authored andcommitted
ktest.pl: Check kernelrelease return in get_version
In the case of a test that uses the special option ${KERNEL_VERSION} in one of its settings but has no configuration available in ${OUTPUT_DIR}, for example if it's a new empty directory, then the `make kernelrelease` call will fail and the subroutine will chomp an empty string, silently. Fix that by adding an empty configuration and retrying. Cc: stable@vger.kernel.org Cc: John Hawley <warthog9@eaglescrag.net> Fixes: 5f9b6ce ("ktest: Bisecting, install modules, add logging") Link: https://lore.kernel.org/20241205-ktest_kver_fallback-v2-1-869dae4c7777@suse.com Signed-off-by: Ricardo B. Marliere <rbm@suse.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
1 parent 78d4f34 commit a4e17a8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tools/testing/ktest/ktest.pl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2419,6 +2419,11 @@ sub get_version {
24192419
return if ($have_version);
24202420
doprint "$make kernelrelease ... ";
24212421
$version = `$make -s kernelrelease | tail -1`;
2422+
if (!length($version)) {
2423+
run_command "$make allnoconfig" or return 0;
2424+
doprint "$make kernelrelease ... ";
2425+
$version = `$make -s kernelrelease | tail -1`;
2426+
}
24222427
chomp($version);
24232428
doprint "$version\n";
24242429
$have_version = 1;

0 commit comments

Comments
 (0)