Commit Graph

77 Commits

Author SHA1 Message Date
Emil Velikov
e7626810fd man: list options one per line
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>
2024-07-09 00:18:21 -05:00
Emil Velikov
082617913f man: rework AUTHORS section
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>
2024-07-09 00:18:21 -05:00
Emil Velikov
ff38d82ede man: remove the "Maintained by" references
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>
2024-07-09 00:18:21 -05:00
Emil Velikov
4ec655d249 man: modprobe: remove hard-coded /etc/modprobe.d references
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>
2024-07-09 00:18:21 -05:00
Emil Velikov
42d60a3267 man: add few mentions about MODPROBE_OPTIONS
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>
2024-07-09 00:18:21 -05:00
Emil Velikov
e46b473a92 man: modprobe.d: factor out a CONFIGURATION FORMAT section
Keep the description neat and tidy.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
2024-07-09 00:18:21 -05:00
Emil Velikov
11d09ac414 man: modprobe.d: document the config file order handling
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>
2024-07-09 00:18:21 -05:00
Emil Velikov
e83e142ce7 man: depmod: remove hard-coded /etc/depmod.d references
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>
2024-07-09 00:18:21 -05:00
Emil Velikov
7b19a71289 man: depmod.d: rework the opening description sentence
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>
2024-07-09 00:18:21 -05:00
Emil Velikov
0682f1ed56 man: depmod.d: factor out a CONFIGURATION FORMAT section
Keep the description neat and tidy.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
2024-07-09 00:18:21 -05:00
Emil Velikov
12ca199bd7 man: depmod.d: document the config file order handling
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>
2024-07-09 00:18:21 -05:00
Emil Velikov
52a9d42464 man: stop removing DISTCONFDIR lines
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>
2024-07-09 00:18:21 -05:00
Emil Velikov
6f80a0874b man: couple of grammar/language fixes
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
2024-07-09 00:18:21 -05:00
Emil Velikov
2b5c56c430 man: some options take an argument, mention that
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>
2024-07-09 00:18:21 -05:00
Emil Velikov
e971579bba man: misc punctuation fixes
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>
2024-07-09 00:18:21 -05:00
Emil Velikov
f1e233c31e man: white space fixes
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>
2024-07-09 00:18:21 -05:00
Emil Velikov
134bf30e74 man: add some extra bold/italic annotations
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
2024-07-09 00:18:21 -05:00
Emil Velikov
fa715f8c8b man: remove no longer used XML files
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
2024-07-03 10:14:47 -05:00
Emil Velikov
83e22ab5e9 man: build the scdoc based man pages
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>
2024-07-03 10:14:35 -05:00
Emil Velikov
f3a423b6d8 man: add scdoc based man pages
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>
2024-07-03 10:10:05 -05:00
Jose Ignacio Tornos Martinez
05828b4a6e libkmod: add weak dependecies
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
2024-05-08 23:37:38 -05:00
Emil Velikov
930a40f518 man: silence autoconf warnings
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>
2024-02-20 15:40:16 -06:00
Michal Suchanek
9d1fb317c8 libkmod, depmod, modprobe: Make directory for kernel modules configurable
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>
2023-12-06 09:53:05 -06:00
Michal Suchanek
8463809f8a libkmod, depmod: Load modprobe.d, depmod.d from ${prefix}/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.

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>
2023-10-17 12:27:59 -05:00
Michal Suchanek
4e7effbdc0 man/depmod.d: Fix incorrect /usr/lib search path
depmod searches /lib/depmod.d but the man page says /usr/lib/depmod.d is
searched. Align the documentation with the code.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Link: https://lore.kernel.org/r/9c5a6356b1a111eb6e17ddb110494b7f1d1b44c0.1689681454.git.msuchanek@suse.de
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
2023-10-17 12:27:59 -05:00
Emil Velikov
1712a1548e depmod: Introduce outdir option
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>
2023-02-09 07:09:06 -08:00
Yauheni Kaliuta
06fadcc6b1 man/rmmod: explain why modprobe -r is more useful
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>
2023-02-08 09:10:05 -08:00
Gustavo Sousa
883d931d1b modprobe: Allow passing path to module
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>
2023-01-13 16:48:02 -08:00
Lucas De Marchi
2b98ed8886 modprobe: Add --wait
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>
2022-06-26 23:23:46 -07:00
Saul Wold
f50e2d6757 depmod: Add support for excluding a directory
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>
2022-04-01 21:44:15 -07:00
Lucas De Marchi
9319b0f4cb Support /usr/local for configuration files
Add /usr/local to the search path for configuration files. These are
intended for local installs, provided /usr/local is given as prefix.
2021-01-18 18:26:36 -08:00
Lucas De Marchi
67e43bbe04 libkmod: Fix documentation on config precedence order
/etc is has higher priority than /run.
2021-01-18 18:26:36 -08:00
Samanta Navarro
2f38000256 man: fix typo 2020-10-19 09:12:53 -07:00
Daniel Kahn Gillmor
aca61d3721 man: Fix typo 2019-01-14 14:24:10 -08:00
Lucas De Marchi
94aad8787f man: depmod: remove deprecated -m option
Thanks to Howard Johnson <hwj@bridgeportcontractor.com> for noticing.
2018-07-20 13:23:57 -07:00
Chris Stackpole
8c50dc4e3a Phrasing correction in modprobe man page 2018-05-14 15:04:55 -07:00
Christopher Díaz Riveros
8803e486a9 man/depmod: Add references in other man pages
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>
2017-10-16 14:39:20 -07:00
Yauheni Kaliuta
e61fb329dd man/depmod.d: add external keyword description
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>
2017-07-21 10:01:32 -07:00
Lucas De Marchi
72167ba113 man: make error message clearer for missing xstlproc
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
2017-02-23 18:31:15 -08:00
Santiago Vila
8feffdfa2e kmod: fix small typo in rmmod(8)
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)
2015-06-08 22:46:42 -03:00
Marco d'Itri
66f4f6804c Add the man page for kmod(8) 2014-09-22 08:52:47 -03:00
Marco d'Itri
fde693c94f Document depmod --show in depmod(8) 2014-09-20 11:23:56 -03:00
Joe Lawrence
445e51c57d man: fixup spacing/parens in modprobe.d(5) 2014-05-13 14:45:15 -03:00
Lucas De Marchi
3be5bf4646 man: use systemd as example instead of udev
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.
2014-03-06 02:47:05 -03:00
Lucas De Marchi
eb18b26905 man: clarify the support to modules.dep file 2014-03-06 02:46:27 -03:00
Lucas De Marchi
06eb29e117 build-sys: add small redirecting Makefiles
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")
2014-03-06 01:59:58 -03:00
Stephen Kitt
a4bd1441e5 Remove "rmmod -w" documentation and getopt entry
This patch removes the cmdopts declaration and the documentation. They
were leftover from the -w removal.
2014-01-26 18:00:23 -02:00
Lukas Berk
3d51a2f6ef man: insmod documentation fix
Add comma between lsmod(8) and modinfo(8)

Signed-off-by: Lukas Berk <lberk@redhat.com>
2014-01-24 10:23:30 -02:00
Lucas De Marchi
2726da5768 man: Change my contact email address 2014-01-02 17:13:38 -02:00
Lucas De Marchi
eb978f10bd build-sys: Add AM_V_XSLT to rule creating man pages 2013-04-21 16:33:54 -03:00