Skip to contentSkip to conversation

linuxptp: Add recipe for linux ptp

PATCH Superseded Sam Nelson 2 participants 5 messages Feb 12, 2014 – Mar 2, 2014

v3 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Sam Nelson

author
#0 lore raw

PATCH v3 1/1 linuxptp: Add recipe for linux ptp

- linuxptp is an implementation of precision time protocol (PTP)

---
Change from previous patch
* Moved to recipes-connectivity directory
* Updated to use tarball from release
* Rename recipe to 1.3 version
* Added SRC_URI checksum
---

---
 .../recipes-connectivity/linuxptp/linuxptp_1.3.bb  |   22 ++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100755 meta-arago-extras/recipes-connectivity/linuxptp/linuxptp_1.3.bb
meta-arago-extras/recipes-connectivity/linuxptp/linuxptp_1.3.bb new file +22 -0
new file mode 100755
index 0000000..33ddb06
@@ -0,0 +1,22 @@
+DESCRIPTION = "This software is an implementation of the Precision Time Protocol (PTP) \
+according to IEEE standard 1588 for Linux"
+HOMEPAGE = "http://linuxptp.sourceforge.net/"
+SECTION = "console/network"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+DEPENDS += "virtual/kernel"
+PR = "r0"
+
+SRC_URI = "http://iweb.dl.sourceforge.net/project/linuxptp/v${PV}/linuxptp-${PV}.tgz"
+SRC_URI[md5sum] = "664706a86fe1413391d4536080548501"
+SRC_URI[sha256sum] = "b1651186689ef06e56add506bd9bb55a700ca56e3f92ba71d08f3ad12fad3085"
+
+inherit autotools 
+
+EXTRA_OEMAKE = "KBUILD_OUTPUT=${STAGING_KERNEL_DIR} CROSS_COMPILE=${TARGET_PREFIX} ARCH=${TARGET_ARCH}"
+
+do_install() {
+	install -d ${D}${bindir}/
+	install -c -m 755 ${S}/ptp4l ${D}${bindir}/
+}
+
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 3 lines · Sam Nelson

- linuxptp is an implementation of precision time protocol (PTP)

Ack, will push soon.

Quoted 47 lines

---
Change from previous patch
* Moved to recipes-connectivity directory
* Updated to use tarball from release
* Rename recipe to 1.3 version
* Added SRC_URI checksum
---

---
 .../recipes-connectivity/linuxptp/linuxptp_1.3.bb  |   22 ++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100755 meta-arago-extras/recipes-connectivity/linuxptp/linuxptp_1.3.bb
meta-arago-extras/recipes-connectivity/linuxptp/linuxptp_1.3.bb new file +22 -0
new file mode 100755
index 0000000..33ddb06
@@ -0,0 +1,22 @@
+DESCRIPTION = "This software is an implementation of the Precision Time Protocol (PTP) \
+according to IEEE standard 1588 for Linux"
+HOMEPAGE = "http://linuxptp.sourceforge.net/"
+SECTION = "console/network"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
+DEPENDS += "virtual/kernel"
+PR = "r0"
+
+SRC_URI = "http://iweb.dl.sourceforge.net/project/linuxptp/v${PV}/linuxptp-${PV}.tgz"
+SRC_URI[md5sum] = "664706a86fe1413391d4536080548501"
+SRC_URI[sha256sum] = "b1651186689ef06e56add506bd9bb55a700ca56e3f92ba71d08f3ad12fad3085"
+
+inherit autotools 
+
+EXTRA_OEMAKE = "KBUILD_OUTPUT=${STAGING_KERNEL_DIR} CROSS_COMPILE=${TARGET_PREFIX} ARCH=${TARGET_ARCH}"
+
+do_install() {
+	install -d ${D}${bindir}/
+	install -c -m 755 ${S}/ptp4l ${D}${bindir}/
+}
+
Signature · 6 lines
1.7.9.5

_______________________________________________
meta-arago mailing list
[email protected]
http://arago-project.org/cgi-bin/mailman/listinfo/meta-arago
#2 lore raw

