|
@@ -43,7 +43,7 @@ fi
|
|
|
if [ -f .lastbuild ];then rm .lastbuild;fi
|
|
|
cat <<'EOF'>> .lastbuild
|
|
|
Mode=arduino
|
|
|
-device=xxx
|
|
|
+Device=xxx
|
|
|
EOF
|
|
|
sed -i -e "s/xxx/$arduino_device/g" .lastbuild
|
|
|
echo -e "\nArduino device found at: \e[91m$arduino_device\e[0m"
|
|
@@ -82,7 +82,7 @@ fi
|
|
|
if [ -f .lastbuild ];then rm .lastbuild;fi
|
|
|
cat <<'EOF'>> .lastbuild
|
|
|
Mode=mega
|
|
|
-device=xxx
|
|
|
+Device=xxx
|
|
|
EOF
|
|
|
sed -i -e "s/xxx/$arduino_device/g" .lastbuild
|
|
|
echo -e ""
|
|
@@ -109,7 +109,8 @@ sleep 2
|
|
|
|
|
|
function raspberry_ {
|
|
|
cat <<'EOF'>> .lastbuild
|
|
|
-mode=raspberry
|
|
|
+Mode=raspberry
|
|
|
+Device=raspberry
|
|
|
EOF
|
|
|
echo -e ""
|
|
|
echo -e "\n\e[93mBuild Raspberry SPIFlash tools:\e[0m\e[24m"
|
|
@@ -145,22 +146,27 @@ echo -e ""
|
|
|
echo -e "\e[97mCleaning:\e[0m\e[24m"
|
|
|
if [ -d flashrom ]; then rm -r -f flashrom; fi
|
|
|
if [ -d frser-duino ]; then rm -r -f frser-duino; fi
|
|
|
-echo -e "\n\e[95mCleaning...Done !\e[0m"
|
|
|
-echo""
|
|
|
sleep 3
|
|
|
if [ -f .lastbuild ]
|
|
|
then
|
|
|
source .lastbuild
|
|
|
-fi
|
|
|
if [ $Mode = "mega" ]
|
|
|
then
|
|
|
-avrdude -p m$mega -c stk500v2 -P /dev/$device -F -U flash:w:.clean/Mega_blink.hex
|
|
|
+avrdude -p m$mega -c stk500v2 -P /dev/$Device -F -U flash:w:.clean/Mega_blink.hex
|
|
|
fi
|
|
|
if [ $Mode = "arduino" ]
|
|
|
then
|
|
|
-avrdude -p atmega328p -c arduino -P /dev/$device -b 115200 -D -U flash:w:.clean/Arduino_blink.hex
|
|
|
+avrdude -p atmega328p -c arduino -P /dev/$Device -b 115200 -D -U flash:w:.clean/Arduino_blink.hex
|
|
|
fi
|
|
|
rm .lastbuild
|
|
|
+fi
|
|
|
+if [ -f /usr/sbin/flashrom ]
|
|
|
+then
|
|
|
+sudo rm /usr/sbin/flashrom
|
|
|
+fi
|
|
|
+echo -e "\n\e[95mCleaning...Done !\e[0m"
|
|
|
+echo""
|
|
|
+
|
|
|
}
|
|
|
|
|
|
function flashrom_raspberry_check_ {
|
|
@@ -189,6 +195,9 @@ echo -e ""
|
|
|
echo -e "\e[93m\e[21mRaspberryPI/beagleBone: \e[0m"
|
|
|
echo -e "flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=2000"
|
|
|
echo -e ""
|
|
|
+echo -e "\e[93m\e[21mCh341a: \e[0m"
|
|
|
+echo -e "flashrom -p ch341a_spi"
|
|
|
+echo -e ""
|
|
|
if ! [ -x "$(command -v flashrom)" ]
|
|
|
then
|
|
|
echo 'Error: flashrom is not yet installed.' >&2
|
|
@@ -207,7 +216,7 @@ Usage: $0 [--arduino] [--mega] [--raspberry] [--clean] [--help]
|
|
|
--help Display extended help message
|
|
|
--arduino Build Serial SPI flashrom tools for arduino328
|
|
|
--mega Build Serial SPI flashrom tools for arduinoMega
|
|
|
- --raspberry Build Serial SPI flashrom tools for raspberryPI
|
|
|
+ --raspberry Build Serial SPI flashrom tools for raspberryPI/beaglebone/ch341
|
|
|
--clean Clean all build files
|
|
|
|
|
|
Install script Written by: wareck <wareck@gmail.com>
|