Skip to content

Commit 57654a1

Browse files
rbmarlieregregkh
authored andcommitted
ktest.pl: Check kernelrelease return in get_version
commit a4e17a8 upstream. 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: [email protected] Cc: John Hawley <[email protected]> Fixes: 5f9b6ce ("ktest: Bisecting, install modules, add logging") Link: https://lore.kernel.org/[email protected] Signed-off-by: Ricardo B. Marliere <[email protected]> Signed-off-by: Steven Rostedt <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 28231a5 commit 57654a1

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)