Development discussion of WireGuard
 help / color / mirror / Atom feed
* [PATCH 1/1] add dkms configuration file dkms.conf
@ 2016-12-03 12:30 Christian Hesse
  2016-12-03 12:42 ` [PATCH v2 " Christian Hesse
  0 siblings, 1 reply; 8+ messages in thread
From: Christian Hesse @ 2016-12-03 12:30 UTC (permalink / raw)
  To: wireguard; +Cc: Christian Hesse

From: Christian Hesse <mail@eworm.de>

This add dkms configuration file dkms.conf and target in Makefile to
update the version.

Signed-off-by: Christian Hesse <mail@eworm.de>
---
 src/Makefile  | 14 ++++++++++----
 src/dkms.conf | 11 +++++++++++
 2 files changed, 21 insertions(+), 4 deletions(-)
 create mode 100644 src/dkms.conf

diff --git a/src/Makefile b/src/Makefile
index 20947ac..f5ab275 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -6,11 +6,17 @@ debug: module-debug tools
 
 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 && \
+	ver="$$(git describe --dirty 2>/dev/null)" && \
+	[ "$$(cut -d\" -f2 version.h 2>/dev/null)" != "$$ver" ] && \
+	echo "#define WIREGUARD_VERSION \"$$ver\"" && \
 	git update-index --assume-unchanged version.h || true
 
+dkms.conf:
+	ver="$$(git describe --dirty 2>/dev/null)" && \
+	[ "$$(grep PACKAGE_VERSION dkms.conf | cut -d\" -f2)" != "$$ver" ] && \
+	sed -i "/PACKAGE_VERSION/c PACKAGE_VERSION=\"$$ver\"" dkms.conf && \
+	git update-index --assume-unchanged dkms.conf || true
+
 module: version.h
 	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
 
@@ -38,4 +44,4 @@ cloc: clean
 
 include tests/debug.mk
 
-.PHONY: all module module-debug tools install clean core-cloc check version.h
+.PHONY: all module module-debug tools install clean core-cloc check version.h dkms.conf
diff --git a/src/dkms.conf b/src/dkms.conf
new file mode 100644
index 0000000..cef8e6d
--- /dev/null
+++ b/src/dkms.conf
@@ -0,0 +1,11 @@
+#
+# Linux DKMS config script for the WireGuard kernel module
+#
+
+PACKAGE_NAME="wireguard"
+PACKAGE_VERSION="experimental-0.0.20161129-3-g27f0e1e-dirty"
+AUTOINSTALL="yes"
+
+BUILT_MODULE_NAME="wireguard"
+DEST_MODULE_LOCATION="/kernel/net"
+
-- 
2.10.2

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2 1/1] add dkms configuration file dkms.conf
  2016-12-03 12:30 [PATCH 1/1] add dkms configuration file dkms.conf Christian Hesse
@ 2016-12-03 12:42 ` Christian Hesse
  2016-12-03 22:21   ` Jason A. Donenfeld
  0 siblings, 1 reply; 8+ messages in thread
From: Christian Hesse @ 2016-12-03 12:42 UTC (permalink / raw)
  To: wireguard; +Cc: Christian Hesse

From: Christian Hesse <mail@eworm.de>

This add dkms configuration file dkms.conf and target in Makefile to
update the version.

Signed-off-by: Christian Hesse <mail@eworm.de>
---
 src/Makefile  | 14 ++++++++++----
 src/dkms.conf | 11 +++++++++++
 2 files changed, 21 insertions(+), 4 deletions(-)
 create mode 100644 src/dkms.conf

diff --git a/src/Makefile b/src/Makefile
index 20947ac..f5ab275 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -6,11 +6,17 @@ debug: module-debug tools
 
 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 && \
+	ver="$$(git describe --dirty 2>/dev/null)" && \
+	[ "$$(cut -d\" -f2 version.h 2>/dev/null)" != "$$ver" ] && \
+	echo "#define WIREGUARD_VERSION \"$$ver\"" > version.h && \
 	git update-index --assume-unchanged version.h || true
 
+dkms.conf:
+	ver="$$(git describe --dirty 2>/dev/null)" && \
+	[ "$$(grep PACKAGE_VERSION dkms.conf | cut -d\" -f2)" != "$$ver" ] && \
+	sed -i "/PACKAGE_VERSION/c PACKAGE_VERSION=\"$$ver\"" dkms.conf && \
+	git update-index --assume-unchanged dkms.conf || true
+
 module: version.h
 	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
 
@@ -38,4 +44,4 @@ cloc: clean
 
 include tests/debug.mk
 
-.PHONY: all module module-debug tools install clean core-cloc check version.h
+.PHONY: all module module-debug tools install clean core-cloc check version.h dkms.conf
diff --git a/src/dkms.conf b/src/dkms.conf
new file mode 100644
index 0000000..cef8e6d
--- /dev/null
+++ b/src/dkms.conf
@@ -0,0 +1,11 @@
+#
+# Linux DKMS config script for the WireGuard kernel module
+#
+
+PACKAGE_NAME="wireguard"
+PACKAGE_VERSION="experimental-0.0.20161129-3-g27f0e1e-dirty"
+AUTOINSTALL="yes"
+
+BUILT_MODULE_NAME="wireguard"
+DEST_MODULE_LOCATION="/kernel/net"
+
-- 
2.10.2

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/1] add dkms configuration file dkms.conf
  2016-12-03 12:42 ` [PATCH v2 " Christian Hesse
@ 2016-12-03 22:21   ` Jason A. Donenfeld
  2016-12-06  9:35     ` Christian Hesse
  0 siblings, 1 reply; 8+ messages in thread
From: Jason A. Donenfeld @ 2016-12-03 22:21 UTC (permalink / raw)
  To: Christian Hesse; +Cc: Christian Hesse, WireGuard mailing list

I like the general idea here of including dkim in WireGuard now, since
basically all distros use it and ship the exact same logic. By putting
it in WireGuard itself, I can provide maintenance over the
interworkings, which will be helpful for downstream.

Another thing I can do is handle the installation myself. `make dkim`
will then copy all the paths and create the dkim.conf file, etc. First
question: is there a standard destination path to which files should
be copied. Second question: what environment variable name do you
think would be appropriate for representing the destination address
(override)?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/1] add dkms configuration file dkms.conf
  2016-12-03 22:21   ` Jason A. Donenfeld
@ 2016-12-06  9:35     ` Christian Hesse
  2016-12-06 18:14       ` Jason A. Donenfeld
  0 siblings, 1 reply; 8+ messages in thread
From: Christian Hesse @ 2016-12-06  9:35 UTC (permalink / raw)
  To: Jason A. Donenfeld; +Cc: Christian Hesse, WireGuard mailing list

[-- Attachment #1: Type: text/plain, Size: 1840 bytes --]

"Jason A. Donenfeld" <Jason@zx2c4.com> on Sat, 2016/12/03 23:21:
> I like the general idea here of including dkim in WireGuard now, 

'dkim' is mail security... We have dkms. ;)

> since
> basically all distros use it and ship the exact same logic. By putting
> it in WireGuard itself, I can provide maintenance over the
> interworkings, which will be helpful for downstream.
> 
> Another thing I can do is handle the installation myself. `make dkim`
> will then copy all the paths and create the dkim.conf file, etc. First
> question: is there a standard destination path to which files should
> be copied.

For Arch Linux we install dkms sources to /usr/src/$pkgname-$pkgver, so for
wireguard we have: /usr/src/wireguard-0.0.20161129/

So directory content looks something like this:

/usr/src/wireguard-0.0.20161129/
/usr/src/wireguard-0.0.20161129/Kbuild
/usr/src/wireguard-0.0.20161129/Kconfig
/usr/src/wireguard-0.0.20161129/Makefile
/usr/src/wireguard-0.0.20161129/dkms.conf
/usr/src/wireguard-0.0.20161129/*.c
/usr/src/wireguard-0.0.20161129/*.h
/usr/src/wireguard-0.0.20161129/crypto/
/usr/src/wireguard-0.0.20161129/crypto/*.S
/usr/src/wireguard-0.0.20161129/crypto/*.c
/usr/src/wireguard-0.0.20161129/crypto/*.h
/usr/src/wireguard-0.0.20161129/selftest/
/usr/src/wireguard-0.0.20161129/selftest/*.h

> Second question: what environment variable name do you
> think would be appropriate for representing the destination address
> (override)?

To have something like this would be great:

make DESTDIR="$pkgdir/" DKMSDIR="/usr/src/$pkgname-$pkgver" dkms
-- 
main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
"CX:;",b;for(a/*    Best regards             my address:    */=0;b=c[a++];)
putchar(b-1/(/*    Chris            cc -ox -xc - && ./x    */b/42*2-3)*42);}

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/1] add dkms configuration file dkms.conf
  2016-12-06  9:35     ` Christian Hesse
