aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/gen_kselftest_tar.sh
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2019-10-30 12:46:08 -0700
committerShuah Khan <skhan@linuxfoundation.org>2019-11-07 14:43:27 -0700
commitea1bf0bb18c0bd627d7b551196453ff2fff44225 (patch)
treed633df52c7247e2bbddc892fce717b6cfb3b992a /tools/testing/selftests/gen_kselftest_tar.sh
parentselftests: breakpoints: Fix a typo of function name (diff)
downloadlinux-dev-ea1bf0bb18c0bd627d7b551196453ff2fff44225.tar.xz
linux-dev-ea1bf0bb18c0bd627d7b551196453ff2fff44225.zip
selftests: gen_kselftest_tar.sh: Do not clobber kselftest/
The default installation location for gen_kselftest_tar.sh was still "kselftest/" which collides with the existing directory. Instead, this moves the installation target into "kselftest_install/kselftest/" and adjusts the tar creation accordingly. This also adjusts indentation and logic to be consistent. Fixes: 42d46e57ec97 ("selftests: Extract single-test shell logic from lib.mk") Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/gen_kselftest_tar.sh')
-rwxr-xr-xtools/testing/selftests/gen_kselftest_tar.sh21
1 files changed, 13 insertions, 8 deletions
diff --git a/tools/testing/selftests/gen_kselftest_tar.sh b/tools/testing/selftests/gen_kselftest_tar.sh
index a27e2eec3586..8b2b6088540d 100755
--- a/tools/testing/selftests/gen_kselftest_tar.sh
+++ b/tools/testing/selftests/gen_kselftest_tar.sh
@@ -38,16 +38,21 @@ main()
esac
fi
- install_dir=./kselftest
+ # Create working directory.
+ dest=`pwd`
+ install_work="$dest"/kselftest_install
+ install_name=kselftest
+ install_dir="$install_work"/"$install_name"
+ mkdir -p "$install_dir"
-# Run install using INSTALL_KSFT_PATH override to generate install
-# directory
-./kselftest_install.sh
-tar $copts kselftest${ext} $install_dir
-echo "Kselftest archive kselftest${ext} created!"
+ # Run install using INSTALL_KSFT_PATH override to generate install
+ # directory
+ ./kselftest_install.sh "$install_dir"
+ (cd "$install_work"; tar $copts "$dest"/kselftest${ext} $install_name)
+ echo "Kselftest archive kselftest${ext} created!"
-# clean up install directory
-rm -rf kselftest
+ # clean up top-level install work directory
+ rm -rf "$install_work"
}
main "$@"