changeset 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 9d2ed561aac5
children 8db03611ee76
files Makefile scripts/build_pd_heavy.sh scripts/build_project.sh scripts/connect_to_project.sh scripts/run_pd_libpd.sh scripts/run_project.sh scripts/set_startup.sh scripts/setup_board.sh scripts/stop_running.sh
diffstat 9 files changed, 56 insertions(+), 59 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Fri Jun 10 00:56:49 2016 +0100
+++ b/Makefile	Sat Jun 11 01:54:43 2016 +0100
@@ -40,7 +40,7 @@
 RUN_COMMAND?=$(OUTPUT_FILE) $(COMMAND_LINE_OPTIONS)
 BELA_STARTUP_SCRIPT?=/root/BeagleRT_startup.sh
 BELA_AUDIO_THREAD_NAME?=bela-audio 
-SCREEN_NAME?=BeagleRT
+SCREEN_NAME?=Bela
 
 
 RM := rm -rf
--- a/scripts/build_pd_heavy.sh	Fri Jun 10 00:56:49 2016 +0100
+++ b/scripts/build_pd_heavy.sh	Sat Jun 11 01:54:43 2016 +0100
@@ -16,7 +16,7 @@
 #make sure the paths have the trailing / . 
 projectpath="../projects/heavy/hvtemp/"
 [ -z "$BBB_ADDRESS" ] && BBB_ADDRESS="root@192.168.7.2"
-[ -z "$BBB_BELA_HOME" ] && BBB_BELA_HOME="~/BeagleRT/"
+[ -z "$BBB_BELA_HOME" ] && BBB_BELA_HOME="~/Bela/"
 [ -z "$BBB_PROJECT_HOME" ] && BBB_PROJECT_HOME="${BBB_BELA_HOME}/projects/"
 BBB_DEFAULT_PROJECT_NAME="heavyProject"
 [ -z "$BBB_PROJECT_NAME" ] && BBB_PROJECT_NAME=$BBB_DEFAULT_PROJECT_NAME
@@ -47,11 +47,11 @@
 {
 printf "\nUSAGE: build_pd.sh [[-i input folder containing _main.pd file ]\
  [-o output folder for new heavy project .c files (default ../projects/heavy/hvtemp)]\
- [-b bbb path to copy to (default ~/BeagleRT)] | [-h] | [-f|--force] | [-w|--watch]\n"
+ [-b bbb path to copy to (default ~/Bela)] | [-h] | [-f|--force] | [-w|--watch]\n"
 printf "\nexample: build_pd.sh -i ../projects/heavy/pd/hello-world -o ../projects/heavy/hello-world\n"
 echo "If --watch is selected, the script will check every 1s for any file that is modified in the source folder, which triggers\
 the building process and runs the process.
-If --screen is selected, the prompt returns to the user after launching BeagleRT in a screen on the target device.
+If --screen is selected, the prompt returns to the user after launching Bela in a screen on the target device.
 If --screen and --watch are combined, while the process is running in the screen, modifications to the source files will \
 still trigger a new build."
 }
@@ -169,8 +169,8 @@
     # exit 2
     # sets the date, remove old executable and heavy context .o/.d files
     ssh $BBB_ADDRESS "date -s '`date`' > /dev/null; rm -rf "$BBB_PROJECT_FOLDER/$BBB_PROJECT_NAME;
-    SCREEN_NAME=BeagleRT
-    # Make new BeagleRT execut/able and run
+    SCREEN_NAME=Bela
+    # Make new Bela execut/able and run
     # It does not look very nice that we type the same things over and over
     # but that is because each line is an ssh session in its own right
     MAKE_COMMAND="make stop -C $BBB_BELA_HOME PROJECT='$BBB_PROJECT_NAME' CL='$COMMAND_ARGS'"
--- a/scripts/build_project.sh	Fri Jun 10 00:56:49 2016 +0100
+++ b/scripts/build_project.sh	Sat Jun 11 01:54:43 2016 +0100
@@ -1,13 +1,13 @@
 #!/bin/bash
 #
-# This script compiles a BeagleRT project on the BeagleBone Black and
+# This script compiles a Bela project on the BeagleBone Black and
 # optionally runs it. Pass a directory path in the first argument. 
 # The source files in this directory are copied to the board and compiled.
 
 # set defaults unless variables are already set
 [ -z "$BBB_ADDRESS" ] && BBB_ADDRESS="root@192.168.7.2"
