temperaturecontrol: allow setting background tool without activating
[clinton/Smoothieware.git] / travis_install
CommitLineData
1e2d6e0e
JM
1#! /usr/bin/env bash
2# Copyright 2012 Adam Green (http://mbed.org/users/AdamGreen/)
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16
17# Logs the command to be run and then executes the command while logging the results.
18RunAndLog () {
19 echo `date` Executing $@>>$LOGFILE
20 $@ 1>>$LOGFILE 2>$ERRORFILE
21 if [ "$?" != "0" ] ; then
22 cat $ERRORFILE >>$LOGFILE
23 echo `date` Failure forced early exit>>$LOGFILE
24 cat $LOGFILE
25 rm -f $ERRORFILE
26 popd >/dev/null
27 read -n 1 -sp "Press any key to continue..." dummy ; echo
28 exit 1
29 fi
30}
31
32
33# Setup script variables.
34ROOTDIR=$0
35ROOTDIR=${ROOTDIR%/*}
36pushd $ROOTDIR
37ROOTDIR=$PWD
38LOGFILE=$ROOTDIR/linux_install.log
39ERRORFILE=$ROOTDIR/linux_install.err
40GCC4ARM_VERSION=gcc-arm-none-eabi-4_8-2014q1
41GCC4ARM_FILENAME=gcc-arm-none-eabi-4_8-2014q1-20140314-linux.tar.bz2
42GCC4ARM_URL=https://launchpad.net/gcc-arm-embedded/4.8/4.8-2014-q1-update/+download/$GCC4ARM_FILENAME
43GCC4ARM_TAR=$ROOTDIR/$GCC4ARM_FILENAME
44GCC4ARM_MD5=72b0d06ae16b303c25fd70b2883d3950
45GCC4ARM_EXTRACT=$ROOTDIR/$GCC4ARM_VERSION
46GCC4ARM_DIR=$ROOTDIR/gcc-arm-none-eabi
47GCC4ARM_BINDIR=$GCC4ARM_DIR/bin
48BUILDSHELL_CMD=$ROOTDIR/BuildShell
49
50
51echo Logging install results to $LOGFILE
52echo `date` Starting $0 $*>$LOGFILE
53
54echo Downloading GNU Tools for ARM Embedded Processors...
55rm $GCC4ARM_FILENAME >/dev/null 2>/dev/null
56echo `date` Executing wget $GCC4ARM_URL>>$LOGFILE
57wget $GCC4ARM_URL
58
59echo Validating md5 signature of GNU Tools for ARM Embedded Processors...
60echo `date` Validating md5 signature of GNU Tools for ARM Embedded Processors>>$LOGFILE
61archive_match=`md5sum $GCC4ARM_FILENAME | grep -c $GCC4ARM_MD5`
62if [ "$archive_match" != "1" ] ; then
63 echo $GCC4ARM_FILENAME failed MD5 signature check.>>$LOGFILE
64 echo `date` Failure forced early exit>>$LOGFILE
65 cat $LOGFILE
66 rm -f $ERRORFILE
67 popd >/dev/null
68 read -n 1 -sp "Press any key to continue..." dummy ; echo
69 exit 1
70fi
71
72echo Extracting GNU Tools for ARM Embedded Processors...
73rm -r $GCC4ARM_DIR >/dev/null 2>/dev/null
74RunAndLog tar xf $GCC4ARM_TAR
75RunAndLog mv $GCC4ARM_EXTRACT $GCC4ARM_DIR
76
1e2d6e0e
JM
77echo Cleaning up intermediate files...
78RunAndLog rm $GCC4ARM_TAR
96a78b07 79echo Installed build tools to $GCC4ARM_DIR