Considering removing dependency of Kernel see my following comments inline.

Quoted 38 lines

-----Original Message-----
From: Dmytriyenko, Denys
Sent: Wednesday, February 12, 2014 1:38 PM
To: Nelson, Sam
Cc: [email protected]
Subject: Re: [meta-arago] [PATCH v3] linuxptp: Add recipe for linux ptp

Quoted 3 lines · Sam Nelson

- linuxptp is an implementation of precision time protocol (PTP)

Ack, will push soon.

Quoted 9 lines

---
Change from previous patch
* Moved to recipes-connectivity directory
* Updated to use tarball from release
* Rename recipe to 1.3 version
* Added SRC_URI checksum
---

---
 .../recipes-connectivity/linuxptp/linuxptp_1.3.bb  |   22

++++++++++++++++++++

Quoted 2 lines
 1 file changed, 22 insertions(+)
 create mode 100755 meta-arago-extras/recipes-

connectivity/linuxptp/linuxptp_1.3.bb

Review

Quoted 2 lines
(quoted diff) +0 -0

connectivity/linuxptp/linuxptp_1.3.bb b/meta-arago-extras/recipes- connectivity/linuxptp/linuxptp_1.3.bb

meta-arago-extras/recipes-connectivity/linuxptp/linuxptp_1.3.bb line 1

Quoted 6 lines

new file mode 100755
index 0000000..33ddb06

meta-arago-extras/recipes-connectivity/linuxptp/linuxptp_1.3.bb new file +1 -0
@@ -0,0 +1,22 @@
+DESCRIPTION = "This software is an implementation of the Precision Time

Protocol (PTP) \

Quoted 7 lines

meta-arago-extras/recipes-connectivity/linuxptp/linuxptp_1.3.bb

Quoted 5 lines
meta-arago-extras/recipes-connectivity/linuxptp/linuxptp_1.3.bb new file +5 -0
+according to IEEE standard 1588 for Linux"
+HOMEPAGE = "http://linuxptp.sourceforge.net/"
+SECTION = "console/network"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM =

"file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"

Quoted 1 line
meta-arago-extras/recipes-connectivity/linuxptp/linuxptp_1.3.bb new file +1 -0
+DEPENDS += "virtual/kernel"

[Sam] I am assuming this can be removed? Do I setup dependency on libc-linux headers? How can I do that.

Quoted 4 lines

meta-arago-extras/recipes-connectivity/linuxptp/linuxptp_1.3.bb

Quoted 3 lines
meta-arago-extras/recipes-connectivity/linuxptp/linuxptp_1.3.bb new file +3 -0
+PR = "r0"
+
+SRC_URI =

"http://iweb.dl.sourceforge.net/project/linuxptp/v${PV}/linuxptp-${PV}.tgz"

Quoted 8 lines

meta-arago-extras/recipes-connectivity/linuxptp/linuxptp_1.3.bb line 12

Quoted 2 lines
meta-arago-extras/recipes-connectivity/linuxptp/linuxptp_1.3.bb new file +2 -0
+SRC_URI[md5sum] = "664706a86fe1413391d4536080548501"
+SRC_URI[sha256sum] =

"b1651186689ef06e56add506bd9bb55a700ca56e3f92ba71d08f3ad12fad30 85"

meta-arago-extras/recipes-connectivity/linuxptp/linuxptp_1.3.bb

Quoted 4 lines
meta-arago-extras/recipes-connectivity/linuxptp/linuxptp_1.3.bb new file +4 -0
+
+inherit autotools
+
+EXTRA_OEMAKE = "KBUILD_OUTPUT=${STAGING_KERNEL_DIR}

[Sam] How can I remove this dependency and point to the libc-linux-headers? Especially the linux kernel root directory is used here. ( Can I use STAGING_DIR_TARGET? ). Appreciate your comments.

Quoted 14 lines

CROSS_COMPILE=${TARGET_PREFIX} ARCH=${TARGET_ARCH}"

