SHA256
1
0
forked from pool/kmod
kmod/usr-lib-modprobe.patch

80 lines
2.6 KiB
Diff
Raw Normal View History

From: Michal Suchanek <msuchanek@suse.de>
Date: Tue, 12 Jan 2021 16:54:46 +0100
Subject: [PATCH] modprobe.d: load from /usr/lib.
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>
From: Jan Engelhardt <jengelh@inai.de>
Date: 2021-05-28 00:17:47.552369139 +0200
If you make the build flexible and allow varying values for ``--sysconfdir``,
then permit the same for ``--prefix``.
An obvious side effect is that with little change, the unnecessary hard
dependency on merged /usr goes away.
---
Makefile.am | 1 +
libkmod/libkmod.c | 2 +-
man/modprobe.d.xml | 2 +-
tools/depmod.c | 2 +-
4 files changed, 4 insertions(+), 3 deletions(-)
Index: kmod-29/Makefile.am
===================================================================
--- kmod-29.orig/Makefile.am
+++ kmod-29/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)
Index: kmod-29/libkmod/libkmod.c
===================================================================
--- kmod-29.orig/libkmod/libkmod.c
+++ kmod-29/libkmod/libkmod.c
@@ -65,7 +65,7 @@ static const char *default_config_paths[
SYSCONFDIR "/modprobe.d",
"/run/modprobe.d",
"/usr/local/lib/modprobe.d",
- "/lib/modprobe.d",
+ PREFIX "/lib/modprobe.d",
NULL
};
Index: kmod-29/man/modprobe.d.xml
===================================================================
--- kmod-29.orig/man/modprobe.d.xml
+++ kmod-29/man/modprobe.d.xml
@@ -40,7 +40,7 @@
</refnamediv>
<refsynopsisdiv>
- <para><filename>/lib/modprobe.d/*.conf</filename></para>
+ <para><filename>/usr/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>
Index: kmod-29/tools/depmod.c
===================================================================
--- kmod-29.orig/tools/depmod.c
+++ kmod-29/tools/depmod.c
@@ -54,7 +54,7 @@ static const char *default_cfg_paths[] =
SYSCONFDIR "/depmod.d",
"/run/depmod.d",
"/usr/local/lib/depmod.d",
- "/lib/depmod.d",
+ PREFIX "/lib/depmod.d",
NULL
};