[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250610221248.819519-1-1997cui@gmail.com>
Date: Tue, 10 Jun 2025 15:12:07 -0700
From: Tianyi Cui <1997cui@...il.com>
To: shuah@...nel.org
Cc: linux-kselftest@...r.kernel.org,
linux-kernel@...r.kernel.org,
skhan@...uxfoundation.org,
Tianyi Cui <1997cui@...il.com>
Subject: [PATCH v2] selftests: Add version file to kselftest installation dir
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 | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index 339b31e6a6b5..9dae84a74e7f 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -293,6 +293,13 @@ ifdef INSTALL_PATH
$(MAKE) -s --no-print-directory OUTPUT=$$BUILD_TARGET COLLECTION=$$TARGET \
-C $$TARGET emit_tests >> $(TEST_LIST); \
done;
+ @VERSION=$$(git describe HEAD 2>/dev/null); \
+ if [ -n "$$VERSION" ]; then \
+ echo "$$VERSION" > $(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
--
2.47.1
Powered by blists - more mailing lists