From: Tianyi Cui <1997cui@gmail.com>
To: Shuah Khan <skhan@linuxfoundation.org>, shuah@kernel.org
Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] selftests: Add version file to kselftest installation dir
Date: Mon, 2 Jun 2025 18:13:33 -0700 [thread overview]
Message-ID: <11d3be92-a934-439e-be36-6d898b437681@gmail.com> (raw)
In-Reply-To: <4a28c302-b37e-4963-86c2-87c5793c2661@linuxfoundation.org>
On 6/2/25 3:48 PM, Shuah Khan wrote:
> On 5/28/25 18:33, Tianyi Cui wrote:
>> As titled, adding version file to kselftest installation dir, so the user
>> of the tarball can know which kernel version the tarball belongs to.
>>
>> Signed-off-by: Tianyi Cui <1997cui@gmail.com>
>> ---
>> tools/testing/selftests/Makefile | 6 ++++++
>> 1 file changed, 6 insertions(+)
>>
>> diff --git a/tools/testing/selftests/Makefile b/tools/testing/
>> selftests/Makefile
>> index a0a6ba47d600..246e9863b45b 100644
>> --- a/tools/testing/selftests/Makefile
>> +++ b/tools/testing/selftests/Makefile
>> @@ -291,6 +291,12 @@ ifdef INSTALL_PATH
>> $(MAKE) -s --no-print-directory OUTPUT=$$BUILD_TARGET
>> COLLECTION=$$TARGET \
>> -C $$TARGET emit_tests >> $(TEST_LIST); \
>> done;
>> + @if git describe HEAD > /dev/null 2>&1; then \
>> + git describe HEAD > $(INSTALL_PATH)/VERSION; \
>> + printf "Version saved to $(INSTALL_PATH)/VERSION\n"; \
>> + else \
>> + printf "Unable to get version from git describe\n"; \
>> + fi
>> else
>> $(error Error: set INSTALL_PATH to use install)
>> endif
>
> Why not use "make kernelrelease" to get the version?
Thank you for your attention for my first patch! There are mainly two
reasons:
1. We'd like to have the `VERSION` file written to to the tarball. This
is because driver hardware tests needs to be run on specific hardware so
that tarball is copied onto the DUT and we can compare the running
kernel version and the test version.`make kernelrelease` only print it
on screen, so we still need a way to store it into the tarball.
2. `make kernelrelease` requires the kernel repo to be configured and
prepared, while `make -C tools/testing/selftests` can run standalone. As
a result, I don't want above to depend on `make kernelrelease`, which
may break compatibility of people's existing CI systems.
> thanks,
> -- Shuah
next prev parent reply other threads:[~2025-06-03 1:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-29 0:33 Tianyi Cui
2025-06-02 22:48 ` Shuah Khan
2025-06-03 1:13 ` Tianyi Cui [this message]
2025-06-03 19:56 ` Shuah Khan
2025-06-10 22:00 ` [PATCH v2] selftests: Add version file to kselftest Tianyi Cui
2025-06-10 22:12 ` [PATCH v2] selftests: Add version file to kselftest installation dir Tianyi Cui
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11d3be92-a934-439e-be36-6d898b437681@gmail.com \
--to=1997cui@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=shuah@kernel.org \
--cc=skhan@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®