summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2016-11-18 05:37:55 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2016-11-21 01:00:07 +0100
commitf5303636391623f844b84187ec286abdc461026a (patch)
tree7e343c3f97402cc24938bd08f2c1f0775d95dad9
parentchacha20poly1305: sse/ymm should be implicit (diff)
downloadwireguard-monolithic-historical-f5303636391623f844b84187ec286abdc461026a.tar.xz
wireguard-monolithic-historical-f5303636391623f844b84187ec286abdc461026a.zip
main: add version to dmesg
-rw-r--r--src/Makefile13
-rw-r--r--src/main.c3
-rw-r--r--src/tests/qemu/init.c2
-rw-r--r--src/version.h1
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
diff --git a/src/main.c b/src/main.c
index e4787ac..77e8e6e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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"