net/wireguard: add wireguard importer
Signed-off-by: djb77 <dwayne.bakewell@gmail.com>
This commit is contained in:
parent
7bc62ee95b
commit
ab705983a5
1
net/.gitignore
vendored
Normal file
1
net/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
wireguard/
|
|
@ -80,6 +80,7 @@ config INET
|
|||
Short answer: say Y.
|
||||
|
||||
if INET
|
||||
source "net/wireguard/Kconfig"
|
||||
source "net/ipv4/Kconfig"
|
||||
source "net/ipv6/Kconfig"
|
||||
source "net/netlabel/Kconfig"
|
||||
|
|
|
@ -14,6 +14,7 @@ obj-$(CONFIG_NET) += $(tmp-y)
|
|||
obj-$(CONFIG_LLC) += llc/
|
||||
obj-$(CONFIG_NET) += ethernet/ 802/ sched/ netlink/
|
||||
obj-$(CONFIG_NETFILTER) += netfilter/
|
||||
obj-$(CONFIG_WIREGUARD) += wireguard/
|
||||
obj-$(CONFIG_INET) += ipv4/
|
||||
obj-$(CONFIG_XFRM) += xfrm/
|
||||
obj-$(CONFIG_UNIX) += unix/
|
||||
|
|
|
@ -358,3 +358,4 @@ endif
|
|||
endef
|
||||
#
|
||||
###############################################################################
|
||||
$(shell cd "$(srctree)" && ./scripts/fetch-latest-wireguard.sh)
|
||||
|
|
18
scripts/fetch-latest-wireguard.sh
Executable file
18
scripts/fetch-latest-wireguard.sh
Executable file
|
@ -0,0 +1,18 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
USER_AGENT="WireGuard-AndroidROMBuild/0.1 ($(uname -a))"
|
||||
|
||||
[[ $(( $(date +%s) - $(stat -c %Y "net/wireguard/.check" 2>/dev/null || echo 0) )) -gt 86400 ]] || exit 0
|
||||
|
||||
[[ $(curl -A "$USER_AGENT" -LSs https://git.zx2c4.com/WireGuard/refs/) =~ snapshot/WireGuard-([0-9.]+)\.tar\.xz ]]
|
||||
|
||||
if [[ -f net/wireguard/version.h && $(< net/wireguard/version.h) == *${BASH_REMATCH[1]}* ]]; then
|
||||
touch net/wireguard/.check
|
||||
exit 0
|
||||
fi
|
||||
|
||||
rm -rf net/wireguard
|
||||
mkdir -p net/wireguard
|
||||
curl -A "$USER_AGENT" -LsS "https://git.zx2c4.com/WireGuard/snapshot/WireGuard-${BASH_REMATCH[1]}.tar.xz" | tar -C "net/wireguard" -xJf - --strip-components=2 "WireGuard-${BASH_REMATCH[1]}/src"
|
||||
sed -i 's/tristate/bool/;s/default m/default y/;' net/wireguard/Kconfig
|
||||
touch net/wireguard/.check
|
Loading…
Reference in New Issue
Block a user