aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-08-06 20:40:35 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-08-06 20:40:35 +0200
commit3b1011a89a59b1185502f50d5d27625fdcc51d7d (patch)
tree3ec0542c41b955ab9069cdf85c4e0b3f51f9009a /src
parentchacha20poly1305: selftest: use arrays for test vectors (diff)
downloadwireguard-monolithic-historical-3b1011a89a59b1185502f50d5d27625fdcc51d7d.tar.xz
wireguard-monolithic-historical-3b1011a89a59b1185502f50d5d27625fdcc51d7d.zip
qemu: add easy git harness
Diffstat (limited to 'src')
-rw-r--r--src/tests/qemu/Makefile9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/tests/qemu/Makefile b/src/tests/qemu/Makefile
index 51e5e92..cef3f4b 100644
--- a/src/tests/qemu/Makefile
+++ b/src/tests/qemu/Makefile
@@ -14,7 +14,7 @@ endif
ARCH := $(firstword $(subst -, ,$(CBUILD)))
# Set these from the environment to override
-KERNEL_VERSION ?= 4.17.9
+KERNEL_VERSION ?= 4.17.12
KERNEL_VERSION := $(KERNEL_VERSION)$(if $(DEBUG_KERNEL),$(if $(findstring -debug,$(KERNEL_VERSION)),,-debug),)
BUILD_PATH ?= $(PWD)/../../../qemu-build/$(ARCH)
DISTFILES_PATH ?= $(PWD)/distfiles
@@ -215,6 +215,7 @@ $(BUILD_PATH)/init-cpio-spec.txt:
echo "file /lib/libc.so $(MUSL_PATH)/lib/libc.so 755 0 0" >> $@
echo "slink /lib/ld-linux.so.1 libc.so 777 0 0" >> $@
+ifeq ($(findstring -git,$(KERNEL_VERSION)),)
$(KERNEL_PATH)/.installed: $(KERNEL_TAR)
mkdir -p $(KERNEL_PATH)
flock -s $<.lock tar --strip-components=1 -C $(KERNEL_PATH) -xf $<
@@ -222,6 +223,12 @@ $(KERNEL_PATH)/.installed: $(KERNEL_TAR)
sed -i "/^obj-\$$(CONFIG_NETFILTER).*+=/a obj-\$$(CONFIG_WIREGUARD) += wireguard/" $(KERNEL_PATH)/net/Makefile
ln -sfT $(shell readlink -f ../..) $(KERNEL_PATH)/net/wireguard
touch $@
+else
+$(KERNEL_PATH)/.installed:
+ mkdir -p $(dir $(KERNEL_PATH))
+ flock -s $(dir $(KERNEL_TAR))/$(KERNEL_VERSION).lock git clone $(GIT_URI_$(patsubst %-git,%,$(patsubst %-debug,%,$(KERNEL_VERSION)))) $(KERNEL_PATH)
+ touch $@
+endif
$(KERNEL_PATH)/.config: kernel.config arch/$(QEMU_ARCH).config | $(KERNEL_PATH)/.installed
cp kernel.config $(KERNEL_PATH)/minimal.config