selftests: introduce gen_tar Makefile target

The gen_kselftest_tar.sh always packages *all* selftests and doesn't
pass along any variables to `make install` to influence what should be
built. This can result in an early error on the command line ("Unknown
tarball format TARGETS=XXX"), or unexpected test failures as the
tarball contains tests people wanted to skip on purpose.

Since the makefile already contains all the logic, we can add a target
for packaging. Keep the default .gz target the script uses, and actually
extend the supported formats by using tar's autodetection.

To not break current workflows, keep the gen_kselftest_tar.sh script as
it is, with an added suggestion to use the makefile target instead.

Signed-off-by: Veronika Kabatova <vkabatov@redhat.com>
Reviewed-by: Stefano Brivio <sbrivio@redhat.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
This commit is contained in:
Veronika Kabatova
2020-05-19 22:00:45 +02:00
committed by Shuah Khan
parent 2ef96a5bb1
commit a5f304670b
3 changed files with 36 additions and 1 deletions

View File

@@ -49,6 +49,11 @@ main()
# directory
./kselftest_install.sh "$install_dir"
(cd "$install_work"; tar $copts "$dest"/kselftest${ext} $install_name)
# Don't put the message at the actual end as people may be parsing the
# "archive created" line in their scripts.
echo -e "\nConsider using 'make gen_tar' instead of this script\n"
echo "Kselftest archive kselftest${ext} created!"
# clean up top-level install work directory