lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <328326d7-a72c-4fae-bd39-af4d89666a91@linuxfoundation.org>
Date: Tue, 3 Jun 2025 13:56:41 -0600
From: Shuah Khan <skhan@...uxfoundation.org>
To: Tianyi Cui <1997cui@...il.com>, shuah@...nel.org
Cc: linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org,
 Shuah Khan <skhan@...uxfoundation.org>
Subject: Re: [PATCH] selftests: Add version file to kselftest installation dir

On 6/2/25 19:13, Tianyi Cui wrote:
> 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@...il.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"; \

How does "git describe HEAD" here in this path?

>>> +    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

Okay - you want to save the version in tarball. No problem there.

> kernel version and the test version.`make kernelrelease` only print it
> on screen, 

This doesn't make sense to me. "git describe HEAD" also prints it
on the screen.

so we still need a way to store it into the tarball.

You can do the same thing you are doing running "git describe HEAD"
and create VERSION file?

> 
>   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.

Yes "make kernelrelease" requires repo to be set up.

thanks,
-- Shuah

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