zerotier: update to 1.12.1
authorMoritz Warning <moritzwarning@web.de>
Sun, 27 Aug 2023 21:00:10 +0000 (23:00 +0200)
committerTianling Shen <cnsztl@gmail.com>
Mon, 4 Sep 2023 06:30:32 +0000 (14:30 +0800)
* split up "fix makefile" patch logical distinct parts
* add libatomic dependency needed for prometheus-cpp-lite-1.0
* refresh patch series
* improve warning message in init script

Signed-off-by: Moritz Warning <moritzwarning@web.de>
(cherry picked from commit 6cf39ba626e35474b5b3c59754610f20c240d202)

net/zerotier/Makefile
net/zerotier/files/etc/init.d/zerotier
net/zerotier/patches/0001-fix-makefile.patch [deleted file]
net/zerotier/patches/0001-fix-miniupnpc-natpmp-include-paths.patch [new file with mode: 0644]
net/zerotier/patches/0002-fix-compilation-for-arm_cortex-a7-neon.patch [deleted file]
net/zerotier/patches/0002-remove-PIE-options.patch [new file with mode: 0644]
net/zerotier/patches/0003-fix-compilation-for-arm_cortex-a7-neon.patch [new file with mode: 0644]
net/zerotier/patches/0004-add-missing-libatomic.patch [new file with mode: 0644]
net/zerotier/patches/0005-remove-noexecstack.patch [new file with mode: 0644]

index 01ad05248f3772b17edc0143d389011746d118c8..ae2cf21f17bcd0e1a6883bb7e1ec3560ff9f6a7c 100644 (file)
@@ -6,12 +6,12 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=zerotier
-PKG_VERSION:=1.10.4
+PKG_VERSION:=1.12.1
 PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://codeload.github.com/zerotier/ZeroTierOne/tar.gz/$(PKG_VERSION)?
-PKG_HASH:=5dc185a65baf8caa3fb739cbc8043677aa117604be9036a28c34f8fda5d6eafe
+PKG_HASH:=c6758a04f161bba1c0ef11fce991029a645ede381ae3862a25a2f5145aaffca8
 PKG_BUILD_DIR:=$(BUILD_DIR)/ZeroTierOne-$(PKG_VERSION)
 
 PKG_MAINTAINER:=Moritz Warning <moritzwarning@web.de>
@@ -26,7 +26,7 @@ include $(INCLUDE_DIR)/package.mk
 define Package/zerotier
   SECTION:=net
   CATEGORY:=Network
-  DEPENDS:=+libpthread +libstdcpp +kmod-tun +ip +libminiupnpc +libnatpmp
+  DEPENDS:=+libpthread +libstdcpp +kmod-tun +ip +libminiupnpc +libnatpmp +libatomic
   TITLE:=Create flat virtual Ethernet networks of almost unlimited size
   URL:=https://www.zerotier.com
   SUBMENU:=VPN
index f7ba8e91d81822edb60c42076ebeea648e6e5229..a919dacea131f4babc00791a9b3250c4f6687b91 100755 (executable)
@@ -18,7 +18,7 @@ start_instance() {
        local args=""
 
        if ! section_enabled "$cfg"; then
-               echo "disabled in config"
+               echo "disabled in /ect/config/zerotier"
                return 1
        fi
 
diff --git a/net/zerotier/patches/0001-fix-makefile.patch b/net/zerotier/patches/0001-fix-makefile.patch
deleted file mode 100644 (file)
index eacb723..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-From 2c513f0db50eaee5623d58ac024d62142f4ac782 Mon Sep 17 00:00:00 2001
-From: Moritz Warning <moritzwarning@web.de>
-Date: Mon, 4 Jul 2022 00:09:24 +0200
-Subject: [PATCH 1/2] fix makefile
-
----
- make-linux.mk | 14 +++++++-------
- 1 file changed, 7 insertions(+), 7 deletions(-)
-
---- a/make-linux.mk
-+++ b/make-linux.mk
-@@ -25,8 +25,8 @@ TIMESTAMP=$(shell date +"%Y%m%d%H%M")
- # otherwise build into binary as done on Mac and Windows.
- ONE_OBJS+=osdep/PortMapper.o
- override DEFS+=-DZT_USE_MINIUPNPC
--MINIUPNPC_IS_NEW_ENOUGH=$(shell grep -sqr '.*define.*MINIUPNPC_VERSION.*"2..*"' /usr/include/miniupnpc/miniupnpc.h && echo 1)
--#MINIUPNPC_IS_NEW_ENOUGH=$(shell grep -sqr '.*define.*MINIUPNPC_VERSION.*"2.."' /usr/include/miniupnpc/miniupnpc.h && echo 1)
-+MINIUPNPC_IS_NEW_ENOUGH=$(shell grep -sqr '.*define.*MINIUPNPC_VERSION.*"2..*"' $(STAGING_DIR)/usr/include/miniupnpc/miniupnpc.h && echo 1)
-+#MINIUPNPC_IS_NEW_ENOUGH=$(shell grep -sqr '.*define.*MINIUPNPC_VERSION.*"2.."' $(STAGING_DIR)/usr/include/miniupnpc/miniupnpc.h && echo 1)
- ifeq ($(MINIUPNPC_IS_NEW_ENOUGH),1)
-       override DEFS+=-DZT_USE_SYSTEM_MINIUPNPC
-       LDLIBS+=-lminiupnpc
-@@ -34,7 +34,7 @@ else
-       override DEFS+=-DMINIUPNP_STATICLIB -DMINIUPNPC_SET_SOCKET_TIMEOUT -DMINIUPNPC_GET_SRC_ADDR -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DOS_STRING="\"Linux\"" -DMINIUPNPC_VERSION_STRING="\"2.0\"" -DUPNP_VERSION_STRING="\"UPnP/1.1\"" -DENABLE_STRNATPMPERR
-       ONE_OBJS+=ext/miniupnpc/connecthostport.o ext/miniupnpc/igd_desc_parse.o ext/miniupnpc/minisoap.o ext/miniupnpc/minissdpc.o ext/miniupnpc/miniupnpc.o ext/miniupnpc/miniwget.o ext/miniupnpc/minixml.o ext/miniupnpc/portlistingparse.o ext/miniupnpc/receivedata.o ext/miniupnpc/upnpcommands.o ext/miniupnpc/upnpdev.o ext/miniupnpc/upnperrors.o ext/miniupnpc/upnpreplyparse.o
- endif
--ifeq ($(wildcard /usr/include/natpmp.h),)
-+ifeq ($(wildcard $(STAGING_DIR)/usr/include/natpmp.h),)
-       ONE_OBJS+=ext/libnatpmp/natpmp.o ext/libnatpmp/getgateway.o
- else
-       LDLIBS+=-lnatpmp
-@@ -70,7 +70,7 @@ else
-       override CFLAGS+=-Wall -Wno-deprecated -pthread $(INCLUDES) -DNDEBUG $(DEFS)
-       CXXFLAGS?=-O3 -fstack-protector
-       override CXXFLAGS+=-Wall -Wno-deprecated -std=c++17 -pthread $(INCLUDES) -DNDEBUG $(DEFS)
--      LDFLAGS=-pie -Wl,-z,relro,-z,now
-+      LDFLAGS=-Wl,-z,relro,-z,now
-       RUSTFLAGS=--release
- endif
-@@ -316,7 +316,7 @@ ifeq ($(ZT_CONTROLLER),1)
- endif
- # ARM32 hell -- use conservative CFLAGS
--ifeq ($(ZT_ARCHITECTURE),3)
-+ifeq (0,3)
-       ifeq ($(shell if [ -e /usr/bin/dpkg ]; then dpkg --print-architecture; fi),armel)
-               override CFLAGS+=-march=armv5t -mfloat-abi=soft -msoft-float -mno-unaligned-access -marm
-               override CXXFLAGS+=-march=armv5t -mfloat-abi=soft -msoft-float -mno-unaligned-access -marm
-@@ -343,8 +343,8 @@ ifeq ($(ZT_USE_ARM32_NEON_ASM_CRYPTO),1)
- endif
- # Position Independence
--override CFLAGS+=-fPIC -fPIE
--override CXXFLAGS+=-fPIC -fPIE
-+#override CFLAGS+=-fPIC -fPIE
-+#override CXXFLAGS+=-fPIC -fPIE
- .PHONY: all
- all:  one
diff --git a/net/zerotier/patches/0001-fix-miniupnpc-natpmp-include-paths.patch b/net/zerotier/patches/0001-fix-miniupnpc-natpmp-include-paths.patch
new file mode 100644 (file)
index 0000000..8779829
--- /dev/null
@@ -0,0 +1,32 @@
+From 8b30e8617720c2a540c84c5c00508e8081e9f06e Mon Sep 17 00:00:00 2001
+From: Moritz Warning <moritzwarning@web.de>
+Date: Sun, 27 Aug 2023 23:26:33 +0200
+Subject: [PATCH 1/5] fix miniupnpc/natpmp include paths
+
+Signed-off-by: Moritz Warning <moritzwarning@web.de>
+---
+ make-linux.mk | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/make-linux.mk
++++ b/make-linux.mk
+@@ -25,8 +25,8 @@ TIMESTAMP=$(shell date +"%Y%m%d%H%M")
+ # otherwise build into binary as done on Mac and Windows.
+ ONE_OBJS+=osdep/PortMapper.o
+ override DEFS+=-DZT_USE_MINIUPNPC
+-MINIUPNPC_IS_NEW_ENOUGH=$(shell grep -sqr '.*define.*MINIUPNPC_VERSION.*"2..*"' /usr/include/miniupnpc/miniupnpc.h && echo 1)
+-#MINIUPNPC_IS_NEW_ENOUGH=$(shell grep -sqr '.*define.*MINIUPNPC_VERSION.*"2.."' /usr/include/miniupnpc/miniupnpc.h && echo 1)
++MINIUPNPC_IS_NEW_ENOUGH=$(shell grep -sqr '.*define.*MINIUPNPC_VERSION.*"2..*"' $(STAGING_DIR)/usr/include/miniupnpc/miniupnpc.h && echo 1)
++#MINIUPNPC_IS_NEW_ENOUGH=$(shell grep -sqr '.*define.*MINIUPNPC_VERSION.*"2.."' $(STAGING_DIR)/usr/include/miniupnpc/miniupnpc.h && echo 1)
+ ifeq ($(MINIUPNPC_IS_NEW_ENOUGH),1)
+       override DEFS+=-DZT_USE_SYSTEM_MINIUPNPC
+       LDLIBS+=-lminiupnpc
+@@ -34,7 +34,7 @@ else
+       override DEFS+=-DMINIUPNP_STATICLIB -DMINIUPNPC_SET_SOCKET_TIMEOUT -DMINIUPNPC_GET_SRC_ADDR -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -DOS_STRING="\"Linux\"" -DMINIUPNPC_VERSION_STRING="\"2.0\"" -DUPNP_VERSION_STRING="\"UPnP/1.1\"" -DENABLE_STRNATPMPERR
+       ONE_OBJS+=ext/miniupnpc/connecthostport.o ext/miniupnpc/igd_desc_parse.o ext/miniupnpc/minisoap.o ext/miniupnpc/minissdpc.o ext/miniupnpc/miniupnpc.o ext/miniupnpc/miniwget.o ext/miniupnpc/minixml.o ext/miniupnpc/portlistingparse.o ext/miniupnpc/receivedata.o ext/miniupnpc/upnpcommands.o ext/miniupnpc/upnpdev.o ext/miniupnpc/upnperrors.o ext/miniupnpc/upnpreplyparse.o
+ endif
+-ifeq ($(wildcard /usr/include/natpmp.h),)
++ifeq ($(wildcard $(STAGING_DIR)/usr/include/natpmp.h),)
+       ONE_OBJS+=ext/libnatpmp/natpmp.o ext/libnatpmp/getgateway.o
+ else
+       LDLIBS+=-lnatpmp
diff --git a/net/zerotier/patches/0002-fix-compilation-for-arm_cortex-a7-neon.patch b/net/zerotier/patches/0002-fix-compilation-for-arm_cortex-a7-neon.patch
deleted file mode 100644 (file)
index 00fef6e..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-From 819232a2b5a09d7aa3cacb8dcf7c2e28afde1b06 Mon Sep 17 00:00:00 2001
-From: Moritz Warning <moritzwarning@web.de>
-Date: Mon, 4 Jul 2022 00:10:52 +0200
-Subject: [PATCH 2/2] fix compilation for arm_cortex-a7+neon
-
-Fixes "error: 'vrbitq_u8' was not declared in this scope"
-
-Signed-off-by: Rosen Penev <rosenp@gmail.com>
----
- node/Constants.hpp | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/node/Constants.hpp
-+++ b/node/Constants.hpp
-@@ -123,7 +123,7 @@
- #include <immintrin.h>
- #endif
--#if (defined(__ARM_NEON) || defined(__ARM_NEON__) || defined(ZT_ARCH_ARM_HAS_NEON))
-+#if (defined(__aarch64__) || defined(ZT_ARCH_ARM_HAS_NEON))
- #if (defined(__APPLE__) && !defined(__LP64__)) || (defined(__ANDROID__) && defined(__arm__))
- #ifdef ZT_ARCH_ARM_HAS_NEON
- #undef ZT_ARCH_ARM_HAS_NEON
diff --git a/net/zerotier/patches/0002-remove-PIE-options.patch b/net/zerotier/patches/0002-remove-PIE-options.patch
new file mode 100644 (file)
index 0000000..0b21991
--- /dev/null
@@ -0,0 +1,41 @@
+From 9b97099560a79529f2b5a748e73164ae038d2b76 Mon Sep 17 00:00:00 2001
+From: Moritz Warning <moritzwarning@web.de>
+Date: Sun, 27 Aug 2023 23:27:33 +0200
+Subject: [PATCH 2/5] remove PIE options
+
+Signed-off-by: Moritz Warning <moritzwarning@web.de>
+---
+ make-linux.mk | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/make-linux.mk
++++ b/make-linux.mk
+@@ -70,7 +70,7 @@ else
+       override CFLAGS+=-Wall -Wno-deprecated -pthread $(INCLUDES) -DNDEBUG $(DEFS)
+       CXXFLAGS?=-O3 -fstack-protector
+       override CXXFLAGS+=-Wall -Wno-deprecated -std=c++17 -pthread $(INCLUDES) -DNDEBUG $(DEFS)
+-      LDFLAGS=-pie -Wl,-z,relro,-z,now
++      LDFLAGS=-Wl,-z,relro,-z,now
+       RUSTFLAGS=--release
+ endif
+@@ -327,7 +327,7 @@ ifeq ($(ZT_CONTROLLER),1)
+ endif
+ # ARM32 hell -- use conservative CFLAGS
+-ifeq ($(ZT_ARCHITECTURE),3)
++ifeq (0,3)
+       ifeq ($(shell if [ -e /usr/bin/dpkg ]; then dpkg --print-architecture; fi),armel)
+               override CFLAGS+=-march=armv5t -mfloat-abi=soft -msoft-float -mno-unaligned-access -marm
+               override CXXFLAGS+=-march=armv5t -mfloat-abi=soft -msoft-float -mno-unaligned-access -marm
+@@ -354,8 +354,8 @@ ifeq ($(ZT_USE_ARM32_NEON_ASM_CRYPTO),1)
+ endif
+ # Position Independence
+-override CFLAGS+=-fPIC -fPIE
+-override CXXFLAGS+=-fPIC -fPIE
++#override CFLAGS+=-fPIC -fPIE
++#override CXXFLAGS+=-fPIC -fPIE
+ # Non-executable stack
+ override ASFLAGS+=--noexecstack
diff --git a/net/zerotier/patches/0003-fix-compilation-for-arm_cortex-a7-neon.patch b/net/zerotier/patches/0003-fix-compilation-for-arm_cortex-a7-neon.patch
new file mode 100644 (file)
index 0000000..8831ede
--- /dev/null
@@ -0,0 +1,23 @@
+From 1689085363cf87deb3877139931a8a88d8c7bcd3 Mon Sep 17 00:00:00 2001
+From: Moritz Warning <moritzwarning@web.de>
+Date: Mon, 4 Jul 2022 00:10:52 +0200
+Subject: [PATCH 3/5] fix compilation for arm_cortex-a7+neon
+
+Fixes "error: 'vrbitq_u8' was not declared in this scope"
+
+Signed-off-by: Rosen Penev <rosenp@gmail.com>
+---
+ node/Constants.hpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/node/Constants.hpp
++++ b/node/Constants.hpp
+@@ -123,7 +123,7 @@
+ #include <immintrin.h>
+ #endif
+-#if (defined(__ARM_NEON) || defined(__ARM_NEON__) || defined(ZT_ARCH_ARM_HAS_NEON))
++#if (defined(__aarch64__) || defined(ZT_ARCH_ARM_HAS_NEON))
+ #if (defined(__APPLE__) && !defined(__LP64__)) || (defined(__ANDROID__) && defined(__arm__))
+ #ifdef ZT_ARCH_ARM_HAS_NEON
+ #undef ZT_ARCH_ARM_HAS_NEON
diff --git a/net/zerotier/patches/0004-add-missing-libatomic.patch b/net/zerotier/patches/0004-add-missing-libatomic.patch
new file mode 100644 (file)
index 0000000..d8d9c61
--- /dev/null
@@ -0,0 +1,21 @@
+From b3879d721734862aa64433f7faf124a0862da029 Mon Sep 17 00:00:00 2001
+From: Moritz Warning <moritzwarning@web.de>
+Date: Sun, 27 Aug 2023 22:27:12 +0200
+Subject: [PATCH 4/5] add missing libatomic
+
+Signed-off-by: Moritz Warning <moritzwarning@web.de>
+---
+ make-linux.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/make-linux.mk
++++ b/make-linux.mk
+@@ -11,7 +11,7 @@ endif
+ INCLUDES?=-Izeroidc/target -isystem ext -Iext/prometheus-cpp-lite-1.0/core/include -Iext-prometheus-cpp-lite-1.0/3rdparty/http-client-lite/include -Iext/prometheus-cpp-lite-1.0/simpleapi/include
+ DEFS?=
+-LDLIBS?=
++LDLIBS?=-latomic
+ DESTDIR?=
+ include objects.mk
diff --git a/net/zerotier/patches/0005-remove-noexecstack.patch b/net/zerotier/patches/0005-remove-noexecstack.patch
new file mode 100644 (file)
index 0000000..07b1ac3
--- /dev/null
@@ -0,0 +1,21 @@
+From adcc68c6c3de8460bd6263d3478873953a4cf894 Mon Sep 17 00:00:00 2001
+From: Moritz Warning <moritzwarning@web.de>
+Date: Mon, 28 Aug 2023 09:48:28 +0200
+Subject: [PATCH 5/5] remove noexecstack
+
+The compilers for arm_cortex-a9 do not recognize this argument.
+---
+ make-linux.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/make-linux.mk
++++ b/make-linux.mk
+@@ -358,7 +358,7 @@ endif
+ #override CXXFLAGS+=-fPIC -fPIE
+ # Non-executable stack
+-override ASFLAGS+=--noexecstack
++# override ASFLAGS+=--noexecstack
+ .PHONY: all
+ all:  one