Skip to content

Commit

Permalink
Moved Salt-specific rootfs files to dedicated folder. make_salt.sh sc…
Browse files Browse the repository at this point in the history
…ript allows to make the board recognized as Salt (by writing to ~/.bela/belaconfig). Fixed board_detect Makefile.
  • Loading branch information
giuliomoro committed Jun 14, 2018
1 parent 0b4b080 commit e4faecc
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 16 deletions.
2 changes: 1 addition & 1 deletion resources/tools/board_detect/Makefile
@@ -1,5 +1,5 @@
board_detect:
gcc main.cpp -I../../../include board_detect.cpp -o board_detect
g++ main.cpp -I../../../include board_detect.cpp -o board_detect

install: board_detect
cp board_detect /usr/local/bin/
15 changes: 0 additions & 15 deletions scripts/make_examples_loop.sh

This file was deleted.

35 changes: 35 additions & 0 deletions scripts/make_salt.sh
@@ -0,0 +1,35 @@
#!/bin/bash
set -e

EXAMPLE_FOLDER=13-Salt
BELA_CONFIG=~/.bela/belaconfig
TMP_BELA_CONFIG=/tmp/belaconfig

uname -a 2>/dev/null | grep -q bela || {
echo "Error: this script must be run on the Bela board" >&2
exit 1;
}

cp -r resources/salt/rootfs/* /

mkdir -p `dirname $BELA_CONFIG`
touch $BELA_CONFIG
grep -v "\s*BOARD=" $BELA_CONFIG > $TMP_BELA_CONFIG || true
echo "BOARD=Salt" >> $TMP_BELA_CONFIG
mv $TMP_BELA_CONFIG $BELA_CONFIG

echo $1
if [ "$1" = "--examples" ]
then
for e in `cd examples/$EXAMPLE_FOLDER/ && ls`
do
if [ "$e" != salt-demo ]
then
PROJECTNAME=loop_$e
echo Building project $PROJECTNAME
make EXAMPLE=$EXAMPLE_FOLDER/$e PROJECT=$PROJECTNAME
fi
done
make -C ~/Bela startuploop
fi

0 comments on commit e4faecc

Please sign in to comment.