-[ -z "$BBB_BELA_HOME" ] && BBB_BELA_HOME="~/BeagleRT/"
-[ -z "$BBB_SCREEN_NAME" ] && BBB_SCREEN_NAME="BeagleRT"
+[ -z "$BBB_BELA_HOME" ] && BBB_BELA_HOME="~/Bela/"
+[ -z "$BBB_SCREEN_NAME" ] && BBB_SCREEN_NAME="Bela"
 [ -z "$RUN_PROJECT" ] && RUN_PROJECT=1
 [ -z "$COMMAND_ARGS" ] && COMMAND_ARGS=
 [ -z "$RUN_IN_FOREGROUND" ] && RUN_IN_FOREGROUND=1
@@ -22,13 +22,13 @@
     echo "Usage: $THIS_SCRIPT [-c command-line-args] [-nbfF] <directory-with-source-files>"
     echo "
     This script copies a directory of source files to the BeagleBone, compiles
-    and runs it. The BeagleRT core files should have first been copied over
-    using the setup_board.sh script supplied with BeagleRT.
+    and runs it. The Bela core files should have first been copied over
+    using the setup_board.sh script supplied with Bela.
 
     The source directory should contain at least one .c, .cpp or .S file.
     If the argument -n is passed, the output will not be run after compiling.
     The -c option passes command-line arguments to
-    the BeagleRT program; enclose the argument string in quotes.
+    the Bela program; enclose the argument string in quotes.
 	
     By default, the project runs in the foreground of the current terminal,
     within a screen session that can be detached later. The -f argument runs
@@ -127,7 +127,7 @@
 	exit
 fi
 
-# Make new BeagleRT executable and run
+# Make new Bela executable and run
 MAKE_COMMAND="make -C $BBB_BELA_HOME PROJECT='$BBB_PROJECT_NAME' CL='$COMMAND_ARGS' $BBB_MAKEFILE_OPTIONS"
 if [ $RUN_PROJECT -eq 0 ]
 then
--- a/scripts/connect_to_project.sh	Fri Jun 10 00:56:49 2016 +0100
+++ b/scripts/connect_to_project.sh	Sat Jun 11 01:54:43 2016 +0100
@@ -1,11 +1,11 @@
 #!/bin/bash
 #
-# This script brings an already running BeagleRT program to the foreground 
+# This script brings an already running Bela program to the foreground 
 # in the terminal, so it can be run interactively.
 
 [ -z "$BBB_ADDRESS" ] && BBB_ADDRESS="root@192.168.7.2"
-[ -z "$BBB_BELA_HOME" ] && BBB_BELA_HOME="~/BeagleRT/"
-[ -z "$BBB_SCREEN_NAME" ] && BBB_SCREEN_NAME="BeagleRT"
+[ -z "$BBB_BELA_HOME" ] && BBB_BELA_HOME="~/Bela/"
+[ -z "$BBB_SCREEN_NAME" ] && BBB_SCREEN_NAME="Bela"
 [ -z "$RUN_PROJECT" ] && RUN_PROJECT=1
 [ -z "$COMMAND_ARGS" ] && COMMAND_ARGS=
 [ -z "$RUN_IN_FOREGROUND" ] && RUN_IN_FOREGROUND=1
--- a/scripts/run_pd_libpd.sh	Fri Jun 10 00:56:49 2016 +0100
+++ b/scripts/run_pd_libpd.sh	Sat Jun 11 01:54:43 2016 +0100
@@ -1,11 +1,11 @@
 #!/bin/bash
 #
-# This script compiles a BeagleRT project on the BeagleBone Black and
+# This script compiles a Bela project on the BeagleBone Black and
 # optionally runs it. Pass a directory path in the first argument. 
 # The source files in this directory are copied to the board and compiled.
 
 BBB_ADDRESS="root@192.168.7.2"
-BBB_LIBPD_EXECUTABLE_PATH="~/libpd/BeagleRT"
+BBB_LIBPD_EXECUTABLE_PATH="~/libpd/Bela"
 BBB_LIBPD_PROJECT_PATH="~/libpd/source/"
 RUN_PROJECT=1
 COMMAND_ARGS=
@@ -18,13 +18,13 @@
     echo "Usage: $THIS_SCRIPT [-c command-line-args] [-nfF] <directory-with-source-files>"
     echo "
     This script copies a PureData project to the BeagleBone and runs it 
