hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/tools/testing/selftests/kselftest_install.sh
....@@ -6,30 +6,30 @@
66 # Author: Shuah Khan <shuahkh@osg.samsung.com>
77 # Copyright (C) 2015 Samsung Electronics Co., Ltd.
88
9
-install_loc=`pwd`
10
-
119 main()
1210 {
13
- if [ $(basename $install_loc) != "selftests" ]; then
11
+ base_dir=`pwd`
12
+ install_dir="$base_dir"/kselftest_install
13
+
14
+ # Make sure we're in the selftests top-level directory.
15
+ if [ $(basename "$base_dir") != "selftests" ]; then
1416 echo "$0: Please run it in selftests directory ..."
1517 exit 1;
1618 fi
19
+
20
+ # Only allow installation into an existing location.
1721 if [ "$#" -eq 0 ]; then
18
- echo "$0: Installing in default location - $install_loc ..."
22
+ echo "$0: Installing in default location - $install_dir ..."
1923 elif [ ! -d "$1" ]; then
2024 echo "$0: $1 doesn't exist!!"
2125 exit 1;
2226 else
23
- install_loc=$1
24
- echo "$0: Installing in specified location - $install_loc ..."
27
+ install_dir="$1"
28
+ echo "$0: Installing in specified location - $install_dir ..."
2529 fi
2630
27
- install_dir=$install_loc/kselftest
28
-
29
-# Create install directory
30
- mkdir -p $install_dir
31
-# Build tests
32
- INSTALL_PATH=$install_dir make install
31
+ # Build tests
32
+ KSFT_INSTALL_PATH="$install_dir" make install
3333 }
3434
3535 main "$@"