summaryrefslogtreecommitdiffstats
path: root/package/linuxptp/S65linuxptp
diff options
context:
space:
mode:
authorPetr Kulhavy <brain@jikos.cz>2017-06-07 20:44:29 +0200
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2017-06-11 15:57:16 +0200
commit09f1b8011b580ae4ce21b6f0e716d69b86efa26a (patch)
tree47b071c5d9aa072b5ae8a7f30a41f1af7b35c55a /package/linuxptp/S65linuxptp
parent8a3accb72cd36271b0eb3a683f6a9301253654d8 (diff)
downloadbuildroot-09f1b8011b580ae4ce21b6f0e716d69b86efa26a.tar.gz
buildroot-09f1b8011b580ae4ce21b6f0e716d69b86efa26a.zip
linuxptp: new package
Add the Linux PTP Project package. http://linuxptp.sourceforge.net/ The SysV and systemd init scripts start the daemon in slave-only mode on eth0 and synchronize the system clock to PTP. Signed-off-by: Petr Kulhavy <brain@jikos.cz> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/linuxptp/S65linuxptp')
-rwxr-xr-xpackage/linuxptp/S65linuxptp46
1 files changed, 46 insertions, 0 deletions
diff --git a/package/linuxptp/S65linuxptp b/package/linuxptp/S65linuxptp
new file mode 100755
index 0000000000..46b8921fdd
--- /dev/null
+++ b/package/linuxptp/S65linuxptp
@@ -0,0 +1,46 @@
+#!/bin/sh
+#
+# Start linuxptp
+#
+
+start() {
+ printf "Starting linuxptp daemon: "
+ start-stop-daemon -S -b -q -p /var/run/linuxptp-ptp4l.pid \
+ -x /usr/sbin/ptp4l -- -f /etc/linuxptp.cfg
+ [ $? = 0 ] && echo "OK" || echo "FAIL"
+
+ printf "Starting linuxptp system clock synchronization: "
+ start-stop-daemon -S -b -q -p /var/run/linuxptp-phc2sys.pid \
+ -x /usr/sbin/phc2sys -- -s eth0 -c CLOCK_REALTIME -w -S 1.0
+ [ $? = 0 ] && echo "OK" || echo "FAIL"
+}
+
+stop() {
+ printf "Stopping linuxptp system clock synchronization: "
+ start-stop-daemon -K -q -p /var/run/linuxptp-phc2sys.pid \
+ -x /usr/sbin/phc2sys
+ echo "OK"
+
+ printf "Stopping linuxptp daemon: "
+ start-stop-daemon -K -q -p /var/run/linuxptp-ptp4l.pid \
+ -x /usr/sbin/ptp4l
+ echo "OK"
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart|reload)
+ stop
+ start
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart}"
+ exit 1
+esac
+
+exit $?
OpenPOWER on IntegriCloud