Initial Commit
- initial default booting image
This commit is contained in:
17
package/linuxptp/Config.in
Normal file
17
package/linuxptp/Config.in
Normal file
@@ -0,0 +1,17 @@
|
||||
config BR2_PACKAGE_LINUXPTP
|
||||
bool "linuxptp"
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS
|
||||
help
|
||||
The Linux PTP Project is the Precision Time Protocol
|
||||
implementation according to IEEE standard 1588 for Linux.
|
||||
|
||||
The dual design goals are to provide a robust implementation
|
||||
of the standard and to use the most relevant and modern
|
||||
Application Programming Interfaces (API) offered by the
|
||||
Linux kernel. Supporting legacy APIs and other platforms is
|
||||
not a goal.
|
||||
|
||||
https://linuxptp.nwtime.org/about/features/
|
||||
|
||||
comment "linuxptp needs a toolchain w/ threads"
|
||||
depends on !BR2_TOOLCHAIN_HAS_THREADS
|
||||
57
package/linuxptp/S65ptp4l
Normal file
57
package/linuxptp/S65ptp4l
Normal file
@@ -0,0 +1,57 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Start linuxptp
|
||||
#
|
||||
|
||||
DAEMON="ptp4l"
|
||||
|
||||
PIDFILE="/var/run/$DAEMON.pid"
|
||||
|
||||
PTP4L_ARGS="-f /etc/linuxptp.cfg"
|
||||
|
||||
# shellcheck source=/dev/null
|
||||
[ -r "/etc/default/ptp4l" ] && . "/etc/default/ptp4l"
|
||||
|
||||
start() {
|
||||
printf "Starting linuxptp daemon: "
|
||||
start-stop-daemon -S -b -q -m -p $PIDFILE \
|
||||
-x /usr/sbin/$DAEMON -- $PTP4L_ARGS
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return $status
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf "Stopping linuxptp daemon: "
|
||||
start-stop-daemon -K -q -p $PIDFILE
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
rm -f "$PIDFILE"
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return $status
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart|reload)
|
||||
stop
|
||||
start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $?
|
||||
57
package/linuxptp/S66phc2sys
Normal file
57
package/linuxptp/S66phc2sys
Normal file
@@ -0,0 +1,57 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Start linuxptp
|
||||
#
|
||||
|
||||
DAEMON="phc2sys"
|
||||
|
||||
PIDFILE="/var/run/$DAEMON.pid"
|
||||
|
||||
PHC2SYS_ARGS="-a -r -S 1.0"
|
||||
|
||||
# shellcheck source=/dev/null
|
||||
[ -r "/etc/default/phc2sys" ] && . "/etc/default/phc2sys"
|
||||
|
||||
start() {
|
||||
printf "Starting linuxptp system clock synchronization: "
|
||||
start-stop-daemon -S -b -q -m -p $PIDFILE \
|
||||
-x /usr/sbin/$DAEMON -- $PHC2SYS_ARGS
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return $status
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf "Stopping linuxptp system clock synchronization: "
|
||||
start-stop-daemon -K -q -p $PIDFILE
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
rm -f "$PIDFILE"
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return $status
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
restart|reload)
|
||||
stop
|
||||
start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart}"
|
||||
exit 1
|
||||
esac
|
||||
|
||||
exit $?
|
||||
19
package/linuxptp/linuxptp.cfg
Normal file
19
package/linuxptp/linuxptp.cfg
Normal file
@@ -0,0 +1,19 @@
|
||||
# LinuxPTP configuration file for synchronizing the system clock to
|
||||
# a remote PTP master in slave-only mode.
|
||||
#
|
||||
# By default synchronize time in slave-only mode using UDP and hardware time
|
||||
# stamps on eth0. If the difference to master is >1.0 second correct by
|
||||
# stepping the clock instead of adjusting the frequency.
|
||||
#
|
||||
# If you change the configuration don't forget to update the phc2sys
|
||||
# parameters accordingly in linuxptp-system-clock.service (systemd)
|
||||
# or the linuxptp SysV init script.
|
||||
|
||||
[global]
|
||||
clientOnly 1
|
||||
delay_mechanism Auto
|
||||
network_transport UDPv4
|
||||
time_stamping hardware
|
||||
step_threshold 1.0
|
||||
|
||||
[eth0]
|
||||
5
package/linuxptp/linuxptp.hash
Normal file
5
package/linuxptp/linuxptp.hash
Normal file
@@ -0,0 +1,5 @@
|
||||
# Locally computed:
|
||||
sha256 61757bc0a58d789b8fcbdddf56c88a0230597184a70dcb2ac05b4c6b619f7d5c linuxptp-4.4.tgz
|
||||
|
||||
# Hash for license file:
|
||||
sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING
|
||||
50
package/linuxptp/linuxptp.mk
Normal file
50
package/linuxptp/linuxptp.mk
Normal file
@@ -0,0 +1,50 @@
|
||||
################################################################################
|
||||
#
|
||||
# linuxptp
|
||||
#
|
||||
################################################################################
|
||||
|
||||
LINUXPTP_VERSION = 4.4
|
||||
LINUXPTP_SOURCE = linuxptp-$(LINUXPTP_VERSION).tgz
|
||||
LINUXPTP_SITE = https://downloads.nwtime.org/linuxptp
|
||||
LINUXPTP_LICENSE = GPL-2.0+
|
||||
LINUXPTP_LICENSE_FILES = COPYING
|
||||
LINUXPTP_CPE_ID_VALID = YES
|
||||
|
||||
LINUXPTP_MAKE_ENV = \
|
||||
$(TARGET_MAKE_ENV) \
|
||||
CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||
KBUILD_OUTPUT=$(STAGING_DIR)
|
||||
|
||||
LINUXPTP_MAKE_OPTS = \
|
||||
prefix=/usr \
|
||||
EXTRA_CFLAGS="$(TARGET_CFLAGS)" \
|
||||
EXTRA_LDFLAGS="$(TARGET_LDFLAGS)"
|
||||
|
||||
define LINUXPTP_BUILD_CMDS
|
||||
$(LINUXPTP_MAKE_ENV) $(MAKE) $(LINUXPTP_MAKE_OPTS) -C $(@D) all
|
||||
endef
|
||||
|
||||
define LINUXPTP_INSTALL_TARGET_CMDS
|
||||
$(LINUXPTP_MAKE_ENV) $(MAKE) $(LINUXPTP_MAKE_OPTS) \
|
||||
DESTDIR=$(TARGET_DIR) -C $(@D) install
|
||||
|
||||
$(INSTALL) -D -m 644 $(LINUXPTP_PKGDIR)/linuxptp.cfg \
|
||||
$(TARGET_DIR)/etc/linuxptp.cfg
|
||||
endef
|
||||
|
||||
define LINUXPTP_INSTALL_INIT_SYSV
|
||||
$(INSTALL) -m 755 -D $(LINUXPTP_PKGDIR)/S65ptp4l \
|
||||
$(TARGET_DIR)/etc/init.d/S65ptp4l
|
||||
$(INSTALL) -m 755 -D $(LINUXPTP_PKGDIR)/S66phc2sys \
|
||||
$(TARGET_DIR)/etc/init.d/S66phc2sys
|
||||
endef
|
||||
|
||||
define LINUXPTP_INSTALL_INIT_SYSTEMD
|
||||
$(INSTALL) -D -m 644 $(LINUXPTP_PKGDIR)/ptp4l.service \
|
||||
$(TARGET_DIR)/usr/lib/systemd/system/ptp4l.service
|
||||
$(INSTALL) -D -m 644 $(LINUXPTP_PKGDIR)/phc2sys.service \
|
||||
$(TARGET_DIR)/usr/lib/systemd/system/phc2sys.service
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
10
package/linuxptp/phc2sys.service
Normal file
10
package/linuxptp/phc2sys.service
Normal file
@@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=Precision Time Protocol system clock synchronization
|
||||
After=ptp4l.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/sbin/phc2sys -s /dev/ptp0 -c CLOCK_REALTIME -w -S 1.0
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
13
package/linuxptp/ptp4l.service
Normal file
13
package/linuxptp/ptp4l.service
Normal file
@@ -0,0 +1,13 @@
|
||||
[Unit]
|
||||
Description=Precision Time Protocol daemon
|
||||
After=syslog.target network.target
|
||||
Before=time-sync.target
|
||||
Wants=time-sync.target
|
||||
Wants=phc2sys.service
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/sbin/ptp4l -f /etc/linuxptp.cfg
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user