diff options
Diffstat (limited to 'meta-oe/recipes-connectivity/linuxptp/linuxptp')
6 files changed, 98 insertions, 63 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/Use-cross-cpp-in-incdefs.patch b/meta-oe/recipes-connectivity/linuxptp/linuxptp/Use-cross-cpp-in-incdefs.patch deleted file mode 100644 index 876088649e..0000000000 --- a/meta-oe/recipes-connectivity/linuxptp/linuxptp/Use-cross-cpp-in-incdefs.patch +++ /dev/null @@ -1,26 +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: Use cross cpp in incdefs - -Use cross cpp incdefs.sh shell script since we are doing cross compiling -we need to ensure we use correct setttings from toolchain - -Upstream-Status: Inappropriate [OE-Specific] -Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- - - makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - ---- 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=$(${CPP} -Wp,-v -xc /dev/null 2>&1 >/dev/null | grep ^" /") - - # Look for clock_adjtime(). - for d in $dirs; do 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 55ce4c9a90..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 -pthread $(EXTRA_LDFLAGS) -@@ -43,7 +43,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/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 |