Skip to content

Commit ef5678d

Browse files
committed
Updated *provision.sh scripts to get a valid VM
1 parent 9ac1eb4 commit ef5678d

File tree

3 files changed

+24
-21
lines changed

3 files changed

+24
-21
lines changed

Vagrantfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Vagrant.configure(2) do |config|
5353

5454
## PROVISIONING ##
5555

56-
config.vm.provision "shell", path: "./scripts/vagrant_provision.sh"
56+
config.vm.provision "shell", inline: "cd /vagrant && ./scripts/vagrant_provision.sh"
5757

5858
## SSH ##
5959

scripts/provision.sh

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,11 @@ fi
3030
BOARDNAME=$1
3131
FAMILY=`scripts/get_board_info.py $BOARDNAME 'board.chip["family"]'`
3232

33-
if [ $FAMILY = "ESP32" ]; then
33+
if [ "$FAMILY" = "ESP32" ]; then
3434
echo ESP32
3535
# 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
3738
# SDK
3839
if [ ! -d "app" ]; then
3940
echo installing app folder
@@ -43,7 +44,7 @@ if [ $FAMILY = "ESP32" ]; then
4344
echo installing esp-idf folder
4445
curl -Ls https://github.com/espruino/EspruinoBuildTools/raw/master/esp32/deploy/esp-idf.tgz | tar xfz -
4546
fi
46-
if ! type xtensa-esp32-elf-gcc > /dev/null; then
47+
if ! type xtensa-esp32-elf-gcc 2> /dev/null > /dev/null; then
4748
echo installing xtensa-esp32-elf-gcc
4849
if [ ! -d "xtensa-esp32-elf" ]; then
4950
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
5657
export ESP_APP_TEMPLATE_PATH=`pwd`/app
5758
export PATH=$PATH:`pwd`/xtensa-esp32-elf/bin/
5859
return 0
59-
elif [ $FAMILY = "ESP8266" ]; then
60+
elif [ "$FAMILY" = "ESP8266" ]; then
6061
echo ESP8266
6162
if [ ! -d "esp_iot_sdk_v2.0.0.p1" ]; then
6263
echo esp_iot_sdk_v2.0.0.p1
6364
curl -Ls http://s3.voneicken.com/esp_iot_sdk_v2.0.0.p1.tgx | tar Jxf -
6465
fi
65-
if ! type xtensa-lx106-elf-gcc > /dev/null; then
66+
if ! type xtensa-lx106-elf-gcc 2> /dev/null > /dev/null; then
6667
echo installing xtensa-lx106-elf-gcc
6768
if [ ! -d "xtensa-lx106-elf" ]; then
6869
curl -Ls http://s3.voneicken.com/xtensa-lx106-elf-20160330.tgx | tar Jxf -
@@ -75,31 +76,31 @@ elif [ $FAMILY = "ESP8266" ]; then
7576
export ESP8266_SDK_ROOT=`pwd`/esp_iot_sdk_v2.0.0.p1
7677
export PATH=$PATH:`pwd`/xtensa-lx106-elf/bin/
7778
return 0
78-
elif [ $FAMILY = "LINUX" ]; then
79+
elif [ "$FAMILY" = "LINUX" ]; then
7980
echo LINUX
8081
# Raspberry Pi?
8182
return 0
82-
elif [ $FAMILY = "NRF52" ]; then
83+
elif [ "$FAMILY" = "NRF52" ]; then
8384
echo NRF52
84-
if ! type nrfutil > /dev/null; then
85+
if ! type nrfutil 2> /dev/null > /dev/null; then
8586
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
8889
fi
8990
ARM=1
90-
elif [ $FAMILY = "NRF51" ]; then
91+
elif [ "$FAMILY" = "NRF51" ]; then
9192
ARM=1
92-
elif [ $FAMILY = "STM32F1" ]; then
93+
elif [ "$FAMILY" = "STM32F1" ]; then
9394
ARM=1
94-
elif [ $FAMILY = "STM32F3" ]; then
95+
elif [ "$FAMILY" = "STM32F3" ]; then
9596
ARM=1
96-
elif [ $FAMILY = "STM32F4" ]; then
97+
elif [ "$FAMILY" = "STM32F4" ]; then
9798
ARM=1
98-
elif [ $FAMILY = "STM32L4" ]; then
99+
elif [ "$FAMILY" = "STM32L4" ]; then
99100
ARM=1
100-
elif [ $FAMILY = "EFM32GG" ]; then
101+
elif [ "$FAMILY" = "EFM32GG" ]; then
101102
ARM=1
102-
elif [ $FAMILY = "SAMD" ]; then
103+
elif [ "$FAMILY" = "SAMD" ]; then
103104
ARM=1
104105
else
105106
echo "Unknown board ($BOARDNAME) or family ($FAMILY)"
@@ -109,14 +110,16 @@ fi
109110
if [ $ARM = "1" ]; then
110111
# defaulting to ARM
111112
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
113114
echo installing gcc-arm-embedded
114115
#sudo add-apt-repository -y ppa:team-gcc-arm-embedded/ppa
115116
#sudo apt-get update
116117
#sudo apt-get --force-yes --yes install libsdl1.2-dev gcc-arm-embedded
117118
# Unpack - newer, and much faster
118119
if [ ! -d "gcc-arm-none-eabi-6-2017-q1-update" ]; then
119120
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"
120123
fi
121124
export PATH=$PATH:`pwd`/gcc-arm-none-eabi-6-2017-q1-update/bin
122125
fi

scripts/vagrant_provision.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
# This script is run by Vagrant when a new machine is provisioned.
44
#
55

6-
sudo apt-get -y install git
6+
sudo apt-get -qq -y install git
77

88
# move to 'Espruino' directory
99
cd `dirname $0`/..
1010

1111
# Attempt to provision for all required platforms
12-
source scripts/provision.sh ESP8266
12+
source scripts/provision.sh ESP8266_BOARD
1313
source scripts/provision.sh ESP32
1414
source scripts/provision.sh PUCKJS
1515

0 commit comments

Comments
 (0)