diff options
| author | Ricardo B. Marliere <rbm@suse.com> | 2024-12-05 17:50:35 -0300 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-03-13 12:43:01 +0100 |
| commit | 270c48e652c4cb394449d0d622458089b4a7871e (patch) | |
| tree | 1ae962caf8ace940a797f03927828038145fe4f8 /tools | |
| parent | d763fa3b658ed0a612868fcd1aa26cae8474cc47 (diff) | |
| download | linux-270c48e652c4cb394449d0d622458089b4a7871e.tar.gz linux-270c48e652c4cb394449d0d622458089b4a7871e.tar.bz2 linux-270c48e652c4cb394449d0d622458089b4a7871e.zip | |
ktest.pl: Check kernelrelease return in get_version
commit a4e17a8f239a545c463f8ec27db4ed6e74b31841 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: 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/testing/ktest/ktest.pl | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/testing/ktest/ktest.pl b/tools/testing/ktest/ktest.pl index 184af2fcc159..10b3c5b25b69 100755 --- a/tools/testing/ktest/ktest.pl +++ b/tools/testing/ktest/ktest.pl @@ -2319,6 +2319,11 @@ sub get_version { return if ($have_version); doprint "$make kernelrelease ... "; $version = `$make -s kernelrelease | tail -1`; + if (!length($version)) { + run_command "$make allnoconfig" or return 0; + doprint "$make kernelrelease ... "; + $version = `$make -s kernelrelease | tail -1`; + } chomp($version); doprint "$version\n"; $have_version = 1; |
