Seemingly Fedora and friends have been carrying this one for years. Just
add it to kmod itself so that people using multiple distros have
consistent experience.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/231
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
The former was introduced with meson v0.49.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/209
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Add missing newline for better formatting and to stay in sync with other
options.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/182
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
A silly copy/paste mistake by yours truly (-:
Fixes: ecedc689 ("man: add BUGS section with basic information")
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/177
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Mention in the help and docs that rmmod operates on list of modules,
alongside its current mode of operation.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/177
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
With earlier commit, I attempted to keep them on separate lines for
somewhat dubious reasons. In practise that didn't work and they stayed
on the same line, while also dropping the separating comma.
Looking back, it would be better to fix the vim manpager mode issues
rather than mask it. Mea culpa
Effectively this reverts commit e7626810fd
Reference: https://lore.kernel.org/linux-modules/ZvknyLKvQeBo16n9@meinfjell.helgefjelltest.de
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/164
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Link the issue tracker and recommend providing reproducer/expectations
in the bug report.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/164
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/156
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
As of the initial import to git, the option was silently ignored.
Shortly afterwards, functionality was reinstated lacking a longopt and
any documentation.
As per insmod(8) for most use-cases you'd want to use modprobe(8).
Although since the option is available and we have an equivalent in
rmmod(8) having it documented and consistent triumphs.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/138
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Add the extra options for consistency with the rest of kmod.
Document all options in the man page.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/138
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Stay consistent with the output of rmmod --help and update the
respective options.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/138
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
This allows for more consistent experience across tools, allows to see
the version, observe/debug if "Used by" reports -1, etc.
Also don't forget to update the man page :-)
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/138
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
... otherwise we get a double-slash in the manual.
Fixes: e2536ab ("man: Provide examples for paths")
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/129
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Main goal is to give the reader the complete picture of each component
of the path being used, divided in <BASEDIR>, <MODULEDIR>, version.
Then reword the options accordingly to refer to what they are
overriding.
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/100
This a compile time option. When building modules for a different system
that uses a different value of this option it is useful to be able to
override it without rebuilding kmod.
Closes: https://github.com/kmod-project/kmod/issues/85
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Link: https://github.com/kmod-project/kmod/pull/100
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Not as brief as the pipeline and pattern matching that (auto)make can
do, although it's fully functional ;-)
v2:
- move man/meson.build
- move script under scripts/
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/86
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Typos found with codespell.
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Somewhat inspired by my selfish use of VIM as man pager. Namely, when
there are multiple options on the same line, only the first one gets
properly rendered.
A good bonus point is that very long instances, like modinfo's legacy
"--author, --description ..." look a bit neater now.
With this is also more consistently handle short/long options which take
an argument.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Replace the partial listing with suggestion to check through git
shortlog and git blame.
Explicitly spell out the current maintainer, alongside giving Jon
attribution for the original project.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
At a glance through my system, around 2% of the man pages include such
statement.
Looking through git log, Jon has been active in a while and presumably
have moved on.
Most importantly the Copyright section isn't the best place to reference
the maintainer/contact person.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Point the users to modprobe.d(5) instead.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
The environment variable may alter config file ordering, so mention it
in the man page.
In addition, highlight that the format is intentionally undocumented
since the use by third parties is discouraged.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
The modprobe.d configuration order/handling aligns with existing tools
such as sysctl.d, even though there is no mention in the manual.
Reorder the list in SYNOPSIS and add a bit of verbiage describing things.
Section is inspired by sysctl.d(5) and sysctl(8).
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Point the users to depmod.d(5) instead.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Use a slightly longer, more gradual introduction.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
The depmod.d configuration order/handling aligns with existing tools
such as sysctl.d, even though there is no mention in the manual.
Reorder the list in SYNOPSIS and add a bit of verbiage describing things.
Section is inspired by sysctl.d(5) and sysctl(8).
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Presently when DISTCONFDIR is identical to /lib we remove the whole
line, since the man pages already have an /lib instance.
At the same time, there are in-text DISTCONFDIR entries, and removing
the whole line outright breaks the documentation.
Drop the removal line - worst case scenario we get a duplicate entry in
the synopsis.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
For example modinfo -F requires the field name, although the
documentation was missing the "field".
Similarly modprobe has omissions, so let's fix those as well.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Some commas and a full stop was missing ;-)
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
These were present in the original xml files and I opted to keep them
separate fix to make the transition/comparison easier.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Note that scdoc does not handle natively handle the dummy
modules.dep.bin.5 entry, so we need to create one manually.
Not a big deal, since it's single static line anyway.
Also: pkg-config --variable=scdoc scdoc, produces the full executable
and path, although for now we stick with the AC_PATH_PROG approach.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
[ Do not add the stub man page (modules.dep.bin.5) to CLEANFILES
to avoid removing a file that is tracked by git. Also fix a typo
s/AM_V_SCDOR_/AM_V_SCDOC_/ to make silent rules to work ]
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Working with xml is quite fiddly. Swap that for scdoc, which has very
trivial markup-like syntax.
We have opted for scdoc since it's available on practically any linux
distribution. Implementation-wise it's a trivial C99 project, at 1k LoC.
If using scdoc proves to be a burden, we can trivially port these to
pandoc or similar - 90% of the content will stay the same.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
It has been seen that for some network mac drivers (i.e. lan78xx) the
related module for the phy is loaded dynamically depending on the current
hardware. In this case, the associated phy is read using mdio bus and then
the associated phy module is loaded during runtime (kernel function
phy_request_driver_module). However, no software dependency is defined, so
the user tools will no be able to get this dependency. For example, if
dracut is used and the hardware is present, lan78xx will be included but no
phy module will be added, and in the next restart the device will not work
from boot because no related phy will be found during initramfs stage.
In order to solve this, we could define a normal 'pre' software dependency
in lan78xx module with all the possible phy modules (there may be some),
but proceeding in that way, all the possible phy modules would be loaded
while only one is necessary.
The idea is to create a new type of dependency, that we are going to call
'weak' to be used only by the user tools that need to detect this situation.
In that way, for example, dracut could check the 'weak' dependency of the
modules involved in order to install these dependencies in initramfs too.
That is, for the commented lan78xx module, defining the 'weak' dependency
with the possible phy modules list, only the necessary phy would be loaded
on demand keeping the same behavior, but all the possible phy modules would
be available from initramfs.
A new function 'kmod_module_get_weakdeps' in libkmod will be added for
this to avoid breaking the API and maintain backward compatibility. This
general procedure could be useful for other similar cases (not only for
dynamic phy loading).
Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
Link: https://lore.kernel.org/r/20240327141116.97587-1-jtornosm@redhat.com
Currently we have a pattern rule, which effective states that two output
files are produced - %.5 and %.8. Although that's not the case in
practise, since each input xml will be generated to a single manual
page.
Add the manpage section as part of the xml filename and tweak the
pattern (match) rule, accordingly.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://lore.kernel.org/r/20240217-autoconf-manpage-warns-v1-1-e1570cfc286e@gmail.com
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
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>