Quoted 13 lines
meta-arago-extras/recipes-connectivity/linuxptp/linuxptp_1.3.bb new file +6 -1
+
+do_install() {
+	install -d ${D}${bindir}/
+	install -c -m 755 ${S}/ptp4l ${D}${bindir}/
+}
+
--

1.7.9.5

_______________________________________________
meta-arago mailing list
[email protected]
http://arago-project.org/cgi-bin/mailman/listinfo/meta-arago

#3 lore raw
Quoted 46 lines · Sam

Considering removing dependency of Kernel see my following comments inline.

Quoted 44 lines

-----Original Message-----
From: Dmytriyenko, Denys
Sent: Wednesday, February 12, 2014 1:38 PM
To: Nelson, Sam
Cc: [email protected]
Subject: Re: [meta-arago] [PATCH v3] linuxptp: Add recipe for linux ptp

Quoted 3 lines · Sam Nelson

- linuxptp is an implementation of precision time protocol (PTP)

Ack, will push soon.

Quoted 9 lines

---
Change from previous patch
* Moved to recipes-connectivity directory
* Updated to use tarball from release
* Rename recipe to 1.3 version
* Added SRC_URI checksum
---

---
 .../recipes-connectivity/linuxptp/linuxptp_1.3.bb  |   22

++++++++++++++++++++

Quoted 2 lines
 1 file changed, 22 insertions(+)
 create mode 100755 meta-arago-extras/recipes-

connectivity/linuxptp/linuxptp_1.3.bb

Review

Quoted 2 lines
(quoted diff) +0 -0

connectivity/linuxptp/linuxptp_1.3.bb b/meta-arago-extras/recipes- connectivity/linuxptp/linuxptp_1.3.bb

meta-arago-extras/recipes-connectivity/linuxptp/linuxptp_1.3.bb line 1

Quoted 6 lines

new file mode 100755
index 0000000..33ddb06

meta-arago-extras/recipes-connectivity/linuxptp/linuxptp_1.3.bb new file +1 -0
@@ -0,0 +1,22 @@
+DESCRIPTION = "This software is an implementation of the Precision Time

Protocol (PTP) \

meta-arago-extras/recipes-connectivity/linuxptp/linuxptp_1.3.bb

Quoted 5 lines
meta-arago-extras/recipes-connectivity/linuxptp/linuxptp_1.3.bb new file +5 -0
+according to IEEE standard 1588 for Linux"
+HOMEPAGE = "http://linuxptp.sourceforge.net/"
+SECTION = "console/network"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM =

"file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"

Quoted 3 lines
Quoted 1 line

meta-arago-extras/recipes-connectivity/linuxptp/linuxptp_1.3.bb line 7

Quoted 1 line
meta-arago-extras/recipes-connectivity/linuxptp/linuxptp_1.3.bb new file +1 -0
+DEPENDS += "virtual/kernel"

[Sam] I am assuming this can be removed? Do I setup dependency on libc-linux headers? How can I do that.

Yes, drop the DEPENDS completely.
Dependency on linux-libc-headers is implicit, as those are part of the system headers. Similar to eglibc, gcc and everything else you need for compiling the code - all those dependencies are taken care of automatically.

Quoted 8 lines
Quoted 8 lines

meta-arago-extras/recipes-connectivity/linuxptp/linuxptp_1.3.bb

Quoted 3 lines
meta-arago-extras/recipes-connectivity/linuxptp/linuxptp_1.3.bb new file +3 -0
+PR = "r0"
+
+SRC_URI =

"http://iweb.dl.sourceforge.net/project/linuxptp/v${PV}/linuxptp-${PV}.tgz"

meta-arago-extras/recipes-connectivity/linuxptp/linuxptp_1.3.bb line 12

Quoted 2 lines
meta-arago-extras/recipes-connectivity/linuxptp/linuxptp_1.3.bb new file +2 -0
+SRC_URI[md5sum] = "664706a86fe1413391d4536080548501"
+SRC_URI[sha256sum] =

"b1651186689ef06e56add506bd9bb55a700ca56e3f92ba71d08f3ad12fad30 85"

Quoted 8 lines
Quoted 4 lines

meta-arago-extras/recipes-connectivity/linuxptp/linuxptp_1.3.bb

