2015-03-19 05:19:50 +08:00
|
|
|
#!/bin/bash
|
2018-01-10 09:36:55 +08:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
2015-03-19 05:19:50 +08:00
|
|
|
#
|
|
|
|
# Kselftest Install
|
|
|
|
# Install kselftest tests
|
|
|
|
# Author: Shuah Khan <shuahkh@osg.samsung.com>
|
|
|
|
# Copyright (C) 2015 Samsung Electronics Co., Ltd.
|
|
|
|
|
|
|
|
main()
|
|
|
|
{
|
2019-10-31 03:46:08 +08:00
|
|
|
base_dir=`pwd`
|
|
|
|
install_dir="$base_dir"/kselftest_install
|
|
|
|
|
|
|
|
# Make sure we're in the selftests top-level directory.
|
|
|
|
if [ $(basename "$base_dir") != "selftests" ]; then
|
2015-03-19 05:19:50 +08:00
|
|
|
echo "$0: Please run it in selftests directory ..."
|
|
|
|
exit 1;
|
|
|
|
fi
|
2019-10-31 03:46:08 +08:00
|
|
|
|
|
|
|
# Only allow installation into an existing location.
|
2015-03-19 05:19:50 +08:00
|
|
|
if [ "$#" -eq 0 ]; then
|
2019-10-31 03:46:08 +08:00
|
|
|
echo "$0: Installing in default location - $install_dir ..."
|
2015-03-19 05:19:50 +08:00
|
|
|
elif [ ! -d "$1" ]; then
|
|
|
|
echo "$0: $1 doesn't exist!!"
|
|
|
|
exit 1;
|
|
|
|
else
|
2019-10-31 03:46:08 +08:00
|
|
|
install_dir="$1"
|
|
|
|
echo "$0: Installing in specified location - $install_dir ..."
|
2015-03-19 05:19:50 +08:00
|
|
|
fi
|
|
|
|
|
2019-10-31 03:46:08 +08:00
|
|
|
# Build tests
|
|
|
|
KSFT_INSTALL_PATH="$install_dir" make install
|
2015-03-19 05:19:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
main "$@"
|