Skip to content

Commit

Permalink
Updated the bela_startup.service to look for /opt/Bela/bela_startup.s…
Browse files Browse the repository at this point in the history
…h instead
  • Loading branch information
giuliomoro committed May 30, 2018
1 parent bb16fff commit 7cf2bb3
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion misc/rootfs/lib/systemd/system/bela_startup.service
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Before=shutdown.target

[Service]
EnvironmentFile=/opt/Bela/startup_env
ExecStart=/usr/bin/stdbuf -i0 -e0 -o0 /usr/bin/make -C /root/Bela PROJECT=${PROJECT} CL="${ARGS}" runonly
ExecStart=/usr/bin/stdbuf -oL -eL /opt/Bela/bela_startup.sh
Type=simple
Restart=always

Expand Down
28 changes: 28 additions & 0 deletions misc/rootfs/opt/Bela/bela_startup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

CUSTOM_FILE=/opt/Bela/local/`basename $0`
[ -f $CUSTOM_FILE ] &&\
{ $CUSTOM_FILE; exit $?; }
[ -z "$BELA_HOME" ] && BELA_HOME=/root/Bela
[ "$ACTIVE" -eq 0 ] && {
echo "No Bela project set to run on boot" >& 2
# this should not happen, and if it does, we prevent it from happening
# again (till the next reboot!)
make -C "$BELA_HOME" stopstartup
exit 1
}

if [ "$PROJECT" = "" ]
then
# run all projects called loop_* in a loop
ls "$BELA_HOME"/projects/loop_* &>/dev/null &&\
while sleep 0.1; do
for PROJECT in "$BELA_HOME"/projects/loop_*; do
echo Running $PROJECT;
/usr/bin/make -C /root/Bela PROJECT=`basename "${PROJECT}"` CL="${ARGS}" runonly
done
done
else
/usr/bin/make -C "$BELA_HOME" PROJECT="$PROJECT" runonly CL="$ARGS"
fi

0 comments on commit 7cf2bb3

Please sign in to comment.