Skip to contentSkip to conversation

linuxptp: new package

PATCH New Petr Kulhavy 2 participants 3 messages Jun 7, 2017 – Jun 15, 2017

lore
Share & tools
lore
#0 lore raw

PATCH v6 1/1 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.

--
Changes v5 -> v6:
- fix broken SYSV init-script path in makefile
- use current GIT head with fixed issues instead of the released version 1.8
- remove patches as they are now integrated in GIT

Changes v4 -> v5:
- move ptp4l parameters into a config file /etc/linuxptp.cfg
- add step threshold of 1 second into the configuration to quickly correct large errors
- add systemd service for phc2sys to sync the system clock

Changes v3 -> v4:
- rename init scripts to linuxptp
- use git format of the additional patches
- use the package name in menuconfig
- clean-up the clock_nanosleep patch

Changes v2 -> v3:
- add patches to fix build issues and enable compilation on all targets

Changes v1 -> v2:
- rename package from ptp4l to linuxptp
- add EXTRA_LDFLAGS to the build cmd (suggested by Danomi Manchego)
- sysV startup script: add restart/reload code, use PID file
- clean-up empty lines and formatting issues
- license uses SPDX license code
- update DEVELOPERS file

---
 DEVELOPERS                                     |  3 ++
 package/Config.in                              |  1 +
 package/linuxptp/Config.in                     | 13 ++++++++
 package/linuxptp/S65linuxptp                   | 46 ++++++++++++++++++++++++++
 package/linuxptp/linuxptp-system-clock.service | 11 ++++++
 package/linuxptp/linuxptp.cfg                  | 19 +++++++++++
 package/linuxptp/linuxptp.hash                 |  2 ++
 package/linuxptp/linuxptp.mk                   | 43 ++++++++++++++++++++++++
 package/linuxptp/linuxptp.service              | 11 ++++++
 9 files changed, 149 insertions(+)
 create mode 100644 package/linuxptp/Config.in
 create mode 100755 package/linuxptp/S65linuxptp
 create mode 100644 package/linuxptp/linuxptp-system-clock.service
 create mode 100644 package/linuxptp/linuxptp.cfg
 create mode 100644 package/linuxptp/linuxptp.hash
 create mode 100644 package/linuxptp/linuxptp.mk
 create mode 100644 package/linuxptp/linuxptp.service
DEVELOPERS +3 -0
index 8fbb69a..524a655 100644
@@ -1267,6 +1267,9 @@ F:	package/sdl2_gfx/
 F:	package/sdl2_image/
 F:	package/sdl2_ttf/
 
+N:	Petr Kulhavy <[email protected]>
+F:	package/linuxptp/
+
 N:	Petr Vorel <[email protected]>
 F:	package/linux-backports/
 F:	package/ltp-testsuite/
package/Config.in +1 -0
index d57813c..200ae00 100644
@@ -1597,6 +1597,7 @@ menu "Networking applications"
 	source "package/links/Config.in"
 	source "package/linphone/Config.in"
 	source "package/linux-zigbee/Config.in"
+	source "package/linuxptp/Config.in"
 	source "package/lldpd/Config.in"
 	source "package/lrzsz/Config.in"
 	source "package/macchanger/Config.in"
package/linuxptp/Config.in new file +13 -0
new file mode 100644
index 0000000..a5604ed
@@ -0,0 +1,13 @@
+config BR2_PACKAGE_LINUXPTP
+	bool "linuxptp"
+	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.
+
+	  http://linuxptp.sourceforge.net/
package/linuxptp/S65linuxptp new file +46 -0

46 lines not on this page · raw message