Quoted 4 lines
meta-arago-extras/recipes-connectivity/linuxptp/linuxptp_1.3.bb new file +4 -0
+
+inherit autotools
+
+EXTRA_OEMAKE = "KBUILD_OUTPUT=${STAGING_KERNEL_DIR}

[Sam] How can I remove this dependency and point to the libc-linux-headers? Especially the linux kernel root directory is used here. ( Can I use STAGING_DIR_TARGET? ). Appreciate your comments.

Ok, so I ended up looking into their Makefile and what they try to do there with KBUILD_OUTPUT... Besides few errors in their script, what they try to do is to check couple header files for availability of specific features and at the end pass corresponding defines to their source code. When crosscompiling, your target kernel is different from host kernel, hence they try to locate the correct /usr/include/linux/net_tstamp.h just to see if it contains definition for HWTSTAMP_TX_ONESTEP_SYNC. But that header file hasn't changed in at least 5 years... They also check time.h to have clock_adjtime.
Anyway, it should be possible to short-cut those checks, but at the end they need to define these: -D_GNU_SOURCE -DHAVE_CLOCK_ADJTIME -DHAVE_ONESTEP_SYNC We can pass those to EXTRA_CFLAGS directly:

EXTRA_OEMAKE = "CROSS_COMPILE=${TARGET_PREFIX} ARCH=${TARGET_ARCH} \
		EXTRA_CFLAGS=\"-D_GNU_SOURCE -DHAVE_CLOCK_ADJTIME \
		-DHAVE_ONESTEP_SYNC\""
Quoted 14 lines
Quoted 14 lines

CROSS_COMPILE=${TARGET_PREFIX} ARCH=${TARGET_ARCH}"

Quoted 13 lines
meta-arago-extras/recipes-connectivity/linuxptp/linuxptp_1.3.bb new file +6 -1
+
+do_install() {
+	install -d ${D}${bindir}/
+	install -c -m 755 ${S}/ptp4l ${D}${bindir}/
+}
+
--

1.7.9.5

_______________________________________________
meta-arago mailing list
[email protected]
http://arago-project.org/cgi-bin/mailman/listinfo/meta-arago

#4 lore raw

Thanks Denys. I have sent an updated patch.

Quoted 125 lines

-----Original Message-----
From: Dmytriyenko, Denys
Sent: Friday, February 28, 2014 1:18 PM
To: Nelson, Sam
Cc: [email protected]
Subject: Re: [meta-arago] [PATCH v3] linuxptp: Add recipe for linux ptp

Quoted 1 line · Sam

Considering removing dependency of Kernel see my following comments

inline.

Quoted 29 lines
Quoted 29 lines

-----Original Message-----
From: Dmytriyenko, Denys
Sent: Wednesday, February 12, 2014 1:38 PM
To: Nelson, Sam
Cc: [email protected]
Subject: Re: [meta-arago] [PATCH v3] linuxptp: Add recipe for linux ptp

Quoted 3 lines · Sam Nelson

- linuxptp is an implementation of precision time protocol (PTP)

Ack, will push soon.

Quoted 9 lines

---
Change from previous patch
* Moved to recipes-connectivity directory
* Updated to use tarball from release
* Rename recipe to 1.3 version
* Added SRC_URI checksum
---

---
 .../recipes-connectivity/linuxptp/linuxptp_1.3.bb  |   22

++++++++++++++++++++

Quoted 2 lines
 1 file changed, 22 insertions(+)
 create mode 100755 meta-arago-extras/recipes-

connectivity/linuxptp/linuxptp_1.3.bb

Quoted 1 line
Quoted 7 lines
Quoted 7 lines

Review

Quoted 1 line
(quoted diff) +0 -0

connectivity/linuxptp/linuxptp_1.3.bb b/meta-arago-extras/recipes- connectivity/linuxptp/linuxptp_1.3.bb

meta-arago-extras/recipes-

Quoted 4 lines

new file mode 100755
index 0000000..33ddb06

meta-arago-extras/recipes- new file +0 -0

