mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH 1/3] pps-tools: new package
@ 2021-05-31 11:57 Roland Hieber
  2021-05-31 11:57 ` [ptxdist] [PATCH 2/3] chrony: enable support for PPS devices Roland Hieber
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Roland Hieber @ 2021-05-31 11:57 UTC (permalink / raw)
  To: ptxdist; +Cc: Roland Hieber

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 ...le-fix-installation-to-empty-DESTDIR.patch | 40 ++++++++++
 patches/pps-tools-1.0.2/series                |  4 +
 rules/pps-tools.in                            | 10 +++
 rules/pps-tools.make                          | 80 +++++++++++++++++++
 4 files changed, 134 insertions(+)
 create mode 100644 patches/pps-tools-1.0.2/0001-Makefile-fix-installation-to-empty-DESTDIR.patch
 create mode 100644 patches/pps-tools-1.0.2/series
 create mode 100644 rules/pps-tools.in
 create mode 100644 rules/pps-tools.make

diff --git a/patches/pps-tools-1.0.2/0001-Makefile-fix-installation-to-empty-DESTDIR.patch b/patches/pps-tools-1.0.2/0001-Makefile-fix-installation-to-empty-DESTDIR.patch
new file mode 100644
index 000000000000..97498dc22e1b
--- /dev/null
+++ b/patches/pps-tools-1.0.2/0001-Makefile-fix-installation-to-empty-DESTDIR.patch
@@ -0,0 +1,40 @@
+From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+Date: Mon, 3 Dec 2018 13:55:02 +0100
+Subject: [PATCH] Makefile: fix installation to empty DESTDIR
+
+When DESTDIR is empty, or at least does not contain usr/bin or
+usr/include, the installation fails, because install does not create
+those intermediate directories:
+
+$ make DESTDIR=/tmp/koin install
+install -m 755 -t /tmp/koin/usr/bin ppsfind ppstest ppsctl ppswatch ppsldisc
+install: failed to access '/tmp/koin/usr/bin': No such file or directory
+
+Using the -D option of install fixes this:
+
+$ make DESTDIR=/tmp/koin install
+install -D -m 755 -t /tmp/koin/usr/bin ppsfind ppstest ppsctl ppswatch ppsldisc
+install -D -m 644 -t /tmp/koin/usr/include/sys timepps.h
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+Origin: upstream; https://github.com/redlab-i/pps-tools/commit/b3eae485a8c759d1ce1727076b2c287deb5f24e1
+Signed-off-by: Roland Hieber <rhi@pengutronix.de>
+---
+ Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 939466885e9f..30672f79585c 100644
+--- a/Makefile
++++ b/Makefile
+@@ -19,8 +19,8 @@ include .depend
+ endif
+ 
+ install : all
+-	install -m 755 -t $(DESTDIR)/usr/bin ppsfind $(TARGETS)
+-	install -m 644 -t $(DESTDIR)/usr/include/sys timepps.h
++	install -D -m 755 -t $(DESTDIR)/usr/bin ppsfind $(TARGETS)
++	install -D -m 644 -t $(DESTDIR)/usr/include/sys timepps.h
+ 
+ uninstall :
+ 	for f in $(TARGETS); do rm $(DESTDIR)/usr/bin/$$f; done
diff --git a/patches/pps-tools-1.0.2/series b/patches/pps-tools-1.0.2/series
new file mode 100644
index 000000000000..7b3c7762325f
--- /dev/null
+++ b/patches/pps-tools-1.0.2/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-Makefile-fix-installation-to-empty-DESTDIR.patch
+# eb24c32ce10c0f011f2d37488c8de58c  - git-ptx-patches magic
diff --git a/rules/pps-tools.in b/rules/pps-tools.in
new file mode 100644
index 000000000000..8b50b475de47
--- /dev/null
+++ b/rules/pps-tools.in
@@ -0,0 +1,10 @@
+## SECTION=shell_and_console
+
+config PPS_TOOLS
+	tristate
+	prompt "pps-tools"
+	select LIBC_M
+	help
+	  The pps-tools provide applications to configure and test pulse per
+	  second devices. They also provide the official PPS API header
+          timepps.h.
diff --git a/rules/pps-tools.make b/rules/pps-tools.make
new file mode 100644
index 000000000000..94b2c3b7dfd4
--- /dev/null
+++ b/rules/pps-tools.make
@@ -0,0 +1,80 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2020 by Daniel Glöckner <dg@emlix.com>
+# Copyright (C) 2021 Roland Hieber, Pengutronix <rhi@pengutronix.de>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_PPS_TOOLS) += pps-tools
+
+#
+# Paths and names
+#
+PPS_TOOLS_VERSION	:= 1.0.2
+PPS_TOOLS_MD5		:= 6eddfeb151cffe8751f4766e428b8eb7
+PPS_TOOLS		:= pps-tools-$(PPS_TOOLS_VERSION)
+PPS_TOOLS_SUFFIX	:= tar.gz
+PPS_TOOLS_URL		:= https://github.com/redlab-i/pps-tools/archive/v$(PPS_TOOLS_VERSION).$(PPS_TOOLS_SUFFIX)
+PPS_TOOLS_SOURCE	:= $(SRCDIR)/$(PPS_TOOLS).$(PPS_TOOLS_SUFFIX)
+PPS_TOOLS_DIR		:= $(BUILDDIR)/$(PPS_TOOLS)
+PPS_TOOLS_LICENSE	:= GPL-2.0-or-later
+PPS_TOOLS_LICENSE_FILES	:= \
+	file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
+	file://ppsctl.c;startline=6;endline=14;md5=681a7c053fa782c41658ac9fc7dd1579
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+PPS_TOOLS_CONF_TOOL	:= NO
+
+# ----------------------------------------------------------------------------
+# Compile
+# ----------------------------------------------------------------------------
+
+PPS_TOOLS_MAKE_ENV	:= $(CROSS_ENV)
+
+$(STATEDIR)/pps-tools.compile:
+	@$(call targetinfo)
+
+	@# Everything depends on .depends, which is made by but also included
+	@# in the Makefile, so make sure that "make install" does not rebuild
+	@# everything
+	@cd ${PPS_TOOLS_DIR} && \
+		${PPS_TOOLS_MAKE_ENV} \
+		${MAKE} .depend
+	@cd ${PPS_TOOLS_DIR} && \
+		${PPS_TOOLS_MAKE_ENV} \
+		${MAKE} ${PARALLELMFLAGS} all
+
+	@$(call touch)
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/pps-tools.targetinstall:
+	@$(call targetinfo)
+
+	@$(call install_init, pps-tools)
+	@$(call install_fixup, pps-tools,PRIORITY,optional)
+	@$(call install_fixup, pps-tools,SECTION,base)
+	@$(call install_fixup, pps-tools,AUTHOR,"Daniel Glöckner <dg@emlix.com>")
+	@$(call install_fixup, pps-tools,DESCRIPTION,missing)
+
+	@$(call install_copy, pps-tools, 0, 0, 0755, -, /usr/bin/ppsfind)
+	@$(call install_copy, pps-tools, 0, 0, 0755, -, /usr/bin/ppstest)
+	@$(call install_copy, pps-tools, 0, 0, 0755, -, /usr/bin/ppsctl)
+	@$(call install_copy, pps-tools, 0, 0, 0755, -, /usr/bin/ppswatch)
+	@$(call install_copy, pps-tools, 0, 0, 0755, -, /usr/bin/ppsldisc)
+
+	@$(call install_finish, pps-tools)
+
+	@$(call touch)
+
+# vim: syntax=make
-- 
2.29.2


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [ptxdist] [PATCH 2/3] chrony: enable support for PPS devices
  2021-05-31 11:57 [ptxdist] [PATCH 1/3] pps-tools: new package Roland Hieber
@ 2021-05-31 11:57 ` Roland Hieber
  2021-06-04  9:25   ` Michael Olbrich
  2021-05-31 11:57 ` [ptxdist] [PATCH 3/3] chrony: fix typo Roland Hieber
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Roland Hieber @ 2021-05-31 11:57 UTC (permalink / raw)
  To: ptxdist; +Cc: Roland Hieber

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 rules/chrony.in   | 8 ++++++++
 rules/chrony.make | 2 +-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/rules/chrony.in b/rules/chrony.in
