1
- WIREGUARD_VERSION ?= 0.0.20190702
1
+ WIREGUARD_VERSION ?= 0.0.20191226
2
+ WIREGUARD_TOOLS_VERSION ?= 1.0.20191226
2
3
LIBMNL_VERSION ?= 1.0.4
3
4
HAS_MEMNEQ ?= 0
4
5
5
6
LIBMNL_TAR := libmnl-$(LIBMNL_VERSION ) .tar.bz2
6
7
LIBMNL_DIR := libmnl-$(LIBMNL_VERSION )
7
8
8
- WIREGUARD_TAR := WireGuard -$(WIREGUARD_VERSION ) .tar.xz
9
- WIREGUARD_DIR := WireGuard -$(WIREGUARD_VERSION )
9
+ WIREGUARD_TAR := wireguard-linux-compat -$(WIREGUARD_VERSION ) .tar.xz
10
+ WIREGUARD_DIR := wireguard-linux-compat -$(WIREGUARD_VERSION )
10
11
11
- WG_TARGET := $(WIREGUARD_DIR ) /src/tools/wg
12
- WG_QUICK_TARGET := $(WIREGUARD_DIR ) /wg-quick
12
+ WIREGUARD_TOOLS_TAR := wireguard-tools-$(WIREGUARD_TOOLS_VERSION ) .tar.xz
13
+ WIREGUARD_TOOLS_DIR := wireguard-tools-$(WIREGUARD_TOOLS_VERSION )
14
+
15
+ WG_TARGET := $(WIREGUARD_TOOLS_DIR ) /src/wg
16
+ WG_QUICK_TARGET := $(WIREGUARD_TOOLS_DIR ) /wg-quick
13
17
WG_MODULE_TARGET := $(WIREGUARD_DIR ) /src/wireguard.ko
14
18
15
19
GCC := $(CROSS_COMPILE ) gcc
@@ -34,7 +38,10 @@ $(LIBMNL_DIR)/src/.libs/libmnl.a: $(LIBMNL_DIR)/Makefile
34
38
35
39
# Download WireGuard source tarball
36
40
$(WIREGUARD_TAR ) :
37
- wget https://git.zx2c4.com/WireGuard/snapshot/$(WIREGUARD_TAR )
41
+ wget https://git.zx2c4.com/wireguard-linux-compat/snapshot/$(WIREGUARD_TAR )
42
+
43
+ $(WIREGUARD_TOOLS_TAR ) :
44
+ wget https://git.zx2c4.com/wireguard-tools/snapshot/$(WIREGUARD_TOOLS_TAR )
38
45
39
46
# Unpack WireGuard source tarball and patch the compatibility layer to always
40
47
# use memneq implementation as it doesn't appear to be included on the D218j.
@@ -44,16 +51,19 @@ ifeq ($(HAS_MEMNEQ), 0)
44
51
patch $(WIREGUARD_DIR)/src/compat/Kbuild.include $(ROOT_DIR)/memneq.patch
45
52
endif
46
53
54
+ $(WIREGUARD_TOOLS_DIR ) /src/Makefile : $(WIREGUARD_TOOLS_TAR )
55
+ tar -xf $(WIREGUARD_TOOLS_TAR )
56
+
47
57
# Build the wg command line tool
48
- $(WG_TARGET ) : $(LIBMNL_DIR ) /src/.libs/libmnl.a $(WIREGUARD_DIR ) /src/Makefile
49
- CFLAGS=-I$(ROOT_DIR ) /$(LIBMNL_DIR ) /include LDFLAGS=-L$(ROOT_DIR ) /$(LIBMNL_DIR ) /src/.libs make -C $(WIREGUARD_DIR ) /src/tools CC=$(GCC )
58
+ $(WG_TARGET ) : $(LIBMNL_DIR ) /src/.libs/libmnl.a $(WIREGUARD_TOOLS_DIR ) /src/Makefile
59
+ CFLAGS=-I$(ROOT_DIR ) /$(LIBMNL_DIR ) /include LDFLAGS=-L$(ROOT_DIR ) /$(LIBMNL_DIR ) /src/.libs make -C $(WIREGUARD_TOOLS_DIR ) /src CC=$(GCC )
50
60
51
61
# Choose the correct wg-quick implementation
52
- $(WG_QUICK_TARGET ) : $(WIREGUARD_DIR ) /src/Makefile
53
- cp $(WIREGUARD_DIR ) /src/tools /wg-quick/linux.bash $(WG_QUICK_TARGET )
62
+ $(WG_QUICK_TARGET ) : $(WIREGUARD_TOOLS_DIR ) /src/Makefile
63
+ cp $(WIREGUARD_TOOLS_DIR ) /src/wg-quick/linux.bash $(WG_QUICK_TARGET )
54
64
55
65
# Build wireguard.ko kernel module
56
- $(WG_MODULE_TARGET ) :
66
+ $(WG_MODULE_TARGET ) : $( WIREGUARD_DIR ) /src/Makefile
57
67
make -C $(WIREGUARD_DIR ) /src module ARCH=$(ARCH ) KERNELDIR=$(KSRC )
58
68
59
69
install : all
@@ -63,4 +73,4 @@ install: all
63
73
install $(WG_MODULE_TARGET ) $(DESTDIR ) /wireguard/
64
74
65
75
clean :
66
- rm -rf $(LIBMNL_TAR ) $(LIBMNL_DIR ) $(WIREGUARD_TAR ) $(WIREGUARD_DIR )
76
+ rm -rf $(LIBMNL_TAR ) $(LIBMNL_DIR ) $(WIREGUARD_TAR ) $(WIREGUARD_DIR ) $( WIREGUARD_TOOLS_TAR ) $( WIREGUARD_TOOLS_DIR )
0 commit comments