connectivity/linuxptp/linuxptp_1.3.bb

Quoted 2 lines
Quoted 2 lines

meta-arago-extras/recipes- line 1

Quoted 2 lines
meta-arago-extras/recipes- new file +1 -0
@@ -0,0 +1,22 @@
+DESCRIPTION = "This software is an implementation of the Precision

Time

Quoted 9 lines
Quoted 8 lines

Protocol (PTP) \

meta-arago-extras/recipes- line 6

Quoted 5 lines
meta-arago-extras/recipes- new file +5 -0
+according to IEEE standard 1588 for Linux"
+HOMEPAGE = "http://linuxptp.sourceforge.net/"
+SECTION = "console/network"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM =

"file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"

Quoted 1 line
meta-arago-extras/recipes- new file +1 -0
+DEPENDS += "virtual/kernel"

[Sam] I am assuming this can be removed? Do I setup dependency on libc-

linux

Quoted 1 line

headers? How can I do that.

Yes, drop the DEPENDS completely.
Dependency on linux-libc-headers is implicit, as those are part of the system headers. Similar to eglibc, gcc and everything else you need for compiling the
code - all those dependencies are taken care of automatically.

Quoted 4 lines
Quoted 4 lines

meta-arago-extras/recipes- line 10

Quoted 3 lines
meta-arago-extras/recipes- new file +3 -0
+PR = "r0"
+
+SRC_URI =

"http://iweb.dl.sourceforge.net/project/linuxptp/v${PV}/linuxptp-

${PV}.tgz"

Quoted 3 lines
Quoted 3 lines

meta-arago-extras/recipes- line 12

Quoted 2 lines
meta-arago-extras/recipes- new file +2 -0
+SRC_URI[md5sum] = "664706a86fe1413391d4536080548501"
+SRC_URI[sha256sum] =

"b1651186689ef06e56add506bd9bb55a700ca56e3f92ba71d08f3ad12fad30

Quoted 7 lines
Quoted 5 lines

85"

meta-arago-extras/recipes- line 16

Quoted 4 lines
meta-arago-extras/recipes- new file +4 -0
+
+inherit autotools
+
+EXTRA_OEMAKE = "KBUILD_OUTPUT=${STAGING_KERNEL_DIR}

[Sam] How can I remove this dependency and point to the libc-linux-

headers?

Quoted 2 lines

Especially the linux kernel root directory is used here. ( Can I use STAGING_DIR_TARGET? ). Appreciate your comments.

Ok, so I ended up looking into their Makefile and what they try to do there with KBUILD_OUTPUT... Besides few errors in their script, what they try to do is to check couple header files for availability of specific features and at the end pass corresponding defines to their source code. When crosscompiling,
your target kernel is different from host kernel, hence they try to locate the correct /usr/include/linux/net_tstamp.h just to see if it contains definition for HWTSTAMP_TX_ONESTEP_SYNC. But that header file hasn't changed in at least
5 years... They also check time.h to have clock_adjtime.
Anyway, it should be possible to short-cut those checks, but at the end they need to define these: -D_GNU_SOURCE -DHAVE_CLOCK_ADJTIME - DHAVE_ONESTEP_SYNC
We can pass those to EXTRA_CFLAGS directly:

EXTRA_OEMAKE = "CROSS_COMPILE=${TARGET_PREFIX}

ARCH=${TARGET_ARCH} \
		EXTRA_CFLAGS=\"-D_GNU_SOURCE -
DHAVE_CLOCK_ADJTIME \
		-DHAVE_ONESTEP_SYNC\""
Quoted 14 lines
Quoted 14 lines

CROSS_COMPILE=${TARGET_PREFIX} ARCH=${TARGET_ARCH}"

Quoted 13 lines
meta-arago-extras/recipes- new file +6 -1
+
+do_install() {
+	install -d ${D}${bindir}/
+	install -c -m 755 ${S}/ptp4l ${D}${bindir}/
+}
+
--

1.7.9.5

_______________________________________________
meta-arago mailing list
[email protected]
http://arago-project.org/cgi-bin/mailman/listinfo/meta-arago