@ 2016-12-06 18:14       ` Jason A. Donenfeld
  2016-12-06 18:57         ` Jason A. Donenfeld
  2016-12-06 20:15         ` Christian Hesse
  0 siblings, 2 replies; 8+ messages in thread
From: Jason A. Donenfeld @ 2016-12-06 18:14 UTC (permalink / raw)
  To: Christian Hesse; +Cc: Christian Hesse, WireGuard mailing list

On Tue, Dec 6, 2016 at 10:35 AM, Christian Hesse <list@eworm.de> wrote:
> "Jason A. Donenfeld" <Jason@zx2c4.com> on Sat, 2016/12/03 23:21:
> > I like the general idea here of including dkim in WireGuard now,
>
> 'dkim' is mail security... We have dkms. ;)

Lol!

> For Arch Linux we install dkms sources to /usr/src/$pkgname-$pkgver, so for
> wireguard we have: /usr/src/wireguard-0.0.20161129/
> To have something like this would be great:
> make DESTDIR="$pkgdir/" DKMSDIR="/usr/src/$pkgname-$pkgver" dkms

How does this look to you:
https://git.zx2c4.com/WireGuard/commit/?id=b70677fb8af28cbaec810146144858ad07a879ed

You can simply run:

make DESTDIR="$pkgdir/" DKMSDIR="/usr/src/$pkgname-$pkgver" dkms-install

You can also adjust SRCDIR or PREFIX, but I imagine you'll want to
keep these as is. All variables are also inherited from the
environment, so if the package manager sets these globally, things are
even easier.

What do you think of that?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/1] add dkms configuration file dkms.conf
  2016-12-06 18:14       ` Jason A. Donenfeld
@ 2016-12-06 18:57         ` Jason A. Donenfeld
  2016-12-06 20:15         ` Christian Hesse
  1 sibling, 0 replies; 8+ messages in thread
From: Jason A. Donenfeld @ 2016-12-06 18:57 UTC (permalink / raw)
  To: Christian Hesse; +Cc: Christian Hesse, WireGuard mailing list

Here's what the change looks like in the gentoo ebuild:
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5162a26ae15cd7ce4c1aa4c5b8a053e2043aec71

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/1] add dkms configuration file dkms.conf
  2016-12-06 18:14       ` Jason A. Donenfeld
  2016-12-06 18:57         ` Jason A. Donenfeld
@ 2016-12-06 20:15         ` Christian Hesse
  2016-12-06 21:31           ` Jason A. Donenfeld
  1 sibling, 1 reply; 8+ messages in thread
From: Christian Hesse @ 2016-12-06 20:15 UTC (permalink / raw)
  To: Jason A. Donenfeld; +Cc: Christian Hesse, WireGuard mailing list

[-- Attachment #1: Type: text/plain, Size: 1529 bytes --]

"Jason A. Donenfeld" <Jason@zx2c4.com> on Tue, 2016/12/06 19:14:
> On Tue, Dec 6, 2016 at 10:35 AM, Christian Hesse <list@eworm.de> wrote:
> > "Jason A. Donenfeld" <Jason@zx2c4.com> on Sat, 2016/12/03 23:21:  
> > > I like the general idea here of including dkim in WireGuard now,  
> >
> > 'dkim' is mail security... We have dkms. ;)  
> 
> Lol!
> 
> > For Arch Linux we install dkms sources to /usr/src/$pkgname-$pkgver, so
> > for wireguard we have: /usr/src/wireguard-0.0.20161129/
> > To have something like this would be great:
> > make DESTDIR="$pkgdir/" DKMSDIR="/usr/src/$pkgname-$pkgver" dkms  
> 
> How does this look to you:
> https://git.zx2c4.com/WireGuard/commit/?id=b70677fb8af28cbaec810146144858ad07a879ed
> 
> You can simply run:
> 
> make DESTDIR="$pkgdir/" DKMSDIR="/usr/src/$pkgname-$pkgver" dkms-install
> 
> You can also adjust SRCDIR or PREFIX, but I imagine you'll want to
> keep these as is. All variables are also inherited from the
> environment, so if the package manager sets these globally, things are
> even easier.
> 
> What do you think of that?

Looks good!

Here are my changes for the git package:

https://aur.archlinux.org/cgit/aur.git/commit/?h=wireguard-git&id=dbb8a8cd7a98d3e5d338a4c1103eb7fae1b4c40c

Thanks a lot!
-- 
main(a){char*c=/*    Schoene Gruesse                         */"B?IJj;MEH"
"CX:;",b;for(a/*    Best regards             my address:    */=0;b=c[a++];)
putchar(b-1/(/*    Chris            cc -ox -xc - && ./x    */b/42*2-3)*42);}

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 1/1] add dkms configuration file dkms.conf
  2016-12-06 20:15         ` Christian Hesse
@ 2016-12-06 21:31           ` Jason A. Donenfeld
  0 siblings, 0 replies; 8+ messages in thread
From: Jason A. Donenfeld @ 2016-12-06 21:31 UTC (permalink / raw)
  To: Christian Hesse; +Cc: Christian Hesse, WireGuard mailing list

Great -- good to hear it works well with the Arch package.

Daniel -- is this something you'll find similarly useful for the Debian package?

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-12-06 21:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-03 12:30 [PATCH 1/1] add dkms configuration file dkms.conf Christian Hesse
2016-12-03 12:42 ` [PATCH v2 " Christian Hesse
2016-12-03 22:21   ` Jason A. Donenfeld
2016-12-06  9:35     ` Christian Hesse
2016-12-06 18:14       ` Jason A. Donenfeld
2016-12-06 18:57         ` Jason A. Donenfeld
2016-12-06 20:15         ` Christian Hesse
2016-12-06 21:31           ` Jason A. Donenfeld

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).