30
30
BOARDNAME=$1
31
31
FAMILY=` scripts/get_board_info.py $BOARDNAME ' board.chip["family"]' `
32
32
33
- if [ $FAMILY = " ESP32" ]; then
33
+ if [ " $FAMILY " = " ESP32" ]; then
34
34
echo ESP32
35
35
# needed for esptool for merging binaries
36
- python -m pip install pyserial
36
+ sudo apt-get install -qq -y python python-pip
37
+ sudo pip -q install pyserial
37
38
# SDK
38
39
if [ ! -d " app" ]; then
39
40
echo installing app folder
@@ -43,7 +44,7 @@ if [ $FAMILY = "ESP32" ]; then
43
44
echo installing esp-idf folder
44
45
curl -Ls https://github.com/espruino/EspruinoBuildTools/raw/master/esp32/deploy/esp-idf.tgz | tar xfz -
45
46
fi
46
- if ! type xtensa-esp32-elf-gcc > /dev/null; then
47
+ if ! type xtensa-esp32-elf-gcc 2> /dev/null > /dev/null; then
47
48
echo installing xtensa-esp32-elf-gcc
48
49
if [ ! -d " xtensa-esp32-elf" ]; then
49
50
curl -Ls https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-61-gab8375a-5.2.0.tar.gz | tar xfz -
@@ -56,13 +57,13 @@ if [ $FAMILY = "ESP32" ]; then
56
57
export ESP_APP_TEMPLATE_PATH=` pwd` /app
57
58
export PATH=$PATH :` pwd` /xtensa-esp32-elf/bin/
58
59
return 0
59
- elif [ $FAMILY = " ESP8266" ]; then
60
+ elif [ " $FAMILY " = " ESP8266" ]; then
60
61
echo ESP8266
61
62
if [ ! -d " esp_iot_sdk_v2.0.0.p1" ]; then
62
63
echo esp_iot_sdk_v2.0.0.p1
63
64
curl -Ls http://s3.voneicken.com/esp_iot_sdk_v2.0.0.p1.tgx | tar Jxf -
64
65
fi
65
- if ! type xtensa-lx106-elf-gcc > /dev/null; then
66
+ if ! type xtensa-lx106-elf-gcc 2> /dev/null > /dev/null; then
66
67
echo installing xtensa-lx106-elf-gcc
67
68
if [ ! -d " xtensa-lx106-elf" ]; then
68
69
curl -Ls http://s3.voneicken.com/xtensa-lx106-elf-20160330.tgx | tar Jxf -
@@ -75,31 +76,31 @@ elif [ $FAMILY = "ESP8266" ]; then
75
76
export ESP8266_SDK_ROOT=` pwd` /esp_iot_sdk_v2.0.0.p1
76
77
export PATH=$PATH :` pwd` /xtensa-lx106-elf/bin/
77
78
return 0
78
- elif [ $FAMILY = " LINUX" ]; then
79
+ elif [ " $FAMILY " = " LINUX" ]; then
79
80
echo LINUX
80
81
# Raspberry Pi?
81
82
return 0
82
- elif [ $FAMILY = " NRF52" ]; then
83
+ elif [ " $FAMILY " = " NRF52" ]; then
83
84
echo NRF52
84
- if ! type nrfutil > /dev/null; then
85
+ if ! type nrfutil 2> /dev/null > /dev/null; then
85
86
echo Installing nrfutil
86
- sudo apt-get install -y python python-pip
87
- sudo pip install nrfutil
87
+ sudo apt-get install -qq - y python python-pip
88
+ sudo pip -q install nrfutil
88
89
fi
89
90
ARM=1
90
- elif [ $FAMILY = " NRF51" ]; then
91
+ elif [ " $FAMILY " = " NRF51" ]; then
91
92
ARM=1
92
- elif [ $FAMILY = " STM32F1" ]; then
93
+ elif [ " $FAMILY " = " STM32F1" ]; then
93
94
ARM=1
94
- elif [ $FAMILY = " STM32F3" ]; then
95
+ elif [ " $FAMILY " = " STM32F3" ]; then
95
96
ARM=1
96
- elif [ $FAMILY = " STM32F4" ]; then
97
+ elif [ " $FAMILY " = " STM32F4" ]; then
97
98
ARM=1
98
- elif [ $FAMILY = " STM32L4" ]; then
99
+ elif [ " $FAMILY " = " STM32L4" ]; then
99
100
ARM=1
100
- elif [ $FAMILY = " EFM32GG" ]; then
101
+ elif [ " $FAMILY " = " EFM32GG" ]; then
101
102
ARM=1
102
- elif [ $FAMILY = " SAMD" ]; then
103
+ elif [ " $FAMILY " = " SAMD" ]; then
103
104
ARM=1
104
105
else
105
106
echo " Unknown board ($BOARDNAME ) or family ($FAMILY )"
109
110
if [ $ARM = " 1" ]; then
110
111
# defaulting to ARM
111
112
echo ARM
112
- if ! type arm-none-eabi-gcc > /dev/null; then
113
+ if ! type arm-none-eabi-gcc 2> /dev/null > /dev/null; then
113
114
echo installing gcc-arm-embedded
114
115
# sudo add-apt-repository -y ppa:team-gcc-arm-embedded/ppa
115
116
# sudo apt-get update
116
117
# sudo apt-get --force-yes --yes install libsdl1.2-dev gcc-arm-embedded
117
118
# Unpack - newer, and much faster
118
119
if [ ! -d " gcc-arm-none-eabi-6-2017-q1-update" ]; then
119
120
curl -Ls https://github.com/espruino/EspruinoBuildTools/raw/master/arm/gcc-arm-none-eabi-6-2017-q1-update-linux.tar.bz2 | tar xfj -
121
+ else
122
+ echo " Folder found"
120
123
fi
121
124
export PATH=$PATH :` pwd` /gcc-arm-none-eabi-6-2017-q1-update/bin
122
125
fi
0 commit comments