flashsd.sh 616 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/bash
  2. source ./utils.sh
  3. BSP_PATH=$(realpath $(dirname $0))
  4. echo "BSP_PATH: $BSP_PATH"
  5. download_rttpkgtool $BSP_PATH
  6. result=$?
  7. if [ $result -ne 0 ]; then
  8. echo "ERROR: rttpkgtool is unavailable! Please check your network connection!"
  9. exit 1
  10. fi
  11. pushd $BSP_PATH/rttpkgtool > /dev/null
  12. ./script/sdcard.sh > /dev/null
  13. result=$?
  14. if [ $result -eq 1 ]; then
  15. echo "ERROR: The kernel file to be flashed does not exist!"
  16. exit 1
  17. fi
  18. if [ $result -eq 2 ]; then
  19. echo "ERROR: The USB/SDcard does not exist!"
  20. exit 1
  21. fi
  22. echo "INFO: The kernel file has been flashed to the USB/SDcard successfully!"
  23. popd > /dev/null