| From: |
| Michal Suchanek <msuchanek-AT-suse.de> |
| To: |
| linux-modules-AT-vger.kernel.org |
| Subject: |
| [PATCH 0/4] kmod /usr support |
| Date: |
| Tue, 11 Jul 2023 17:31:15 +0200 |
| Message-ID: |
| <20230711153126.28876-1-msuchanek@suse.de> |
| Cc: |
| Michal Suchanek <msuchanek-AT-suse.de>, Takashi Iwai <tiwai-AT-suse.com>, Lucas De Marchi <lucas.de.marchi-AT-gmail.com>, Michal Koutný <mkoutny-AT-suse.com>, Jiri Slaby <jslaby-AT-suse.com>, Jan Engelhardt <jengelh-AT-inai.de>, Masahiro Yamada <masahiroy-AT-kernel.org>, Nathan Chancellor <nathan-AT-kernel.org>, Nick Desaulniers <ndesaulniers-AT-google.com>, Nicolas Schier <nicolas-AT-fjasle.eu>, linux-kbuild-AT-vger.kernel.org, linux-kernel-AT-vger.kernel.org |
| Archive-link: |
| Article |
Hello,
with these patches it is possible to install kernel modules under an
arbitrary prefix - eg. moving the /lib/modules to /usr/lib/modules with
/usr prefix.
While the modprobe.d and depmod.d search which already includes multiple
paths is expanded to also include $(prefix) the module directory still
supports only one location, only a different one under $(module_prefix).
Having kmod search multiple module locations while only one is supported
now might break some assumption about relative modulke path
corresponding to a specific file, would require more invasive changes to
implement, and is not supportive of the goal of moving the modules away
from /lib.
Both kmod and the kernel need to be patched to make use of this feature.
Patched kernel is backwards compatible with older kmod. Patched kmod
with empty $(module_prefix) is equivalent to unpatched kmod.
Thanks
Michal
Link: https://lore.kernel.org/linux-modules/20210112160211.5614...
Michal Suchanek (4):
man/depmod.d: Fix incorrect /usr/lib search path
libkmod, depmod: Load modprobe.d, depmod.d from $prefix/lib.
kmod: Add config command to show compile time configuration as JSON
libkmod, depmod, modprobe: Search for kernel modules under
${module_prefix}
Makefile.am | 4 +-
configure.ac | 7 ++
libkmod/libkmod.c | 7 +-
man/Makefile.am | 10 ++-
man/depmod.d.xml | 9 ++-
man/depmod.xml | 4 +-
man/kmod.xml | 6 ++
man/modinfo.xml | 2 +-
man/modprobe.d.xml | 1 +
man/modprobe.xml | 2 +-
man/modules.dep.xml | 6 +-
testsuite/module-playground/Makefile | 2 +-
testsuite/setup-rootfs.sh | 109 +++++++++++++++------------
testsuite/test-depmod.c | 16 ++--
testsuite/test-testsuite.c | 8 +-
tools/depmod.c | 7 +-
tools/kmod.c | 40 ++++++++++
tools/modinfo.c | 4 +-
tools/modprobe.c | 4 +-
tools/static-nodes.c | 6 +-
20 files changed, 166 insertions(+), 88 deletions(-)
--
2.41.0