Development discussion of WireGuard
 help / color / Atom feed
* [PATCH] compat: allow override of depmod basedir
@ 2020-07-22 11:40 mendoza.ricardo
  2020-07-24  9:09 ` Jason A. Donenfeld
  0 siblings, 1 reply; 2+ messages in thread
From: mendoza.ricardo @ 2020-07-22 11:40 UTC (permalink / raw)
  To: wireguard; +Cc: Ricardo Mendoza

From: Ricardo Mendoza <ricmm@pantacor.com>

When building in an environment with a different modules install path
we need to be able to also override the depmod basedir flag.

Signed-off-by: Ricardo Mendoza <ricmm@pantacor.com>
---
 src/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/Makefile b/src/Makefile
index c20bfd3..35e8e98 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -9,6 +9,7 @@ DESTDIR ?=
 SRCDIR ?= $(PREFIX)/src
 DKMSDIR ?= $(SRCDIR)/wireguard
 DEPMOD ?= depmod
+MODBASE ?= /
 
 PWD := $(shell pwd)
 
@@ -32,7 +33,7 @@ clean:
 
 module-install:
 	@$(MAKE) -C $(KERNELDIR) M=$(PWD) WIREGUARD_VERSION="$(WIREGUARD_VERSION)" modules_install
-	$(DEPMOD) -a $(KERNELRELEASE)
+	$(DEPMOD) -b $(MODBASE) -a $(KERNELRELEASE)
 
 install: module-install
 
-- 
2.17.1


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

* Re: [PATCH] compat: allow override of depmod basedir
  2020-07-22 11:40 [PATCH] compat: allow override of depmod basedir mendoza.ricardo
@ 2020-07-24  9:09 ` Jason A. Donenfeld
  0 siblings, 0 replies; 2+ messages in thread
From: Jason A. Donenfeld @ 2020-07-24  9:09 UTC (permalink / raw)
  To: mendoza.ricardo; +Cc: WireGuard mailing list, Ricardo Mendoza

Thanks for figuring this out. It looks like '/' as the default is
indeed safe, as this value is only used in this expression:

       cfg.dirnamelen = snprintf(cfg.dirname, PATH_MAX,
                                 "%s/lib/modules/%s",
                                 root == NULL ? "" : root, cfg.kversion);

and // and / are equivalent.

I've applied this with slight modifications here:
https://git.zx2c4.com/wireguard-linux-compat/commit/?id=6028795b4415d7f467acc01c5292f8e4703a6b39


Jason

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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-22 11:40 [PATCH] compat: allow override of depmod basedir mendoza.ricardo
2020-07-24  9:09 ` Jason A. Donenfeld

Development discussion of WireGuard

Archives are clonable: git clone --mirror http://inbox.vuxu.org/wireguard

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.wireguard


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git