index f50b864429b0..67a87277fc84 100644
--- a/rules/chrony.in
+++ b/rules/chrony.in
@@ -8,6 +8,7 @@ menuconfig CHRONY
 	select LIBCAP
 	select LIBSECCOMP	if CHRONY_SECCOMP
 	select NETTLE		if CHRONY_USE_NETTLE
+	select PPS_TOOLS	if CHRONY_PPS_REFCLK
 	help
 	  This will install the Chrony NTPD Daemon (chronyd)
 	  Chrony is a pair of programs which are used to maintain
@@ -44,6 +45,13 @@ config CHRONY_ADVANCED_COMMAND
 	  This allows getting advanced NTP time synchronization
 	  status monitoring from the service.
 
+config CHRONY_PPS_REFCLK
+	bool
+	prompt "Enable support for PPS devices"
+	help
+	  Pulse per second devices signal the start of every second
+	  with high precision.
+
 comment "install options   ---"
 
 config CHRONY_INSTALL_CHRONY_COMMAND
diff --git a/rules/chrony.make b/rules/chrony.make
index 7cf59f30560c..5edddf5b41a0 100644
--- a/rules/chrony.make
+++ b/rules/chrony.make
@@ -52,7 +52,7 @@ CHRONY_CONF_OPT		:= \
 	$(call ptx/ifdef, PTXCONF_CHRONY_ADVANCED_COMMAND,--enable-debug,) \
 	--disable-refclock \
 	--disable-phc \