-    using libpd. The BeagleRT-libpd executable should have first been copied
+    using libpd. The Bela-libpd executable should have first been copied
     to the $BBB_LIBPD_EXECUTABLE_PATH folder on the Beaglebone.
     The source directory should contain a file called _main.pd, which is the 
     patch that will be loaded into Pd. All the content of the folder is 
     recursively copied and the folder structure is flattened.
     If the argument -n is passed, the output will not be run after compiling.
-    The -c option passes command-line arguments to the BeagleRT program; 
+    The -c option passes command-line arguments to the Bela program; 
     enclose the argument string in quotes.
 	
     The -f argument runs the project in the foreground of the current terminal,
@@ -72,10 +72,10 @@
     exit
 fi
 
-# Stop BeagleRT and clean out old source files
-echo "Stopping BeagleRT and removing old source files..."
-ssh -t -t $BBB_ADDRESS "screen -X -S BeagleRT quit &>/dev/null;\
- pkill BeagleRT ; rm -rf $BBB_LIBPD_PROJECT_PATH/; mkdir -p $BBB_LIBPD_PROJECT_PATH; "
+# Stop Bela and clean out old source files
+echo "Stopping Bela and removing old source files..."
+ssh -t -t $BBB_ADDRESS "screen -X -S Bela quit &>/dev/null;\
+ pkill Bela ; rm -rf $BBB_LIBPD_PROJECT_PATH/; mkdir -p $BBB_LIBPD_PROJECT_PATH; "
 
 # Copy new source files to the board
 echo "Copying new pd projects to BeagleBone..."
@@ -87,7 +87,7 @@
 	exit
 fi
 
-# Make new BeagleRT executable and run
+# Make new Bela executable and run
 if [ $RUN_PROJECT -eq 0 ]
 then
     echo "Files copied. Run without \"-n\" to run the project"
@@ -99,9 +99,9 @@
 		ssh -t $BBB_ADDRESS "cd $BBB_LIBPD_PROJECT_PATH && $BBB_LIBPD_EXECUTABLE_PATH $COMMAND_ARGS"
 	elif [ $RUN_IN_FOREGROUND -eq 0 ]
 	then
-	    ssh $BBB_ADDRESS "cd $BBB_LIBPD_PROJECT_PATH && screen -S BeagleRT -d -m \
+	    ssh $BBB_ADDRESS "cd $BBB_LIBPD_PROJECT_PATH && screen -S Bela -d -m \
          $BBB_LIBPD_EXECUTABLE_PATH $COMMAND_ARGS"
 	else
-	    ssh -t $BBB_ADDRESS "cd $BBB_LIBPD_PROJECT_PATH && screen -S BeagleRT $BBB_LIBPD_EXECUTABLE_PATH $COMMAND_ARGS"
+	    ssh -t $BBB_ADDRESS "cd $BBB_LIBPD_PROJECT_PATH && screen -S Bela $BBB_LIBPD_EXECUTABLE_PATH $COMMAND_ARGS"
 	fi
-fi
\ No newline at end of file
+fi
--- a/scripts/run_project.sh	Fri Jun 10 00:56:49 2016 +0100
+++ b/scripts/run_project.sh	Sat Jun 11 01:54:43 2016 +0100
@@ -1,11 +1,11 @@
 #!/bin/bash
 #
-# This script runs an already-compiled BeagleRT project on the
+# This script runs an already-compiled Bela project on the
 # BeagleBone Black.
 
 [ -z "$BBB_ADDRESS" ] && BBB_ADDRESS="root@192.168.7.2"
-[ -z "$BBB_BELA_HOME" ] && BBB_BELA_HOME="~/BeagleRT/"
-[ -z "$BBB_SCREEN_NAME" ] && BBB_SCREEN_NAME="BeagleRT"
+[ -z "$BBB_BELA_HOME" ] && BBB_BELA_HOME="~/Bela/"
+[ -z "$BBB_SCREEN_NAME" ] && BBB_SCREEN_NAME="Bela"
 [ -z "$RUN_PROJECT" ] && RUN_PROJECT=1
 [ -z "$COMMAND_ARGS" ] && COMMAND_ARGS=
 [ -z "$RUN_IN_FOREGROUND" ] && RUN_IN_FOREGROUND=1
@@ -19,10 +19,10 @@
     echo "Usage: $THIS_SCRIPT [-b path-on-beaglebone] [-c command-line-args] [-fF]"
 
     echo "
-    This script runs a previously compiled BeagleRT project on the 
+    This script runs a previously compiled Bela project on the 
     BeagleBone Black. The -b option changes the default path, which
     is otherwise $BBB_BELA_HOME. The -c option passes command-line arguments
