Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 5f9b6ced04a4e ("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>

authored by

Ricardo B. Marliere and committed by
Steven Rostedt
a4e17a8f 78d4f34e

+5
+5
tools/testing/ktest/ktest.pl
··· 2419 2419 return if ($have_version); 2420 2420 doprint "$make kernelrelease ... "; 2421 2421 $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 + } 2422 2427 chomp($version); 2423 2428 doprint "$version\n"; 2424 2429 $have_version = 1;