-	--disable-pps \
+	$(call ptx/ifdef, PTXCONF_CHRONY_PPS_REFCLK,--enable-pps,--disable-pps) \
 	$(call ptx/ifdef, PTXCONF_GLOBAL_IPV6,,--disable-ipv6) \
 	--with-user=chrony \
 	$(call ptx/ifdef, PTXCONF_CHRONY_SECCOMP,--enable-scfilter,) \
-- 
2.29.2


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [ptxdist] [PATCH 3/3] chrony: fix typo
  2021-05-31 11:57 [ptxdist] [PATCH 1/3] pps-tools: new package Roland Hieber
  2021-05-31 11:57 ` [ptxdist] [PATCH 2/3] chrony: enable support for PPS devices Roland Hieber
@ 2021-05-31 11:57 ` Roland Hieber
  2021-05-31 12:56 ` [ptxdist] [PATCH 1/3] pps-tools: new package Alexander Dahl
  2021-06-04  9:23 ` Michael Olbrich
  3 siblings, 0 replies; 8+ messages in thread
From: Roland Hieber @ 2021-05-31 11:57 UTC (permalink / raw)
  To: ptxdist; +Cc: Roland Hieber

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 rules/chrony.make | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rules/chrony.make b/rules/chrony.make
index 5edddf5b41a0..bb7439a8be95 100644
--- a/rules/chrony.make
+++ b/rules/chrony.make
@@ -32,7 +32,7 @@ CHRONY_LICENSE_FILES	:= \
 # ----------------------------------------------------------------------------
 
 #
-# Chony is using a handcrafted configure script so normal ptx/endis
+# Chrony is using a handcrafted configure script so normal ptx/endis
 # and ptx/wwo are broken and causes "Unrecognized option".
 # CROSS_AUTOCONF_USR is not used as that adds 3 unrecognized options:
 # --libdir=, --build=, --host=
-- 
2.29.2


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ptxdist] [PATCH 1/3] pps-tools: new package
  2021-05-31 11:57 [ptxdist] [PATCH 1/3] pps-tools: new package Roland Hieber
  2021-05-31 11:57 ` [ptxdist] [PATCH 2/3] chrony: enable support for PPS devices Roland Hieber
  2021-05-31 11:57 ` [ptxdist] [PATCH 3/3] chrony: fix typo Roland Hieber
