linuxptp: update to v4.4
authorShenghao Yang <[email protected]>
Tue, 17 Sep 2024 14:12:08 +0000 (22:12 +0800)
committerJosef Schlehofer <[email protected]>
Fri, 20 Sep 2024 07:22:17 +0000 (09:22 +0200)
- Replaced SF project and download URLs with nwtime ones.
  The project is now hosted at https://linuxptp.nwtime.org/.

- Removed 020-gcc14.patch. Missing include was fixed upstream
  in v4.2.

- Added patch to disable MAC library autodetection. That
  can silently pick up unwanted dependencies, depending on
  package build order. We can add linuxptp-<mac lib> variants
  of this package later if there are users of authenticated
  PTP.

Signed-off-by: Shenghao Yang <[email protected]>
net/linuxptp/Makefile
net/linuxptp/patches/001-fix_kbuild_output.patch
net/linuxptp/patches/020-allow-disabling-MAC-autodetection.patch [new file with mode: 0644]
net/linuxptp/patches/020-gcc14.patch [deleted file]

index e0b34d3d7eceeedf0969e8bde794edc05428d609..67d88aea93ca3268d2af0c4442114b090e00b3fb 100644 (file)
@@ -8,12 +8,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=linuxptp
-PKG_VERSION:=4.1
-PKG_RELEASE:=2
+PKG_VERSION:=4.4
+PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
-PKG_SOURCE_URL:=@SF/$(PKG_NAME)/v$(PKG_VERSION)
-PKG_HASH:=e1743d44f8208897e30895da3579e670ff919b914feb4b5a949f3e421ddde535
+PKG_SOURCE_URL:=https://downloads.nwtime.org/linuxptp/
+PKG_HASH:=61757bc0a58d789b8fcbdddf56c88a0230597184a70dcb2ac05b4c6b619f7d5c
 
 PKG_MAINTAINER:=Wojciech Dubowik <[email protected]>
 PKG_LICENSE:=GPL-2.0-only
@@ -28,7 +28,7 @@ define Package/linuxptp
   CATEGORY:=Network
   SUBMENU:=Time Synchronization
   TITLE:=Linux Precision Time Protocol (PTP) daemon
-  URL:=http://linuxptp.sourceforge.net/
+  URL:=https://linuxptp.nwtime.org/
 endef
 
 define Package/linuxptp/description
@@ -42,7 +42,8 @@ EXTRA_CFLAGS += -DHAVE_CLOCK_ADJTIME -DHAVE_POSIX_SPAWN -DHAVE_ONESTEP_SYNC
 
 MAKE_VARS += \
        EXTRA_CFLAGS="$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) $(EXTRA_CFLAGS)" \
-       KBUILD_OUTPUT="$(LINUX_DIR)"
+       KBUILD_OUTPUT="$(LINUX_DIR)" \
+       NO_AUTODETECT_SAD_MAC_LIB="y"
 
 define Package/linuxptp/install
        $(INSTALL_DIR) $(1)/usr/sbin
index 1b5e81e979647bf46af0199acde4f37d40c54c9c..a43e5111a9161d169c8081daf0785359b52f30a1 100644 (file)
@@ -1,11 +1,11 @@
 --- a/incdefs.sh
 +++ b/incdefs.sh
