|
@@ -6,7 +6,7 @@ set -e
|
|
|
################
|
|
|
CWD="$(pwd)" # current working directory
|
|
|
flash_arduino="u2" # u2 or ftdi
|
|
|
-arduino_device="ttyACM0" # ls /dev/tty* and find your arduino
|
|
|
+arduino_device="ttyUSB0" # ls /dev/tty* and find your arduino
|
|
|
mega=2560 #2560 or 1280
|
|
|
|
|
|
script_version="1.0.0"
|
|
@@ -34,7 +34,7 @@ echo -e ""
|
|
|
echo -e "\e[92m\e[4mBuild Arduino SPIFlash tools:\e[0m\e[24m"
|
|
|
|
|
|
echo -e "\n\e[93mPerforming Update :\e[0m"
|
|
|
-sudo apt-get install flashrom gcc-avr binutils-avr gdb-avr avr-libc avrdude libpci-dev git -y
|
|
|
+sudo apt-get install flashrom gcc-avr binutils-avr gdb-avr avr-libc avrdude libpci-dev git libusb-1.0-0-dev libftdi-dev -y
|
|
|
|
|
|
if [ ! -d frser-duino ]
|
|
|
then
|
|
@@ -48,9 +48,12 @@ cd ..
|
|
|
fi
|
|
|
|
|
|
cd frser-duino
|
|
|
-sed -i -e "s/dev\/ttyUSB0/dev\/$arduino_device/g" Makefile
|
|
|
+if [ $arduino_device = "ttyUSB0" ]
|
|
|
+then
|
|
|
+sed -i -e "s/dev\/ttyACM0/dev\/$arduino_device/g" Makefile
|
|
|
+fi
|
|
|
echo -e "\n\e[93mBuild frser-arduino :\e[0m"
|
|
|
-make $flash_arduino
|
|
|
+make $flash_arduino -j$((`nproc`+1))
|
|
|
echo -e "\n\e[93mFlash Arduino :\e[0m"
|
|
|
make flash-$flash_arduino
|
|
|
}
|
|
@@ -74,9 +77,12 @@ cd ..
|
|
|
fi
|
|
|
|
|
|
cd frser-duino
|
|
|
-sed -i -e "s/dev\/ttyUSB0/dev\/$arduino_device/g" Makefile
|
|
|
+if [ $arduino_device = "ttyUSB0" ]
|
|
|
+then
|
|
|
+sed -e "s/dev\/dev/ttyACM0/dev\/$arduino_device/g" Makefile
|
|
|
+fi
|
|
|
echo -e "\n\e[93mBuild frser-duino :\e[0m"
|
|
|
-make mega$mega
|
|
|
+make mega$mega -j$((`nproc`+1))
|
|
|
echo -e "\n\e[93mFlash ATMega$mega :\e[0m"
|
|
|
make flash-mega$mega
|
|
|
|
|
@@ -106,7 +112,7 @@ fi
|
|
|
cd flashrom
|
|
|
sed -i -e "s/WARNERROR ?= yes/WARNERROR ?= no/g" Makefile
|
|
|
echo -e "\n\e[93mBuild and install flashrom:\e[0m"
|
|
|
-make
|
|
|
+make -j$((`nproc`+1))
|
|
|
sudo make install
|
|
|
}
|
|
|
|