summaryrefslogtreecommitdiffstats
path: root/meta-xilinx-pynq/recipes-devtool/python/python3-pynq
diff options
context:
space:
mode:
authorChristian Kohn <christian.kohn@xilinx.com>2021-05-15 14:53:15 -0700
committerSai Hari Chandana Kalluri <chandana.kalluri@xilinx.com>2021-07-14 15:00:08 -0700
commit5a34028efb948bc05899b15c88951203221e61ab (patch)
tree43b1b89b7e8fd20776c89ef21efce1d39799891e /meta-xilinx-pynq/recipes-devtool/python/python3-pynq
parent328b6d4b49f5233f258a11936f136c53da54ad4a (diff)
downloadmeta-xilinx-5a34028efb948bc05899b15c88951203221e61ab.tar.gz
pynq: Package pl_server_init as part of pynq-overlay
Package the pl_server_init script as part of the pynq-overlay recipe instead of the python3-pynq recipe.
Diffstat (limited to 'meta-xilinx-pynq/recipes-devtool/python/python3-pynq')
-rw-r--r--meta-xilinx-pynq/recipes-devtool/python/python3-pynq/pl_server_init109
1 files changed, 0 insertions, 109 deletions
diff --git a/meta-xilinx-pynq/recipes-devtool/python/python3-pynq/pl_server_init b/meta-xilinx-pynq/recipes-devtool/python/python3-pynq/pl_server_init
deleted file mode 100644
index 8b13ae1f..00000000
--- a/meta-xilinx-pynq/recipes-devtool/python/python3-pynq/pl_server_init
+++ /dev/null
@@ -1,109 +0,0 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides:
4# Required-Start: $remote_fs $syslog
5# Required-Stop: $remote_fs $syslog
6# Default-Start: 2 3 4 5
7# Default-Stop: 0 1 6
8# Short-Description: Start daemon at boot time
9# Description: Enable service provided by daemon.
10### END INIT INFO
11
12dir=""
13cmd="start_pl_server.py"
14user=""
15
16name="pl_server"
17pid_file="/var/run/$name.pid"
18stdout_log="/var/log/$name.log"
19stderr_log="/var/log/$name.err"
20
21get_pid() {
22 cat "$pid_file"
23}
24
25is_running() {
26 [ -f "$pid_file" ] && (ps -o"pid" | grep '^ '`get_pid`'$') > /dev/null 2>&1
27}
28
29install_overlay() {
30if [ ! -e '/sys/kernel/config/device-tree/overlays/pynq' ]; then
31 modprobe uio_pdrv_genirq
32 if [ ! -e /proc/device-tree/__symbols__ ]; then
33 mkdir /sys/kernel/config/device-tree/overlays/pynq-symbols
34 cat /lib/firmware/pynq-symbols.dtbo > /sys/kernel/config/device-tree/overlays/pynq-symbols/dtbo
35 fi
36 mkdir /sys/kernel/config/device-tree/overlays/pynq
37 cat /lib/firmware/pynq.dtbo > /sys/kernel/config/device-tree/overlays/pynq/dtbo
38fi
39}
40
41case "$1" in
42 start)
43 if is_running; then
44 echo "Already started"
45 else
46 echo "Starting $name"
47 cd "$dir"
48 install_overlay
49 $cmd >> "$stdout_log" 2>> "$stderr_log" &
50 echo $! > "$pid_file"
51 if ! is_running; then
52 echo "Unable to start, see $stdout_log and $stderr_log"
53 exit 1
54 fi
55 fi
56 ;;
57 stop)
58 if is_running; then
59 echo -n "Stopping $name.."
60 kill `get_pid`
61 for i in 1 2 3 4 5 6 7 8 9 10
62 # for i in `seq 10`
63 do
64 if ! is_running; then
65 break
66 fi
67
68 echo -n "."
69 sleep 1
70 done
71 echo
72
73 if is_running; then
74 echo "Not stopped; may still be shutting down or shutdown may have failed"
75 exit 1
76 else
77 echo "Stopped"
78 if [ -f "$pid_file" ]; then
79 rm "$pid_file"
80 fi
81 fi
82 else
83 echo "Not running"
84 fi
85 ;;
86 restart)
87 $0 stop
88 if is_running; then
89 echo "Unable to stop, will not attempt to start"
90 exit 1
91 fi
92 $0 start
93 ;;
94 status)
95 if is_running; then
96 echo "Running"
97 else
98 echo "Stopped"
99 exit 1
100 fi
101 ;;
102 *)
103 echo "Usage: $0 {start|stop|restart|status}"
104 exit 1
105 ;;
106esac
107
108exit 0
109