* [Buildroot] [PATCH v3 0/1] package/linuxptp: make initscript options configurable
@ 2020-03-10 8:07 Heiko Thiery
2020-03-10 8:07 ` [Buildroot] [PATCH v3 1/3] " Heiko Thiery
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Heiko Thiery @ 2020-03-10 8:07 UTC (permalink / raw)
To: buildroot
After talking to Michael I've taken his patch and did a new version
with some modifications/improvements.
This series changes the SysV init script to match the prefered style
(used package/busybox/S01syslogd) for init scripts. Since in the old
init script 2 daemons were started this is split in two. The names for
the scripts now matches the daemons they start.
The systemd service scripts are also renamed to match the daemon names
(this is the same name as used in debian).
---
v2 -> v3
- fix the install hooks to match the renamed files
- rename the systemd service scripts to have the same name as for the
SysVinit scripts
- update the indentation of the hash file
v1 -> v2
- rename the init script from S65linuxptp to S65ptp4l
- move the phc2sys stuff to S66phc2sys
- use the style form package/busybox/S01syslogd as template
Heiko Thiery (1):
package/linuxptp: make initscript options configurable
package/linuxptp/S65linuxptp | 46 ----------------------------
package/linuxptp/S65ptp4l | 59 ++++++++++++++++++++++++++++++++++++
package/linuxptp/S66phc2sys | 59 ++++++++++++++++++++++++++++++++++++
3 files changed, 118 insertions(+), 46 deletions(-)
delete mode 100644 package/linuxptp/S65linuxptp
create mode 100644 package/linuxptp/S65ptp4l
create mode 100644 package/linuxptp/S66phc2sys
--
2.20.1
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH v3 1/3] package/linuxptp: make initscript options configurable
2020-03-10 8:07 [Buildroot] [PATCH v3 0/1] package/linuxptp: make initscript options configurable Heiko Thiery
@ 2020-03-10 8:07 ` Heiko Thiery
2020-03-12 13:43 ` Carlos Santos
2020-03-10 8:07 ` [Buildroot] [PATCH v3 2/3] package/linuxptp: rename systemd service scripts Heiko Thiery
2020-03-10 8:07 ` [Buildroot] [PATCH v3 3/3] package/linuxptp: update indentation of hash file Heiko Thiery
2 siblings, 1 reply; 11+ messages in thread
From: Heiko Thiery @ 2020-03-10 8:07 UTC (permalink / raw)
To: buildroot
The "package/busybox/S01sysklogd" is taken as template to change the
init script of the linuxptp daemon. The init script is split two parts
because there are 2 daemons (ptp4l and phc2sys).
Let the user supply its own options in /etc/default/ptp4l and
/etc/default/phc2sys.
This patch also fixes an issue with the creation of the pid file that is
needed to properly stop the daemon again.
Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
---
package/linuxptp/S65linuxptp | 46 ----------------------------
package/linuxptp/S65ptp4l | 59 ++++++++++++++++++++++++++++++++++++
package/linuxptp/S66phc2sys | 59 ++++++++++++++++++++++++++++++++++++
package/linuxptp/linuxptp.mk | 6 ++--
4 files changed, 122 insertions(+), 48 deletions(-)
delete mode 100644 package/linuxptp/S65linuxptp
create mode 100644 package/linuxptp/S65ptp4l
create mode 100644 package/linuxptp/S66phc2sys
diff --git a/package/linuxptp/S65linuxptp b/package/linuxptp/S65linuxptp
deleted file mode 100644
index 46b8921fdd..0000000000
--- a/package/linuxptp/S65linuxptp
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/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 $?
diff --git a/package/linuxptp/S65ptp4l b/package/linuxptp/S65ptp4l
new file mode 100644
index 0000000000..630c5e803b
--- /dev/null
+++ b/package/linuxptp/S65ptp4l
@@ -0,0 +1,59 @@
+#!/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"
+
+# ptp4l does not create a pidfile, so pass "-n" in the command line
+# and use "-m" to instruct start-stop-daemon to create one.
+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 $?
diff --git a/package/linuxptp/S66phc2sys b/package/linuxptp/S66phc2sys
new file mode 100644
index 0000000000..5d9e962b07
--- /dev/null
+++ b/package/linuxptp/S66phc2sys
@@ -0,0 +1,59 @@
+#!/bin/sh
+#
+# Start linuxptp
+#
+
+DAEMON="phc2sys"
+
+PIDFILE="/var/run/$DAEMON.pid"
+
+PHC2SYS_ARGS="-s eth0 -c CLOCK_REALTIME -w -S 1.0"
+
+# shellcheck source=/dev/null
+[ -r "/etc/default/phc2sys" ] && . "/etc/default/phc2sys"
+
+# phc2sys does not create a pidfile, so pass "-n" in the command line
+# and use "-m" to instruct start-stop-daemon to create one.
+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 $?
diff --git a/package/linuxptp/linuxptp.mk b/package/linuxptp/linuxptp.mk
index 97e4af7be7..ba57396f86 100644
--- a/package/linuxptp/linuxptp.mk
+++ b/package/linuxptp/linuxptp.mk
@@ -33,8 +33,10 @@ define LINUXPTP_INSTALL_TARGET_CMDS
endef
define LINUXPTP_INSTALL_INIT_SYSV
- $(INSTALL) -m 755 -D $(LINUXPTP_PKGDIR)/S65linuxptp \
- $(TARGET_DIR)/etc/init.d/S65linuxptp
+ $(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
--
2.20.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH v3 2/3] package/linuxptp: rename systemd service scripts
2020-03-10 8:07 [Buildroot] [PATCH v3 0/1] package/linuxptp: make initscript options configurable Heiko Thiery
2020-03-10 8:07 ` [Buildroot] [PATCH v3 1/3] " Heiko Thiery
@ 2020-03-10 8:07 ` Heiko Thiery
2020-03-12 16:37 ` Carlos Santos
2020-03-10 8:07 ` [Buildroot] [PATCH v3 3/3] package/linuxptp: update indentation of hash file Heiko Thiery
2 siblings, 1 reply; 11+ messages in thread
From: Heiko Thiery @ 2020-03-10 8:07 UTC (permalink / raw)
To: buildroot
Use the same name as for the SysVinit scripts. This name is also used in
debian.
linuxptp-system-clock.service -> phc2sys.service
linuxptp.service -> ptp4l.service
Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
---
package/linuxptp/linuxptp.mk | 8 ++++----
.../{linuxptp-system-clock.service => phc2sys.service} | 2 +-
package/linuxptp/{linuxptp.service => ptp4l.service} | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
rename package/linuxptp/{linuxptp-system-clock.service => phc2sys.service} (89%)
rename package/linuxptp/{linuxptp.service => ptp4l.service} (87%)
diff --git a/package/linuxptp/linuxptp.mk b/package/linuxptp/linuxptp.mk
index ba57396f86..921c55ad59 100644
--- a/package/linuxptp/linuxptp.mk
+++ b/package/linuxptp/linuxptp.mk
@@ -40,10 +40,10 @@ define LINUXPTP_INSTALL_INIT_SYSV
endef
define LINUXPTP_INSTALL_INIT_SYSTEMD
- $(INSTALL) -D -m 644 $(LINUXPTP_PKGDIR)/linuxptp.service \
- $(TARGET_DIR)/usr/lib/systemd/system/linuxptp.service
- $(INSTALL) -D -m 644 $(LINUXPTP_PKGDIR)/linuxptp-system-clock.service \
- $(TARGET_DIR)/usr/lib/systemd/system/linuxptp-system-clock.service
+ $(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))
diff --git a/package/linuxptp/linuxptp-system-clock.service b/package/linuxptp/phc2sys.service
similarity index 89%
rename from package/linuxptp/linuxptp-system-clock.service
rename to package/linuxptp/phc2sys.service
index 57beec4579..63b0ca23c3 100644
--- a/package/linuxptp/linuxptp-system-clock.service
+++ b/package/linuxptp/phc2sys.service
@@ -1,6 +1,6 @@
[Unit]
Description=Precision Time Protocol system clock synchronization
-After=linuxptp.service
+After=ptp4l.service
[Service]
ExecStart=/usr/sbin/phc2sys -s /dev/ptp0 -c CLOCK_REALTIME -w -S 1.0
diff --git a/package/linuxptp/linuxptp.service b/package/linuxptp/ptp4l.service
similarity index 87%
rename from package/linuxptp/linuxptp.service
rename to package/linuxptp/ptp4l.service
index 14e9814b06..07f0b68fad 100644
--- a/package/linuxptp/linuxptp.service
+++ b/package/linuxptp/ptp4l.service
@@ -3,7 +3,7 @@ Description=Precision Time Protocol daemon
After=syslog.target network.target
Before=time-sync.target
Wants=time-sync.target
-Wants=linuxptp-system-clock.service
+Wants=phc2sys.service
[Service]
ExecStart=/usr/sbin/ptp4l -f /etc/linuxptp.cfg
--
2.20.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH v3 3/3] package/linuxptp: update indentation of hash file
2020-03-10 8:07 [Buildroot] [PATCH v3 0/1] package/linuxptp: make initscript options configurable Heiko Thiery
2020-03-10 8:07 ` [Buildroot] [PATCH v3 1/3] " Heiko Thiery
2020-03-10 8:07 ` [Buildroot] [PATCH v3 2/3] package/linuxptp: rename systemd service scripts Heiko Thiery
@ 2020-03-10 8:07 ` Heiko Thiery
2020-03-12 12:24 ` Carlos Santos
2 siblings, 1 reply; 11+ messages in thread
From: Heiko Thiery @ 2020-03-10 8:07 UTC (permalink / raw)
To: buildroot
Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
---
package/linuxptp/linuxptp.hash | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/package/linuxptp/linuxptp.hash b/package/linuxptp/linuxptp.hash
index 5e6c7741cd..d04be1f655 100644
--- a/package/linuxptp/linuxptp.hash
+++ b/package/linuxptp/linuxptp.hash
@@ -1,9 +1,9 @@
# From https://sourceforge.net/projects/linuxptp/files/v2.0/
-sha1 592ca42c6146a79c1fcabed7c19fa7af4803d4f6 linuxptp-2.0.tgz
-md5 d8bb7374943bb747db7786ac26f17f11 linuxptp-2.0.tgz
+sha1 592ca42c6146a79c1fcabed7c19fa7af4803d4f6 linuxptp-2.0.tgz
+md5 d8bb7374943bb747db7786ac26f17f11 linuxptp-2.0.tgz
# Locally computed:
-sha256 0a24d9401e87d4af023d201e234d91127d82c350daad93432106284aa9459c7d linuxptp-2.0.tgz
+sha256 0a24d9401e87d4af023d201e234d91127d82c350daad93432106284aa9459c7d linuxptp-2.0.tgz
# Hash for license file:
-sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING
+sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING
--
2.20.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH v3 3/3] package/linuxptp: update indentation of hash file
2020-03-10 8:07 ` [Buildroot] [PATCH v3 3/3] package/linuxptp: update indentation of hash file Heiko Thiery
@ 2020-03-12 12:24 ` Carlos Santos
2020-03-12 12:35 ` Heiko Thiery
0 siblings, 1 reply; 11+ messages in thread
From: Carlos Santos @ 2020-03-12 12:24 UTC (permalink / raw)
To: buildroot
On Tue, Mar 10, 2020 at 5:08 AM Heiko Thiery <heiko.thiery@gmail.com> wrote:
>
> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
> ---
> package/linuxptp/linuxptp.hash | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/package/linuxptp/linuxptp.hash b/package/linuxptp/linuxptp.hash
> index 5e6c7741cd..d04be1f655 100644
> --- a/package/linuxptp/linuxptp.hash
> +++ b/package/linuxptp/linuxptp.hash
> @@ -1,9 +1,9 @@
> # From https://sourceforge.net/projects/linuxptp/files/v2.0/
> -sha1 592ca42c6146a79c1fcabed7c19fa7af4803d4f6 linuxptp-2.0.tgz
> -md5 d8bb7374943bb747db7786ac26f17f11 linuxptp-2.0.tgz
> +sha1 592ca42c6146a79c1fcabed7c19fa7af4803d4f6 linuxptp-2.0.tgz
> +md5 d8bb7374943bb747db7786ac26f17f11 linuxptp-2.0.tgz
>
> # Locally computed:
> -sha256 0a24d9401e87d4af023d201e234d91127d82c350daad93432106284aa9459c7d linuxptp-2.0.tgz
> +sha256 0a24d9401e87d4af023d201e234d91127d82c350daad93432106284aa9459c7d linuxptp-2.0.tgz
>
> # Hash for license file:
> -sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING
> +sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING
Is the current indentation causing any problem? If not, I'd leave this
change to be made in a package version bump.
--
Carlos Santos <unixmania@gmail.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH v3 3/3] package/linuxptp: update indentation of hash file
2020-03-12 12:24 ` Carlos Santos
@ 2020-03-12 12:35 ` Heiko Thiery
0 siblings, 0 replies; 11+ messages in thread
From: Heiko Thiery @ 2020-03-12 12:35 UTC (permalink / raw)
To: buildroot
Hi Carlos,
On 3/12/20 1:24 PM, Carlos Santos wrote:
> On Tue, Mar 10, 2020 at 5:08 AM Heiko Thiery <heiko.thiery@gmail.com> wrote:
>>
>> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
>> ---
>> package/linuxptp/linuxptp.hash | 8 ++++----
>> 1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/package/linuxptp/linuxptp.hash b/package/linuxptp/linuxptp.hash
>> index 5e6c7741cd..d04be1f655 100644
>> --- a/package/linuxptp/linuxptp.hash
>> +++ b/package/linuxptp/linuxptp.hash
>> @@ -1,9 +1,9 @@
>> # From https://sourceforge.net/projects/linuxptp/files/v2.0/
>> -sha1 592ca42c6146a79c1fcabed7c19fa7af4803d4f6 linuxptp-2.0.tgz
>> -md5 d8bb7374943bb747db7786ac26f17f11 linuxptp-2.0.tgz
>> +sha1 592ca42c6146a79c1fcabed7c19fa7af4803d4f6 linuxptp-2.0.tgz
>> +md5 d8bb7374943bb747db7786ac26f17f11 linuxptp-2.0.tgz
>>
>> # Locally computed:
>> -sha256 0a24d9401e87d4af023d201e234d91127d82c350daad93432106284aa9459c7d linuxptp-2.0.tgz
>> +sha256 0a24d9401e87d4af023d201e234d91127d82c350daad93432106284aa9459c7d linuxptp-2.0.tgz
>>
>> # Hash for license file:
>> -sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING
>> +sha256 8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643 COPYING
>
> Is the current indentation causing any problem? If not, I'd leave this
> change to be made in a package version bump.
>
No there is no problem. We just can ignore this commit.
--
Heiko
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH v3 1/3] package/linuxptp: make initscript options configurable
2020-03-10 8:07 ` [Buildroot] [PATCH v3 1/3] " Heiko Thiery
@ 2020-03-12 13:43 ` Carlos Santos
2020-03-12 14:08 ` Carlos Santos
0 siblings, 1 reply; 11+ messages in thread
From: Carlos Santos @ 2020-03-12 13:43 UTC (permalink / raw)
To: buildroot
On Tue, Mar 10, 2020 at 5:08 AM Heiko Thiery <heiko.thiery@gmail.com> wrote:
>
> The "package/busybox/S01sysklogd" is taken as template to change the
> init script of the linuxptp daemon. The init script is split two parts
> because there are 2 daemons (ptp4l and phc2sys).
>
> Let the user supply its own options in /etc/default/ptp4l and
> /etc/default/phc2sys.
>
> This patch also fixes an issue with the creation of the pid file that is
> needed to properly stop the daemon again.
>
> Signed-off-by: Michael Walle <michael@walle.cc>
> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
Tested-by: Carlos Santos <unixmania@gmail.com>
---
Testes on an Intel C3000 device
02:00.0 Ethernet controller: Intel Corporation I210 Gigabit
Network Connection (rev 03)
after adding
==> /etc/default/phc2sys <==
PHC2SYS_ARGS="-s enp2s0 -c CLOCK_REALTIME -w -S 1.0"
==> /etc/default/ptp4l <==
PTP4L_ARGS="-i enp2s0 -f /etc/linuxptp.cfg -m"
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH v3 1/3] package/linuxptp: make initscript options configurable
2020-03-12 13:43 ` Carlos Santos
@ 2020-03-12 14:08 ` Carlos Santos
2020-03-12 14:55 ` Heiko Thiery
0 siblings, 1 reply; 11+ messages in thread
From: Carlos Santos @ 2020-03-12 14:08 UTC (permalink / raw)
To: buildroot
On Thu, Mar 12, 2020 at 10:43 AM Carlos Santos <unixmania@gmail.com> wrote:
>
> On Tue, Mar 10, 2020 at 5:08 AM Heiko Thiery <heiko.thiery@gmail.com> wrote:
> >
> > The "package/busybox/S01sysklogd" is taken as template to change the
> > init script of the linuxptp daemon. The init script is split two parts
> > because there are 2 daemons (ptp4l and phc2sys).
> >
> > Let the user supply its own options in /etc/default/ptp4l and
> > /etc/default/phc2sys.
> >
> > This patch also fixes an issue with the creation of the pid file that is
> > needed to properly stop the daemon again.
> >
> > Signed-off-by: Michael Walle <michael@walle.cc>
> > Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
>
> Tested-by: Carlos Santos <unixmania@gmail.com>
> ---
> Testes on an Intel C3000 device
>
> 02:00.0 Ethernet controller: Intel Corporation I210 Gigabit
> Network Connection (rev 03)
>
> after adding
>
> ==> /etc/default/phc2sys <==
> PHC2SYS_ARGS="-s enp2s0 -c CLOCK_REALTIME -w -S 1.0"
>
> ==> /etc/default/ptp4l <==
> PTP4L_ARGS="-i enp2s0 -f /etc/linuxptp.cfg -m"
Hum, maybe it would be better just to use
PHC2SYS_ARGS="-s /dev/ptp0 -c CLOCK_REALTIME -w -S 1.0"
in S66phc2sys, matching phc2sys.service.
--
Carlos Santos <unixmania@gmail.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH v3 1/3] package/linuxptp: make initscript options configurable
2020-03-12 14:08 ` Carlos Santos
@ 2020-03-12 14:55 ` Heiko Thiery
2020-03-12 16:33 ` Carlos Santos
0 siblings, 1 reply; 11+ messages in thread
From: Heiko Thiery @ 2020-03-12 14:55 UTC (permalink / raw)
To: buildroot
Hi Carlos,
On 3/12/20 3:08 PM, Carlos Santos wrote:
> On Thu, Mar 12, 2020 at 10:43 AM Carlos Santos <unixmania@gmail.com> wrote:
>>
>> On Tue, Mar 10, 2020 at 5:08 AM Heiko Thiery <heiko.thiery@gmail.com> wrote:
>>>
>>> The "package/busybox/S01sysklogd" is taken as template to change the
>>> init script of the linuxptp daemon. The init script is split two parts
>>> because there are 2 daemons (ptp4l and phc2sys).
>>>
>>> Let the user supply its own options in /etc/default/ptp4l and
>>> /etc/default/phc2sys.
>>>
>>> This patch also fixes an issue with the creation of the pid file that is
>>> needed to properly stop the daemon again.
>>>
>>> Signed-off-by: Michael Walle <michael@walle.cc>
>>> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
>>
>> Tested-by: Carlos Santos <unixmania@gmail.com>
>> ---
>> Testes on an Intel C3000 device
>>
>> 02:00.0 Ethernet controller: Intel Corporation I210 Gigabit
>> Network Connection (rev 03)
>>
>> after adding
>>
>> ==> /etc/default/phc2sys <==
>> PHC2SYS_ARGS="-s enp2s0 -c CLOCK_REALTIME -w -S 1.0"
>>
>> ==> /etc/default/ptp4l <==
>> PTP4L_ARGS="-i enp2s0 -f /etc/linuxptp.cfg -m"
>
> Hum, maybe it would be better just to use
>
> PHC2SYS_ARGS="-s /dev/ptp0 -c CLOCK_REALTIME -w -S 1.0"
>
What about doing the that:
--- a/package/linuxptp/S66phc2sys
+++ b/package/linuxptp/S66phc2sys
@@ -7,7 +7,7 @@ DAEMON="phc2sys"
PIDFILE="/var/run/$DAEMON.pid"
-PHC2SYS_ARGS="-s eth0 -c CLOCK_REALTIME -w -S 1.0"
+PHC2SYS_ARGS="-a -r -S 1.0"
This will do an automatically configuration as default.
--
Heiko
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH v3 1/3] package/linuxptp: make initscript options configurable
2020-03-12 14:55 ` Heiko Thiery
@ 2020-03-12 16:33 ` Carlos Santos
0 siblings, 0 replies; 11+ messages in thread
From: Carlos Santos @ 2020-03-12 16:33 UTC (permalink / raw)
To: buildroot
On Thu, Mar 12, 2020 at 11:55 AM Heiko Thiery <heiko.thiery@gmail.com> wrote:
>
> Hi Carlos,
>
>
> On 3/12/20 3:08 PM, Carlos Santos wrote:
> > On Thu, Mar 12, 2020 at 10:43 AM Carlos Santos <unixmania@gmail.com> wrote:
> >>
> >> On Tue, Mar 10, 2020 at 5:08 AM Heiko Thiery <heiko.thiery@gmail.com> wrote:
> >>>
> >>> The "package/busybox/S01sysklogd" is taken as template to change the
> >>> init script of the linuxptp daemon. The init script is split two parts
> >>> because there are 2 daemons (ptp4l and phc2sys).
> >>>
> >>> Let the user supply its own options in /etc/default/ptp4l and
> >>> /etc/default/phc2sys.
> >>>
> >>> This patch also fixes an issue with the creation of the pid file that is
> >>> needed to properly stop the daemon again.
> >>>
> >>> Signed-off-by: Michael Walle <michael@walle.cc>
> >>> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
> >>
> >> Tested-by: Carlos Santos <unixmania@gmail.com>
> >> ---
> >> Testes on an Intel C3000 device
> >>
> >> 02:00.0 Ethernet controller: Intel Corporation I210 Gigabit
> >> Network Connection (rev 03)
> >>
> >> after adding
> >>
> >> ==> /etc/default/phc2sys <==
> >> PHC2SYS_ARGS="-s enp2s0 -c CLOCK_REALTIME -w -S 1.0"
> >>
> >> ==> /etc/default/ptp4l <==
> >> PTP4L_ARGS="-i enp2s0 -f /etc/linuxptp.cfg -m"
> >
> > Hum, maybe it would be better just to use
> >
> > PHC2SYS_ARGS="-s /dev/ptp0 -c CLOCK_REALTIME -w -S 1.0"
> >
>
> What about doing the that:
>
> --- a/package/linuxptp/S66phc2sys
> +++ b/package/linuxptp/S66phc2sys
> @@ -7,7 +7,7 @@ DAEMON="phc2sys"
>
> PIDFILE="/var/run/$DAEMON.pid"
>
> -PHC2SYS_ARGS="-s eth0 -c CLOCK_REALTIME -w -S 1.0"
> +PHC2SYS_ARGS="-a -r -S 1.0"
>
>
> This will do an automatically configuration as default.
Yeah, that works too.
--
Carlos Santos <unixmania@gmail.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH v3 2/3] package/linuxptp: rename systemd service scripts
2020-03-10 8:07 ` [Buildroot] [PATCH v3 2/3] package/linuxptp: rename systemd service scripts Heiko Thiery
@ 2020-03-12 16:37 ` Carlos Santos
0 siblings, 0 replies; 11+ messages in thread
From: Carlos Santos @ 2020-03-12 16:37 UTC (permalink / raw)
To: buildroot
On Tue, Mar 10, 2020 at 5:08 AM Heiko Thiery <heiko.thiery@gmail.com> wrote:
>
> Use the same name as for the SysVinit scripts. This name is also used in
> debian.
>
> linuxptp-system-clock.service -> phc2sys.service
> linuxptp.service -> ptp4l.service
>
> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
Tested-by: Carlos Santos <unixmania@gmail.com>
---
Tested on an Intel C3000 device
02:00.0 Ethernet controller: Intel Corporation I210 Gigabit
Network Connection (rev 03)
after adding
==> /etc/linuxptp.cfg <==
[global]
slaveOnly 1
delay_mechanism Auto
network_transport UDPv4
time_stamping hardware
step_threshold 1.0
[enp2s0]
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2020-03-12 16:37 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-10 8:07 [Buildroot] [PATCH v3 0/1] package/linuxptp: make initscript options configurable Heiko Thiery
2020-03-10 8:07 ` [Buildroot] [PATCH v3 1/3] " Heiko Thiery
2020-03-12 13:43 ` Carlos Santos
2020-03-12 14:08 ` Carlos Santos
2020-03-12 14:55 ` Heiko Thiery
2020-03-12 16:33 ` Carlos Santos
2020-03-10 8:07 ` [Buildroot] [PATCH v3 2/3] package/linuxptp: rename systemd service scripts Heiko Thiery
2020-03-12 16:37 ` Carlos Santos
2020-03-10 8:07 ` [Buildroot] [PATCH v3 3/3] package/linuxptp: update indentation of hash file Heiko Thiery
2020-03-12 12:24 ` Carlos Santos
2020-03-12 12:35 ` Heiko Thiery
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.