-    to the BeagleRT program; enclose the argument string in quotes.
+    to the Bela program; enclose the argument string in quotes.
 	
     The -f argument runs the project in the foreground of the current terminal,
     within a screen session that can be detached later. The -F argument runs
@@ -60,13 +60,10 @@
 echo "Running $BBB_PROJECT_NAME..."
 if [ $RUN_WITHOUT_SCREEN -ne 0 ]
 then
-    echo ssh $BBB_ADDRESS "$MAKE_COMMAND run"
     ssh $BBB_ADDRESS "$MAKE_COMMAND run"
 elif [ $RUN_IN_FOREGROUND -eq 0 ]
 then
-    echo ssh $BBB_ADDRESS "$MAKE_COMMAND runscreenfg"
     ssh $BBB_ADDRESS "$MAKE_COMMAND runscreenfg"
 else
-    echo ssh $BBB_ADDRESS "$MAKE_COMMAND runscreen"
     ssh $BBB_ADDRESS "$MAKE_COMMAND runscreen"
 fi
--- a/scripts/set_startup.sh	Fri Jun 10 00:56:49 2016 +0100
+++ b/scripts/set_startup.sh	Sat Jun 11 01:54:43 2016 +0100
@@ -1,11 +1,11 @@
 #!/bin/bash
 #
-# This script enables or disables running BeagleRT when the board starts
+# This script enables or disables running Bela when the board starts
 # up.
 
 [ -z "$BBB_ADDRESS" ] && BBB_ADDRESS="root@192.168.7.2"
-[ -z "$BBB_BELA_HOME" ] && BBB_BELA_HOME="~/BeagleRT/"
-[ -z "$BBB_SCREEN_NAME" ] && BBB_SCREEN_NAME="BeagleRT"
+[ -z "$BBB_BELA_HOME" ] && BBB_BELA_HOME="~/Bela/"
+[ -z "$BBB_SCREEN_NAME" ] && BBB_SCREEN_NAME="Bela"
 [ -z "$RUN_PROJECT" ] && RUN_PROJECT=1
 [ -z "$COMMAND_ARGS" ] && COMMAND_ARGS=
 [ -z "$RUN_IN_FOREGROUND" ] && RUN_IN_FOREGROUND=1
@@ -16,7 +16,7 @@
 ENABLE_STARTUP=1
 RUN_IN_LOOP=0
 
-# This path is hard-coded in the BeagleRT image at present.
+# This path is hard-coded in the Bela image at present.
 
 function usage
 {
@@ -24,13 +24,13 @@
     echo "Usage: $THIS_SCRIPT [-b path-on-beaglebone] [-c command-line-args] [-n] [-l]"
 
     echo "
-    This script enables (by default) or disables running the BeagleRT
+    This script enables (by default) or disables running the Bela
     project at startup. The -n option disables auto-startup, otherwise
     auto-startup is enabled. The -b option changes the name of the project to
     set on startup, which is otherwise $BBB_DEFAULT_PROJECT_NAME. The -c option 
-    passes command-line arguments to the BeagleRT program; enclose the argument 
+    passes command-line arguments to the Bela program; enclose the argument 
     string in quotes.
-    The -l option runs the BeagleRT program in a loop, restarting
+    The -l option runs the Bela program in a loop, restarting
     automatically in the event of a crash."
 }
 
@@ -56,13 +56,13 @@
 MAKE_COMMAND="make -C $BBB_BELA_HOME PROJECT=$BBB_PROJECT_NAME CL=\"$OPTARG\""
 if [ $ENABLE_STARTUP -eq 0 ]
 then
-    echo "Disabling BeagleRT at startup..."
+    echo "Disabling Bela at startup..."
     ssh $BBB_ADDRESS "$MAKE_COMMAND nostartup"
 elif [ $RUN_IN_LOOP -eq 1 ]
 then    
-    echo "Enabling BeagleRT at startup..."
+    echo "Enabling Bela at startup..."
     ssh $BBB_ADDRESS "$MAKE_COMMAND startuploop" 
 else 
-    echo "Enabling BeagleRT at startup..."
+    echo "Enabling Bela at startup..."
     ssh $BBB_ADDRESS "$MAKE_COMMAND startup" 
 fi
--- a/scripts/setup_board.sh	Fri Jun 10 00:56:49 2016 +0100
+++ b/scripts/setup_board.sh	Sat Jun 11 01:54:43 2016 +0100
@@ -1,11 +1,11 @@
 #!/bin/bash
 #
