kselftest_install.sh 748 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash
  2. # SPDX-License-Identifier: GPL-2.0
  3. #
  4. # Kselftest Install
  5. # Install kselftest tests
  6. # Author: Shuah Khan <shuahkh@osg.samsung.com>
  7. # Copyright (C) 2015 Samsung Electronics Co., Ltd.
  8. install_loc=`pwd`
  9. main()
  10. {
  11. if [ $(basename $install_loc) != "selftests" ]; then
  12. echo "$0: Please run it in selftests directory ..."
  13. exit 1;
  14. fi
  15. if [ "$#" -eq 0 ]; then
  16. echo "$0: Installing in default location - $install_loc ..."
  17. elif [ ! -d "$1" ]; then
  18. echo "$0: $1 doesn't exist!!"
  19. exit 1;
  20. else
  21. install_loc=$1
  22. echo "$0: Installing in specified location - $install_loc ..."
  23. fi
  24. install_dir=$install_loc/kselftest
  25. # Create install directory
  26. mkdir -p $install_dir
  27. # Build tests
  28. INSTALL_PATH=$install_dir make install
  29. }
  30. main "$@"