comparison scripts/run_project.sh @ 377:a430a16d2c02 prerelease

Updated scripts so that the Bela folder on the bbb is ~/Bela. Note: BeagleRT_startup.sh is still the same (because the reference to it needs to be changed in /etc/init.d/ ....
author Giulio Moro <giuliomoro@yahoo.it>
date Sat, 11 Jun 2016 01:54:43 +0100
parents 8e0dee85b73a
children 99de323c13b3
comparison
equal deleted inserted replaced
376:9d2ed561aac5 377:a430a16d2c02
1 #!/bin/bash 1 #!/bin/bash
2 # 2 #
3 # This script runs an already-compiled BeagleRT project on the 3 # This script runs an already-compiled Bela project on the
4 # BeagleBone Black. 4 # BeagleBone Black.
5 5
6 [ -z "$BBB_ADDRESS" ] && BBB_ADDRESS="root@192.168.7.2" 6 [ -z "$BBB_ADDRESS" ] && BBB_ADDRESS="root@192.168.7.2"
7 [ -z "$BBB_BELA_HOME" ] && BBB_BELA_HOME="~/BeagleRT/" 7 [ -z "$BBB_BELA_HOME" ] && BBB_BELA_HOME="~/Bela/"
8 [ -z "$BBB_SCREEN_NAME" ] && BBB_SCREEN_NAME="BeagleRT" 8 [ -z "$BBB_SCREEN_NAME" ] && BBB_SCREEN_NAME="Bela"
9 [ -z "$RUN_PROJECT" ] && RUN_PROJECT=1 9 [ -z "$RUN_PROJECT" ] && RUN_PROJECT=1
10 [ -z "$COMMAND_ARGS" ] && COMMAND_ARGS= 10 [ -z "$COMMAND_ARGS" ] && COMMAND_ARGS=
11 [ -z "$RUN_IN_FOREGROUND" ] && RUN_IN_FOREGROUND=1 11 [ -z "$RUN_IN_FOREGROUND" ] && RUN_IN_FOREGROUND=1
12 [ -z "$RUN_WITHOUT_SCREEN" ] && RUN_WITHOUT_SCREEN=0 12 [ -z "$RUN_WITHOUT_SCREEN" ] && RUN_WITHOUT_SCREEN=0
13 [ -z "$BBB_PROJECT_HOME" ] && BBB_PROJECT_HOME="${BBB_BELA_HOME}/projects/" 13 [ -z "$BBB_PROJECT_HOME" ] && BBB_PROJECT_HOME="${BBB_BELA_HOME}/projects/"
17 { 17 {
18 THIS_SCRIPT=`basename "$0"` 18 THIS_SCRIPT=`basename "$0"`
19 echo "Usage: $THIS_SCRIPT [-b path-on-beaglebone] [-c command-line-args] [-fF]" 19 echo "Usage: $THIS_SCRIPT [-b path-on-beaglebone] [-c command-line-args] [-fF]"
20 20
21 echo " 21 echo "
22 This script runs a previously compiled BeagleRT project on the 22 This script runs a previously compiled Bela project on the
23 BeagleBone Black. The -b option changes the default path, which 23 BeagleBone Black. The -b option changes the default path, which
24 is otherwise $BBB_BELA_HOME. The -c option passes command-line arguments 24 is otherwise $BBB_BELA_HOME. The -c option passes command-line arguments
25 to the BeagleRT program; enclose the argument string in quotes. 25 to the Bela program; enclose the argument string in quotes.
26 26
27 The -f argument runs the project in the foreground of the current terminal, 27 The -f argument runs the project in the foreground of the current terminal,
28 within a screen session that can be detached later. The -F argument runs 28 within a screen session that can be detached later. The -F argument runs
29 the project in the foreground of the current terminal, without screen, so 29 the project in the foreground of the current terminal, without screen, so
30 the output can be piped to another destination." 30 the output can be piped to another destination."
58 58
59 MAKE_COMMAND="make stop -C $BBB_BELA_HOME PROJECT='$BBB_PROJECT_NAME' CL='$COMMAND_ARGS'" 59 MAKE_COMMAND="make stop -C $BBB_BELA_HOME PROJECT='$BBB_PROJECT_NAME' CL='$COMMAND_ARGS'"
60 echo "Running $BBB_PROJECT_NAME..." 60 echo "Running $BBB_PROJECT_NAME..."
61 if [ $RUN_WITHOUT_SCREEN -ne 0 ] 61 if [ $RUN_WITHOUT_SCREEN -ne 0 ]
62 then 62 then
63 echo ssh $BBB_ADDRESS "$MAKE_COMMAND run"
64 ssh $BBB_ADDRESS "$MAKE_COMMAND run" 63 ssh $BBB_ADDRESS "$MAKE_COMMAND run"
65 elif [ $RUN_IN_FOREGROUND -eq 0 ] 64 elif [ $RUN_IN_FOREGROUND -eq 0 ]
66 then 65 then
67 echo ssh $BBB_ADDRESS "$MAKE_COMMAND runscreenfg"
68 ssh $BBB_ADDRESS "$MAKE_COMMAND runscreenfg" 66 ssh $BBB_ADDRESS "$MAKE_COMMAND runscreenfg"
69 else 67 else
70 echo ssh $BBB_ADDRESS "$MAKE_COMMAND runscreen"
71 ssh $BBB_ADDRESS "$MAKE_COMMAND runscreen" 68 ssh $BBB_ADDRESS "$MAKE_COMMAND runscreen"
72 fi 69 fi