@ 2021-05-31 12:56 ` Alexander Dahl
  2021-05-31 12:58   ` Roland Hieber
  2021-06-04  9:23 ` Michael Olbrich
  3 siblings, 1 reply; 8+ messages in thread
From: Alexander Dahl @ 2021-05-31 12:56 UTC (permalink / raw)
  To: ptxdist; +Cc: Roland Hieber

Hello Roland,

we already had an internal package pps-tools from 2019 which we never 
published. Sorry for that additional work you had to do.

Am Montag, 31. Mai 2021, 13:57:06 CEST schrieb Roland Hieber:
> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
> ---
>  ...le-fix-installation-to-empty-DESTDIR.patch | 40 ++++++++++
>  patches/pps-tools-1.0.2/series                |  4 +
>  rules/pps-tools.in                            | 10 +++
>  rules/pps-tools.make                          | 80 +++++++++++++++++++
>  4 files changed, 134 insertions(+)
>  create mode 100644
> patches/pps-tools-1.0.2/0001-Makefile-fix-installation-to-empty-DESTDIR.pat
> ch create mode 100644 patches/pps-tools-1.0.2/series
>  create mode 100644 rules/pps-tools.in
>  create mode 100644 rules/pps-tools.make
> 
> diff --git
> a/patches/pps-tools-1.0.2/0001-Makefile-fix-installation-to-empty-DESTDIR.p
> atch
> b/patches/pps-tools-1.0.2/0001-Makefile-fix-installation-to-empty-DESTDIR.p
> atch new file mode 100644
> index 000000000000..97498dc22e1b
> --- /dev/null
> +++
> b/patches/pps-tools-1.0.2/0001-Makefile-fix-installation-to-empty-DESTDIR.p
> atch @@ -0,0 +1,40 @@
> +From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> +Date: Mon, 3 Dec 2018 13:55:02 +0100
> +Subject: [PATCH] Makefile: fix installation to empty DESTDIR
> +
> +When DESTDIR is empty, or at least does not contain usr/bin or
> +usr/include, the installation fails, because install does not create
> +those intermediate directories:
> +
> +$ make DESTDIR=/tmp/koin install
> +install -m 755 -t /tmp/koin/usr/bin ppsfind ppstest ppsctl ppswatch
> ppsldisc +install: failed to access '/tmp/koin/usr/bin': No such file or
> directory +
> +Using the -D option of install fixes this:
> +
> +$ make DESTDIR=/tmp/koin install
> +install -D -m 755 -t /tmp/koin/usr/bin ppsfind ppstest ppsctl ppswatch
> ppsldisc +install -D -m 644 -t /tmp/koin/usr/include/sys timepps.h
> +
> +Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> +Origin: upstream;
> https://github.com/redlab-i/pps-tools/commit/b3eae485a8c759d1ce1727076b2c28
> 7deb5f24e1 +Signed-off-by: Roland Hieber <rhi@pengutronix.de>
> +---
> + Makefile | 4 ++--
> + 1 file changed, 2 insertions(+), 2 deletions(-)
> +
> +diff --git a/Makefile b/Makefile
> +index 939466885e9f..30672f79585c 100644
> +--- a/Makefile
> ++++ b/Makefile
> +@@ -19,8 +19,8 @@ include .depend
> + endif
> +
> + install : all
> +-	install -m 755 -t $(DESTDIR)/usr/bin ppsfind $(TARGETS)
> +-	install -m 644 -t $(DESTDIR)/usr/include/sys timepps.h
> ++	install -D -m 755 -t $(DESTDIR)/usr/bin ppsfind $(TARGETS)
> ++	install -D -m 644 -t $(DESTDIR)/usr/include/sys timepps.h
> +
> + uninstall :
> + 	for f in $(TARGETS); do rm $(DESTDIR)/usr/bin/$$f; done
> diff --git a/patches/pps-tools-1.0.2/series b/patches/pps-tools-1.0.2/series
> new file mode 100644
> index 000000000000..7b3c7762325f
> --- /dev/null
> +++ b/patches/pps-tools-1.0.2/series
> @@ -0,0 +1,4 @@
> +# generated by git-ptx-patches
> +#tag:base --start-number 1
> +0001-Makefile-fix-installation-to-empty-DESTDIR.patch
> +# eb24c32ce10c0f011f2d37488c8de58c  - git-ptx-patches magic
> diff --git a/rules/pps-tools.in b/rules/pps-tools.in
> new file mode 100644
> index 000000000000..8b50b475de47
> --- /dev/null
> +++ b/rules/pps-tools.in
> @@ -0,0 +1,10 @@
> +## SECTION=shell_and_console
> +
> +config PPS_TOOLS
> +	tristate
> +	prompt "pps-tools"
> +	select LIBC_M
> +	help
> +	  The pps-tools provide applications to configure and test pulse per
> +	  second devices. They also provide the official PPS API header
> +          timepps.h.

Check whitespace in indentation. Last line should be 

<tab><space><space>tim…

Greets
Alex

> diff --git a/rules/pps-tools.make b/rules/pps-tools.make
> new file mode 100644
> index 000000000000..94b2c3b7dfd4
> --- /dev/null
> +++ b/rules/pps-tools.make
> @@ -0,0 +1,80 @@
> +# -*-makefile-*-
> +#
> +# Copyright (C) 2020 by Daniel Glöckner <dg@emlix.com>
> +# Copyright (C) 2021 Roland Hieber, Pengutronix <rhi@pengutronix.de>
> +#
> +# For further information about the PTXdist project and license conditions
> +# see the README file.
> +#
> +
> +#
> +# We provide this package
> +#
> +PACKAGES-$(PTXCONF_PPS_TOOLS) += pps-tools
> +
> +#
> +# Paths and names
> +#
> +PPS_TOOLS_VERSION	:= 1.0.2
> +PPS_TOOLS_MD5		:= 6eddfeb151cffe8751f4766e428b8eb7
> +PPS_TOOLS		:= pps-tools-$(PPS_TOOLS_VERSION)
> +PPS_TOOLS_SUFFIX	:= tar.gz
> +PPS_TOOLS_URL		:=
> https://github.com/redlab-i/pps-tools/archive/v$(PPS_TOOLS_VERSION).$(PPS_T
> OOLS_SUFFIX) +PPS_TOOLS_SOURCE	:= $(SRCDIR)/$(PPS_TOOLS).$(PPS_TOOLS_SUFFIX)
> +PPS_TOOLS_DIR		:= $(BUILDDIR)/$(PPS_TOOLS)
> +PPS_TOOLS_LICENSE	:= GPL-2.0-or-later
> +PPS_TOOLS_LICENSE_FILES	:= \
> +	file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
> +	file://ppsctl.c;startline=6;endline=14;md5=681a7c053fa782c41658ac9fc7dd157
> 9 +
> +#
> ---------------------------------------------------------------------------
> - +# Prepare
> +#
> ---------------------------------------------------------------------------
> - +
> +PPS_TOOLS_CONF_TOOL	:= NO
> +
> +#
> ---------------------------------------------------------------------------
> - +# Compile
> +#
> ---------------------------------------------------------------------------
> - +
> +PPS_TOOLS_MAKE_ENV	:= $(CROSS_ENV)
> +
> +$(STATEDIR)/pps-tools.compile:
> +	@$(call targetinfo)
> +
> +	@# Everything depends on .depends, which is made by but also included
> +	@# in the Makefile, so make sure that "make install" does not rebuild
> +	@# everything
> +	@cd ${PPS_TOOLS_DIR} && \
> +		${PPS_TOOLS_MAKE_ENV} \
> +		${MAKE} .depend
> +	@cd ${PPS_TOOLS_DIR} && \
> +		${PPS_TOOLS_MAKE_ENV} \
> +		${MAKE} ${PARALLELMFLAGS} all
> +
> +	@$(call touch)
> +
> +#
> ---------------------------------------------------------------------------
> - +# Target-Install
> +#
> ---------------------------------------------------------------------------
> - +
> +$(STATEDIR)/pps-tools.targetinstall:
> +	@$(call targetinfo)
> +
> +	@$(call install_init, pps-tools)
> +	@$(call install_fixup, pps-tools,PRIORITY,optional)
> +	@$(call install_fixup, pps-tools,SECTION,base)
> +	@$(call install_fixup, pps-tools,AUTHOR,"Daniel Glöckner <dg@emlix.com>")
> +	@$(call install_fixup, pps-tools,DESCRIPTION,missing)
> +
> +	@$(call install_copy, pps-tools, 0, 0, 0755, -, /usr/bin/ppsfind)
> +	@$(call install_copy, pps-tools, 0, 0, 0755, -, /usr/bin/ppstest)
> +	@$(call install_copy, pps-tools, 0, 0, 0755, -, /usr/bin/ppsctl)
> +	@$(call install_copy, pps-tools, 0, 0, 0755, -, /usr/bin/ppswatch)
> +	@$(call install_copy, pps-tools, 0, 0, 0755, -, /usr/bin/ppsldisc)
> +
> +	@$(call install_finish, pps-tools)
> +
> +	@$(call touch)
> +
> +# vim: syntax=make





_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ptxdist] [PATCH 1/3] pps-tools: new package
  2021-05-31 12:56 ` [ptxdist] [PATCH 1/3] pps-tools: new package Alexander Dahl