-# This script copies the core BeagleRT files to the BeagleBone Black
+# This script copies the core Bela files to the BeagleBone Black
 # in preparation for building projects. It will remove any existing
-# BeagleRT directory before copying the files over
+# Bela directory before copying the files over
 
 [ -z "$BBB_ADDRESS" ] && BBB_ADDRESS="root@192.168.7.2"
-[ -z "$BBB_BELA_HOME" ] && BBB_BELA_HOME="~/BeagleRT/"
+[ -z "$BBB_BELA_HOME" ] && BBB_BELA_HOME="~/Bela/"
 
 function usage
 {
@@ -13,7 +13,7 @@
     echo "Usage: $THIS_SCRIPT [-b path-on-beaglebone]"
 
     echo "
-    This script copies the core BeagleRT files to the BeagleBone, REMOVING
+    This script copies the core Bela files to the BeagleBone, REMOVING
     any previous files found at that location. This should be done before
     running any of the other build scripts in this directory. The -b option
     changes the default path, which is otherwise $BBB_BELA_HOME."
@@ -30,7 +30,7 @@
     esac
 done
 
-echo "Copying BeagleRT core files to $BBB_BELA_HOME"
+echo "Copying Bela core files to $BBB_BELA_HOME"
 
 shift $((OPTIND-1))
 
@@ -38,13 +38,13 @@
 SCRIPTPATH=$(readlink "$0")
 SCRIPTDIR=$(dirname "$SCRIPTPATH")
 
-read -p "Warning: this script will DELETE any existing BeagleRT files from your BeagleBone! Continue? (y/N) " -r
+read -p "Warning: this script will DELETE any existing Bela files from your BeagleBone! Continue? (y/N) " -r
 echo
 if [[ $REPLY = [yY]  ]]
 then
-# Stop BeagleRT if running and remove all files
-  echo "Stopping BeagleRT and removing old files." 
-  ssh $BBB_ADDRESS "screen -X -S BeagleRT quit &>/dev/null; pkill BeagleRT; sleep 0.5 ; rm -rf $BBB_BELA_HOME ; mkdir $BBB_BELA_HOME"
+# Stop Bela if running and remove all files
+  echo "Stopping Bela and removing old files." 
+  ssh $BBB_ADDRESS "screen -X -S Bela quit &>/dev/null; pkill Bela; sleep 0.5 ; rm -rf $BBB_BELA_HOME ; mkdir $BBB_BELA_HOME"
 
 # Copy relevant files to BeagleBone Black
   echo "Copying new files to BeagleBone..."
--- a/scripts/stop_running.sh	Fri Jun 10 00:56:49 2016 +0100
+++ b/scripts/stop_running.sh	Sat Jun 11 01:54:43 2016 +0100
@@ -1,10 +1,10 @@
 #!/bin/bash
 #
-# This script stops the BeagleRT program running on the BeagleBone.
+# This script stops the Bela program running on the BeagleBone.
 
 [ -z "$BBB_ADDRESS" ] && BBB_ADDRESS="root@192.168.7.2"
-[ -z "$BBB_BELA_HOME" ] && BBB_BELA_HOME="~/BeagleRT/"
-[ -z "$BBB_SCREEN_NAME" ] && BBB_SCREEN_NAME="BeagleRT"
+[ -z "$BBB_BELA_HOME" ] && BBB_BELA_HOME="~/Bela/"
+[ -z "$BBB_SCREEN_NAME" ] && BBB_SCREEN_NAME="Bela"
 [ -z "$RUN_PROJECT" ] && RUN_PROJECT=1
 [ -z "$COMMAND_ARGS" ] && COMMAND_ARGS=
 [ -z "$RUN_IN_FOREGROUND" ] && RUN_IN_FOREGROUND=1
@@ -12,7 +12,7 @@
 [ -z "$BBB_PROJECT_HOME" ] && BBB_PROJECT_HOME="${BBB_BELA_HOME}/projects/"
 [ -z "$BBB_DEFAULT_PROJECT_NAME" ] && BBB_DEFAULT_PROJECT_NAME="scriptUploadedProject"
 [ -z "$BBB_PROJECT_NAME" ] && BBB_PROJECT_NAME=$BBB_DEFAULT_PROJECT_NAME
-# The first command should be sufficient to stop any BeagleRT run with
+# The first command should be sufficient to stop any Bela run with
 # these scripts; the second will catch any leftovers run other ways
 
 BELA_AUDIO_THREAD_NAME=beaglert-audio