build.sh 815 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #!/bin/bash
  2. echo "installation des librairies"
  3. sleep 1
  4. sudo apt-get update
  5. sudo apt-get install build-essential git avr-libc gcc-avr libpci-dev avrdude -y
  6. echo "Decompression des fichiers"
  7. sleep 2
  8. if [ ! -d "arduino_firmware" ]; then
  9. tar xvfz arduino_firmware.tar.gz
  10. fi
  11. if [ ! -d "flashrom-0.9.7" ]; then
  12. tar xvfj flashrom-0.9.7.tar.bz2
  13. fi
  14. if [ ! -d "backup" ]; then
  15. tar xvfJ backup.tar.xz
  16. fi
  17. echo "Compilation des programmes"
  18. sleep 2
  19. cd flashrom-0.9.7
  20. if [ ! -e "flashrom" ]; then
  21. make
  22. fi
  23. cd ..
  24. cd arduino_firmware
  25. if [ ! -e "serprog.hex" ]; then
  26. make
  27. fi
  28. echo "Programmation de l'arduino"
  29. echo "Press [ENTER] to continue...: "
  30. read var_name
  31. make upload
  32. cd ..
  33. echo "Arduino Ready..."
  34. sleep 1
  35. echo ""
  36. echo "Test du firmware..."
  37. ln -s flashrom-0.9.7/flashrom ./flashrom
  38. ./flashrom -p serprog:dev=/dev/ttyACM0:2000000