@ 2021-05-31 12:58   ` Roland Hieber
  0 siblings, 0 replies; 8+ messages in thread
From: Roland Hieber @ 2021-05-31 12:58 UTC (permalink / raw)
  To: Alexander Dahl; +Cc: ptxdist

On Mon, May 31, 2021 at 02:56:55PM +0200, Alexander Dahl wrote:
> Hello Roland,
> 
> we already had an internal package pps-tools from 2019 which we never 
> published. Sorry for that additional work you had to do.

No worries, I only picked it up from an existing BSP and did some
cleanup (see copyright lines…)

 - Roland
-- 
Roland Hieber, Pengutronix e.K.          | r.hieber@pengutronix.de     |
Steuerwalder Str. 21                     | https://www.pengutronix.de/ |
31137 Hildesheim, Germany                | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686         | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ptxdist] [PATCH 1/3] pps-tools: new package
  2021-05-31 11:57 [ptxdist] [PATCH 1/3] pps-tools: new package Roland Hieber
                   ` (2 preceding siblings ...)
  2021-05-31 12:56 ` [ptxdist] [PATCH 1/3] pps-tools: new package Alexander Dahl
@ 2021-06-04  9:23 ` Michael Olbrich
  3 siblings, 0 replies; 8+ messages in thread
From: Michael Olbrich @ 2021-06-04  9:23 UTC (permalink / raw)
  To: ptxdist; +Cc: Roland Hieber

