summaryrefslogtreecommitdiffstats
path: root/bootstrap.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bootstrap.sh')
-rw-r--r--bootstrap.sh58
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.
5ECLIPSE_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
8GCC_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
6apt-get update 11apt-get update
7sudo apt-get install -y lib32z1 lib32ncurses5 lib32bz2-1.0 12sudo apt-get install -y lib32z1 lib32ncurses5 lib32bz2-1.0
8 13
9# eclipse IDE 14# install Java
10# sudo apt-get install -y eclipse 15sudo apt-get install -y openjdk-7-jdk
11 16
12# download the compiler 17# download Eclipse
13wget -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 18wget -O /tmp/eclipse.tar.gz $ECLIPSE_URL
19
20# Extract files
21sudo tar zxvf /tmp/eclipse.tar.gz -C /opt/
22# Change ownership to root
23sudo chown -R root:root /opt/eclipse/
24
25# Create launch script in /usr/bin
26echo '#!/bin/sh' | sudo tee /usr/bin/eclipse
27echo 'export ECLIPSE_HOME="/opt/eclipse"' | sudo tee -a /usr/bin/eclipse
28echo '$ECLIPSE_HOME/eclipse $*' | sudo tee -a /usr/bin/eclipse
29sudo chmod 755 /usr/bin/eclipse
30
31# Create menu entry
32echo "[Desktop Entry]" | sudo tee /usr/share/applications/eclipse.desktop
33echo "Name=Eclipse IDE" | sudo tee -a /usr/share/applications/eclipse.desktop
34echo "Comment=Integrated Development Environment" | sudo tee -a /usr/share/applications/eclipse.desktop
35echo "TryExec=/usr/bin/eclipse" | sudo tee -a /usr/share/applications/eclipse.desktop
36echo "Exec=/usr/bin/eclipse" | sudo tee -a /usr/share/applications/eclipse.desktop
37echo "Icon=/opt/eclipse/icon.xpm" | sudo tee -a /usr/share/applications/eclipse.desktop
38echo "Categories=Development;IDE;Java;" | sudo tee -a /usr/share/applications/eclipse.desktop
39echo "Terminal=false" | sudo tee -a /usr/share/applications/eclipse.desktop
40echo "Type=Application" | sudo tee -a /usr/share/applications/eclipse.desktop
41echo "StartupNotify=true" | sudo tee -a /usr/share/applications/eclipse.desktop
42
43# Delete the eclipse tarball
44rm /tmp/eclipse.tar.gz
45
46# download the gcc-arm tools
47wget -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 ;)
16cd /usr/local 50sudo tar xjf /tmp/gcc-arm.tar.bz2 -C /usr/local
17sudo tar xjf /tmp/gcc-arm.tar.bz2
18
19# cd to the /vagrant dir on login
20echo "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
23echo "export PATH=/usr/local/gcc-arm-none-eabi-4_9-2015q1/bin:$PATH" >> /home/vagrant/.bashrc 53sudo 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
56rm /tmp/gcc-arm.tar.bz2
25 57
58# helpfully cd to the /vagrant dir on login
59echo "cd /vagrant" >> /home/vagrant/.bashrc