-@@ -62,7 +62,7 @@ user_flags()
+@@ -152,7 +152,7 @@ user_flags()
  kernel_flags()
  {
        prefix=""
 -      tstamp=/usr/include/linux/net_tstamp.h
 +      tstamp=/include/uapi/linux/net_tstamp.h
        ptp_clock=/usr/include/linux/ptp_clock.h
+       if_team=/usr/include/linux/if_team.h
  
-       if [ "x$KBUILD_OUTPUT" != "x" ]; then
diff --git a/net/linuxptp/patches/020-allow-disabling-MAC-autodetection.patch b/net/linuxptp/patches/020-allow-disabling-MAC-autodetection.patch
new file mode 100644 (file)
index 0000000..ce71480
--- /dev/null
@@ -0,0 +1,195 @@
+Date: Sun, 15 Sep 2024 18:41:20 +0800
+From: Shenghao Yang <[email protected]>
+Subject: [PATCH] sad: allow disabling MAC library autodetection
+
+Avoids ptp4l linking against MAC libraries in a build
+environment with insufficient isolation (OpenWRT).
+
+NO_AUTODETECT_SAD_MAC_LIB can be set to any value to disable
+autodetection, and then one of the SAD_MAC_* variables can be
+used to choose a preferred MAC implementation.
+
+Signed-off-by: Shenghao Yang <[email protected]>
+---
+ incdefs.sh | 154 ++++++++++++++++++++++++++++-------------------------
+ 1 file changed, 81 insertions(+), 73 deletions(-)
+
+--- a/incdefs.sh
++++ b/incdefs.sh
+@@ -52,94 +52,102 @@ user_flags()
+       done
+       # Look for nettle support.
+-      for d in $dirs; do
+-              sdirs=$(find $d -type d -name "nettle")
+-              for s in $sdirs; do
+-                      have_hmac="0"
+-                      files=$(find $s -type f -name hmac.h)
+-                      for f in $files; do
+-                              if grep -q hmac_sha256_set_key $f; then
+-                                      have_hmac="1"
+-                                      break 1;
+-                              fi
+-                      done
+-                      have_memops="0"
+-                      files=$(find $s -type f -name memops.h)
+-                      for f in $files; do
+-                              if grep -q memeql_sec $f; then
+-                                      have_memops="1"
+-                                      break 1;
+-                              fi
+-                      done
+-                      have_nettle_meta="0"
+-                      files=$(find $s -type f -name nettle-meta.h)
+-                      for f in $files; do
+-                              if grep -q nettle_get_macs $f; then
+-                                      have_nettle_meta="1"
+-                                      break 1;
++      if [ "x$NO_AUTODETECT_SAD_MAC_LIB" = "x" ] || [ "x$SAD_MAC_NETTLE" != "x" ]; then
++              for d in $dirs; do
++                      sdirs=$(find $d -type d -name "nettle")
++                      for s in $sdirs; do
++                              have_hmac="0"
++                              files=$(find $s -type f -name hmac.h)
++                              for f in $files; do
++                                      if grep -q hmac_sha256_set_key $f; then
++                                              have_hmac="1"
++                                              break 1;
++                                      fi
++                              done
++                              have_memops="0"
++                              files=$(find $s -type f -name memops.h)
++                              for f in $files; do
++                                      if grep -q memeql_sec $f; then
++                                              have_memops="1"
++                                              break 1;
++                                      fi
++                              done
++                              have_nettle_meta="0"
++                              files=$(find $s -type f -name nettle-meta.h)
++                              for f in $files; do
++                                      if grep -q nettle_get_macs $f; then
++                                              have_nettle_meta="1"
++                                              break 1;
++                                      fi
++                              done
++                              if [ $have_hmac = "1" ] &&
++                              [ $have_memops = "1" ] &&
++                              [ $have_nettle_meta = "1" ]; then
++                                      printf " -DHAVE_NETTLE"
++                                      break 2
+                               fi
+                       done
+-                      if [ $have_hmac = "1" ] &&
+-                         [ $have_memops = "1" ] &&
+-                         [ $have_nettle_meta = "1" ]; then
+-                              printf " -DHAVE_NETTLE"
+-                              break 2
+-                      fi
+               done
+-      done
++      fi
+       # Look for gnutls support.
+-      for d in $dirs; do
+-              sdirs=$(find $d -type d -name "gnutls")
+-              for s in $sdirs; do
+-                      files=$(find $s -type f -name crypto.h)
+-                      for f in $files; do
+-                              if grep -q gnutls_hmac_init $f; then
+-                                      printf " -DHAVE_GNUTLS"
+-                                      break 3
+-                              fi
++      if [ "x$NO_AUTODETECT_SAD_MAC_LIB" = "x" ] || [ "x$SAD_MAC_GNUTLS" != "x" ]; then
++              for d in $dirs; do
++                      sdirs=$(find $d -type d -name "gnutls")
++                      for s in $sdirs; do
++                              files=$(find $s -type f -name crypto.h)
++                              for f in $files; do
++                                      if grep -q gnutls_hmac_init $f; then
++                                              printf " -DHAVE_GNUTLS"
++                                              break 3
++                                      fi
++                              done
+                       done
+               done
+-      done
++      fi
+       # Look for gnupg support.
+-      for d in $dirs; do
+-              files=$(find $d -type f -name gcrypt.h)
+-              for f in $files; do
+-                      if grep -q gcry_mac_open $f; then
+-                              printf " -DHAVE_GNUPG"
+-                              break 2
+-                      fi
++      if [ "x$NO_AUTODETECT_SAD_MAC_LIB" = "x" ] ||  [ "x$SAD_MAC_GNUPG" != "x" ]; then
++              for d in $dirs; do
++                      files=$(find $d -type f -name gcrypt.h)
++                      for f in $files; do
++                              if grep -q gcry_mac_open $f; then
++                                      printf " -DHAVE_GNUPG"
++                                      break 2
++                              fi
++                      done
+               done
+-      done
++      fi
+       # Look for openssl support.
+-      for d in $dirs; do
+-              sdirs=$(find $d -type d -name "openssl")
+-              for s in $sdirs; do
+-                      have_crypto="0"
+-                      files=$(find $s -type f -name crypto.h)
+-                      for f in $files; do
+-                              if grep -q CRYPTO_memcmp $f; then
+-                                      have_crypto="1"
+-                                      break 1;
++      if [ "x$NO_AUTODETECT_SAD_MAC_LIB" = "x" ] || [ "x$SAD_MAC_OPENSSL" != "x" ]; then
++              for d in $dirs; do
++                      sdirs=$(find $d -type d -name "openssl")
++                      for s in $sdirs; do
++                              have_crypto="0"
++                              files=$(find $s -type f -name crypto.h)
++                              for f in $files; do
++                                      if grep -q CRYPTO_memcmp $f; then
++                                              have_crypto="1"
++                                              break 1;
++                                      fi
++                              done
++                              have_evp="0"
++                              files=$(find $s -type f -name evp.h)
++                              for f in $files; do
++                                      if grep -q EVP_MAC_init $f; then
++                                              have_evp="1"
++                                              break 1;
++                                      fi
++                              done
++                              if [ $have_crypto = "1" ] &&
++                              [ $have_evp = "1" ]; then
++                                      printf " -DHAVE_OPENSSL"
++                                      break 2
+                               fi
+                       done
+-                      have_evp="0"
+-                      files=$(find $s -type f -name evp.h)
+-                      for f in $files; do
+-                              if grep -q EVP_MAC_init $f; then
+-                                      have_evp="1"
+-                                      break 1;
+-                              fi
+-                      done
+-                      if [ $have_crypto = "1" ] &&
+-                         [ $have_evp = "1" ]; then
+-                              printf " -DHAVE_OPENSSL"
+-                              break 2
+-                      fi
+               done
+-      done
++      fi
+ }
+ #
diff --git a/net/linuxptp/patches/020-gcc14.patch b/net/linuxptp/patches/020-gcc14.patch
deleted file mode 100644 (file)
index 13ac073..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
---- 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 {