On Mon, May 31, 2021 at 01:57:06PM +0200, Roland Hieber wrote:
> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
> ---
>  ...le-fix-installation-to-empty-DESTDIR.patch | 40 ++++++++++
>  patches/pps-tools-1.0.2/series                |  4 +
>  rules/pps-tools.in                            | 10 +++
>  rules/pps-tools.make                          | 80 +++++++++++++++++++
>  4 files changed, 134 insertions(+)
>  create mode 100644 patches/pps-tools-1.0.2/0001-Makefile-fix-installation-to-empty-DESTDIR.patch
>  create mode 100644 patches/pps-tools-1.0.2/series
>  create mode 100644 rules/pps-tools.in
>  create mode 100644 rules/pps-tools.make
> 
> diff --git a/patches/pps-tools-1.0.2/0001-Makefile-fix-installation-to-empty-DESTDIR.patch b/patches/pps-tools-1.0.2/0001-Makefile-fix-installation-to-empty-DESTDIR.patch
> new file mode 100644
> index 000000000000..97498dc22e1b
> --- /dev/null
> +++ b/patches/pps-tools-1.0.2/0001-Makefile-fix-installation-to-empty-DESTDIR.patch
> @@ -0,0 +1,40 @@
> +From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> +Date: Mon, 3 Dec 2018 13:55:02 +0100
> +Subject: [PATCH] Makefile: fix installation to empty DESTDIR
> +
> +When DESTDIR is empty, or at least does not contain usr/bin or
> +usr/include, the installation fails, because install does not create
> +those intermediate directories:
> +
> +$ make DESTDIR=/tmp/koin install
> +install -m 755 -t /tmp/koin/usr/bin ppsfind ppstest ppsctl ppswatch ppsldisc
> +install: failed to access '/tmp/koin/usr/bin': No such file or directory
> +
> +Using the -D option of install fixes this:
> +
> +$ make DESTDIR=/tmp/koin install
> +install -D -m 755 -t /tmp/koin/usr/bin ppsfind ppstest ppsctl ppswatch ppsldisc
> +install -D -m 644 -t /tmp/koin/usr/include/sys timepps.h
> +
> +Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> +Origin: upstream; https://github.com/redlab-i/pps-tools/commit/b3eae485a8c759d1ce1727076b2c287deb5f24e1
> +Signed-off-by: Roland Hieber <rhi@pengutronix.de>
> +---
> + Makefile | 4 ++--
> + 1 file changed, 2 insertions(+), 2 deletions(-)
> +
> +diff --git a/Makefile b/Makefile
> +index 939466885e9f..30672f79585c 100644
> +--- a/Makefile
> ++++ b/Makefile
> +@@ -19,8 +19,8 @@ include .depend
> + endif
> + 
> + install : all
> +-	install -m 755 -t $(DESTDIR)/usr/bin ppsfind $(TARGETS)
> +-	install -m 644 -t $(DESTDIR)/usr/include/sys timepps.h
> ++	install -D -m 755 -t $(DESTDIR)/usr/bin ppsfind $(TARGETS)
> ++	install -D -m 644 -t $(DESTDIR)/usr/include/sys timepps.h
> + 
> + uninstall :
> + 	for f in $(TARGETS); do rm $(DESTDIR)/usr/bin/$$f; done
> diff --git a/patches/pps-tools-1.0.2/series b/patches/pps-tools-1.0.2/series
> new file mode 100644
> index 000000000000..7b3c7762325f
> --- /dev/null
> +++ b/patches/pps-tools-1.0.2/series
> @@ -0,0 +1,4 @@
> +# generated by git-ptx-patches
> +#tag:base --start-number 1
> +0001-Makefile-fix-installation-to-empty-DESTDIR.patch
> +# eb24c32ce10c0f011f2d37488c8de58c  - git-ptx-patches magic
> diff --git a/rules/pps-tools.in b/rules/pps-tools.in
> new file mode 100644
> index 000000000000..8b50b475de47
> --- /dev/null
> +++ b/rules/pps-tools.in
> @@ -0,0 +1,10 @@
> +## SECTION=shell_and_console
> +
> +config PPS_TOOLS
> +	tristate
> +	prompt "pps-tools"
> +	select LIBC_M
> +	help
> +	  The pps-tools provide applications to configure and test pulse per
> +	  second devices. They also provide the official PPS API header
> +          timepps.h.
> diff --git a/rules/pps-tools.make b/rules/pps-tools.make
> new file mode 100644
> index 000000000000..94b2c3b7dfd4
> --- /dev/null
> +++ b/rules/pps-tools.make
> @@ -0,0 +1,80 @@
> +# -*-makefile-*-
> +#
> +# Copyright (C) 2020 by Daniel Glöckner <dg@emlix.com>
> +# Copyright (C) 2021 Roland Hieber, Pengutronix <rhi@pengutronix.de>
> +#
> +# For further information about the PTXdist project and license conditions
> +# see the README file.
> +#
> +
> +#
> +# We provide this package
> +#
> +PACKAGES-$(PTXCONF_PPS_TOOLS) += pps-tools
> +
> +#
> +# Paths and names
> +#
> +PPS_TOOLS_VERSION	:= 1.0.2
> +PPS_TOOLS_MD5		:= 6eddfeb151cffe8751f4766e428b8eb7
> +PPS_TOOLS		:= pps-tools-$(PPS_TOOLS_VERSION)
> +PPS_TOOLS_SUFFIX	:= tar.gz
> +PPS_TOOLS_URL		:= https://github.com/redlab-i/pps-tools/archive/v$(PPS_TOOLS_VERSION).$(PPS_TOOLS_SUFFIX)
> +PPS_TOOLS_SOURCE	:= $(SRCDIR)/$(PPS_TOOLS).$(PPS_TOOLS_SUFFIX)
> +PPS_TOOLS_DIR		:= $(BUILDDIR)/$(PPS_TOOLS)
> +PPS_TOOLS_LICENSE	:= GPL-2.0-or-later
> +PPS_TOOLS_LICENSE_FILES	:= \
> +	file://COPYING;md5=751419260aa954499f7abaabaa882bbe \
> +	file://ppsctl.c;startline=6;endline=14;md5=681a7c053fa782c41658ac9fc7dd1579
> +
> +# ----------------------------------------------------------------------------
> +# Prepare
> +# ----------------------------------------------------------------------------
> +
> +PPS_TOOLS_CONF_TOOL	:= NO
> +
> +# ----------------------------------------------------------------------------
> +# Compile
> +# ----------------------------------------------------------------------------
> +
> +PPS_TOOLS_MAKE_ENV	:= $(CROSS_ENV)
> +
> +$(STATEDIR)/pps-tools.compile:
> +	@$(call targetinfo)
> +
> +	@# Everything depends on .depends, which is made by but also included
> +	@# in the Makefile, so make sure that "make install" does not rebuild
> +	@# everything
> +	@cd ${PPS_TOOLS_DIR} && \
> +		${PPS_TOOLS_MAKE_ENV} \
> +		${MAKE} .depend
> +	@cd ${PPS_TOOLS_DIR} && \
> +		${PPS_TOOLS_MAKE_ENV} \
> +		${MAKE} ${PARALLELMFLAGS} all

	@$(call compile, PPS_TOOLS, .depend)
	@$(call world/compile, PPS_TOOLS)

