From patchwork Wed Oct 11 16:33:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Fancellu X-Patchwork-Id: 31998 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B95EBCDB46F for ; Wed, 11 Oct 2023 16:34:02 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.21327.1697042037101773037 for ; Wed, 11 Oct 2023 09:33:57 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: luca.fancellu@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4ABEF150C; Wed, 11 Oct 2023 09:34:37 -0700 (PDT) Received: from e125770.cambridge.arm.com (e125770.arm.com [10.1.199.1]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 05EB63F7A6; Wed, 11 Oct 2023 09:33:55 -0700 (PDT) From: Luca Fancellu To: openembedded-devel@lists.openembedded.org Cc: Diego.Sueiro@arm.com, Rahul.Singh@arm.com Subject: [meta-oe][PATCH 1/3] linuxptp: update linuxptp recipe to 4.1 Date: Wed, 11 Oct 2023 17:33:44 +0100 Message-Id: <20231011163346.1856498-2-luca.fancellu@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231011163346.1856498-1-luca.fancellu@arm.com> References: <20231011163346.1856498-1-luca.fancellu@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 11 Oct 2023 16:34:02 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/105427 Update linuxptp recipe to the new version, from 3.1.1 to 4.1. Remove one downstream patch that is already applied and update the remaining to remove merge issues. Signed-off-by: Luca Fancellu --- .../0001-include-string.h-for-strncpy.patch | 8 ++-- ...ditional-assignment-for-KBUILD_OUTPU.patch | 42 ------------------- .../linuxptp/Use-cross-cpp-in-incdefs.patch | 8 ++-- ...-Allow-CC-and-prefix-to-be-overriden.patch | 12 +++--- .../{linuxptp_3.1.1.bb => linuxptp_4.1.bb} | 22 ++++++---- 5 files changed, 26 insertions(+), 66 deletions(-) delete mode 100644 meta-oe/recipes-connectivity/linuxptp/linuxptp/0001-makefile-use-conditional-assignment-for-KBUILD_OUTPU.patch rename meta-oe/recipes-connectivity/linuxptp/{linuxptp_3.1.1.bb => linuxptp_4.1.bb} (59%) 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 index 60f2079d37ae..ae544699272f 100644 --- 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 @@ -1,4 +1,4 @@ -From d49b4fb8063ecd89617587e5ea566cc9da9393ef Mon Sep 17 00:00:00 2001 +From ecfc8e287eb6811e42c4e2800a913822f554d7c8 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 31 Aug 2022 19:09:18 -0700 Subject: [PATCH] include string.h for strncpy() @@ -6,12 +6,13 @@ Subject: [PATCH] include string.h for strncpy() Upstream-Status: Pending Signed-off-by: Khem Raj + --- interface.c | 1 + 1 file changed, 1 insertion(+) diff --git a/interface.c b/interface.c -index 65bdff0..5228db9 100644 +index 29229ad..9a83c36 100644 --- a/interface.c +++ b/interface.c @@ -5,6 +5,7 @@ @@ -22,6 +23,3 @@ index 65bdff0..5228db9 100644 #include "interface.h" struct interface { --- -2.37.3 - diff --git a/meta-oe/recipes-connectivity/linuxptp/linuxptp/0001-makefile-use-conditional-assignment-for-KBUILD_OUTPU.patch b/meta-oe/recipes-connectivity/linuxptp/linuxptp/0001-makefile-use-conditional-assignment-for-KBUILD_OUTPU.patch deleted file mode 100644 index fb5190652196..000000000000 --- a/meta-oe/recipes-connectivity/linuxptp/linuxptp/0001-makefile-use-conditional-assignment-for-KBUILD_OUTPU.patch +++ /dev/null @@ -1,42 +0,0 @@ -From dfd38cb29c0768692f886d3ab9158bd2b3132582 Mon Sep 17 00:00:00 2001 -From: Changqing Li -Date: Tue, 22 Nov 2022 15:20:48 +0800 -Subject: [PATCH] makefile: use conditional assignment for KBUILD_OUTPUT - -Refer [1],from make 4.4, all variables that are marked as export will -also be passed to the shell started by the shell function. use "=" will -make KBUILD_OUTPUT always empty for shell function, use "?=" to make -"export KBUILD_OUTPUT" in enrironment can work. - -[snip of 4.4 NEWS] -* WARNING: Backward-incompatibility! - Previously makefile variables marked as export were not exported to commands - started by the $(shell ...) function. Now, all exported variables are - exported to $(shell ...). -[snip] - -[1] https://git.savannah.gnu.org/cgit/make.git/tree/NEWS?h=4.4&id=ed493f6c9116cc217b99c2cfa6a95f15803235a2#n74 - -Upstream-Status: Submitted [linuxptp-devel@lists.sourceforge.net] - -Signed-off-by: Changqing Li ---- - makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/makefile b/makefile -index 529d8a0..3db60fa 100644 ---- a/makefile -+++ b/makefile -@@ -15,7 +15,7 @@ - # with this program; if not, write to the Free Software Foundation, Inc., - # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - --KBUILD_OUTPUT = -+KBUILD_OUTPUT ?= - - DEBUG = - CC ?= $(CROSS_COMPILE)gcc --- -2.25.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 index 876088649e3d..9c87851e48ef 100644 --- 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 @@ -1,4 +1,4 @@ -From 8a4cad5e2f2cbb6a34bdc6e877fe499502b8c4c8 Mon Sep 17 00:00:00 2001 +From be8808005772da48c052cf34a343a6d140541f6a Mon Sep 17 00:00:00 2001 From: Marcel Ziswiler Date: Fri, 23 Dec 2016 18:12:29 +0100 Subject: [PATCH] linuxptp: Use cross cpp in incdefs @@ -8,11 +8,13 @@ we need to ensure we use correct setttings from toolchain Upstream-Status: Inappropriate [OE-Specific] Signed-off-by: Khem Raj ---- - makefile | 2 +- +--- + incdefs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) +diff --git a/incdefs.sh b/incdefs.sh +index a9e94f7..dd1692f 100755 --- a/incdefs.sh +++ b/incdefs.sh @@ -27,7 +27,7 @@ user_flags() 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 index 55ce4c9a9015..d4d6fac0ee5c 100644 --- 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 @@ -1,4 +1,4 @@ -From af485c638c61fa883212ea424e676fbf90bee594 Mon Sep 17 00:00:00 2001 +From 886bca11ff8fcc55386b6e4397b13e64950f93fb Mon Sep 17 00:00:00 2001 From: Otavio Salvador Date: Tue, 1 Jul 2014 17:37:31 -0300 Subject: [PATCH] build: Allow CC and prefix to be overriden @@ -6,16 +6,17 @@ Subject: [PATCH] build: Allow CC and prefix to be overriden Upstream-Status: Pending Signed-off-by: Otavio Salvador + --- - makefile | 4 ++-- + makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/makefile b/makefile -index 22e7d0d..809cc8f 100644 +index 3e3b8b3..5c1a1f9 100644 --- a/makefile +++ b/makefile @@ -18,7 +18,7 @@ - KBUILD_OUTPUT = + KBUILD_OUTPUT ?= DEBUG = -CC = $(CROSS_COMPILE)gcc @@ -32,6 +33,3 @@ index 22e7d0d..809cc8f 100644 sbindir = $(prefix)/sbin mandir = $(prefix)/man man8dir = $(mandir)/man8 --- -1.7.10.4 - diff --git a/meta-oe/recipes-connectivity/linuxptp/linuxptp_3.1.1.bb b/meta-oe/recipes-connectivity/linuxptp/linuxptp_4.1.bb similarity index 59% rename from meta-oe/recipes-connectivity/linuxptp/linuxptp_3.1.1.bb rename to meta-oe/recipes-connectivity/linuxptp/linuxptp_4.1.bb index 5903cb38ca4e..0b559df8c3c1 100644 --- a/meta-oe/recipes-connectivity/linuxptp/linuxptp_3.1.1.bb +++ b/meta-oe/recipes-connectivity/linuxptp/linuxptp_4.1.bb @@ -1,19 +1,23 @@ -DESCRIPTION = "Precision Time Protocol (PTP) according to IEEE standard 1588 for Linux" +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" -SRC_URI = "http://sourceforge.net/projects/linuxptp/files/v3.1/linuxptp-${PV}.tgz \ +LINUXPTP_SRC_URI = "http://sourceforge.net/projects/linuxptp" + +SRC_URI = "${LINUXPTP_SRC_URI}/files/v4.1/linuxptp-${PV}.tgz \ file://build-Allow-CC-and-prefix-to-be-overriden.patch \ file://Use-cross-cpp-in-incdefs.patch \ file://0001-include-string.h-for-strncpy.patch \ - file://0001-makefile-use-conditional-assignment-for-KBUILD_OUTPU.patch \ " -UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/linuxptp/files/" -UPSTREAM_CHECK_REGEX = "(?P\d+(\.\d+)+)/" +SRC_URI[md5sum] = "1db8699fc155965341759be5e5aad938" +SRC_URI[sha256sum] = "e1743d44f8208897e30895da3579e670ff919b914feb4b5a949f3e421ddde535" -SRC_URI[sha256sum] = "94d6855f9b7f2d8e9b0ca6d384e3fae6226ce6fc012dbad02608bdef3be1c0d9" +UPSTREAM_CHECK_URI = "${LINUXPTP_SRC_URI}/files/" +UPSTREAM_CHECK_REGEX = "(?P\d+(\.\d+)+)/" EXTRA_OEMAKE = "ARCH=${TARGET_ARCH} EXTRA_CFLAGS='${CFLAGS}' mandir=${mandir}" @@ -24,10 +28,10 @@ do_install() { # Install example configs from source tree install -d ${D}${docdir}/${PN} - cp -R --no-dereference --preserve=mode,links ${S}/configs ${D}${docdir}/${PN} + cp -R --no-dereference --preserve=mode,links ${S}/configs \ + ${D}${docdir}/${PN} } PACKAGES =+ "${PN}-configs" -FILES:${PN}-configs = "${docdir}" -FILES:${PN}-doc = "${mandir}" +FILES:${PN}-configs += "${docdir}" From patchwork Wed Oct 11 16:33:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Fancellu X-Patchwork-Id: 31996 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB321CDB46D for ; Wed, 11 Oct 2023 16:34:02 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.21373.1697042037649833282 for ; Wed, 11 Oct 2023 09:33:57 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: luca.fancellu@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0E33C1515; Wed, 11 Oct 2023 09:34:38 -0700 (PDT) Received: from e125770.cambridge.arm.com (e125770.arm.com [10.1.199.1]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BD69A3F7A6; Wed, 11 Oct 2023 09:33:56 -0700 (PDT) From: Luca Fancellu To: openembedded-devel@lists.openembedded.org Cc: Diego.Sueiro@arm.com, Rahul.Singh@arm.com Subject: [meta-oe][PATCH 2/3] linuxptp: install default configuration file in sysconfdir Date: Wed, 11 Oct 2023 17:33:45 +0100 Message-Id: <20231011163346.1856498-3-luca.fancellu@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231011163346.1856498-1-luca.fancellu@arm.com> References: <20231011163346.1856498-1-luca.fancellu@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 11 Oct 2023 16:34:02 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/105428 Install a default configuration files to be used in ${sysconfdir}/linuxptp, the default.cfg file from linuxptp is used. Signed-off-by: Luca Fancellu --- meta-oe/recipes-connectivity/linuxptp/linuxptp_4.1.bb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/meta-oe/recipes-connectivity/linuxptp/linuxptp_4.1.bb b/meta-oe/recipes-connectivity/linuxptp/linuxptp_4.1.bb index 0b559df8c3c1..3c7efbdeca72 100644 --- a/meta-oe/recipes-connectivity/linuxptp/linuxptp_4.1.bb +++ b/meta-oe/recipes-connectivity/linuxptp/linuxptp_4.1.bb @@ -30,6 +30,11 @@ do_install() { 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 } PACKAGES =+ "${PN}-configs" From patchwork Wed Oct 11 16:33:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Fancellu X-Patchwork-Id: 31997 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99BF2CDB46B for ; Wed, 11 Oct 2023 16:34:02 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.21328.1697042038437941511 for ; Wed, 11 Oct 2023 09:33:58 -0700 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: luca.fancellu@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C5B611516; Wed, 11 Oct 2023 09:34:38 -0700 (PDT) Received: from e125770.cambridge.arm.com (e125770.arm.com [10.1.199.1]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 810773F7A6; Wed, 11 Oct 2023 09:33:57 -0700 (PDT) From: Luca Fancellu To: openembedded-devel@lists.openembedded.org Cc: Diego.Sueiro@arm.com, Rahul.Singh@arm.com Subject: [meta-oe][PATCH 3/3] linuxptp: add systemd services Date: Wed, 11 Oct 2023 17:33:46 +0100 Message-Id: <20231011163346.1856498-4-luca.fancellu@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231011163346.1856498-1-luca.fancellu@arm.com> References: <20231011163346.1856498-1-luca.fancellu@arm.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Wed, 11 Oct 2023 16:34:02 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-devel/message/105429 Add systemd services phc2sys@.service and ptp4l@.service, these services are taken from the Ubuntu/Debian linuxptp package. Update the recipe to install them when needed using the systemd bbclass, the services are disabled by default. Signed-off-by: Luca Fancellu --- .../linuxptp/linuxptp/systemd/phc2sys@.service | 13 +++++++++++++ .../linuxptp/linuxptp/systemd/ptp4l@.service | 11 +++++++++++ .../linuxptp/linuxptp_4.1.bb | 16 ++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 meta-oe/recipes-connectivity/linuxptp/linuxptp/systemd/phc2sys@.service create mode 100644 meta-oe/recipes-connectivity/linuxptp/linuxptp/systemd/ptp4l@.service diff --git a/meta-oe/recipes-connectivity/linuxptp/linuxptp/systemd/phc2sys@.service b/meta-oe/recipes-connectivity/linuxptp/linuxptp/systemd/phc2sys@.service new file mode 100644 index 000000000000..dd2512bdca11 --- /dev/null +++ b/meta-oe/recipes-connectivity/linuxptp/linuxptp/systemd/phc2sys@.service @@ -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=/usr/sbin/phc2sys -w -s %I + +[Install] +WantedBy=multi-user.target diff --git a/meta-oe/recipes-connectivity/linuxptp/linuxptp/systemd/ptp4l@.service b/meta-oe/recipes-connectivity/linuxptp/linuxptp/systemd/ptp4l@.service new file mode 100644 index 000000000000..1bad2d72df6b --- /dev/null +++ b/meta-oe/recipes-connectivity/linuxptp/linuxptp/systemd/ptp4l@.service @@ -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=/usr/sbin/ptp4l -f /etc/linuxptp/ptp4l.conf -i %I + +[Install] +WantedBy=multi-user.target diff --git a/meta-oe/recipes-connectivity/linuxptp/linuxptp_4.1.bb b/meta-oe/recipes-connectivity/linuxptp/linuxptp_4.1.bb index 3c7efbdeca72..95ed76e621e6 100644 --- a/meta-oe/recipes-connectivity/linuxptp/linuxptp_4.1.bb +++ b/meta-oe/recipes-connectivity/linuxptp/linuxptp_4.1.bb @@ -11,11 +11,15 @@ SRC_URI = "${LINUXPTP_SRC_URI}/files/v4.1/linuxptp-${PV}.tgz \ file://build-Allow-CC-and-prefix-to-be-overriden.patch \ file://Use-cross-cpp-in-incdefs.patch \ file://0001-include-string.h-for-strncpy.patch \ + file://systemd/phc2sys@.service \ + file://systemd/ptp4l@.service \ " SRC_URI[md5sum] = "1db8699fc155965341759be5e5aad938" SRC_URI[sha256sum] = "e1743d44f8208897e30895da3579e670ff919b914feb4b5a949f3e421ddde535" +inherit systemd + UPSTREAM_CHECK_URI = "${LINUXPTP_SRC_URI}/files/" UPSTREAM_CHECK_REGEX = "(?P\d+(\.\d+)+)/" @@ -23,6 +27,8 @@ EXTRA_OEMAKE = "ARCH=${TARGET_ARCH} EXTRA_CFLAGS='${CFLAGS}' mandir=${mandir}" export KBUILD_OUTPUT="${RECIPE_SYSROOT}" +LINUXPTP_SYSTEMD_SERVICES = "phc2sys@.service ptp4l@.service" + do_install() { oe_runmake install DESTDIR=${D} prefix=${prefix} @@ -35,8 +41,18 @@ do_install() { 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 + install -m 644 ${WORKDIR}/systemd/$service \ + ${D}/${systemd_unitdir}/system/$service + done } +SYSTEMD_SERVICE:${PN} = "${LINUXPTP_SYSTEMD_SERVICES}" +SYSTEMD_AUTO_ENABLE:${PN} = "disable" + PACKAGES =+ "${PN}-configs" FILES:${PN}-configs += "${docdir}"