Skip to contentSkip to conversation

pps-tools: new package

PATCH Superseded Matt Weber 2 participants 3 messages Oct 16, 2014

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Matt Weber

author
#0 lore raw

PATCH v2 1/2 pps-tools: new package

From: Bryan Brinsko <[email protected]>

Added pps-tools package to add support to the ntpd for a pps source (requires timepps.h from pps-tools as part of ntpd build).

---
Changes v1 -> v2
- Adjusted newlines (Suggested Thomas P)
- Updated license to GPLv2+ (Suggested Thomas P)
- Build cmd to use config opts env (Suggested Thomas P)
- Install step to use pkg install (Suggested Thomas P)
- Github helper for download (Suggested Ryan B)

 package/Config.in              |  1 +
 package/pps-tools/Config.in    |  6 ++++++
 package/pps-tools/pps-tools.mk | 27 +++++++++++++++++++++++++++
 3 files changed, 34 insertions(+)
 create mode 100644 package/pps-tools/Config.in
 create mode 100644 package/pps-tools/pps-tools.mk
package/Config.in +1 -0
index 93e148d..8c109a5 100644
@@ -351,6 +351,7 @@ endif
 	source "package/parted/Config.in"
 	source "package/pciutils/Config.in"
 	source "package/picocom/Config.in"
+	source "package/pps-tools/Config.in"
 	source "package/pifmrds/Config.in"
 	source "package/read-edid/Config.in"
 	source "package/rng-tools/Config.in"
package/pps-tools/Config.in new file +6 -0
new file mode 100644
index 0000000..83308f4
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_PPS_TOOLS
+	bool "pps-tools"
+	help
+	  Pulse per second tools. Provides timepps.h and other PPS utilities.
+
+	  https://github.com/ago/pps-tools/
package/pps-tools/pps-tools.mk new file +27 -0
new file mode 100644
index 0000000..a77869a
@@ -0,0 +1,27 @@
+################################################################################
+#
+# pps-tools
+#
+################################################################################
+
+PPS_TOOLS_VERSION = 0deb9c7e135e9380a6d09e9d2e938a146bb698c8
+PPS_TOOLS_SITE = $(call github,ago,pps-tools,$(PPS_TOOLS_VERSION))
+PPS_TOOLS_INSTALL_STAGING = YES
+PPS_TOOLS_LICENSE = GPLv2+
+PPS_TOOLS_LICENSE_FILES = COPYING
+
+define PPS_TOOLS_BUILD_CMDS
+	$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) all
+endef
+
+define PPS_TOOLS_INSTALL_STAGING_CMDS
+	mkdir -p $(STAGING_DIR)/usr/include/sys $(STAGING_DIR)/usr/bin
+	$(MAKE) DESTDIR=$(STAGING_DIR) -C $(@D) install
+endef
+
+define PPS_TOOLS_INSTALL_TARGET_CMDS
+	mkdir -p $(TARGET_DIR)/usr/include/sys $(TARGET_DIR)/usr/bin
+	$(TARGET_CONFIGURE_OPTS) $(MAKE) DESTDIR=$(TARGET_DIR) -C $(@D) install
+endef
+
+$(eval $(generic-package))
Signature · 1 line
1.9.1
author
#1 lore raw

PATCH v2 2/2 ntp: Adding pps support to ntpd

From: Bryan Brinsko <[email protected]>

Added an option for the ntpd application to support pps inputs.

---
Changes v1 -> v2
- Updated Config.in option description (Suggested Thomas P)
- Added conf opts to disable PPS when not selected (Suggested Thomas P)

 package/ntp/Config.in | 7 +++++++
 package/ntp/ntp.mk    | 7 +++++++
 2 files changed, 14 insertions(+)
package/ntp/Config.in +7 -0
index 858a9ad..c92ae93 100644
@@ -34,6 +34,13 @@ config BR2_PACKAGE_NTP_NTPD
 	  system date and time in sync and optionally serving time and date
 	  information on the network via the NTP protocol.
 
+config BR2_PACKAGE_NTP_NTPD_ATOM_PPS
+	bool "PPS support"
+	depends on BR2_PACKAGE_NTP_NTPD
+	select BR2_PACKAGE_PPS_TOOLS
+	help
+	  Compile ntpd with the ability to use an ATOM PPS source.
+
 config BR2_PACKAGE_NTP_NTPDATE
 	bool "ntpdate"
 	help
package/ntp/ntp.mk +7 -0
index 7c2cb8e..bb950a1 100644
@@ -34,6 +34,13 @@ else
 	NTP_CONF_OPTS += --without-ntpsnmpd
 endif
 
+ifeq ($(BR2_PACKAGE_NTP_NTPD_ATOM_PPS),y)
+	NTP_CONF_OPTS += --enable-ATOM
+	NTP_DEPENDENCIES += pps-tools
+else
+	NTP_CONF_OPTS += --disable-ATOM
+endif
+
 define NTP_PATCH_FIXUPS
 	$(SED) "s,^#if.*__GLIBC__.*_BSD_SOURCE.*$$,#if 0," $(@D)/ntpd/refclock_pcf.c
 	$(SED) '/[[:space:](]rindex[[:space:]]*(/s/[[:space:]]*rindex[[:space:]]*(/ strrchr(/g' $(@D)/ntpd/*.c
Signature · 1 line
1.9.1
#2 lore raw

PATCH v2 1/2 pps-tools: new package

In reply to Matt Weber

Dear Matt Weber,

Quoted 10 lines · Matt Weber
package/pps-tools/pps-tools.mk new file +4 -0
new file mode 100644
index 0000000..a77869a
@@ -0,0 +1,27 @@
+################################################################################
+#
+# pps-tools
+#

package/pps-tools/pps-tools.mk line 14

Quoted 10 lines
package/pps-tools/pps-tools.mk new file +10 -0
+################################################################################
+
+PPS_TOOLS_VERSION = 0deb9c7e135e9380a6d09e9d2e938a146bb698c8
+PPS_TOOLS_SITE = $(call github,ago,pps-tools,$(PPS_TOOLS_VERSION))
+PPS_TOOLS_INSTALL_STAGING = YES
+PPS_TOOLS_LICENSE = GPLv2+
+PPS_TOOLS_LICENSE_FILES = COPYING
+
+define PPS_TOOLS_BUILD_CMDS
+	$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) all

We more commonly pass $(TARGET_CONFIGURE_OPTS) on the right hand side of $(MAKE), and pass $(TARGET_MAKE_ENV) in the environment, i.e on the left hand-side of $(MAKE).

package/pps-tools/pps-tools.mk line 19

Quoted 5 lines
package/pps-tools/pps-tools.mk new file +5 -0
+endef
+
+define PPS_TOOLS_INSTALL_STAGING_CMDS
+	mkdir -p $(STAGING_DIR)/usr/include/sys $(STAGING_DIR)/usr/bin
+	$(MAKE) DESTDIR=$(STAGING_DIR) -C $(@D) install

Not using $(TARGET_CONFIGURE_OPTS) here but you're using it in the target installation command. Either it's needed or not, but it should be the same for both cases.

Using $(TARGET_MAKE_ENV) is also recommended. Sorry I forgot to spot this in my earlier review.

Thomas

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