From: Lucas De Marchi <lucas.demarchi@intel.com>
To: linux-modules@vger.kernel.org
Cc: Jan Tojnar <jtojnar@gmail.com>
Subject: [PATCH 3/3] Support /usr/local for configuration files
Date: Tue, 19 Jan 2021 06:52:38 -0800 [thread overview]
Message-ID: <20210119145238.12774-3-lucas.demarchi@intel.com> (raw)
In-Reply-To: <20210119145238.12774-1-lucas.demarchi@intel.com>
Add /usr/local to the search path for configuration files. These are
intended for local installs, provided /usr/local is given as prefix.
---
libkmod/libkmod.c | 10 ++++++----
man/depmod.d.xml | 1 +
man/modprobe.d.xml | 1 +
tools/depmod.c | 1 +
4 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/libkmod/libkmod.c b/libkmod/libkmod.c
index 25655b9..7c2b889 100644
--- a/libkmod/libkmod.c
+++ b/libkmod/libkmod.c
@@ -64,6 +64,7 @@ static struct _index_files {
static const char *default_config_paths[] = {
SYSCONFDIR "/modprobe.d",
"/run/modprobe.d",
+ "/usr/local/lib/modprobe.d",
"/lib/modprobe.d",
NULL
};
@@ -234,10 +235,11 @@ static char *get_kernel_release(const char *dirname)
* Otherwise, give an absolute dirname.
* @config_paths: ordered array of paths (directories or files) where
* to load from user-defined configuration parameters such as
- * alias, blacklists, commands (install, remove). If
- * NULL defaults to /etc/modprobe.d, /run/modprobe.d and
- * /lib/modprobe.d. Give an empty vector if configuration should
- * not be read. This array must be null terminated.
+ * alias, blacklists, commands (install, remove). If NULL
+ * defaults to /etc/modprobe.d, /run/modprobe.d,
+ * /usr/local/lib/modprobe.d and /lib/modprobe.d. Give an empty
+ * vector if configuration should not be read. This array must
+ * be null terminated.
*
* Create kmod library context. This reads the kmod configuration
* and fills in the default values.
diff --git a/man/depmod.d.xml b/man/depmod.d.xml
index 6472bda..b315e93 100644
--- a/man/depmod.d.xml
+++ b/man/depmod.d.xml
@@ -40,6 +40,7 @@
<refsynopsisdiv>
<para><filename>/usr/lib/depmod.d/*.conf</filename></para>
+ <para><filename>/usr/local/lib/depmod.d/*.conf</filename></para>
<para><filename>/run/depmod.d/*.conf</filename></para>
<para><filename>/etc/depmod.d/*.conf</filename></para>
</refsynopsisdiv>
diff --git a/man/modprobe.d.xml b/man/modprobe.d.xml
index a674d69..0ab3e91 100644
--- a/man/modprobe.d.xml
+++ b/man/modprobe.d.xml
@@ -41,6 +41,7 @@
<refsynopsisdiv>
<para><filename>/lib/modprobe.d/*.conf</filename></para>
+ <para><filename>/usr/local/lib/modprobe.d/*.conf</filename></para>
<para><filename>/run/modprobe.d/*.conf</filename></para>
<para><filename>/etc/modprobe.d/*.conf</filename></para>
</refsynopsisdiv>
diff --git a/tools/depmod.c b/tools/depmod.c
index 8e1d9ec..170a1d8 100644
--- a/tools/depmod.c
+++ b/tools/depmod.c
@@ -53,6 +53,7 @@ static const char CFG_EXTERNAL_KEY[] = "external";
static const char *default_cfg_paths[] = {
SYSCONFDIR "/depmod.d",
"/run/depmod.d",
+ "/usr/local/lib/depmod.d",
"/lib/depmod.d",
NULL
};
--
2.30.0
prev parent reply other threads:[~2021-01-19 15:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-19 14:52 [PATCH 1/3] libkmod: Fix documentation on config precedence order Lucas De Marchi
2021-01-19 14:52 ` [PATCH 2/3] depmod: fix " Lucas De Marchi
2021-01-19 15:34 ` Marco d'Itri
2021-01-19 17:22 ` Lucas De Marchi
2021-01-19 18:31 ` Dmitry V. Levin
2021-01-19 20:36 ` Lucas De Marchi
2021-01-19 14:52 ` Lucas De Marchi [this message]
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=20210119145238.12774-3-lucas.demarchi@intel.com \
--to=lucas.demarchi@intel.com \
--cc=jtojnar@gmail.com \
--cc=linux-modules@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).