From b2c1d37b73e3e86a91b99ba1a80cd7b72e55da0d Mon Sep 17 00:00:00 2001 From: Andreas Runfalk Date: Fri, 22 Mar 2019 16:11:03 +0100 Subject: [PATCH] Added support for apollolake builds --- Makefile | 3 +++ README.rst | 29 +++++++++++++++-------------- build.sh | 10 ++++++++++ 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index 22d4d68..d9dd786 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,6 @@ WIREGUARD_VERSION ?= 0.0.20190227 LIBMNL_VERSION ?= 1.0.4 +HAS_MEMNEQ ?= 0 LIBMNL_TAR := libmnl-$(LIBMNL_VERSION).tar.bz2 LIBMNL_DIR := libmnl-$(LIBMNL_VERSION) @@ -39,7 +40,9 @@ $(WIREGUARD_TAR): # use memneq implementation as it doesn't appear to be included on the D218j. $(WIREGUARD_DIR)/src/Makefile: $(WIREGUARD_TAR) tar -xf $(WIREGUARD_TAR) +ifeq ($(HAS_MEMNEQ), 0) patch $(WIREGUARD_DIR)/src/compat/Kbuild.include $(ROOT_DIR)/memneq.patch +endif # Build the wg command line tool $(WG_TARGET): $(LIBMNL_DIR)/src/.libs/libmnl.a $(WIREGUARD_DIR)/src/Makefile diff --git a/README.rst b/README.rst index 569c3f8..1623aeb 100644 --- a/README.rst +++ b/README.rst @@ -18,20 +18,21 @@ Compatibility list ------------------ The following drives have been tested: -========= ========= =========== =========================== -Model Platform DSM Version Is working? ---------- --------- ----------- --------------------------- -DS114 armada370 *N/A* No (Kernel version too old) -DS115j armada370 *N/A* No (Kernel version too old) -DS213j armada370 *N/A* No (Kernel version too old) -DS213j armada370 *N/A* No (Kernel version too old) -DS214play armada370 *N/A* No (Kernel version too old) -DS214se armada370 *N/A* No (Kernel version too old) -DS216se armada370 *N/A* No (Kernel version too old) -DS218j armada38x 6.2 Yes -DS414slim armada370 *N/A* No (Kernel version too old) -RS214 armada370 *N/A* No (Kernel version too old) -========= ========= =========== =========================== +========= ========== =========== =========================== +Model Platform DSM Version Is working? +--------- ---------- ----------- --------------------------- +DS114 armada370 *N/A* No (Kernel version too old) +DS115j armada370 *N/A* No (Kernel version too old) +DS213j armada370 *N/A* No (Kernel version too old) +DS213j armada370 *N/A* No (Kernel version too old) +DS214play armada370 *N/A* No (Kernel version too old) +DS214se armada370 *N/A* No (Kernel version too old) +DS216se armada370 *N/A* No (Kernel version too old) +DS218j armada38x 6.2 Yes +DS218+ apollolake 6.2 Yes +DS414slim armada370 *N/A* No (Kernel version too old) +RS214 armada370 *N/A* No (Kernel version too old) +========= ========== =========== =========================== The minimum required kernel version is 3.10. If you have a kernel version lower than that, WireGuard will not work. You can check your kernel version by diff --git a/build.sh b/build.sh index 05fc2c2..cc3b6c1 100755 --- a/build.sh +++ b/build.sh @@ -40,6 +40,16 @@ fi # Disable quit if errors to allow printing of logfiles set +e +# By default we patch WireGuard to always use include its own memneq +# implemenation. This is required on most NASes, but some of them come with +# built in memneq support. Unless HAS_MEMNEQ is defined we set it for models +# that support it here. +if [ -z ${HAS_MEMNEQ+x} ]; then + if [ "$PACKAGE_ARCH" == "apollolake" ]; then + export HAS_MEMNEQ=1 + fi +fi + # Build packages # -p package arch # -v DSM version