diff options
Diffstat (limited to 'bootstrap.sh')
-rw-r--r-- | bootstrap.sh | 58 |
1 files changed, 46 insertions, 12 deletions
diff --git a/bootstrap.sh b/bootstrap.sh index 111b248..63991d5 100644 --- a/bootstrap.sh +++ b/bootstrap.sh | |||
@@ -1,25 +1,59 @@ | |||
1 | #!/usr/bin/env bash | 1 | #!/usr/bin/env bash |
2 | 2 | ||
3 | # setup as described here: http://gnuarmeclipse.livius.net/blog/toolchain-install/#GNULinux | 3 | # setup as described here: http://gnuarmeclipse.livius.net/blog/toolchain-install/#GNULinux |
4 | # We're using Luna - need to update plugin install locations below if switching to Kepler etc. | ||
5 | ECLIPSE_URL=http://mirror.netcologne.de/eclipse//technology/epp/downloads/release/luna/SR2/eclipse-cpp-luna-SR2-linux-gtk-x86_64.tar.gz | ||
4 | 6 | ||
5 | # tools for running 32-bit binaries | 7 | # latest GCC-ARM version |
8 | GCC_ARM_URL=https://launchpad.net/gcc-arm-embedded/4.8/4.8-2014-q3-update/+download/gcc-arm-none-eabi-4_8-2014q3-20140805-linux.tar.bz2 | ||
9 | |||
10 | # install tools for running 32-bit binaries | ||
6 | apt-get update | 11 | apt-get update |
7 | sudo apt-get install -y lib32z1 lib32ncurses5 lib32bz2-1.0 | 12 | sudo apt-get install -y lib32z1 lib32ncurses5 lib32bz2-1.0 |
8 | 13 | ||
9 | # eclipse IDE | 14 | # install Java |
10 | # sudo apt-get install -y eclipse | 15 | sudo apt-get install -y openjdk-7-jdk |
11 | 16 | ||
12 | # download the compiler | 17 | # download Eclipse |
13 | wget -O /tmp/gcc-arm.tar.bz2 https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q1-update/+download/gcc-arm-none-eabi-4_9-2015q1-20150306-linux.tar.bz2 | 18 | wget -O /tmp/eclipse.tar.gz $ECLIPSE_URL |
19 | |||
20 | # Extract files | ||
21 | sudo tar zxvf /tmp/eclipse.tar.gz -C /opt/ | ||
22 | # Change ownership to root | ||
23 | sudo chown -R root:root /opt/eclipse/ | ||
24 | |||
25 | # Create launch script in /usr/bin | ||
26 | echo '#!/bin/sh' | sudo tee /usr/bin/eclipse | ||
27 | echo 'export ECLIPSE_HOME="/opt/eclipse"' | sudo tee -a /usr/bin/eclipse | ||
28 | echo '$ECLIPSE_HOME/eclipse $*' | sudo tee -a /usr/bin/eclipse | ||
29 | sudo chmod 755 /usr/bin/eclipse | ||
30 | |||
31 | # Create menu entry | ||
32 | echo "[Desktop Entry]" | sudo tee /usr/share/applications/eclipse.desktop | ||
33 | echo "Name=Eclipse IDE" | sudo tee -a /usr/share/applications/eclipse.desktop | ||
34 | echo "Comment=Integrated Development Environment" | sudo tee -a /usr/share/applications/eclipse.desktop | ||
35 | echo "TryExec=/usr/bin/eclipse" | sudo tee -a /usr/share/applications/eclipse.desktop | ||
36 | echo "Exec=/usr/bin/eclipse" | sudo tee -a /usr/share/applications/eclipse.desktop | ||
37 | echo "Icon=/opt/eclipse/icon.xpm" | sudo tee -a /usr/share/applications/eclipse.desktop | ||
38 | echo "Categories=Development;IDE;Java;" | sudo tee -a /usr/share/applications/eclipse.desktop | ||
39 | echo "Terminal=false" | sudo tee -a /usr/share/applications/eclipse.desktop | ||
40 | echo "Type=Application" | sudo tee -a /usr/share/applications/eclipse.desktop | ||
41 | echo "StartupNotify=true" | sudo tee -a /usr/share/applications/eclipse.desktop | ||
42 | |||
43 | # Delete the eclipse tarball | ||
44 | rm /tmp/eclipse.tar.gz | ||
45 | |||
46 | # download the gcc-arm tools | ||
47 | wget -O /tmp/gcc-arm.tar.bz2 $GCC_ARM_URL | ||
14 | 48 | ||
15 | # expand and add it to the path (yes, I know it says don't ever do this - but this is a Vagrant box ;) | 49 | # expand and add it to the path (yes, I know it says don't ever do this - but this is a Vagrant box ;) |
16 | cd /usr/local | 50 | sudo tar xjf /tmp/gcc-arm.tar.bz2 -C /usr/local |
17 | sudo tar xjf /tmp/gcc-arm.tar.bz2 | ||
18 | |||
19 | # cd to the /vagrant dir on login | ||
20 | echo "cd /vagrant" >> /home/vagrant/.bashrc | ||
21 | 51 | ||
22 | # set up path to arm gcc on login | 52 | # set up path to arm gcc on login |
23 | echo "export PATH=/usr/local/gcc-arm-none-eabi-4_9-2015q1/bin:$PATH" >> /home/vagrant/.bashrc | 53 | sudo echo "export PATH=/usr/local/gcc-arm-none-eabi-4_8-2014q3/bin:$PATH" >> /etc/profile.d/env.sh |
24 | 54 | ||
55 | # Delete the gcc-arm tarball | ||
56 | rm /tmp/gcc-arm.tar.bz2 | ||
25 | 57 | ||
58 | # helpfully cd to the /vagrant dir on login | ||
59 | echo "cd /vagrant" >> /home/vagrant/.bashrc | ||