comparison scripts/setup_board.sh @ 402:c29f07b7350e prerelease

Quieter setup_board.sh, also invokes IDE setup if available
author Giulio Moro <giuliomoro@yahoo.it>
date Wed, 15 Jun 2016 02:21:13 +0100
parents a430a16d2c02
children d7b002d68cdb
comparison
equal deleted inserted replaced
401:00c3bbea4faf 402:c29f07b7350e
4 # in preparation for building projects. It will remove any existing 4 # in preparation for building projects. It will remove any existing
5 # Bela directory before copying the files over 5 # Bela directory before copying the files over
6 6
7 [ -z "$BBB_ADDRESS" ] && BBB_ADDRESS="root@192.168.7.2" 7 [ -z "$BBB_ADDRESS" ] && BBB_ADDRESS="root@192.168.7.2"
8 [ -z "$BBB_BELA_HOME" ] && BBB_BELA_HOME="~/Bela/" 8 [ -z "$BBB_BELA_HOME" ] && BBB_BELA_HOME="~/Bela/"
9
10 function usage 9 function usage
11 { 10 {
12 THIS_SCRIPT=`basename "$0"` 11 THIS_SCRIPT=`basename "$0"`
13 echo "Usage: $THIS_SCRIPT [-b path-on-beaglebone]" 12 echo "Usage: $THIS_SCRIPT [-b path-on-beaglebone]"
14 13
35 shift $((OPTIND-1)) 34 shift $((OPTIND-1))
36 35
37 # Find location of this script so we can locate the rest of the files 36 # Find location of this script so we can locate the rest of the files
38 SCRIPTPATH=$(readlink "$0") 37 SCRIPTPATH=$(readlink "$0")
39 SCRIPTDIR=$(dirname "$SCRIPTPATH") 38 SCRIPTDIR=$(dirname "$SCRIPTPATH")
39 [ -z "$IDE_FOLDER" ] && IDE_FOLDER=$SCRIPTDIR/../bela-ide/
40 40
41 read -p "Warning: this script will DELETE any existing Bela files from your BeagleBone! Continue? (y/N) " -r 41 read -p "Warning: this script will DELETE any existing Bela files from your BeagleBone! Continue? (y/N) " -r
42 echo 42 echo
43 if [[ $REPLY = [yY] ]] 43 if [[ $REPLY = [yY] ]]
44 then 44 then
46 echo "Stopping Bela and removing old files." 46 echo "Stopping Bela and removing old files."
47 ssh $BBB_ADDRESS "screen -X -S Bela quit &>/dev/null; pkill Bela; sleep 0.5 ; rm -rf $BBB_BELA_HOME ; mkdir $BBB_BELA_HOME" 47 ssh $BBB_ADDRESS "screen -X -S Bela quit &>/dev/null; pkill Bela; sleep 0.5 ; rm -rf $BBB_BELA_HOME ; mkdir $BBB_BELA_HOME"
48 48
49 # Copy relevant files to BeagleBone Black 49 # Copy relevant files to BeagleBone Black
50 echo "Copying new files to BeagleBone..." 50 echo "Copying new files to BeagleBone..."
51 scp -r $SCRIPTDIR/../core $SCRIPTDIR/../include $SCRIPTDIR/../Makefile $SCRIPTDIR/../libNE10.a $SCRIPTDIR/../libprussdrv.a $SCRIPTDIR/../examples $BBB_ADDRESS:$BBB_BELA_HOME &&\ 51 scp -q -r $SCRIPTDIR/../core $SCRIPTDIR/../include $SCRIPTDIR/../Makefile $SCRIPTDIR/../libNE10.a $SCRIPTDIR/../libprussdrv.a $SCRIPTDIR/../examples $BBB_ADDRESS:$BBB_BELA_HOME &&\
52 scp $SCRIPTDIR/../libpd.so $BBB_ADDRESS:/usr/lib 52 scp -q $SCRIPTDIR/../libpd.so $BBB_ADDRESS:/usr/lib
53 if [ $? -ne 0 ] 53 if [ $? -ne 0 ]
54 then 54 then
55 echo "Error while copying files" 55 echo "Error while copying files"
56 exit 56 exit
57 fi 57 fi
58 # Make remaining directories needed for building 58 # Create remaining directories needed for building
59 echo "Creating directory structure on BeagleBone..." 59 echo "Creating directory structure on BeagleBone..."
60 ssh $BBB_ADDRESS "mkdir -p $BBB_BELA_HOME/build ; mkdir -p $BBB_BELA_HOME/build/core ; mkdir -p $BBB_BELA_HOME/build/projects; mkdir -p $BBB_BELA_HOME/projects" &&\ 60 ssh $BBB_ADDRESS "mkdir -p $BBB_BELA_HOME/build ; mkdir -p $BBB_BELA_HOME/build/core ; mkdir -p $BBB_BELA_HOME/build/projects; mkdir -p $BBB_BELA_HOME/projects" &&\
61 echo "Done." 61 echo "Done."
62 else 62 else
63 echo "Aborting..." 63 echo "Aborting..."
64 exit
64 fi 65 fi
65 66
67 #-------------
68 #Installing IDE
69 stat $IDE_FOLDER/scripts/setup_IDE.sh > /dev/null
70 if [ $? -eq 0 ]
71 then
72 cd $IDE_FOLDER/scripts;
73 ./setup_IDE.sh
74 else
75 echo "No IDE found, no IDE installed. You can get a copy of the IDE files from https://github.com/LBDonovan/bela-ide"
76 fi;