aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-05-22 21:37:27 -0600
committerJason A. Donenfeld <Jason@zx2c4.com>2020-05-22 21:37:27 -0600
commit4f15060e9503ff7a1ea51942bdacfe7f1ede4bd2 (patch)
tree1c507d0509bb3d198b27859a575393a58da4b53b
parentcompat: backport iptunnel_xmit to 3.11 (diff)
downloadwireguard-linux-compat-4f15060e9503ff7a1ea51942bdacfe7f1ede4bd2.tar.xz
wireguard-linux-compat-4f15060e9503ff7a1ea51942bdacfe7f1ede4bd2.zip
qemu: support fetching kernels for arbitrary URLs
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--src/tests/qemu/Makefile12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/tests/qemu/Makefile b/src/tests/qemu/Makefile
index c08e324..cdb2a34 100644
--- a/src/tests/qemu/Makefile
+++ b/src/tests/qemu/Makefile
@@ -43,13 +43,23 @@ $(DISTFILES_PATH)/$(1):
flock -x $$@.lock -c '[ -f $$@ ] && exit 0; wget -O $$@ $(MIRROR)$(1) || wget -t inf --retry-on-http-error=404 -O $$@ $(2)$(1) || rm -f $$@'
endef
+ifneq ($(findstring https://,$(KERNEL_VERSION)),)
+KERNEL_URL := $(word 1,$(KERNEL_VERSION))
+KERNEL_NAME := $(word 2,$(KERNEL_VERSION))
+KERNEL_TAR := $(DISTFILES_PATH)/$(KERNEL_NAME)-$(notdir $(KERNEL_URL))
+KERNEL_PATH := $(BUILD_PATH)/$(KERNEL_NAME)
+KERNEL_VERSION := $(KERNEL_NAME)
+$(KERNEL_TAR):
+ mkdir -p $(DISTFILES_PATH)
+ flock -x $@.lock -c '[ -f $@ ] && exit 0; wget -O $@ $(KERNEL_URL) || rm -f $@'
+else
ifeq ($(findstring -rc,$(KERNEL_VERSION)),)
KERNEL_URL_DIRECTORY := https://cdn.kernel.org/pub/linux/kernel/v$(firstword $(subst ., ,$(KERNEL_VERSION:-debug=))).x/
else
KERNEL_URL_DIRECTORY := https://git.kernel.org/torvalds/t/
endif
-
$(eval $(call tar_download,KERNEL,linux,$(KERNEL_VERSION),.tar.gz,$(KERNEL_URL_DIRECTORY)))
+endif
$(eval $(call tar_download,MUSL,musl,1.1.24,.tar.gz,https://www.musl-libc.org/releases/))
$(eval $(call tar_download,LIBMNL,libmnl,1.0.4,.tar.bz2,https://www.netfilter.org/projects/libmnl/files/))
$(eval $(call tar_download,IPERF,iperf,3.7,.tar.gz,https://downloads.es.net/pub/iperf/))