-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modify configuration files, add install script and rename daemon file
Added install script for the project and modified the unit file and the config files accordingly. Running the script loads the daemon and also compiles the examples with the bindings
- Loading branch information
1 parent
b363d09
commit 24418f5
Showing
4 changed files
with
74 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#!/bin/bash | ||
|
||
# Install script for prussd daemon service | ||
# To be run on the BeagleBone, from the cloned PRUSS-Bindings | ||
# git repository | ||
|
||
DIR=$(cd `dirname $BASH_SOURCE[0]` && pwd -P) | ||
|
||
pru_examples() { | ||
|
||
#paths needed to compile PRU firmware examples | ||
if [ ! -d /usr/share/ti/cgt-pru/bin ] ; | ||
then | ||
ln -s /usr/bin/ /usr/share/ti/cgt-pru/bin | ||
fi | ||
export PRU_CGT=/usr/share/ti/cgt-pru | ||
|
||
#run compilation scripts | ||
bash "${DIR}/examples/run.sh" blinky | ||
bash "${DIR}/examples/run.sh" rpmsg_echo | ||
bash "${DIR}/examples/run.sh" pru_pin_state_reader | ||
bash "${DIR}/examples/run.sh" pru1_to_pru0_to_arm | ||
bash "${DIR}/examples/run.sh" multi_threaded | ||
|
||
} | ||
|
||
systemd_service() { | ||
|
||
#copy the systemd unit configuration file | ||
cp -v "${DIR}/prussd/prussd.service" "/lib/systemd/system/prussd.service" | ||
|
||
#copy the config file | ||
cp -v "${DIR}/prussd/prussd.conf" "/etc/default/prussd.conf" | ||
|
||
#edit the unit file to replace DIR by the actual path | ||
sed -i -e "s:DIR:${DIR}:" "/lib/systemd/system/prussd.service" | ||
|
||
#edit the config file to include paths to firmware_examples | ||
sed -i -e "s:DIR:${DIR}:" "/etc/default/prussd.conf" | ||
|
||
#mark the daemon script as executable | ||
chmod a+x "${DIR}/prussd/prussd.py" | ||
|
||
#enable the service | ||
systemctl enable prussd.service | ||
|
||
#reload the systemctl daemons | ||
systemctl daemon-reload | ||
|
||
#start the prussd daemon | ||
systemctl start prussd.service | ||
|
||
} | ||
|
||
if [ $# -eq 0 ]; then | ||
pru_examples | ||
systemd_service | ||
fi | ||
|
||
if [ "$1" == "--examples" ] ; then | ||
pru_examples | ||
fi | ||
|
||
if [ "$1" == "--service" ] ; then | ||
systemd_service | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
FIRMWARE=DIR/examples/firmware_examples | ||
RPMSG_CHANNELS= |
0
prussd/prudaemon.py → prussd/prussd.py
100644 → 100755
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters