From 928a1338b5c98c76dbdf2f358cd862c5eb46c533 Mon Sep 17 00:00:00 2001 From: Andreas Runfalk Date: Sat, 28 Dec 2019 22:37:29 +0100 Subject: [PATCH] Updated Wireguard version to 0.0.20191226. This also means this project supports the non-monolithic releases --- INFO.sh | 2 +- Makefile | 34 ++++++++++++++++++++++------------ README.rst | 4 ++-- 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/INFO.sh b/INFO.sh index 5b4eb69..82b49ec 100755 --- a/INFO.sh +++ b/INFO.sh @@ -2,7 +2,7 @@ source /pkgscripts-ng/include/pkg_util.sh package="WireGuard" -version="0.0.20190702" +version="0.0.20191226" displayname="WireGuard" maintainer="Andreas Runfalk" arch="$(pkg_get_platform)" diff --git a/Makefile b/Makefile index 2b4a8f6..7582e6b 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,19 @@ -WIREGUARD_VERSION ?= 0.0.20190702 +WIREGUARD_VERSION ?= 0.0.20191226 +WIREGUARD_TOOLS_VERSION ?= 1.0.20191226 LIBMNL_VERSION ?= 1.0.4 HAS_MEMNEQ ?= 0 LIBMNL_TAR := libmnl-$(LIBMNL_VERSION).tar.bz2 LIBMNL_DIR := libmnl-$(LIBMNL_VERSION) -WIREGUARD_TAR := WireGuard-$(WIREGUARD_VERSION).tar.xz -WIREGUARD_DIR := WireGuard-$(WIREGUARD_VERSION) +WIREGUARD_TAR := wireguard-linux-compat-$(WIREGUARD_VERSION).tar.xz +WIREGUARD_DIR := wireguard-linux-compat-$(WIREGUARD_VERSION) -WG_TARGET := $(WIREGUARD_DIR)/src/tools/wg -WG_QUICK_TARGET := $(WIREGUARD_DIR)/wg-quick +WIREGUARD_TOOLS_TAR := wireguard-tools-$(WIREGUARD_TOOLS_VERSION).tar.xz +WIREGUARD_TOOLS_DIR := wireguard-tools-$(WIREGUARD_TOOLS_VERSION) + +WG_TARGET := $(WIREGUARD_TOOLS_DIR)/src/wg +WG_QUICK_TARGET := $(WIREGUARD_TOOLS_DIR)/wg-quick WG_MODULE_TARGET := $(WIREGUARD_DIR)/src/wireguard.ko GCC := $(CROSS_COMPILE)gcc @@ -34,7 +38,10 @@ $(LIBMNL_DIR)/src/.libs/libmnl.a: $(LIBMNL_DIR)/Makefile # Download WireGuard source tarball $(WIREGUARD_TAR): - wget https://git.zx2c4.com/WireGuard/snapshot/$(WIREGUARD_TAR) + wget https://git.zx2c4.com/wireguard-linux-compat/snapshot/$(WIREGUARD_TAR) + +$(WIREGUARD_TOOLS_TAR): + wget https://git.zx2c4.com/wireguard-tools/snapshot/$(WIREGUARD_TOOLS_TAR) # Unpack WireGuard source tarball and patch the compatibility layer to always # use memneq implementation as it doesn't appear to be included on the D218j. @@ -44,16 +51,19 @@ ifeq ($(HAS_MEMNEQ), 0) patch $(WIREGUARD_DIR)/src/compat/Kbuild.include $(ROOT_DIR)/memneq.patch endif +$(WIREGUARD_TOOLS_DIR)/src/Makefile: $(WIREGUARD_TOOLS_TAR) + tar -xf $(WIREGUARD_TOOLS_TAR) + # Build the wg command line tool -$(WG_TARGET): $(LIBMNL_DIR)/src/.libs/libmnl.a $(WIREGUARD_DIR)/src/Makefile - CFLAGS=-I$(ROOT_DIR)/$(LIBMNL_DIR)/include LDFLAGS=-L$(ROOT_DIR)/$(LIBMNL_DIR)/src/.libs make -C $(WIREGUARD_DIR)/src/tools CC=$(GCC) +$(WG_TARGET): $(LIBMNL_DIR)/src/.libs/libmnl.a $(WIREGUARD_TOOLS_DIR)/src/Makefile + CFLAGS=-I$(ROOT_DIR)/$(LIBMNL_DIR)/include LDFLAGS=-L$(ROOT_DIR)/$(LIBMNL_DIR)/src/.libs make -C $(WIREGUARD_TOOLS_DIR)/src CC=$(GCC) # Choose the correct wg-quick implementation -$(WG_QUICK_TARGET): $(WIREGUARD_DIR)/src/Makefile - cp $(WIREGUARD_DIR)/src/tools/wg-quick/linux.bash $(WG_QUICK_TARGET) +$(WG_QUICK_TARGET): $(WIREGUARD_TOOLS_DIR)/src/Makefile + cp $(WIREGUARD_TOOLS_DIR)/src/wg-quick/linux.bash $(WG_QUICK_TARGET) # Build wireguard.ko kernel module -$(WG_MODULE_TARGET): +$(WG_MODULE_TARGET): $(WIREGUARD_DIR)/src/Makefile make -C $(WIREGUARD_DIR)/src module ARCH=$(ARCH) KERNELDIR=$(KSRC) install: all @@ -63,4 +73,4 @@ install: all install $(WG_MODULE_TARGET) $(DESTDIR)/wireguard/ clean: - rm -rf $(LIBMNL_TAR) $(LIBMNL_DIR) $(WIREGUARD_TAR) $(WIREGUARD_DIR) + rm -rf $(LIBMNL_TAR) $(LIBMNL_DIR) $(WIREGUARD_TAR) $(WIREGUARD_DIR) $(WIREGUARD_TOOLS_TAR) $(WIREGUARD_TOOLS_DIR) diff --git a/README.rst b/README.rst index 96a993f..900073c 100644 --- a/README.rst +++ b/README.rst @@ -146,7 +146,7 @@ Now we can build for any platform and DSM version using: .. code-block:: bash - sudo docker run --rm --privileged --env PACKAGE_ARCH= --env DSM_VER= -v $(pwd)/artifacts:/result_spk -v $(pwd)/sdk_cache:/toolkit_tarballs synobuild + sudo docker run --rm --privileged --env PACKAGE_ARCH= --env DSM_VER= -v $(pwd)/artifacts:/result_spk synobuild You should replace ```` with your NAS's package arch. Using `this table `_ @@ -158,7 +158,7 @@ For the DS218j that I have, the complete command looks like this: .. code-block:: bash - sudo docker run --rm --privileged --env PACKAGE_ARCH=armada38x --env DSM_VER=6.2 -v $(pwd)/artifacts:/result_spk -v $(pwd)/sdk_cache:/toolkit_tarballs synobuild + sudo docker run --rm --privileged --env PACKAGE_ARCH=armada38x --env DSM_VER=6.2 -v $(pwd)/artifacts:/result_spk synobuild If everything worked you should have a directory called ``artifacts`` that contains your SPK files.