diff options
-rw-r--r-- | src/Makefile | 13 | ||||
-rw-r--r-- | src/main.c | 3 | ||||
-rw-r--r-- | src/tests/qemu/init.c | 2 | ||||
-rw-r--r-- | src/version.h | 1 |
4 files changed, 14 insertions, 5 deletions
diff --git a/src/Makefile b/src/Makefile index 2ca55ec..20947ac 100644 --- a/src/Makefile +++ b/src/Makefile @@ -4,10 +4,17 @@ PWD := $(shell pwd) all: module tools debug: module-debug tools -module: +version.h: + @export GIT_CEILING_DIRECTORIES="$$(readlink -f ../..)" && \ + ver="#define WIREGUARD_VERSION \"$$(git describe --dirty 2>/dev/null)\"" && \ + [ "$$(cat version.h 2>/dev/null)" != "$$ver" ] && \ + echo "$$ver" > version.h && \ + git update-index --assume-unchanged version.h || true + +module: version.h $(MAKE) -C $(KERNELDIR) M=$(PWD) modules -module-debug: +module-debug: version.h $(MAKE) -C $(KERNELDIR) M=$(PWD) V=1 CONFIG_WIREGUARD_DEBUG=y modules clean: @@ -31,4 +38,4 @@ cloc: clean include tests/debug.mk -.PHONY: all module module-debug tools install clean core-cloc check +.PHONY: all module module-debug tools install clean core-cloc check version.h @@ -1,5 +1,6 @@ /* Copyright 2015-2016 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. */ +#include "version.h" #include "device.h" #include "noise.h" #include "packets.h" @@ -43,7 +44,7 @@ static int __init mod_init(void) return ret; } - pr_info("WireGuard loaded. See www.wireguard.io for information.\n"); + pr_info("WireGuard " WIREGUARD_VERSION " loaded. See www.wireguard.io for information.\n"); pr_info("(C) Copyright 2015-2016 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.\n"); return ret; } diff --git a/src/tests/qemu/init.c b/src/tests/qemu/init.c index 04ab8fd..488f504 100644 --- a/src/tests/qemu/init.c +++ b/src/tests/qemu/init.c @@ -123,7 +123,7 @@ static void kmod_selftests(void) continue; start += 11; *strchrnul(start, '\n') = '\0'; - if (strstr(start, "WireGuard loaded.")) + if (strstr(start, "www.wireguard.io")) break; pass = strstr(start, ": pass"); if (!pass || pass[6] != '\0') { diff --git a/src/version.h b/src/version.h new file mode 100644 index 0000000..83bad72 --- /dev/null +++ b/src/version.h @@ -0,0 +1 @@ +#define WIREGUARD_VERSION "experimental-0.0.20161116.1" |