kselftest_install.sh 819 B

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