Linux Modules
 help / color / mirror / Atom feed
From: Michal Suchanek <msuchanek@suse.de>
To: linux-modules@vger.kernel.org
Cc: "Michal Suchanek" <msuchanek@suse.de>,
	"Marcus Rückert" <mrueckert@suse.com>,
	"Takashi Iwai" <tiwai@suse.com>,
	"Dominique Leuenberger" <dimstar@opensuse.org>
Subject: [PATCH] modprobe.d: load from /usr/lib.
Date: Tue, 12 Jan 2021 17:02:11 +0100	[thread overview]
Message-ID: <20210112160211.5614-1-msuchanek@suse.de> (raw)

There is an ongoing effort to limit use of files outside of /usr (or
$prefix on general). Currently all modprobe.d paths are hardcoded to
outside of $prefix. Teach kmod to load modprobe.d from $prefix/lib.

Cc: Marcus Rückert <mrueckert@suse.com>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Dominique Leuenberger <dimstar@opensuse.org>
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
---
 Makefile.am        | 1 +
 libkmod/libkmod.c  | 1 +
 man/modprobe.d.xml | 1 +
 3 files changed, 3 insertions(+)

diff --git a/Makefile.am b/Makefile.am
index b29e943a4d29..702a665f0334 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,6 +19,7 @@ AM_CPPFLAGS = \
 	-include $(top_builddir)/config.h \
 	-I$(top_srcdir) \
 	-DSYSCONFDIR=\""$(sysconfdir)"\" \
+	-DPREFIX=\""$(prefix)"\" \
 	${zlib_CFLAGS}
 
 AM_CFLAGS = $(OUR_CFLAGS)
diff --git a/libkmod/libkmod.c b/libkmod/libkmod.c
index 43423d63a889..9399c6c902f8 100644
--- a/libkmod/libkmod.c
+++ b/libkmod/libkmod.c
@@ -65,6 +65,7 @@ static const char *default_config_paths[] = {
 	SYSCONFDIR "/modprobe.d",
 	"/run/modprobe.d",
 	"/lib/modprobe.d",
+	PREFIX "/lib/modprobe.d",
 	NULL
 };
 
diff --git a/man/modprobe.d.xml b/man/modprobe.d.xml
index 211af8488abb..ae5a83986a52 100644
--- a/man/modprobe.d.xml
+++ b/man/modprobe.d.xml
@@ -40,6 +40,7 @@
   </refnamediv>
 
   <refsynopsisdiv>
+    <para><filename>/usr/lib/modprobe.d/*.conf</filename></para>
     <para><filename>/lib/modprobe.d/*.conf</filename></para>
     <para><filename>/etc/modprobe.d/*.conf</filename></para>
     <para><filename>/run/modprobe.d/*.conf</filename></para>
-- 
2.26.2


             reply	other threads:[~2021-01-12 16:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-12 16:02 Michal Suchanek [this message]
2021-01-12 20:56 ` [PATCH] modprobe.d: load from /usr/lib Lucas De Marchi
2021-01-12 22:22   ` Dmitry V. Levin
2021-01-13 14:08     ` Lucas De Marchi
2021-01-14  9:54       ` Michal Suchánek
2021-05-30  9:39   ` Michal Suchánek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210112160211.5614-1-msuchanek@suse.de \
    --to=msuchanek@suse.de \
    --cc=dimstar@opensuse.org \
    --cc=linux-modules@vger.kernel.org \
    --cc=mrueckert@suse.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox