Message ID | 20200512110634.21976-1-fe@dev.tdt.de |
---|---|
State | Rejected |
Delegated to: | Petr Štetiar |
Headers | show |
Series | [OpenWrt-Devel,v3] wireguard-tools: fix version indicator | expand |
Is this a patch you'd like to send upstream to wireguard@lists.zx2c4.com?
> Is this a patch you'd like to send upstream to > wireguard@lists.zx2c4.com? Yes this would be the fix for the version problem in Openwrt. This would be nice if this gets applied into the wireguard repository.
diff --git a/package/network/utils/wireguard-tools/patches/0001-wireguard-tools-fix-version.patch b/package/network/utils/wireguard-tools/patches/0001-wireguard-tools-fix-version.patch new file mode 100644 index 0000000000..7a5f32566d --- /dev/null +++ b/package/network/utils/wireguard-tools/patches/0001-wireguard-tools-fix-version.patch @@ -0,0 +1,11 @@ +--- a/src/Makefile ++++ b/src/Makefile +@@ -46,7 +46,7 @@ CFLAGS += -DRUNSTATEDIR="\"$(RUNSTATEDIR + ifeq ($(DEBUG),yes) + CFLAGS += -g + endif +-WIREGUARD_TOOLS_VERSION = $(patsubst v%,%,$(shell GIT_CEILING_DIRECTORIES="$(PWD)/../.." git describe --dirty 2>/dev/null)) ++WIREGUARD_TOOLS_VERSION = $(patsubst v%,%,$(shell GIT_DIR="$(PWD)/../.git" git describe --dirty 2>/dev/null)) + ifneq ($(WIREGUARD_TOOLS_VERSION),) + CFLAGS += -D'WIREGUARD_TOOLS_VERSION="$(WIREGUARD_TOOLS_VERSION)"' + endif
If we execute `wg --version` we get a diffrent version string that does not match with the version string in the openwrt makefile. Current version string: `wireguard-tools vreboot-13159-gac5caa2718 -https://git.zx2c4.com/wireguard-tools/` Corrected versions string: `wireguard-tools v1.0.20200319 - https://git.zx2c4.com/wireguard-tools/` This had already led to confusion! To fix this, the version string of the wireguard source code include file 'src/version.h' must be used. This is achieved by removing version string generation from the wireguard-tools src/Makefile during build. Signed-off-by: Florian Eckert <fe@dev.tdt.de> --- v2: Update commit message v3: Suggest a different solution with GIT_DIR .../patches/0001-wireguard-tools-fix-version.patch | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 package/network/utils/wireguard-tools/patches/0001-wireguard-tools-fix-version.patch