2021-05-29 19:41:53 +02:00
|
|
|
From fc1b2c14e2ca4d7ccd4a3b75a435ab7d927533bc Mon Sep 17 00:00:00 2001
|
2021-01-13 10:00:05 +01:00
|
|
|
From: Michal Suchanek <msuchanek@suse.de>
|
|
|
|
Date: Tue, 12 Jan 2021 16:54:46 +0100
|
2021-05-29 19:41:53 +02:00
|
|
|
Subject: [PATCH] modprobe.d, depmod.d: load from /usr/lib.
|
|
|
|
MIME-Version: 1.0
|
|
|
|
Content-Type: text/plain; charset=UTF-8
|
|
|
|
Content-Transfer-Encoding: 8bit
|
2021-01-13 10:00:05 +01:00
|
|
|
|
|
|
|
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>
|
2020-11-06 12:44:26 +01:00
|
|
|
---
|
2021-05-29 19:41:53 +02:00
|
|
|
Makefile.am | 1 +
|
|
|
|
libkmod/libkmod.c | 1 +
|
|
|
|
man/depmod.d.xml | 1 +
|
|
|
|
man/modprobe.d.xml | 1 +
|
|
|
|
tools/depmod.c | 1 +
|
|
|
|
5 files changed, 5 insertions(+)
|
2020-11-06 12:44:26 +01:00
|
|
|
|
2021-05-29 19:41:53 +02:00
|
|
|
diff --git a/Makefile.am b/Makefile.am
|
|
|
|
index d859c240178f..8553368988c0 100644
|
|
|
|
--- a/Makefile.am
|
|
|
|
+++ b/Makefile.am
|
2021-01-13 10:00:05 +01:00
|
|
|
@@ -19,6 +19,7 @@ AM_CPPFLAGS = \
|
|
|
|
-include $(top_builddir)/config.h \
|
|
|
|
-I$(top_srcdir) \
|
|
|
|
-DSYSCONFDIR=\""$(sysconfdir)"\" \
|
|
|
|
+ -DPREFIX=\""$(prefix)"\" \
|
|
|
|
${zlib_CFLAGS}
|
|
|
|
|
|
|
|
AM_CFLAGS = $(OUR_CFLAGS)
|
2021-05-29 19:41:53 +02:00
|
|
|
diff --git a/libkmod/libkmod.c b/libkmod/libkmod.c
|
|
|
|
index 7c2b889d713e..ddf13fb3d822 100644
|
|
|
|
--- a/libkmod/libkmod.c
|
|
|
|
+++ b/libkmod/libkmod.c
|
|
|
|
@@ -65,6 +65,7 @@ static const char *default_config_paths[] = {
|
2020-11-06 12:44:26 +01:00
|
|
|
SYSCONFDIR "/modprobe.d",
|
|
|
|
"/run/modprobe.d",
|
2021-05-28 00:33:54 +02:00
|
|
|
"/usr/local/lib/modprobe.d",
|
2021-01-13 10:00:05 +01:00
|
|
|
+ PREFIX "/lib/modprobe.d",
|
2021-05-29 19:41:53 +02:00
|
|
|
"/lib/modprobe.d",
|
2020-11-06 12:44:26 +01:00
|
|
|
NULL
|
|
|
|
};
|
2021-05-29 19:41:53 +02:00
|
|
|
diff --git a/man/depmod.d.xml b/man/depmod.d.xml
|
|
|
|
index b315e931d635..8a898cf4a9eb 100644
|
|
|
|
--- a/man/depmod.d.xml
|
|
|
|
+++ b/man/depmod.d.xml
|
|
|
|
@@ -39,6 +39,7 @@
|
2021-01-13 10:00:05 +01:00
|
|
|
</refnamediv>
|
|
|
|
|
|
|
|
<refsynopsisdiv>
|
2021-05-29 19:41:53 +02:00
|
|
|
+ <para><filename>/lib/depmod.d/*.conf</filename></para>
|
|
|
|
<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>
|
|
|
|
diff --git a/man/modprobe.d.xml b/man/modprobe.d.xml
|
|
|
|
index 0ab3e9110a7e..8a7c696dcee1 100644
|
|
|
|
--- a/man/modprobe.d.xml
|
|
|
|
+++ b/man/modprobe.d.xml
|
|
|
|
@@ -41,6 +41,7 @@
|
|
|
|
|
|
|
|
<refsynopsisdiv>
|
|
|
|
<para><filename>/lib/modprobe.d/*.conf</filename></para>
|
2021-01-13 10:00:05 +01:00
|
|
|
+ <para><filename>/usr/lib/modprobe.d/*.conf</filename></para>
|
2021-05-28 00:33:54 +02:00
|
|
|
<para><filename>/usr/local/lib/modprobe.d/*.conf</filename></para>
|
2021-01-13 10:00:05 +01:00
|
|
|
<para><filename>/run/modprobe.d/*.conf</filename></para>
|
2021-05-28 00:33:54 +02:00
|
|
|
<para><filename>/etc/modprobe.d/*.conf</filename></para>
|
2021-05-29 19:41:53 +02:00
|
|
|
diff --git a/tools/depmod.c b/tools/depmod.c
|
|
|
|
index eb810b811e35..8f6a4f8cd7cb 100644
|
|
|
|
--- a/tools/depmod.c
|
|
|
|
+++ b/tools/depmod.c
|
|
|
|
@@ -54,6 +54,7 @@ static const char *default_cfg_paths[] = {
|
2021-05-28 00:33:54 +02:00
|
|
|
SYSCONFDIR "/depmod.d",
|
|
|
|
"/run/depmod.d",
|
|
|
|
"/usr/local/lib/depmod.d",
|
|
|
|
+ PREFIX "/lib/depmod.d",
|
2021-05-29 19:41:53 +02:00
|
|
|
"/lib/depmod.d",
|
2021-05-28 00:33:54 +02:00
|
|
|
NULL
|
|
|
|
};
|
2021-05-29 19:41:53 +02:00
|
|
|
--
|
|
|
|
2.26.2
|
|
|
|
|