Updated Wireguard version to 0.0.20191226. This also means this project supports the non-monolithic releases

This commit is contained in:
Andreas Runfalk 2019-12-28 22:37:29 +01:00
parent db3414691a
commit 928a1338b5
3 changed files with 25 additions and 15 deletions

View File

@ -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)"

View File

@ -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)

View File

@ -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=<arch> --env DSM_VER=<dsm-ver> -v $(pwd)/artifacts:/result_spk -v $(pwd)/sdk_cache:/toolkit_tarballs synobuild
sudo docker run --rm --privileged --env PACKAGE_ARCH=<arch> --env DSM_VER=<dsm-ver> -v $(pwd)/artifacts:/result_spk synobuild
You should replace ``<arch>`` with your NAS's package arch. Using
`this table <https://www.synology.com/en-global/knowledgebase/DSM/tutorial/General/What_kind_of_CPU_does_my_NAS_have>`_
@ -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.