# HG changeset patch # User Giulio Moro # Date 1466428183 -3600 # Node ID d9a4fc5357e79a89b163d9866d491bdf81d845f1 # Parent 26b3b87437fbc590863a00c17621e58cebed9efc Path-relativeness of scripts has been improved. At least update_board will work when double clicked diff -r 26b3b87437fb -r d9a4fc5357e7 scripts/build_pd_heavy.sh --- a/scripts/build_pd_heavy.sh Mon Jun 20 13:49:48 2016 +0100 +++ b/scripts/build_pd_heavy.sh Mon Jun 20 14:09:43 2016 +0100 @@ -21,7 +21,9 @@ RUN_WITHOUT_SCREEN=1 BELA_PYTHON27= -. ./.bela_common || exit 1 +SCRIPTDIR=$(dirname "$0") +[ -z $SCRIPTDIR ] && SCRIPTDIR="./" || SCRIPTDIR=$SCRIPTDIR/ +. $SCRIPTDIR.bela_common || { echo "You must be in Bela/scripts to run these scripts" | exit 1; } if [ -z "$BELA_PYTHON27" ]; then for PY in python python2.7 ; do @@ -116,8 +118,7 @@ done # invoke the online compiler - echo "$BELA_PYTHON27" hvresources/uploader.py "$pdpath"/ -n $ENZIENAUDIO_COM_PATCH_NAME -g c -o "$projectpath" $RELEASE_STRING - "$BELA_PYTHON27" hvresources/uploader.py "$pdpath"/ -n $ENZIENAUDIO_COM_PATCH_NAME -g c -o "$projectpath" $RELEASE_STRING ||\ + "$BELA_PYTHON27" $SCRIPTDIR/hvresources/uploader.py "$pdpath"/ -n $ENZIENAUDIO_COM_PATCH_NAME -g c -o "$projectpath" $RELEASE_STRING ||\ { echo "ERROR: an error occurred while executing the uploader.py script"; exit 1; } fi; diff -r 26b3b87437fb -r d9a4fc5357e7 scripts/build_project.sh --- a/scripts/build_project.sh Mon Jun 20 13:49:48 2016 +0100 +++ b/scripts/build_project.sh Mon Jun 20 14:09:43 2016 +0100 @@ -6,7 +6,9 @@ # set defaults unless variables are already set -. ./.bela_common || exit 1 +SCRIPTDIR=$(dirname "$0") +[ -z $SCRIPTDIR ] && SCRIPTDIR="./" || SCRIPTDIR=$SCRIPTDIR/ +. $SCRIPTDIR.bela_common || { echo "You must be in Bela/scripts to run these scripts" | exit 1; } usage() { diff -r 26b3b87437fb -r d9a4fc5357e7 scripts/connect_to_project.sh --- a/scripts/connect_to_project.sh Mon Jun 20 13:49:48 2016 +0100 +++ b/scripts/connect_to_project.sh Mon Jun 20 14:09:43 2016 +0100 @@ -3,15 +3,8 @@ # 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="~/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 -[ -z "$RUN_WITHOUT_SCREEN" ] && RUN_WITHOUT_SCREEN=0 -[ -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 +SCRIPTDIR=$(dirname "$0") +[ -z $SCRIPTDIR ] && SCRIPTDIR="./" || SCRIPTDIR=$SCRIPTDIR/ +. $SCRIPTDIR.bela_common || { echo "You must be in Bela/scripts to run these scripts" | exit 1; } ssh -t $BBB_ADDRESS "make -C "$BBB_BELA_HOME" connect" diff -r 26b3b87437fb -r d9a4fc5357e7 scripts/halt_board.sh --- a/scripts/halt_board.sh Mon Jun 20 13:49:48 2016 +0100 +++ b/scripts/halt_board.sh Mon Jun 20 14:09:43 2016 +0100 @@ -2,7 +2,9 @@ # # This script halts the BeagleBone Black. -[ -z "$BBB_ADDRESS" ] && BBB_ADDRESS="root@192.168.7.2" +SCRIPTDIR=$(dirname "$0") +[ -z $SCRIPTDIR ] && SCRIPTDIR="./" || SCRIPTDIR=$SCRIPTDIR/ +. $SCRIPTDIR.bela_common || { echo "You must be in Bela/scripts to run these scripts" | exit 1; } echo "Shutting down the BeagleBone Black..." ssh $BBB_ADDRESS "halt" diff -r 26b3b87437fb -r d9a4fc5357e7 scripts/ide.sh --- a/scripts/ide.sh Mon Jun 20 13:49:48 2016 +0100 +++ b/scripts/ide.sh Mon Jun 20 14:09:43 2016 +0100 @@ -3,7 +3,9 @@ # set defaults unless variables are already set -. ./.bela_common || exit 1 +SCRIPTDIR=$(dirname "$0") +[ -z $SCRIPTDIR ] && SCRIPTDIR="./" || SCRIPTDIR=$SCRIPTDIR/ +. $SCRIPTDIR.bela_common || { echo "You must be in Bela/scripts to run these scripts" | exit 1; } usage() { diff -r 26b3b87437fb -r d9a4fc5357e7 scripts/run_pd_libpd.sh --- a/scripts/run_pd_libpd.sh Mon Jun 20 13:49:48 2016 +0100 +++ b/scripts/run_pd_libpd.sh Mon Jun 20 14:09:43 2016 +0100 @@ -4,9 +4,10 @@ # 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/Bela" -BBB_LIBPD_PROJECT_PATH="~/libpd/source/" +SCRIPTDIR=$(dirname "$0") +[ -z $SCRIPTDIR ] && SCRIPTDIR="./" || SCRIPTDIR=$SCRIPTDIR/ +. $SCRIPTDIR.bela_common || { echo "You must be in Bela/scripts to run these scripts" | exit 1; } + RUN_PROJECT=1 COMMAND_ARGS= RUN_IN_FOREGROUND=0 diff -r 26b3b87437fb -r d9a4fc5357e7 scripts/run_project.sh --- a/scripts/run_project.sh Mon Jun 20 13:49:48 2016 +0100 +++ b/scripts/run_project.sh Mon Jun 20 14:09:43 2016 +0100 @@ -3,15 +3,9 @@ # 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="~/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 -[ -z "$RUN_WITHOUT_SCREEN" ] && RUN_WITHOUT_SCREEN=0 -[ -z "$BBB_PROJECT_HOME" ] && BBB_PROJECT_HOME="${BBB_BELA_HOME}/projects/" -[ -z "$BBB_DEFAULT_PROJECT_NAME" ] && BBB_DEFAULT_PROJECT_NAME="scriptUploadedProject" +SCRIPTDIR=$(dirname "$0") +[ -z $SCRIPTDIR ] && SCRIPTDIR="./" || SCRIPTDIR=$SCRIPTDIR/ +. $SCRIPTDIR.bela_common || { echo "You must be in Bela/scripts to run these scripts" | exit 1; } usage() { diff -r 26b3b87437fb -r d9a4fc5357e7 scripts/set_startup.sh --- a/scripts/set_startup.sh Mon Jun 20 13:49:48 2016 +0100 +++ b/scripts/set_startup.sh Mon Jun 20 14:09:43 2016 +0100 @@ -3,16 +3,10 @@ # 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="~/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 -[ -z "$RUN_WITHOUT_SCREEN" ] && RUN_WITHOUT_SCREEN=0 -[ -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 +SCRIPTDIR=$(dirname "$0") +[ -z $SCRIPTDIR ] && SCRIPTDIR="./" || SCRIPTDIR=$SCRIPTDIR/ +. $SCRIPTDIR.bela_common || { echo "You must be in Bela/scripts to run these scripts" | exit 1; } + ENABLE_STARTUP=1 RUN_IN_LOOP=0 diff -r 26b3b87437fb -r d9a4fc5357e7 scripts/setup_ssh.sh --- a/scripts/setup_ssh.sh Mon Jun 20 13:49:48 2016 +0100 +++ b/scripts/setup_ssh.sh Mon Jun 20 14:09:43 2016 +0100 @@ -1,7 +1,8 @@ #!/bin/sh -[ -z "$BBB_HOSTNAME" ] && BBB_HOSTNAME="192.168.7.2" -[ -z "$BBB_USER" ] && BBB_USER="root" -[ -z "$BBB_HOST" ] && BBB_HOST="bbb" +SCRIPTDIR=$(dirname "$0") +[ -z $SCRIPTDIR ] && SCRIPTDIR="./" || SCRIPTDIR=$SCRIPTDIR/ +. $SCRIPTDIR.bela_common || { echo "You must be in Bela/scripts to run these scripts" | exit 1; } + CONFIG_FILENAME=$HOME/.ssh/config mkdir -p $HOME/.ssh # create the ssh folder if it does not exist printf "\nHost $BBB_HOST\nHostname $BBB_HOSTNAME\nUser $BBB_USER\nStrictHostKeyChecking=no\n\n" >> $HOME/.ssh/config diff -r 26b3b87437fb -r d9a4fc5357e7 scripts/stop_running.sh --- a/scripts/stop_running.sh Mon Jun 20 13:49:48 2016 +0100 +++ b/scripts/stop_running.sh Mon Jun 20 14:09:43 2016 +0100 @@ -2,18 +2,8 @@ # # 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="~/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 -[ -z "$RUN_WITHOUT_SCREEN" ] && RUN_WITHOUT_SCREEN=0 -[ -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 Bela run with -# these scripts; the second will catch any leftovers run other ways +SCRIPTDIR=$(dirname "$0") +[ -z $SCRIPTDIR ] && SCRIPTDIR="./" || SCRIPTDIR=$SCRIPTDIR/ +. $SCRIPTDIR.bela_common || { echo "You must be in Bela/scripts to run these scripts" | exit 1; } -BELA_AUDIO_THREAD_NAME=beaglert-audio ssh $BBB_ADDRESS make --no-print-directory -C $BBB_BELA_HOME stop