> +
> +	@$(call touch)
> +
> +# ----------------------------------------------------------------------------
> +# Target-Install
> +# ----------------------------------------------------------------------------
> +
> +$(STATEDIR)/pps-tools.targetinstall:
> +	@$(call targetinfo)
> +
> +	@$(call install_init, pps-tools)
> +	@$(call install_fixup, pps-tools,PRIORITY,optional)
> +	@$(call install_fixup, pps-tools,SECTION,base)
> +	@$(call install_fixup, pps-tools,AUTHOR,"Daniel Glöckner <dg@emlix.com>")
> +	@$(call install_fixup, pps-tools,DESCRIPTION,missing)
> +
> +	@$(call install_copy, pps-tools, 0, 0, 0755, -, /usr/bin/ppsfind)
> +	@$(call install_copy, pps-tools, 0, 0, 0755, -, /usr/bin/ppstest)
> +	@$(call install_copy, pps-tools, 0, 0, 0755, -, /usr/bin/ppsctl)
> +	@$(call install_copy, pps-tools, 0, 0, 0755, -, /usr/bin/ppswatch)
> +	@$(call install_copy, pps-tools, 0, 0, 0755, -, /usr/bin/ppsldisc)
> +
> +	@$(call install_finish, pps-tools)
> +
> +	@$(call touch)
> +
> +# vim: syntax=make
> -- 
> 2.29.2
> 
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de
> To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ptxdist] [PATCH 2/3] chrony: enable support for PPS devices
  2021-05-31 11:57 ` [ptxdist] [PATCH 2/3] chrony: enable support for PPS devices Roland Hieber
@ 2021-06-04  9:25   ` Michael Olbrich
  2021-06-04 17:59     ` Roland Hieber
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Olbrich @ 2021-06-04  9:25 UTC (permalink / raw)
  To: ptxdist

On Mon, May 31, 2021 at 01:57:07PM +0200, Roland Hieber wrote:
> Signed-off-by: Roland Hieber <rhi@pengutronix.de>
> ---
>  rules/chrony.in   | 8 ++++++++
>  rules/chrony.make | 2 +-
>  2 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/rules/chrony.in b/rules/chrony.in
> index f50b864429b0..67a87277fc84 100644
> --- a/rules/chrony.in
> +++ b/rules/chrony.in
> @@ -8,6 +8,7 @@ menuconfig CHRONY
>  	select LIBCAP
>  	select LIBSECCOMP	if CHRONY_SECCOMP
>  	select NETTLE		if CHRONY_USE_NETTLE
> +	select PPS_TOOLS	if CHRONY_PPS_REFCLK
>  	help
>  	  This will install the Chrony NTPD Daemon (chronyd)
>  	  Chrony is a pair of programs which are used to maintain
> @@ -44,6 +45,13 @@ config CHRONY_ADVANCED_COMMAND
>  	  This allows getting advanced NTP time synchronization
>  	  status monitoring from the service.
>  
> +config CHRONY_PPS_REFCLK
> +	bool
> +	prompt "Enable support for PPS devices"
> +	help
> +	  Pulse per second devices signal the start of every second
> +	  with high precision.
> +
>  comment "install options   ---"
>  
>  config CHRONY_INSTALL_CHRONY_COMMAND
> diff --git a/rules/chrony.make b/rules/chrony.make
> index 7cf59f30560c..5edddf5b41a0 100644
> --- a/rules/chrony.make
> +++ b/rules/chrony.make
> @@ -52,7 +52,7 @@ CHRONY_CONF_OPT		:= \
>  	$(call ptx/ifdef, PTXCONF_CHRONY_ADVANCED_COMMAND,--enable-debug,) \
>  	--disable-refclock \
>  	--disable-phc \
> -	--disable-pps \
> +	$(call ptx/ifdef, PTXCONF_CHRONY_PPS_REFCLK,--enable-pps,--disable-pps) \

Use ptx/endis. Does this work? I think we use ptx/ifdef for the other
options because e.g. --enable-ipv6 does not work as expected, so we only
add the --disable-ipv6.

Michael

>  	$(call ptx/ifdef, PTXCONF_GLOBAL_IPV6,,--disable-ipv6) \
>  	--with-user=chrony \
>  	$(call ptx/ifdef, PTXCONF_CHRONY_SECCOMP,--enable-scfilter,) \
> -- 
> 2.29.2
> 
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de
> To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [ptxdist] [PATCH 2/3] chrony: enable support for PPS devices
  2021-06-04  9:25   ` Michael Olbrich
