diff options
Diffstat (limited to 'meta-oe/recipes-connectivity/linuxptp')
8 files changed, 160 insertions, 88 deletions
diff --git a/meta-oe/recipes-connectivity/linuxptp/linuxptp/0001-include-string.h-for-strncpy.patch b/meta-oe/recipes-connectivity/linuxptp/linuxptp/0001-include-string.h-for-strncpy.patch new file mode 100644 index 0000000000..b117dcf670 --- /dev/null +++ b/meta-oe/recipes-connectivity/linuxptp/linuxptp/0001-include-string.h-for-strncpy.patch @@ -0,0 +1,26 @@ +From 6120cee594c543d17ae015bc601012debcf57177 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Mon, 23 Oct 2023 10:43:42 +0100 +Subject: [PATCH] include string.h for strncpy() + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +Upstream-Status: Backport [master: 6120cee594c543d17ae015bc601012debcf57177] +--- + interface.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/interface.c b/interface.c +index 29229ad6f53d..9a83c36933e7 100644 +--- a/interface.c ++++ b/interface.c +@@ -5,6 +5,7 @@ + * @note SPDX-License-Identifier: GPL-2.0+ + */ + #include <stdlib.h> ++#include <string.h> + #include "interface.h" + + struct interface { +-- +2.34.1 + diff --git a/meta-oe/recipes-connectivity/linuxptp/linuxptp/0002-linuxptp-Use-CC-in-incdefs.sh.patch b/meta-oe/recipes-connectivity/linuxptp/linuxptp/0002-linuxptp-Use-CC-in-incdefs.sh.patch new file mode 100644 index 0000000000..3cf3a63b94 --- /dev/null +++ b/meta-oe/recipes-connectivity/linuxptp/linuxptp/0002-linuxptp-Use-CC-in-incdefs.sh.patch @@ -0,0 +1,48 @@ +From cffb4807ac0b9ff7aea2aa4f3842985b5363d184 Mon Sep 17 00:00:00 2001 +From: Luca Fancellu <luca.fancellu@arm.com> +Date: Mon, 23 Oct 2023 10:43:43 +0100 +Subject: [PATCH] linuxptp: Use ${CC} in incdefs.sh + +The Makefile is defining CC and incdefs.sh is using +${CROSS_COMPILE}cpp inside it, allowing both to use different +compilers depending on what the user pass during make invocation +as CC. + +Align them using ${CC} also inside incdefs.sh. + +Signed-off-by: Luca Fancellu <luca.fancellu@arm.com> +Upstream-Status: Backport [master: cffb4807ac0b9ff7aea2aa4f3842985b5363d184] +--- + incdefs.sh | 2 +- + makefile | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/incdefs.sh b/incdefs.sh +index a9e94f777f6b..391e63c7fac6 100755 +--- a/incdefs.sh ++++ b/incdefs.sh +@@ -27,7 +27,7 @@ user_flags() + printf " -D_GNU_SOURCE" + + # Get list of directories searched for header files. +- dirs=$(echo "" | ${CROSS_COMPILE}cpp -Wp,-v 2>&1 >/dev/null | grep ^" /") ++ dirs=$(${CC} -E -Wp,-v -xc /dev/null 2>&1 >/dev/null | grep ^" /") + + # Look for clock_adjtime(). + for d in $dirs; do +diff --git a/makefile b/makefile +index 3e3b8b35fc96..7fc5f6fb8fa8 100644 +--- a/makefile ++++ b/makefile +@@ -39,7 +39,7 @@ OBJECTS = $(OBJ) hwstamp_ctl.o nsm.o phc2sys.o phc_ctl.o pmc.o pmc_agent.o \ + SRC = $(OBJECTS:.o=.c) + DEPEND = $(OBJECTS:.o=.d) + srcdir := $(dir $(lastword $(MAKEFILE_LIST))) +-incdefs := $(shell $(srcdir)/incdefs.sh) ++incdefs := $(shell CC="$(CC)" $(srcdir)/incdefs.sh) + version := $(shell $(srcdir)/version.sh $(srcdir)) + VPATH = $(srcdir) + +-- +2.34.1 + diff --git a/meta-oe/recipes-connectivity/linuxptp/linuxptp/build-Allow-CC-and-prefix-to-be-overriden.patch b/meta-oe/recipes-connectivity/linuxptp/linuxptp/build-Allow-CC-and-prefix-to-be-overriden.patch deleted file mode 100644 index b1d96ae5a7..0000000000 --- a/meta-oe/recipes-connectivity/linuxptp/linuxptp/build-Allow-CC-and-prefix-to-be-overriden.patch +++ /dev/null @@ -1,37 +0,0 @@ -From af485c638c61fa883212ea424e676fbf90bee594 Mon Sep 17 00:00:00 2001 -From: Otavio Salvador <otavio@ossystems.com.br> -Date: Tue, 1 Jul 2014 17:37:31 -0300 -Subject: [PATCH] build: Allow CC and prefix to be overriden - -Upstream-Status: Pending - -Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> ---- - makefile | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/makefile b/makefile -index 22e7d0d..809cc8f 100644 ---- a/makefile -+++ b/makefile -@@ -18,7 +18,7 @@ - KBUILD_OUTPUT = - - DEBUG = --CC = $(CROSS_COMPILE)gcc -+CC ?= $(CROSS_COMPILE)gcc - VER = -DVER=$(version) - CFLAGS = -Wall $(VER) $(incdefs) $(DEBUG) $(EXTRA_CFLAGS) - LDLIBS = -lm -lrt $(EXTRA_LDFLAGS) -@@ -35,7 +35,7 @@ incdefs := $(shell $(srcdir)/incdefs.sh) - version := $(shell $(srcdir)/version.sh $(srcdir)) - VPATH = $(srcdir) - --prefix = /usr/local -+prefix ?= /usr/local - sbindir = $(prefix)/sbin - mandir = $(prefix)/man - man8dir = $(mandir)/man8 --- -1.7.10.4 - diff --git a/meta-oe/recipes-connectivity/linuxptp/linuxptp/no-incdefs-using-host-headers.patch b/meta-oe/recipes-connectivity/linuxptp/linuxptp/no-incdefs-using-host-headers.patch deleted file mode 100644 index 02dbb23465..0000000000 --- a/meta-oe/recipes-connectivity/linuxptp/linuxptp/no-incdefs-using-host-headers.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 8a4cad5e2f2cbb6a34bdc6e877fe499502b8c4c8 Mon Sep 17 00:00:00 2001 -From: Marcel Ziswiler <marcel.ziswiler@toradex.com> -Date: Fri, 23 Dec 2016 18:12:29 +0100 -Subject: [PATCH] linuxptp: no incdefs using host headers - -Avoid using host headers via incdefs.sh shell script. - -Signed-off-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> ---- - - makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/makefile b/makefile -index 8cdbd15..85174b8 100644 ---- a/makefile -+++ b/makefile -@@ -33,7 +33,7 @@ OBJECTS = $(OBJ) hwstamp_ctl.o phc2sys.o phc_ctl.o pmc.o pmc_common.o \ - SRC = $(OBJECTS:.o=.c) - DEPEND = $(OBJECTS:.o=.d) - srcdir := $(dir $(lastword $(MAKEFILE_LIST))) --incdefs := $(shell $(srcdir)/incdefs.sh) -+#incdefs := $(shell $(srcdir)/incdefs.sh) - version := $(shell $(srcdir)/version.sh $(srcdir)) - VPATH = $(srcdir) - --- -2.9.3 - diff --git a/meta-oe/recipes-connectivity/linuxptp/linuxptp/systemd/phc2sys@.service.in b/meta-oe/recipes-connectivity/linuxptp/linuxptp/systemd/phc2sys@.service.in new file mode 100644 index 0000000000..f66dd2d010 --- /dev/null +++ b/meta-oe/recipes-connectivity/linuxptp/linuxptp/systemd/phc2sys@.service.in @@ -0,0 +1,13 @@ +[Unit] +Description=Synchronize system clock or PTP hardware clock (PHC) +Documentation=man:phc2sys +Requires=ptp4l.service +After=ptp4l.service +Before=time-sync.target + +[Service] +Type=simple +ExecStart=@SBINDIR@/phc2sys -w -s %I + +[Install] +WantedBy=multi-user.target diff --git a/meta-oe/recipes-connectivity/linuxptp/linuxptp/systemd/ptp4l@.service.in b/meta-oe/recipes-connectivity/linuxptp/linuxptp/systemd/ptp4l@.service.in new file mode 100644 index 0000000000..2502181412 --- /dev/null +++ b/meta-oe/recipes-connectivity/linuxptp/linuxptp/systemd/ptp4l@.service.in @@ -0,0 +1,11 @@ +[Unit] +Description=Precision Time Protocol (PTP) service for %I +Documentation=man:ptp4l +After=sys-subsystem-net-devices-%i.device + +[Service] +Type=simple +ExecStart=@SBINDIR@/ptp4l -f @SYSCONFDIR@/linuxptp/ptp4l.conf -i %I + +[Install] +WantedBy=multi-user.target diff --git a/meta-oe/recipes-connectivity/linuxptp/linuxptp_2.0.bb b/meta-oe/recipes-connectivity/linuxptp/linuxptp_2.0.bb deleted file mode 100644 index eb262d36b2..0000000000 --- a/meta-oe/recipes-connectivity/linuxptp/linuxptp_2.0.bb +++ /dev/null @@ -1,22 +0,0 @@ -DESCRIPTION = "Precision Time Protocol (PTP) according to IEEE standard 1588 for Linux" -LICENSE = "GPLv2" -LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" - -SRC_URI = "http://sourceforge.net/projects/linuxptp/files/v${PV}/linuxptp-${PV}.tgz \ - file://build-Allow-CC-and-prefix-to-be-overriden.patch \ - file://no-incdefs-using-host-headers.patch \ - " - -SRC_URI[md5sum] = "d8bb7374943bb747db7786ac26f17f11" -SRC_URI[sha256sum] = "0a24d9401e87d4af023d201e234d91127d82c350daad93432106284aa9459c7d" - -EXTRA_OEMAKE = "ARCH=${TARGET_ARCH} \ - EXTRA_CFLAGS='-D_GNU_SOURCE -DHAVE_CLOCK_ADJTIME -DHAVE_POSIX_SPAWN -DHAVE_ONESTEP_SYNC ${CFLAGS}'" - -do_install () { - install -d ${D}/${bindir} - install -p ${S}/ptp4l ${D}/${bindir} - install -p ${S}/pmc ${D}/${bindir} - install -p ${S}/phc2sys ${D}/${bindir} - install -p ${S}/hwstamp_ctl ${D}/${bindir} -} diff --git a/meta-oe/recipes-connectivity/linuxptp/linuxptp_4.1.bb b/meta-oe/recipes-connectivity/linuxptp/linuxptp_4.1.bb new file mode 100644 index 0000000000..d1a73841a1 --- /dev/null +++ b/meta-oe/recipes-connectivity/linuxptp/linuxptp_4.1.bb @@ -0,0 +1,62 @@ +SUMMARY = "linuxptp package for linux" +DESCRIPTION = "Precision Time Protocol (PTP) according to IEEE standard 1588 \ +for Linux" +HOMEPAGE = "http://linuxptp.sourceforge.net/" +LICENSE = "GPL-2.0-only" +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" + +LINUXPTP_SRC_URI = "http://sourceforge.net/projects/linuxptp" + +SRC_URI = "${LINUXPTP_SRC_URI}/files/v4.1/linuxptp-${PV}.tgz \ + file://0001-include-string.h-for-strncpy.patch \ + file://0002-linuxptp-Use-CC-in-incdefs.sh.patch \ + file://systemd/phc2sys@.service.in \ + file://systemd/ptp4l@.service.in \ + " + +SRC_URI[md5sum] = "1db8699fc155965341759be5e5aad938" +SRC_URI[sha256sum] = "e1743d44f8208897e30895da3579e670ff919b914feb4b5a949f3e421ddde535" + +inherit systemd + +UPSTREAM_CHECK_URI = "${LINUXPTP_SRC_URI}/files/" +UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)/" + +EXTRA_OEMAKE = "CC='${CC}' EXTRA_CFLAGS='${CFLAGS}' mandir='${mandir}' \ + sbindir='${sbindir}'" + +export KBUILD_OUTPUT="${RECIPE_SYSROOT}" + +LINUXPTP_SYSTEMD_SERVICES = "phc2sys@.service ptp4l@.service" + +do_install() { + oe_runmake install DESTDIR=${D} + + # Install example configs from source tree + install -d ${D}${docdir}/${PN} + cp -R --no-dereference --preserve=mode,links ${S}/configs \ + ${D}${docdir}/${PN} + + # Install default configuration files + install -d ${D}/${sysconfdir}/linuxptp/ + install -m 644 ${S}/configs/default.cfg \ + ${D}${sysconfdir}/linuxptp/ptp4l.conf + + # Install systemd services + install -d ${D}/${systemd_unitdir}/system/ + for service in ${LINUXPTP_SYSTEMD_SERVICES}; do + sed -i -e 's,@SBINDIR@,${sbindir},g' \ + ${UNPACKDIR}/systemd/$service.in + sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' \ + ${UNPACKDIR}/systemd/$service.in + install -m 644 ${UNPACKDIR}/systemd/$service.in \ + ${D}/${systemd_unitdir}/system/$service + done +} + +SYSTEMD_SERVICE:${PN} = "${LINUXPTP_SYSTEMD_SERVICES}" +SYSTEMD_AUTO_ENABLE:${PN} = "disable" + +PACKAGES =+ "${PN}-configs" + +FILES:${PN}-configs += "${docdir}" |