package/linuxptp/linuxptp-system-clock.service new file +11 -0
new file mode 100644
index 0000000..7327254
@@ -0,0 +1,11 @@
+[Unit]
+Description=Precision Time Protocol system clock synchronization
+After=syslog.target network.target
+
+[Service]
+ExecStart=/usr/sbin/phc2sys -s /dev/ptp0 -c CLOCK_REALTIME -w -S 1.0
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
+WantedBy=linuxptp.service
package/linuxptp/linuxptp.cfg new file +19 -0
new file mode 100644
index 0000000..f9d02e8
@@ -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]
+slaveOnly		1
+delay_mechanism		Auto
+network_transport	UDPv4
+time_stamping		hardware
+step_threshold		1.0
+
+[eth0]
package/linuxptp/linuxptp.hash new file +2 -0
new file mode 100644
index 0000000..ccda2d6
@@ -0,0 +1,2 @@
+# Locally computed:
+sha256	b8190ab71a99f1dc32847f33cb301d2464d3f9e5f4c51300d55589aff42e8b3f  linuxptp-97c351cafd7327fd28047580c9e2528a6f7e742b.tar.gz
package/linuxptp/linuxptp.mk new file +43 -0

43 lines not on this page · raw message

package/linuxptp/linuxptp.service new file +11 -0
new file mode 100644
index 0000000..f690430
@@ -0,0 +1,11 @@
+[Unit]
+Description=Precision Time Protocol daemon
+After=syslog.target network.target
+Wants=linuxptp-system-clock.service
+
+[Service]
+ExecStart=/usr/sbin/ptp4l -f /etc/linuxptp.cfg
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
Signature · 1 line
2.7.4
#1 lore raw

PATCH v6 1/1 linuxptp: new package

Hello,

Quoted 44 lines · Petr Kulhavy

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.

--
Changes v5 -> v6:
- fix broken SYSV init-script path in makefile
- use current GIT head with fixed issues instead of the released version 1.8
- remove patches as they are now integrated in GIT

Changes v4 -> v5:
- move ptp4l parameters into a config file /etc/linuxptp.cfg
- add step threshold of 1 second into the configuration to quickly correct large errors
- add systemd service for phc2sys to sync the system clock

Changes v3 -> v4:
- rename init scripts to linuxptp
- use git format of the additional patches
- use the package name in menuconfig
- clean-up the clock_nanosleep patch

Changes v2 -> v3:
- add patches to fix build issues and enable compilation on all targets

Changes v1 -> v2:
- rename package from ptp4l to linuxptp
- add EXTRA_LDFLAGS to the build cmd (suggested by Danomi Manchego)
- sysV startup script: add restart/reload code, use PID file
- clean-up empty lines and formatting issues
- license uses SPDX license code
- update DEVELOPERS file

---
 DEVELOPERS                                     |  3 ++
 package/Config.in                              |  1 +
 package/linuxptp/Config.in                     | 13 ++++++++
 package/linuxptp/S65linuxptp                   | 46 ++++++++++++++++++++++++++
 package/linuxptp/linuxptp-system-clock.service | 11 ++++++
 package/linuxptp/linuxptp.cfg                  | 19 +++++++++++
 package/linuxptp/linuxptp.hash                 |  2 ++
 package/linuxptp/linuxptp.mk                   | 43 ++++++++++++++++++++++++
 package/linuxptp/linuxptp.service              | 11 ++++++
Quoted 8 lines
 9 files changed, 149 insertions(+)
 create mode 100644 package/linuxptp/Config.in
 create mode 100755 package/linuxptp/S65linuxptp
 create mode 100644 package/linuxptp/linuxptp-system-clock.service
 create mode 100644 package/linuxptp/linuxptp.cfg
 create mode 100644 package/linuxptp/linuxptp.hash
 create mode 100644 package/linuxptp/linuxptp.mk
 create mode 100644 package/linuxptp/linuxptp.service

Applied to master, thanks a lot!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#2 lore raw

PATCH v6 1/1 linuxptp: new package

In reply to Petr Kulhavy

Hello,

Quoted 7 lines · Petr Kulhavy

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.

Now that your patch has been accepted and applied, it is being tested by our autobuild infrastructure, and numerous build failures have appeared:

http://autobuild.buildroot.net/?reason=linuxptp-97c351cafd7327fd28047580c9e2528a6f7e742b

You should normally have received a daily e-mail with the summary of those build failures.

Do you think you will get the chance of investigating those issues, and providing additional patches to fix them?

Thanks a lot,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com