SHA256
1
0
forked from pool/kmod
kmod/usr-lib-modprobe.patch
Jan Engelhardt 18d10a1b0f Accepting request 1089524 from home:michals
- On usrmerged system move kernel modules into /usr as well (boo#1211796)
  + usr-lib-modules.patch
- Refresh usr-lib-modprobe.patch
- Refresh no-stylesheet-download.patch

OBS-URL: https://build.opensuse.org/request/show/1089524
OBS-URL: https://build.opensuse.org/package/show/Base:System/kmod?expand=0&rev=213
2023-05-29 09:49:12 +00:00

109 lines
3.8 KiB
Diff

From 99208681c29cec2097cb9c7a4b109d9c3d3f47a9 Mon Sep 17 00:00:00 2001
From: Michal Suchanek <msuchanek@suse.de>
Date: Tue, 12 Jan 2021 16:54:46 +0100
Subject: [PATCH] modprobe.d, depmod.d: load from $prefix/lib.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
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 | 3 ++-
man/Makefile.am | 1 +
man/depmod.d.xml | 3 ++-
man/modprobe.d.xml | 1 +
tools/depmod.c | 1 +
6 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 0e4877074f40..e7313fa8a33e 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 7c2b889d713e..75fc8be3fadc 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",
"/usr/local/lib/modprobe.d",
+ PREFIX "/lib/modprobe.d",
"/lib/modprobe.d",
NULL
};
@@ -237,7 +238,7 @@ static char *get_kernel_release(const char *dirname)
* to load from user-defined configuration parameters such as
* 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
+ * /usr/local/lib/modprobe.d and PREFIX/lib/modprobe.d. Give an empty
* vector if configuration should not be read. This array must
* be null terminated.
*
diff --git a/man/Makefile.am b/man/Makefile.am
index 11514d52a190..b6603e34c4bf 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -23,3 +23,4 @@ CLEANFILES = $(dist_man_MANS)
--stringparam man.output.quietly 1 \
--param funcsynopsis.style "'ansi'" \
http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
+ sed -i -e 's|@PREFIX@|$(prefix)|g' $@
diff --git a/man/depmod.d.xml b/man/depmod.d.xml
index 76548e92a312..431ebca6654b 100644
--- a/man/depmod.d.xml
+++ b/man/depmod.d.xml
@@ -39,7 +39,8 @@
</refnamediv>
<refsynopsisdiv>
- <para><filename>/usr/lib/depmod.d/*.conf</filename></para>
+ <para><filename>/lib/depmod.d/*.conf</filename></para>
+ <para><filename>@PREFIX@/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>
diff --git a/man/modprobe.d.xml b/man/modprobe.d.xml
index 0ab3e9110a7e..e8a91d7668af 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>@PREFIX@/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>
diff --git a/tools/depmod.c b/tools/depmod.c
index 364b7d4faa9e..a9349b20ee9c 100644
--- a/tools/depmod.c
+++ b/tools/depmod.c
@@ -54,6 +54,7 @@ static const char *default_cfg_paths[] = {
SYSCONFDIR "/depmod.d",
"/run/depmod.d",
"/usr/local/lib/depmod.d",
+ PREFIX "/lib/depmod.d",
"/lib/depmod.d",
NULL
};
--
2.40.0