-
Notifications
You must be signed in to change notification settings - Fork 1
/
installmeshthing
executable file
·65 lines (49 loc) · 2.08 KB
/
installmeshthing
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env bash
# Copyright (c) 2014 All Right Reserved Alec Clews
#
# author: Alec Clews
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
#
AVR_PREFIX=/usr/local ; export AVR_PREFIX
CONTIKI_DIR=~/contiki ; export CONTIKI_DIR
echo
echo About to fully upgrade all relevent packges and install curses plus git
echo This will take some time
echo
# Make sure system is fully up to date
sudo apt-get update
sudo apt-get -y dist-upgrade
sudo apt-get -y install git libncurses5-dev
[[ -d $CONTIKI_DIR ]] && rm -rf $CONTIKI_DIR
git clone https://github.com/geekscape/contiki.git $CONTIKI_DIR
[[ -d $AVR_PREFIX/avr ]] && sudo rm -rf $AVR_PREFIX/avr
wget https://www.dropbox.com/s/jdo6egxaxfnogtj/avr-gcc.tgz -O - | sudo tar -xzf - -C $AVR_PREFIX
if [[ ! -f /etc/profile.d/avr.sh ]] ; then
echo '# Setup for AVR compiler ' |sudo tee /etc/profile.d/avr.sh
echo AVR_PREFIX=$AVR_PREFIX \; export AVR_PREFIX |sudo tee -a /etc/profile.d/avr.sh
echo 'PATH=$AVR_PREFIX/bin:$PATH' |sudo tee -a /etc/profile.d/avr.sh
echo 'CONTIKI_DIR=~/contiki ; export CONTIKI_DIR' |sudo tee -a /etc/profile.d/avr.sh
fi
. /etc/profile.d/avr.sh
# Remove anything out of date
sudo apt-get autoremove
# Maybe save a few hundred Mb of disk space by removing downloaded deb archives
sudo apt-get clean
cd $CONTIKI_DIR/examples/hello-world
git checkout avr-meshthing
make TARGET=avr-meshthing hello-world.hex