Mercurial > hg > beaglert
comparison scripts/set_startup.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 | 6e428d6b57ef |
children | d56e638c37c6 |
comparison
equal
deleted
inserted
replaced
376:9d2ed561aac5 | 377:a430a16d2c02 |
---|---|
1 #!/bin/bash | 1 #!/bin/bash |
2 # | 2 # |
3 # This script enables or disables running BeagleRT when the board starts | 3 # This script enables or disables running Bela when the board starts |
4 # up. | 4 # up. |
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/" |
14 [ -z "$BBB_DEFAULT_PROJECT_NAME" ] && BBB_DEFAULT_PROJECT_NAME="scriptUploadedProject" | 14 [ -z "$BBB_DEFAULT_PROJECT_NAME" ] && BBB_DEFAULT_PROJECT_NAME="scriptUploadedProject" |
15 [ -z "$BBB_PROJECT_NAME" ] && BBB_PROJECT_NAME=$BBB_DEFAULT_PROJECT_NAME | 15 [ -z "$BBB_PROJECT_NAME" ] && BBB_PROJECT_NAME=$BBB_DEFAULT_PROJECT_NAME |
16 ENABLE_STARTUP=1 | 16 ENABLE_STARTUP=1 |
17 RUN_IN_LOOP=0 | 17 RUN_IN_LOOP=0 |
18 | 18 |
19 # This path is hard-coded in the BeagleRT image at present. | 19 # This path is hard-coded in the Bela image at present. |
20 | 20 |
21 function usage | 21 function usage |
22 { | 22 { |
23 THIS_SCRIPT=`basename "$0"` | 23 THIS_SCRIPT=`basename "$0"` |
24 echo "Usage: $THIS_SCRIPT [-b path-on-beaglebone] [-c command-line-args] [-n] [-l]" | 24 echo "Usage: $THIS_SCRIPT [-b path-on-beaglebone] [-c command-line-args] [-n] [-l]" |
25 | 25 |
26 echo " | 26 echo " |
27 This script enables (by default) or disables running the BeagleRT | 27 This script enables (by default) or disables running the Bela |
28 project at startup. The -n option disables auto-startup, otherwise | 28 project at startup. The -n option disables auto-startup, otherwise |
29 auto-startup is enabled. The -b option changes the name of the project to | 29 auto-startup is enabled. The -b option changes the name of the project to |
30 set on startup, which is otherwise $BBB_DEFAULT_PROJECT_NAME. The -c option | 30 set on startup, which is otherwise $BBB_DEFAULT_PROJECT_NAME. The -c option |
31 passes command-line arguments to the BeagleRT program; enclose the argument | 31 passes command-line arguments to the Bela program; enclose the argument |
32 string in quotes. | 32 string in quotes. |
33 The -l option runs the BeagleRT program in a loop, restarting | 33 The -l option runs the Bela program in a loop, restarting |
34 automatically in the event of a crash." | 34 automatically in the event of a crash." |
35 } | 35 } |
36 | 36 |
37 OPTIND=1 | 37 OPTIND=1 |
38 | 38 |
54 shift $((OPTIND-1)) | 54 shift $((OPTIND-1)) |
55 | 55 |
56 MAKE_COMMAND="make -C $BBB_BELA_HOME PROJECT=$BBB_PROJECT_NAME CL=\"$OPTARG\"" | 56 MAKE_COMMAND="make -C $BBB_BELA_HOME PROJECT=$BBB_PROJECT_NAME CL=\"$OPTARG\"" |
57 if [ $ENABLE_STARTUP -eq 0 ] | 57 if [ $ENABLE_STARTUP -eq 0 ] |
58 then | 58 then |
59 echo "Disabling BeagleRT at startup..." | 59 echo "Disabling Bela at startup..." |
60 ssh $BBB_ADDRESS "$MAKE_COMMAND nostartup" | 60 ssh $BBB_ADDRESS "$MAKE_COMMAND nostartup" |
61 elif [ $RUN_IN_LOOP -eq 1 ] | 61 elif [ $RUN_IN_LOOP -eq 1 ] |
62 then | 62 then |
63 echo "Enabling BeagleRT at startup..." | 63 echo "Enabling Bela at startup..." |
64 ssh $BBB_ADDRESS "$MAKE_COMMAND startuploop" | 64 ssh $BBB_ADDRESS "$MAKE_COMMAND startuploop" |
65 else | 65 else |
66 echo "Enabling BeagleRT at startup..." | 66 echo "Enabling Bela at startup..." |
67 ssh $BBB_ADDRESS "$MAKE_COMMAND startup" | 67 ssh $BBB_ADDRESS "$MAKE_COMMAND startup" |
68 fi | 68 fi |