Skip to content

Commit 6dae5b2

Browse files
Add script for running on Raspberry Pi4 B
1 parent d8145ac commit 6dae5b2

1 file changed

Lines changed: 58 additions & 0 deletions

File tree

phoebus_arm32_pi4.sh

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
#!/bin/sh
2+
#
3+
# Phoebus launcher for Linux or Mac OS X
4+
5+
# When deploying, change "TOP"
6+
# to the absolute installation path
7+
# TOP="."
8+
THIS_SCRIPT="$(realpath "$0")";
9+
TOP="${THIS_SCRIPT%/*}";
10+
echo "Phoebus started at $(date)" >> /home/pi/phoebus-debug.log
11+
# Ideally, assert that Java is found
12+
# export JAVA_HOME=/opt/jdk-9
13+
# export PATH="$JAVA_HOME/bin:$PATH"
14+
15+
if [ -d "${TOP}/target" ]
16+
then
17+
TOP="$TOP/target"
18+
fi
19+
20+
if [ -d "${TOP}/update" ]
21+
then
22+
echo "Installing update..."
23+
cd ${TOP}
24+
rm -rf doc lib
25+
mv update/* .
26+
rmdir update
27+
echo "Updated."
28+
fi
29+
30+
31+
JAR=`echo ${TOP}/product-*.jar`
32+
echo $JAR
33+
# To get one instance, use server mode
34+
OPT="-server 4918"
35+
JDK_JAVA_OPTIONS=" -DCA_DISABLE_REPEATER=true"
36+
JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS -Dnashorn.args=--no-deprecation-warning"
37+
JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS -Djdk.gtk.verbose=false -Djdk.gtk.version=2 -Dprism.forceGPU=true"
38+
JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS -Dlogback.configurationFile=/home/train/epics-tools/setup/settings/logback.xml"
39+
JDK_JAVA_OPTIONS="$JDK_JAVA_OPTIONS -Dorg.csstudio.javafx.rtplot.update_counter=false"
40+
export JDK_JAVA_OPTIONS
41+
42+
43+
filter1="-help"
44+
filter2="-main"
45+
46+
firstarg=$1;
47+
48+
if test "${firstarg#*$filter1}" != "$firstarg"; then
49+
# Run MEDM converter etc. in foreground
50+
java -jar $JAR $OPT "$@"
51+
elif test "${firstarg#*$filter2}" != "$firstarg"; then
52+
exec java -jar $JAR $OPT "$@"
53+
else
54+
# Run UI as separate thread
55+
java -jar --module-path /usr/share/openjfx/lib --add-modules javafx.base,javafx.controls,javafx.fxml,javafx.graphics,javafx.media,javafx.web,javafx.swing $JAR $OPT "$@"
56+
fi
57+
sleep 10
58+
echo "Phoebus ended at $(date)" >> /home/pi/phoebus-debug.log

0 commit comments

Comments
 (0)