Now that modprobe.d is searched under ${prefix}/lib, allow a complete
transition to files only under ${prefix} by adding a ${module_directory}
configuration. This specifies the directory where to search for kernel
modules and should match the location where the kernel/distro installs
them.
With this distributions that do not want to ship files in /lib can also
move kernel modules to /usr while others can keep them in /lib.
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Link: https://lore.kernel.org/r/a3765f4e8ae3ce29c0847a0132d4a8d51ad040a9.1699618135.git.msuchanek@suse.de
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
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.
On some distributions /usr/lib and /lib are the same directory because
of a compatibility symlink, and it is possible to craft configuration
files with sideeffects that would behave differently when loaded twice.
However, the override semantic ensures that one 'overrides' the other,
and only one configuration file of the same name is loaded from any of
the search directories.
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Link: https://lore.kernel.org/r/a290343ce32e2a3c25b134e4f27c13b26e06c9e0.1689681454.git.msuchanek@suse.de
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
This option is equivalent to basedir, with the small difference being
that's where the meta-data files are generated. In other words, this
allows us to have read-only input modules and modules.dep, while still
being able to generate the meta-data files.
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
[ Move files to a different dir so input files (produced by kernel build
system is separate from the files generated by depmod (output) ]
Signed-off-by: Lucas De Marchi <lucas.demarchi@gmail.com>
Improve user experience by explaining the option so the user may
not search explanations in other manpages (modprobe).
Signed-off-by: Yauheni Kaliuta <ykaliuta@redhat.com>
Reviewed-by: Luis Chamberlain <mcgrof@kernel.org>
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
This is useful to kernel module developers for testing a just compiled
module: instead of using insmod, they can load the module from the path
while getting all the benefits of modprobe (e.g. module dependency
resolution).
v2:
- Add test for relative path as well. (Lucas)
- Add note warning about modules with dependencies not matching the
installed depmod database. (Lucas)
Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Retry module removal if it fails due to EAGAIN. This allows user to pass
--wait <timeout>, during which `modprobe -r` will keep trying to remove
the module.
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
This adds support to depmod to enable a new exclude directive in
the depmod.d/*.conf configuration file. Currently depmod
already excludes directories named source or build. This change
will allow additional directories like .debug to be excluded also
via a new exclude directive.
depmod.d/exclude.conf example:
exclude .debug
Signed-off-by: Saul Wold <saul.wold@windriver.com>
[ Fix warnings and make should_exclude_dir() return bool ]
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Depmod man page is not referenced in some man pages. This makes it
harder to find through reading documentation.
References added to:
-man/insmod.xml
-man/lsmod.xml
-man/modprobe.xml
-man/rmmod.xml
Signed-off-by: Christopher Díaz Riveros <chrisadr@gentoo.org>
The commit 'depmod: implement external directories support' added
external directories support (see
7da6884e73).
This patch documents the extention in the manpage.
Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
We can't do at configure phase since we actually ship the built man pages with
dist, so it's fine not having xsltproc if building from dist. If building from
the repository, it's better to have have a better message saying xsltproc was
not found than trying to execute the argument to xsltproc. Now message is:
XSLT depmod.d.5
/bin/sh: line 1: xsltproc: command not found
Instead of:
XSLT depmod.d.5
/bin/sh: --nonet: command not found
This is how rmmod(8) looks like:
SEE ALSO
modprobe(8), insmod(8), lsmod(8)modinfo(8)
The attached trivial patch fixes it:
SEE ALSO
modprobe(8), insmod(8), lsmod(8), modinfo(8)
Nowadays udev doesn't create nodes in /dev anymore. This role is rather
taken by systemd-tmpfiles on early boot so reference it generically as
systemd.
These redirecting makefiles simplifies compiling from some editors and
when CWD is not the root of the source tree. This is similar to what was
introduced in systemd in 340d89e ("build-sys: add small redirecting
Makefiles to simplify compilation from within emacs")
This was never documented in the manpage of module-init-tools either.
The flag is identical in function to modprobe's --dirname option, so use
the same language to describe it.
The documentation for this flag leads one to believe that the full path
to the module directory is needed. In reality, this flag specifies only
the root of the module path.
- Gah, kmod insmod can't load from stdin anymore. :/
- What's the use case?
- zcat module.ko.gz | insmod - (but the new insmod apparently can load .gz fine)
- yes... just insmod module.ko.gz
- and actually insmod(8) says it works. :)
Not anymore...