kselftest_install.sh 823 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/bash
  2. # SPDX-License-Identifier: GPL-2.0
  3. #
  4. # Kselftest Install
  5. # Install kselftest tests
  6. # Author: Shuah Khan <[email protected]>
  7. # Copyright (C) 2015 Samsung Electronics Co., Ltd.
  8. main()
  9. {
  10. base_dir=`pwd`
  11. install_dir="$base_dir"/kselftest_install
  12. # Make sure we're in the selftests top-level directory.
  13. if [ $(basename "$base_dir") != "selftests" ]; then
  14. echo "$0: Please run it in selftests directory ..."
  15. exit 1;
  16. fi
  17. # Only allow installation into an existing location.
  18. if [ "$#" -eq 0 ]; then
  19. echo "$0: Installing in default location - $install_dir ..."
  20. elif [ ! -d "$1" ]; then
  21. echo "$0: $1 doesn't exist!!"
  22. exit 1;
  23. else
  24. install_dir="$1"
  25. echo "$0: Installing in specified location - $install_dir ..."
  26. fi
  27. # Build tests
  28. KSFT_INSTALL_PATH="$install_dir" make install
  29. }
  30. main "$@"