@ 2021-06-04 17:59     ` Roland Hieber
  0 siblings, 0 replies; 8+ messages in thread
From: Roland Hieber @ 2021-06-04 17:59 UTC (permalink / raw)
  To: ptxdist

On Fri, Jun 04, 2021 at 11:25:05AM +0200, Michael Olbrich wrote:
> On Mon, May 31, 2021 at 01:57:07PM +0200, Roland Hieber wrote:
> > diff --git a/rules/chrony.make b/rules/chrony.make
> > index 7cf59f30560c..5edddf5b41a0 100644
> > --- a/rules/chrony.make
> > +++ b/rules/chrony.make
> > @@ -52,7 +52,7 @@ CHRONY_CONF_OPT		:= \
> >  	$(call ptx/ifdef, PTXCONF_CHRONY_ADVANCED_COMMAND,--enable-debug,) \
> >  	--disable-refclock \
> >  	--disable-phc \
> > -	--disable-pps \
> > +	$(call ptx/ifdef, PTXCONF_CHRONY_PPS_REFCLK,--enable-pps,--disable-pps) \
> 
> Use ptx/endis. Does this work? I think we use ptx/ifdef for the other
> options because e.g. --enable-ipv6 does not work as expected, so we only
> add the --disable-ipv6.

Mh no, the PPS option is equally broken as the others, and --enable-pps
does not work at all. It seems I've not tested this enough 😬

 - Roland

-- 
Roland Hieber, Pengutronix e.K.          | r.hieber@pengutronix.de     |
Steuerwalder Str. 21                     | https://www.pengutronix.de/ |
31137 Hildesheim, Germany                | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686         | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-06-04 18:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-31 11:57 [ptxdist] [PATCH 1/3] pps-tools: new package Roland Hieber
2021-05-31 11:57 ` [ptxdist] [PATCH 2/3] chrony: enable support for PPS devices Roland Hieber
2021-06-04  9:25   ` Michael Olbrich
2021-06-04 17:59     ` Roland Hieber
2021-05-31 11:57 ` [ptxdist] [PATCH 3/3] chrony: fix typo Roland Hieber
2021-05-31 12:56 ` [ptxdist] [PATCH 1/3] pps-tools: new package Alexander Dahl
2021-05-31 12:58   ` Roland Hieber
2021-06-04  9:23 ` Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox