From 7b5cc70faad1f70f3851f6608b3e4fe233012216 Mon Sep 17 00:00:00 2001 From: Moritz Warning Date: Thu, 4 Jul 2019 15:52:09 +0200 Subject: [PATCH 1/8] zerotier: keep configuration file on update Signed-off-by: Moritz Warning --- net/zerotier/Makefile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/net/zerotier/Makefile b/net/zerotier/Makefile index 50a270a87e..7cf5a44cb7 100644 --- a/net/zerotier/Makefile +++ b/net/zerotier/Makefile @@ -7,15 +7,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=zerotier PKG_VERSION:=1.2.12 -PKG_RELEASE:=3 - -PKG_LICENSE:=GPL-3.0 +PKG_RELEASE:=4 PKG_SOURCE_URL:=https://codeload.github.com/zerotier/ZeroTierOne/tar.gz/$(PKG_VERSION)? PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_HASH:=212799bfaeb5e7dff20f2cd83f15742c8e13b8e9535606cfb85abcfb5fb6fed4 PKG_BUILD_DIR:=$(BUILD_DIR)/ZeroTierOne-$(PKG_VERSION) +PKG_MAINTAINER:=Moritz Warning +PKG_LICENSE:=GPL-3.0-or-later +PKG_LICENSE_FILES:=LICENSE.txt PKG_BUILD_PARALLEL:=1 include $(INCLUDE_DIR)/package.mk @@ -27,7 +28,6 @@ define Package/zerotier TITLE:=Create flat virtual Ethernet networks of almost unlimited size URL:=https://www.zerotier.com SUBMENU:=VPN - MAINTAINER:=Moritz Warning endef define Package/zerotier/description @@ -56,6 +56,10 @@ endef TARGET_CFLAGS += -ffunction-sections -fdata-sections TARGET_LDFLAGS += -Wl,--gc-sections +define Package/zerotier/conffiles +/etc/config/zerotier +endef + define Package/zerotier/install $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_BUILD_DIR)/zerotier-one $(1)/usr/bin/ From 1961985f86c5cb36e5d47de70f5c219c0a11656e Mon Sep 17 00:00:00 2001 From: Moritz Warning Date: Sat, 3 Aug 2019 21:42:58 +0200 Subject: [PATCH 2/8] zerotier: update to zerotier 1.4.0 Signed-off-by: Moritz Warning --- net/zerotier/Makefile | 8 ++++---- ...1-find-miniupnpc.h-in-staging-directory.patch | 8 ++++---- net/zerotier/patches/0002-remove-pie.patch | 8 ++++---- .../0003-remove-arm32-conservative-CFLAGS.patch | 16 +++++++++++++++- .../0004-accept-external-linker-flags.patch | 8 ++++---- 5 files changed, 31 insertions(+), 17 deletions(-) diff --git a/net/zerotier/Makefile b/net/zerotier/Makefile index 7cf5a44cb7..d1f5533f25 100644 --- a/net/zerotier/Makefile +++ b/net/zerotier/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=zerotier -PKG_VERSION:=1.2.12 -PKG_RELEASE:=4 +PKG_VERSION:=1.4.0.1 +PKG_RELEASE:=1 -PKG_SOURCE_URL:=https://codeload.github.com/zerotier/ZeroTierOne/tar.gz/$(PKG_VERSION)? PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz -PKG_HASH:=212799bfaeb5e7dff20f2cd83f15742c8e13b8e9535606cfb85abcfb5fb6fed4 +PKG_SOURCE_URL:=https://codeload.github.com/zerotier/ZeroTierOne/tar.gz/$(PKG_VERSION)? +PKG_HASH:=39f5cdbe589ff550dca9d407f579e87b55a750dbb46458914476fa7dbafb8214 PKG_BUILD_DIR:=$(BUILD_DIR)/ZeroTierOne-$(PKG_VERSION) PKG_MAINTAINER:=Moritz Warning diff --git a/net/zerotier/patches/0001-find-miniupnpc.h-in-staging-directory.patch b/net/zerotier/patches/0001-find-miniupnpc.h-in-staging-directory.patch index 5ea4d697ee..7aa9c7ead3 100644 --- a/net/zerotier/patches/0001-find-miniupnpc.h-in-staging-directory.patch +++ b/net/zerotier/patches/0001-find-miniupnpc.h-in-staging-directory.patch @@ -1,4 +1,4 @@ -From c578216351a4daa3916265b39b14f7c23ef15c90 Mon Sep 17 00:00:00 2001 +From 14454285d7ef5b9cd134c86059933036c1aa2fef Mon Sep 17 00:00:00 2001 From: Moritz Warning Date: Mon, 23 Apr 2018 22:12:31 +0200 Subject: [PATCH 1/4] find miniupnpc.h in staging directory @@ -8,10 +8,10 @@ Subject: [PATCH 1/4] find miniupnpc.h in staging directory 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/make-linux.mk b/make-linux.mk -index 2e6a8632..0cd955d1 100644 +index b81c7aeb..a547125d 100644 --- a/make-linux.mk +++ b/make-linux.mk -@@ -22,8 +22,8 @@ ONE_OBJS+=osdep/LinuxEthernetTap.o +@@ -29,8 +29,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 @@ -23,5 +23,5 @@ index 2e6a8632..0cd955d1 100644 override DEFS+=-DZT_USE_SYSTEM_MINIUPNPC LDLIBS+=-lminiupnpc -- -2.17.0 +2.22.0 diff --git a/net/zerotier/patches/0002-remove-pie.patch b/net/zerotier/patches/0002-remove-pie.patch index 849cb20f91..8f90d8f0a2 100644 --- a/net/zerotier/patches/0002-remove-pie.patch +++ b/net/zerotier/patches/0002-remove-pie.patch @@ -1,4 +1,4 @@ -From 7cfe751128d412a9b780ba5e4cb11908fc71cd3d Mon Sep 17 00:00:00 2001 +From 68fe97ef6b05e3709cd4b67c7681dcfc63bfaf80 Mon Sep 17 00:00:00 2001 From: Moritz Warning Date: Mon, 30 Apr 2018 16:14:30 +0200 Subject: [PATCH 2/4] remove -pie @@ -10,10 +10,10 @@ when making a shared object; recompile with -fPIC" error 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/make-linux.mk b/make-linux.mk -index 0cd955d1..add1d3ae 100644 +index a547125d..13244741 100644 --- a/make-linux.mk +++ b/make-linux.mk -@@ -63,11 +63,11 @@ ifeq ($(ZT_DEBUG),1) +@@ -77,11 +77,11 @@ ifeq ($(ZT_DEBUG),1) # C25519 in particular is almost UNUSABLE in -O0 even on a 3ghz box! node/Salsa20.o node/SHA512.o node/C25519.o node/Poly1305.o: CXXFLAGS=-Wall -O2 -g -pthread $(INCLUDES) $(DEFS) else @@ -29,5 +29,5 @@ index 0cd955d1..add1d3ae 100644 STRIP+=--strip-all endif -- -2.17.0 +2.22.0 diff --git a/net/zerotier/patches/0003-remove-arm32-conservative-CFLAGS.patch b/net/zerotier/patches/0003-remove-arm32-conservative-CFLAGS.patch index ea74d0d8cb..f2189b97f1 100644 --- a/net/zerotier/patches/0003-remove-arm32-conservative-CFLAGS.patch +++ b/net/zerotier/patches/0003-remove-arm32-conservative-CFLAGS.patch @@ -1,6 +1,17 @@ +From a856855ab97e0775a08e1571a4ad26c264cb13f4 Mon Sep 17 00:00:00 2001 +From: Moritz Warning +Date: Sun, 4 Aug 2019 03:56:37 +0200 +Subject: [PATCH 3/4] remove arm32 conservative CFLAGS + +--- + make-linux.mk | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/make-linux.mk b/make-linux.mk +index 13244741..fd164dfa 100644 --- a/make-linux.mk +++ b/make-linux.mk -@@ -231,7 +231,7 @@ ifeq ($(ZT_OFFICIAL),1) +@@ -262,7 +262,7 @@ ifeq ($(ZT_OFFICIAL),1) endif # ARM32 hell -- use conservative CFLAGS @@ -9,3 +20,6 @@ ifeq ($(shell if [ -e /usr/bin/dpkg ]; then dpkg --print-architecture; fi),armel) override CFLAGS+=-march=armv5 -mfloat-abi=soft -msoft-float -mno-unaligned-access -marm override CXXFLAGS+=-march=armv5 -mfloat-abi=soft -msoft-float -mno-unaligned-access -marm +-- +2.22.0 + diff --git a/net/zerotier/patches/0004-accept-external-linker-flags.patch b/net/zerotier/patches/0004-accept-external-linker-flags.patch index d50143a612..a28f4d8266 100644 --- a/net/zerotier/patches/0004-accept-external-linker-flags.patch +++ b/net/zerotier/patches/0004-accept-external-linker-flags.patch @@ -1,4 +1,4 @@ -From a2cf8bf645d25f18cbc2ed7ad4b9a25725811afd Mon Sep 17 00:00:00 2001 +From 5169e5328525af28f6b7de087ece10a9bc0a2282 Mon Sep 17 00:00:00 2001 From: Moritz Warning Date: Wed, 2 May 2018 16:06:46 +0200 Subject: [PATCH 4/4] accept external linker flags @@ -8,10 +8,10 @@ Subject: [PATCH 4/4] accept external linker flags 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/make-linux.mk b/make-linux.mk -index 49e14f70..8e766bfb 100644 +index fd164dfa..29ff8813 100644 --- a/make-linux.mk +++ b/make-linux.mk -@@ -67,7 +67,7 @@ else +@@ -81,7 +81,7 @@ else override CFLAGS+=-Wall -Wno-deprecated -pthread $(INCLUDES) -DNDEBUG $(DEFS) CXXFLAGS?=-O3 -fstack-protector override CXXFLAGS+=-Wall -Wno-deprecated -std=c++11 -pthread $(INCLUDES) -DNDEBUG $(DEFS) @@ -21,5 +21,5 @@ index 49e14f70..8e766bfb 100644 STRIP+=--strip-all endif -- -2.17.0 +2.22.0 From 61291196d337136084791a372b59db76c26671e3 Mon Sep 17 00:00:00 2001 From: DENG Qingfang Date: Thu, 8 Aug 2019 17:05:25 +0800 Subject: [PATCH 3/8] zerotier: fix linking to libnatpmp and build with uclibc Makefile always checks the existence of host's NAT-PMP header, which results in internal NAT-PMP code being used if it's missing. Add a patch to make it check targets' header instead. Use aligned_alloc() instead of valloc() in case of uclibc. Signed-off-by: DENG Qingfang --- net/zerotier/Makefile | 6 +++++- net/zerotier/patches/0005-link-natpmp.patch | 11 +++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 net/zerotier/patches/0005-link-natpmp.patch diff --git a/net/zerotier/Makefile b/net/zerotier/Makefile index d1f5533f25..13937b4da2 100644 --- a/net/zerotier/Makefile +++ b/net/zerotier/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=zerotier PKG_VERSION:=1.4.0.1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/zerotier/ZeroTierOne/tar.gz/$(PKG_VERSION)? @@ -56,6 +56,10 @@ endef TARGET_CFLAGS += -ffunction-sections -fdata-sections TARGET_LDFLAGS += -Wl,--gc-sections +ifdef CONFIG_USE_UCLIBC + TARGET_CFLAGS += -D'valloc(a)=aligned_alloc(getpagesize(),a)' +endif + define Package/zerotier/conffiles /etc/config/zerotier endef diff --git a/net/zerotier/patches/0005-link-natpmp.patch b/net/zerotier/patches/0005-link-natpmp.patch new file mode 100644 index 0000000000..d1c820947a --- /dev/null +++ b/net/zerotier/patches/0005-link-natpmp.patch @@ -0,0 +1,11 @@ +--- a/make-linux.mk ++++ b/make-linux.mk +@@ -38,7 +38,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 From 70f4c1d197e9a4a5bb6bfb1856bf321596ff9d91 Mon Sep 17 00:00:00 2001 From: Moritz Warning Date: Tue, 13 Aug 2019 16:58:48 +0200 Subject: [PATCH 4/8] zerotier: udpate to 1.4.2 Signed-off-by: Moritz Warning --- net/zerotier/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/zerotier/Makefile b/net/zerotier/Makefile index 13937b4da2..4a69d5e6b4 100644 --- a/net/zerotier/Makefile +++ b/net/zerotier/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=zerotier -PKG_VERSION:=1.4.0.1 -PKG_RELEASE:=2 +PKG_VERSION:=1.4.2 +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:=39f5cdbe589ff550dca9d407f579e87b55a750dbb46458914476fa7dbafb8214 +PKG_HASH:=557a444127812384265ec97232bae43dce1d4b1545ddd72e2b1646c971dad7c5 PKG_BUILD_DIR:=$(BUILD_DIR)/ZeroTierOne-$(PKG_VERSION) PKG_MAINTAINER:=Moritz Warning From e42648f3c82937334883a35ab23caccb08cacc98 Mon Sep 17 00:00:00 2001 From: Moritz Warning Date: Mon, 2 Sep 2019 03:48:44 +0200 Subject: [PATCH 5/8] zerotier: update to release 1.4.4 Also allow path to local.conf to be set and enable linker optimisations to save a few bytes. Signed-off-by: Moritz Warning --- net/zerotier/Makefile | 6 +++--- net/zerotier/files/etc/config/zerotier | 3 +++ net/zerotier/files/etc/init.d/zerotier | 7 ++++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/net/zerotier/Makefile b/net/zerotier/Makefile index 4a69d5e6b4..1ccb21bfd3 100644 --- a/net/zerotier/Makefile +++ b/net/zerotier/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=zerotier -PKG_VERSION:=1.4.2 +PKG_VERSION:=1.4.4 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:=557a444127812384265ec97232bae43dce1d4b1545ddd72e2b1646c971dad7c5 +PKG_HASH:=0c11aab77b1c30fb8932e31906fc93fe7cb38c579c33740c1d407ec13d5b3e12 PKG_BUILD_DIR:=$(BUILD_DIR)/ZeroTierOne-$(PKG_VERSION) PKG_MAINTAINER:=Moritz Warning @@ -54,7 +54,7 @@ endef # Make binary smaller TARGET_CFLAGS += -ffunction-sections -fdata-sections -TARGET_LDFLAGS += -Wl,--gc-sections +TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed ifdef CONFIG_USE_UCLIBC TARGET_CFLAGS += -D'valloc(a)=aligned_alloc(getpagesize(),a)' diff --git a/net/zerotier/files/etc/config/zerotier b/net/zerotier/files/etc/config/zerotier index 1a016ebcfb..f342f851b5 100644 --- a/net/zerotier/files/etc/config/zerotier +++ b/net/zerotier/files/etc/config/zerotier @@ -7,6 +7,9 @@ config zerotier sample_config #option port '9993' + # path to the local.conf + #option local_conf '/etc/zerotier.conf' + # Generate secret on first start option secret '' diff --git a/net/zerotier/files/etc/init.d/zerotier b/net/zerotier/files/etc/init.d/zerotier index ba6b427fa7..dacb47c09a 100755 --- a/net/zerotier/files/etc/init.d/zerotier +++ b/net/zerotier/files/etc/init.d/zerotier @@ -14,7 +14,7 @@ section_enabled() { start_instance() { local cfg="$1" - local port secret config_path path + local port secret config_path local_conf path local args="" if ! section_enabled "$cfg"; then @@ -25,6 +25,7 @@ start_instance() { config_get config_path $cfg 'config_path' config_get port $cfg 'port' config_get secret $cfg 'secret' + config_get local_conf $cfg 'local_conf' path=${CONFIG_PATH}_$cfg @@ -71,6 +72,10 @@ start_instance() { rm -f $path/identity.public fi + if [ -f "$local_conf" ]; then + ln -s "$local_conf" $path/local.conf + fi + add_join() { # an (empty) config file will cause ZT to join a network touch $path/networks.d/$1.conf From 38a3ed1c75f4cdae52c2b8fbce93d44f5e71d2ed Mon Sep 17 00:00:00 2001 From: Moritz Warning Date: Sun, 8 Sep 2019 17:17:55 +0200 Subject: [PATCH 6/8] zerotier: change license to BSL 1.1 Business Source License. Signed-off-by: Moritz Warning --- net/zerotier/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/zerotier/Makefile b/net/zerotier/Makefile index 1ccb21bfd3..f2e28cc75f 100644 --- a/net/zerotier/Makefile +++ b/net/zerotier/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=zerotier PKG_VERSION:=1.4.4 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/zerotier/ZeroTierOne/tar.gz/$(PKG_VERSION)? @@ -15,7 +15,7 @@ PKG_HASH:=0c11aab77b1c30fb8932e31906fc93fe7cb38c579c33740c1d407ec13d5b3e12 PKG_BUILD_DIR:=$(BUILD_DIR)/ZeroTierOne-$(PKG_VERSION) PKG_MAINTAINER:=Moritz Warning -PKG_LICENSE:=GPL-3.0-or-later +PKG_LICENSE:=BSL 1.1 PKG_LICENSE_FILES:=LICENSE.txt PKG_BUILD_PARALLEL:=1 From f0c5a95a4fcd0c06a3b728a3da34a8d530381c8a Mon Sep 17 00:00:00 2001 From: Moritz Warning Date: Sun, 8 Sep 2019 17:18:47 +0200 Subject: [PATCH 7/8] zerotier: make sure the /var/lib exists Signed-off-by: Moritz Warning --- net/zerotier/files/etc/init.d/zerotier | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/zerotier/files/etc/init.d/zerotier b/net/zerotier/files/etc/init.d/zerotier index dacb47c09a..c308b4246e 100755 --- a/net/zerotier/files/etc/init.d/zerotier +++ b/net/zerotier/files/etc/init.d/zerotier @@ -39,6 +39,9 @@ start_instance() { return fi + # ensure that the symlink target exists + mkdir -p $(dirname $path) + ln -s $config_path $path fi From 479b45b8ab8f6c8608497be7daee7a982be3eadb Mon Sep 17 00:00:00 2001 From: Moritz Warning Date: Tue, 17 Sep 2019 01:37:24 +0200 Subject: [PATCH 8/8] zerotier: update to 1.4.6 Signed-off-by: Moritz Warning --- net/zerotier/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/net/zerotier/Makefile b/net/zerotier/Makefile index f2e28cc75f..4413da2df0 100644 --- a/net/zerotier/Makefile +++ b/net/zerotier/Makefile @@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=zerotier -PKG_VERSION:=1.4.4 -PKG_RELEASE:=2 +PKG_VERSION:=1.4.6 +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:=0c11aab77b1c30fb8932e31906fc93fe7cb38c579c33740c1d407ec13d5b3e12 +PKG_HASH:=d1a0eeb03acfa446f67adf5901902d17de14b4648c21e160024acf476e3d4fba PKG_BUILD_DIR:=$(BUILD_DIR)/ZeroTierOne-$(PKG_VERSION) PKG_MAINTAINER:=Moritz Warning