Skip to contentSkip to conversation

man: convert to scdoc and minor improvements

PATCH Superseded Emil Velikov 2 participants 31 messages Jun 11, 2024 – Jul 3, 2024

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover man: convert to scdoc and minor improvements

Hello all,

As mentioned previously, here is a series converting the existing xml based documentation to scdoc.

Despite the size of this series, one should be able to review nearly all of it during their first morning coffee ;-)

I've went ahead with scdoc instead of other solutions since it's a simple 1K LoC, C99 program with trivial markdown-like syntax. Which is practically available for any distro [1].

A quick search in Arch shows that over 50 packages/projects use scdoc.

This series:
- patch 1 - simple comparison script of man page _output_ (the roff files themselves vary significantly) - DO NOT MERGE
- patch 2 - the scdoc files themselves, including typos to make diff vs original smaller
- patch 3 - wires scdoc to the build and removes the old xml files

- patch 4-9 - trivial fixes as white space, punctuation, etc
- patch 10-18 - expand documentation around {depmod,modprobe}.d handling

- patch 19 - remove "maintained by" references
- patch 20 - list short and long options on separate lines

The last two might be little controversial, so feel free to drop them.

NOTE: Some patches have respective question or two within.

As always - comments and suggestions are greatly appreciated.

[1] https://repology.org/project/scdoc/versions
[2] https://archlinux.org/packages/extra/x86_64/scdoc/

---
Emil Velikov (20):
man: add script to generate/compare the xslt vs upcoming scdoc
man: add scdoc based man pages
man: build the scdoc based man pages
man: remove no longer used XML files
man: add some extra bold/italic annotations
man: white space fixes
man: misc punctuation fixes
man: some options take an argument, mention that
man: couple of grammar/language fixes
man: stop removing DISTCONFDIR lines
man: depmod.d: document the config file order handling
man: depmod.d: factor out a CONFIGURATION FORMAT section
man: depmod.d: rework the opening description sentence
man: depmod: remove hard-coded /etc/depmod.d references
man: modprobe.d: document the config file order handling
man: modprobe.d: factor out a CONFIGURATION FORMAT section
man: modprobe.d: mention about MODPROBE_OPTIONS
man: modprobe: remove hard-coded /etc/modprobe.d references
man: remove the "Maintained by" references
man: list options one per line

 configure.ac          |   2 +-
 man/Makefile.am       |  30 +--
 man/compare.sh        |  63 ++++++
 man/depmod.8.scd      | 139 +++++++++++++
 man/depmod.8.xml      | 343 -------------------------------
 man/depmod.d.5.scd    | 115 +++++++++++
 man/depmod.d.5.xml    | 164 ---------------
 man/insmod.8.scd      |  35 ++++
 man/insmod.8.xml      |  87 --------
 man/kmod.8.scd        |  49 +++++
 man/kmod.8.xml        | 120 -----------
 man/lsmod.8.scd       |  29 +++
 man/lsmod.8.xml       |  73 -------
 man/modinfo.8.scd     |  84 ++++++++
 man/modinfo.8.xml     | 201 -------------------
 man/modprobe.8.scd    | 232 +++++++++++++++++++++
 man/modprobe.8.xml    | 544 --------------------------------------------------
 man/modprobe.d.5.scd  | 187 +++++++++++++++++
 man/modprobe.d.5.xml  | 265 ------------------------
 man/modules.dep.5.scd |  43 ++++
 man/modules.dep.5.xml |  80 --------
 man/modules.dep.bin.5 |   1 +
 man/rmmod.8.scd       |  53 +++++
 man/rmmod.8.xml       | 148 --------------
 24 files changed, 1041 insertions(+), 2046 deletions(-)

---
base-commit: 8837461494761d58be579641f20cc043274adddf
change-id: 20240523-man-743d6e51eb6f

Best regards,

Signature · 1 line
Emil Velikov <[email protected]>
#1 lore raw

PATCH 1/20 man: add script to generate/compare the xslt vs upcoming scdoc

---
 man/compare.sh | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 63 insertions(+)
man/compare.sh new file +63 -0
new file mode 100755
index 0000000..7579ab5
@@ -0,0 +1,63 @@
+#!/bin/bash
+
+the_sed()
+{
+	sed -e 's|@DISTCONFDIR@|/TEST|g;s|@MODULE_DIRECTORY@|/TEST|g' $1
+}
+
+gen_xslt()
+{
+			#--output ${xml//.xml}.xslt \
+			#--noout \
+	for xml in *xml; do
+		the_sed $xml | xsltproc \
+			--stringparam man.output.quietly 1 \
+			--param funcsynopsis.style "'ansi'" \
+			http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl -
+		# The output and noout args seems cosmetic, sigh
+		mv ${xml//.xml}{,.xslt}
+	done
+}
+
+gen_scdoc()
+{
+	for scd in *scd; do
+		the_sed $scd | scdoc > ${scd//.scd}.scdoc
+	done
+}
+
+comp_output()
+{
+	export LESS='-F -i -M -R -S -w -X -z-4'
+	unset MANPAGER
+
+	for xslt in $(ls --sort=version *xslt); do
+		_name=${xslt//.xslt}
+
+		echo "Checking $_name"
+
+		diff --unified --color=always \
+			<(man ./$_name.xslt) \
+			<(man ./$_name.scdoc) | less
+
+		read
+	done
+}
+
+comp_raw()
+{
+	for xslt in *xslt; do
+		_name=${xslt//.xslt}
+
+		diff --unified --color=always ./$_name.{xslt,scdoc}
+	done
+}
+
+time gen_xslt
+time gen_scdoc
+
+comp_output
+#comp_raw
+
+rm -f *xslt
+rm -f *scdoc
Signature · 1 line
2.45.0
#2 lore raw

PATCH 2/20 man: add scdoc based man pages

In reply to Emil Velikov

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.

---
Comparing the output via the compare.sh script, we can see a few advantages of scdoc over xsltproc:

- uses ISO 8601 date format
- does not choke for short opt + arg
- does not escape every non-alphanum char so we get proper word breaks and nicer word wrapping

There are a couple of cons though:

- uses leading [ for table handling, so we need to manually escape it
- manual indentation with spaces is not allowed, escape again

Initially I was inclined to send patches in upstream scdoc to "fix" this. Then I noticed that:
- only a couple of instances are affected
- both are very crowded and could use some love

I would be happy to prep something up - if anyone has concrete suggestions, please let me know.

---
 man/depmod.8.scd      | 126 +++++++++++++++++++++++++++++
 man/depmod.d.5.scd    |  95 ++++++++++++++++++++++
 man/insmod.8.scd      |  36 +++++++++
 man/kmod.8.scd        |  48 +++++++++++
 man/lsmod.8.scd       |  30 +++++++
 man/modinfo.8.scd     |  78 ++++++++++++++++++
 man/modprobe.8.scd    | 216 ++++++++++++++++++++++++++++++++++++++++++++++++++
 man/modprobe.d.5.scd  | 168 +++++++++++++++++++++++++++++++++++++++
 man/modules.dep.5.scd |  43 ++++++++++
 man/rmmod.8.scd       |  50 ++++++++++++
 10 files changed, 890 insertions(+)
man/depmod.8.scd new file +126 -0
new file mode 100644
index 0000000..0fe9128
@@ -0,0 +1,126 @@
+DEPMOD(8) "kmod" "depmod"
+
+# NAME
+
+depmod - Generate modules.dep and map files.
+
+# SYNOPSIS
+
+*depmod* [*-b* _basedir_] [*-o* _outdir_] [*-e*] [*-E* _Module.symvers_]
+\ \ \ \ \ \ \ \[*-F* _System.map_] [*-n*] [*-v*] [*-A*] [*-P* _prefix_] [*-w*] [_version_]
+
+*depmod* [*-e*] [*-E* _Module.symvers_] [*-F* _System.map_] [*-n*] [*-v*] [*-P* _prefix_]
+\ \ \ \ \ \ \ \[*-w*] [_version_] [_filename_...]
+
+# DESCRIPTION
+
+Linux kernel modules can provide services (called "symbols") for other modules
+to use (using one of the EXPORT_SYMBOL variants in the code). If a second module
+uses this symbol, that second module clearly depends on the first module. These
+dependencies can get quite complex.
+
+*depmod* creates a list of module dependencies by reading each module under
+@MODULE_DIRECTORY@/_version_ and determining what symbols it exports and what
+symbols it needs. By default, this list is written to modules.dep, and a binary
+hashed version named modules.dep.bin, in the same directory. If filenames are
+given on the command line, only those modules are examined (which is rarely
+useful unless all modules are listed). * depmod* also creates a list of symbols
+provided by modules in the file named modules.symbols and its binary hashed
+version, modules.symbols.bin. Finally, *depmod* will output a file named
+modules.devname if modules supply special device names (devname) that should be
+populated in /dev on boot (by a utility such as systemd-tmpfiles).
+
+If a _version_ is provided, then that kernel version's module directory is used
+rather than the current kernel version (as returned by *uname -r*).
+
+# OPTIONS
+
+*-a*, *--all*
+	Probe all modules. This option is enabled by default if no file names
+	are given in the command-line.
+
+*-A*, *--quick*
+	This option scans to see if any modules are newer than the
+	modules.dep file before any work is done: if not, it silently exits
+	rather than regenerating the files.
+
+*-b* _basedir_, *--basedir* _basedir_
+	If your modules are not currently in the (normal) directory
+	@MODULE_DIRECTORY@/_version_, but in a staging area, you can specify a
+	_basedir_ which is prepended to the directory name. This _basedir_ is
+	stripped from the resulting modules.dep file, so it is ready to be moved
+	into the normal location. Use this option if you are a distribution
+	vendor who needs to pre-generate the meta-data files rather than running
+	depmod again later.
+
+*-o* _outdir_, *--outdir* _outdir_
+	Set the output directory where depmod will store any generated file.
+	_ outdir_ serves as a root to that location, similar to how _basedir_ is
+	used. Also this setting takes precedence and if used together with
+	_basedir_ it will result in the input being that directory, but the output
+	being the one set by _outdir_.
+
+*-C*, *--config* _file_ _or_ _directory_
+	This option overrides the default configuration directory at
+	/etc/depmod.d/.
+
+*-e*, *--errsyms*
+	When combined with the *-F* option, this reports any symbols which a
+	module needs which are not supplied by other modules or the kernel.
+	Normally, any symbols not provided by modules are assumed to be provided
+	by the kernel (which should be true in a perfect world), but this
+	assumption can break especially when additionally updated third party
+	drivers are not correctly installed or were built incorrectly.
+
+*-E*, *--symvers*
+	When combined with the *-e* option, this reports any symbol versions
+	supplied by modules that do not match with the symbol versions provided
+	by the kernel in its Module.symvers. This option is mutually
+	incompatible with *-F*.
+
+*-F*, *--filesyms* _System.map_
+	Supplied with the System.map produced when the kernel was built, this
+	allows the *-e* option to report unresolved symbols. This option is
+	mutually incompatible with *-E*.
+
+*-h*, *--help*
+	Print the help message and exit.
+
+*-n*, *--show*, *--dry-run*
+	This sends the resulting modules.dep and the various map files to
+	standard output rather than writing them into the module directory.
+
+*-P*
+	Some architectures prefix symbols with an extraneous character. This
+	specifies a prefix character (for example '\_') to ignore.
+
+*-v*, *--verbose*
+	In verbose mode, *depmod* will print (to stdout) all the symbols each
+	module depends on and the module's file name which provides that symbol.
+
+*-V*, *--version*
+	Show version of program and exit. See below for caveats when run on
+	older kernels.
+
+*-w*
+	Warn on duplicate dependencies, aliases, symbol versions, etc.
+
+# COPYRIGHT
+
+This manual page originally Copyright 2002, Rusty Russell, IBM Corporation.
+Portions Copyright Jon Masters, and others.
+
+# SEE ALSO
+
+*depmod.d*(5), *modprobe*(8), *modules.dep*(5)
+
+# AUTHORS
+
+*Jon Masters* <[email protected]>
+	Developer
+
+*Robby Workman* <[email protected]>
+	Developer
+
+*Lucas De Marchi* <[email protected]>
+	Developer
man/depmod.d.5.scd new file +95 -0

95 lines not on this page · raw message

man/insmod.8.scd new file +36 -0
new file mode 100644
index 0000000..b6f8654
@@ -0,0 +1,36 @@
+INSMOD(8) "kmod" "insmod"
+
+# NAME
+
+insmod - Simple program to insert a module into the Linux Kernel
+
+# SYNOPSIS
+
+*insmod* [_filename_] [_module options_...]
+
+# DESCRIPTION
+
+*insmod* is a trivial program to insert a module into the kernel. Most users
+will want to use* modprobe*(8) instead, which is more clever and can handle
+module dependencies.
+
+Only the most general of error messages are reported: as the work of trying to
+link the module is now done inside the kernel, the *dmesg* usually gives more
+information about errors.
+
+# COPYRIGHT
+
+This manual page originally Copyright 2002, Rusty Russell, IBM Corporation.
+Maintained by Jon Masters and others.
+
+# SEE ALSO
+
+*modprobe*(8), *rmmod*(8), *lsmod*(8), *modinfo*(8) *depmod*(8)
+
+# AUTHORS
+
+*Jon Masters* <[email protected]>
+	Developer
+
+*Lucas De Marchi* <[email protected]>
+	Developer
man/kmod.8.scd new file +48 -0

48 lines not on this page · raw message

man/lsmod.8.scd new file +30 -0
new file mode 100644
index 0000000..7195cba
@@ -0,0 +1,30 @@
+LSMOD(8) "kmod" "lsmod"
+
+# NAME
+
+lsmod - Show the status of modules in the Linux Kernel
+
+# SYNOPSIS
+*lsmod*
+
+# DESCRIPTION
+
+*lsmod* is a trivial program which nicely formats the contents of the
+/proc/modules, showing what kernel modules are currently loaded.
+
+# COPYRIGHT
+
+This manual page originally Copyright 2002, Rusty Russell, IBM Corporation.
+Maintained by Jon Masters and others.
+
+# SEE ALSO
+
+*insmod*(8), *modprobe*(8), *modinfo*(8) *depmod*(8)
+
+# AUTHORS
+
+*Jon Masters* <[email protected]>
+	Developer
+
+*Lucas De Marchi* <[email protected]>
+	Developer
man/modinfo.8.scd new file +78 -0

78 lines not on this page · raw message

man/modprobe.8.scd new file +216 -0

216 lines not on this page · raw message

man/modprobe.d.5.scd new file +168 -0

168 lines not on this page · raw message

man/modules.dep.5.scd new file +43 -0

43 lines not on this page · raw message

man/rmmod.8.scd new file +50 -0

50 lines not on this page · raw message

Signature · 1 line
2.45.0
#3 lore raw

PATCH 3/20 man: build the scdoc based man pages

In reply to Emil Velikov

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.

---
 configure.ac          |  2 +-
 man/Makefile.am       | 24 ++++++++----------------
 man/modules.dep.bin.5 |  1 +
 3 files changed, 10 insertions(+), 17 deletions(-)
configure.ac +1 -1
index 9527aa2..dcf7479 100644
@@ -32,7 +32,7 @@ AC_PROG_SED
 AC_PROG_MKDIR_P
 AC_PROG_LN_S
 PKG_PROG_PKG_CONFIG
-AC_PATH_PROG([XSLTPROC], [xsltproc])
+AC_PATH_PROG([SCDOC], [scdoc])
 
 AC_PROG_CC_C99
 
man/Makefile.am +8 -16
index d62ff21..0285fdd 100644
@@ -2,37 +2,29 @@ MAN5 = depmod.d.5 modprobe.d.5 modules.dep.5
 MAN8 = kmod.8 depmod.8 insmod.8 lsmod.8 rmmod.8 modprobe.8 modinfo.8
 MAN_STUB = modules.dep.bin.5
 
-AM_V_XSLT = $(AM_V_XSLT_$(V))
-AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
-AM_V_XSLT_0 = @echo "  XSLT    " $@;
-
-XSLT = $(if $(XSLTPROC), $(XSLTPROC), xsltproc)
+AM_V_SCDOC = $(AM_V_SCDOC_$(V))
+AM_V_SCDOC_ = $(AM_V_SCDOR_$(AM_DEFAULT_VERBOSITY))
+AM_V_SCDOC_0 = @echo "  SCDOC    " $@;
 
 if BUILD_TOOLS
 dist_man_MANS = $(MAN5) $(MAN8) $(MAN_STUB)
-modules.dep.bin.5: modules.dep.5
 endif
 
-EXTRA_DIST = $(MAN5:%.5=%.5.xml) $(MAN8:%.8=%.8.xml)
+EXTRA_DIST = $(MAN5:%.5=%.5.scd) $(MAN8:%.8=%.8.scd)
 CLEANFILES = $(dist_man_MANS)
 
 define generate_manpage
-	$(AM_V_XSLT)if [ '$(distconfdir)' != '/lib' ] ; then \
+	$(AM_V_SCDOC)if [ '$(distconfdir)' != '/lib' ] ; then \
 		sed -e 's|@DISTCONFDIR@|$(distconfdir)|g' $< ; \
 	else \
 		sed -e '/@DISTCONFDIR@/d' $< ; \
 	fi | \
 	sed -e 's|@MODULE_DIRECTORY@|$(module_directory)|g' | \
-	$(XSLT) \
-		-o $@ \
-		--nonet \
-		--stringparam man.output.quietly 1 \
-		--param funcsynopsis.style "'ansi'" \
-		http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl -
+	$(SCDOC) > $@
 endef
 
-%.5: %.5.xml
+%.5: %.5.scd
 	$(generate_manpage)
 
-%.8: %.8.xml
+%.8: %.8.scd
 	$(generate_manpage)
man/modules.dep.bin.5 new file +1 -0
new file mode 100644
index 0000000..795636b
@@ -0,0 +1 @@
+.so modules.dep.5
Signature · 1 line
2.45.0
#4 lore raw

Re: [PATCH kmod 03/20] man: build the scdoc based man pages

Quoted 25 lines · On Tue, Jun 11, 2024 at 04:05:03PM GMT, Emil Velikov via B4 Relay wrote:

From: Emil Velikov <[email protected]>

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.

---

configure.ac          |  2 +-
man/Makefile.am       | 24 ++++++++----------------
man/modules.dep.bin.5 |  1 +
3 files changed, 10 insertions(+), 17 deletions(-)
configure.ac +0 -0
index 9527aa2..dcf7479 100644
@@ -32,7 +32,7 @@ AC_PROG_SED

AC_PROG_MKDIR_P
AC_PROG_LN_S
PKG_PROG_PKG_CONFIG

configure.ac AC_PROG_SED · line 35

Quoted 2 lines
configure.ac +1 -1
-AC_PATH_PROG([XSLTPROC], [xsltproc])
+AC_PATH_PROG([SCDOC], [scdoc])

we should fail it if scdoc is not found and --disable-manpages is not passed. Right now, it just proceeds without failing, and create bogus manpages:

$ scdoc
bash: scdoc: command not found
$ make
...
Making all in man
if [ '/usr/lib' != '/lib' ] ; then sed -e 's|@DISTCONFDIR@|/usr/lib|g' ../../man/depmod.d.5.scd ; else sed -e '/@DISTCONFDIR@/d' ../../man/depmod.d.5.scd ; fi | sed -e 's|@MODULE_DIRECTORY@|/lib/modules|g' |  > depmod.d.5
if [ '/usr/lib' != '/lib' ] ; then sed -e 's|@DISTCONFDIR@|/usr/lib|g' ../../man/modprobe.d.5.scd ; else sed -e '/@DISTCONFDIR@/d' ../../man/modprobe.d.5.scd ; fi | sed -e 's|@MODULE_DIRECTORY@|/lib/modules|g' |  > modprobe.d.5
if [ '/usr/lib' != '/lib' ] ; then sed -e 's|@DISTCONFDIR@|/usr/lib|g' ../../man/modules.dep.5.scd ; else sed -e '/@DISTCONFDIR@/d' ../../man/modules.dep.5.scd ; fi | sed -e 's|@MODULE_DIRECTORY@|/lib/modules|g' |  > modules.dep.5
if [ '/usr/lib' != '/lib' ] ; then sed -e 's|@DISTCONFDIR@|/usr/lib|g' ../../man/kmod.8.scd ; else sed -e '/@DISTCONFDIR@/d' ../../man/kmod.8.scd ; fi | sed -e 's|@MODULE_DIRECTORY@|/lib/modules|g' |  > kmod.8
if [ '/usr/lib' != '/lib' ] ; then sed -e 's|@DISTCONFDIR@|/usr/lib|g' ../../man/depmod.8.scd ; else sed -e '/@DISTCONFDIR@/d' ../../man/depmod.8.scd ; fi | sed -e 's|@MODULE_DIRECTORY@|/lib/modules|g' |  > depmod.8
if [ '/usr/lib' != '/lib' ] ; then sed -e 's|@DISTCONFDIR@|/usr/lib|g' ../../man/insmod.8.scd ; else sed -e '/@DISTCONFDIR@/d' ../../man/insmod.8.scd ; fi | sed -e 's|@MODULE_DIRECTORY@|/lib/modules|g' |  > insmod.8
if [ '/usr/lib' != '/lib' ] ; then sed -e 's|@DISTCONFDIR@|/usr/lib|g' ../../man/lsmod.8.scd ; else sed -e '/@DISTCONFDIR@/d' ../../man/lsmod.8.scd ; fi | sed -e 's|@MODULE_DIRECTORY@|/lib/modules|g' |  > lsmod.8
if [ '/usr/lib' != '/lib' ] ; then sed -e 's|@DISTCONFDIR@|/usr/lib|g' ../../man/rmmod.8.scd ; else sed -e '/@DISTCONFDIR@/d' ../../man/rmmod.8.scd ; fi | sed -e 's|@MODULE_DIRECTORY@|/lib/modules|g' |  > rmmod.8
if [ '/usr/lib' != '/lib' ] ; then sed -e 's|@DISTCONFDIR@|/usr/lib|g' ../../man/modprobe.8.scd ; else sed -e '/@DISTCONFDIR@/d' ../../man/modprobe.8.scd ; fi | sed -e 's|@MODULE_DIRECTORY@|/lib/modules|g' |  > modprobe.8
if [ '/usr/lib' != '/lib' ] ; then sed -e 's|@DISTCONFDIR@|/usr/lib|g' ../../man/modinfo.8.scd ; else sed -e '/@DISTCONFDIR@/d' ../../man/modinfo.8.scd ; fi | sed -e 's|@MODULE_DIRECTORY@|/lib/modules|g' |  > modinfo.8
$ cat man/modprobe.8
$
Quoted 11 lines

AC_PROG_CC_C99

man/Makefile.am +0 -0
index d62ff21..0285fdd 100644
@@ -2,37 +2,29 @@ MAN5 = depmod.d.5 modprobe.d.5 modules.dep.5

MAN8 = kmod.8 depmod.8 insmod.8 lsmod.8 rmmod.8 modprobe.8 modinfo.8 MAN_STUB = modules.dep.bin.5

man/Makefile.am MAN5 = depmod.d.5 modprobe.d.5 modules.dep.5 · line 6

Quoted 7 lines
man/Makefile.am +2 -5
-AM_V_XSLT = $(AM_V_XSLT_$(V))
-AM_V_XSLT_ = $(AM_V_XSLT_$(AM_DEFAULT_VERBOSITY))
-AM_V_XSLT_0 = @echo "  XSLT    " $@;
-
-XSLT = $(if $(XSLTPROC), $(XSLTPROC), xsltproc)
+AM_V_SCDOC = $(AM_V_SCDOC_$(V))
+AM_V_SCDOC_ = $(AM_V_SCDOR_$(AM_DEFAULT_VERBOSITY))

^ typo here,

so quieting the command doesn't work. Once fixed I get:

Making all in man

  SCDOC     modprobe.d.5
  SCDOC     depmod.d.5
  SCDOC     modules.dep.5
  SCDOC     kmod.8
  SCDOC     depmod.8
  SCDOC     insmod.8
  SCDOC     lsmod.8
  SCDOC     rmmod.8
  SCDOC     modprobe.8
  SCDOC     modinfo.8

thanks
Lucas De Marchi

Quoted 47 lines

+AM_V_SCDOC_0 = @echo " SCDOC " $@;

if BUILD_TOOLS
dist_man_MANS = $(MAN5) $(MAN8) $(MAN_STUB)
-modules.dep.bin.5: modules.dep.5
endif

man/Makefile.am +1 -1
-EXTRA_DIST = $(MAN5:%.5=%.5.xml) $(MAN8:%.8=%.8.xml)
+EXTRA_DIST = $(MAN5:%.5=%.5.scd) $(MAN8:%.8=%.8.scd)

CLEANFILES = $(dist_man_MANS)

define generate_manpage

man/Makefile.am +1 -1
-	$(AM_V_XSLT)if [ '$(distconfdir)' != '/lib' ] ; then \
+	$(AM_V_SCDOC)if [ '$(distconfdir)' != '/lib' ] ; then \
		sed -e 's|@DISTCONFDIR@|$(distconfdir)|g' $< ; \
	else \
		sed -e '/@DISTCONFDIR@/d' $< ; \
	fi | \
	sed -e 's|@MODULE_DIRECTORY@|$(module_directory)|g' | \
man/Makefile.am +1 -6
-	$(XSLT) \
-		-o $@ \
-		--nonet \
-		--stringparam man.output.quietly 1 \
-		--param funcsynopsis.style "'ansi'" \
-		http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl -
+	$(SCDOC) > $@

endef

-%.5: %.5.xml
+%.5: %.5.scd

	$(generate_manpage)

-%.8: %.8.xml
+%.8: %.8.scd

	$(generate_manpage)
man/modules.dep.bin.5 new file +1 -0
new file mode 100644
index 0000000..795636b
@@ -0,0 +1 @@
+.so modules.dep.5
Signature · 2 lines
-- 
2.45.0
#5 lore raw

Re: [PATCH kmod 03/20] man: build the scdoc based man pages

Quoted 18 lines · Lucas De Marchi
Quoted 17 lines · On Tue, Jun 11, 2024 at 04:05:03PM GMT, Emil Velikov via B4 Relay wrote:

From: Emil Velikov <[email protected]>

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.

---

configure.ac          |  2 +-
man/Makefile.am       | 24 ++++++++----------------
man/modules.dep.bin.5 |  1 +
3 files changed, 10 insertions(+), 17 deletions(-)
Quoted 12 lines

configure.ac AC_PROG_SED · line 35

Quoted 10 lines
configure.ac +0 -0
index 9527aa2..dcf7479 100644
@@ -32,7 +32,7 @@ AC_PROG_SED

AC_PROG_MKDIR_P
AC_PROG_LN_S
PKG_PROG_PKG_CONFIG

configure.ac +1 -1
-AC_PATH_PROG([XSLTPROC], [xsltproc])
+AC_PATH_PROG([SCDOC], [scdoc])

we should fail it if scdoc is not found and --disable-manpages

I added a patch on top to make it a required tool

Quoted 3 lines
Quoted 1 line

+AM_V_SCDOC_ = $(AM_V_SCDOR_$(AM_DEFAULT_VERBOSITY))

^ typo here,

and squashed this fix in your patch.

Applied patches 2, 3 and 4 for now.

Lucas De Marchi

#6 lore raw

PATCH 4/20 man: remove no longer used XML files

In reply to Emil Velikov
---
 man/depmod.8.xml      | 343 -------------------------------
 man/depmod.d.5.xml    | 164 ---------------
 man/insmod.8.xml      |  87 --------
 man/kmod.8.xml        | 120 -----------
 man/lsmod.8.xml       |  73 -------
 man/modinfo.8.xml     | 201 -------------------
 man/modprobe.8.xml    | 544 --------------------------------------------------
 man/modprobe.d.5.xml  | 265 ------------------------
 man/modules.dep.5.xml |  80 --------
 man/rmmod.8.xml       | 148 --------------
 10 files changed, 2025 deletions(-)
man/depmod.8.xml deleted +0 -343
deleted file mode 100644
index fce2a4a..0000000
@@ -1,343 +0,0 @@
-<?xml version='1.0'?>
-<!--*-nxml-*-->
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
-        "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
-<refentry id="depmod">
-  <refentryinfo>
-    <title>depmod</title>
-    <productname>kmod</productname>
-
-    <authorgroup>
-      <author>
-        <contrib>Developer</contrib>
-        <firstname>Jon</firstname>
-        <surname>Masters</surname>
-        <email>[email protected]</email>
-      </author>
-      <author>
-        <contrib>Developer</contrib>
-        <firstname>Robby</firstname>
-        <surname>Workman</surname>
-        <email>[email protected]</email>
-      </author>
-      <author>
-        <contrib>Developer</contrib>
-        <firstname>Lucas</firstname>
-        <surname>De Marchi</surname>
-        <email>[email protected]</email>
-      </author>
-    </authorgroup>
-  </refentryinfo>
-
-  <refmeta>
-    <refentrytitle>depmod</refentrytitle>
-    <manvolnum>8</manvolnum>
-  </refmeta>
-
-  <refnamediv>
-    <refname>depmod</refname>
-    <refpurpose>
-      Generate <filename>modules.dep</filename> and map files.
-    </refpurpose>
-  </refnamediv>
-
-  <refsynopsisdiv>
-    <cmdsynopsis>
-      <command>depmod</command>
-      <arg><option>-b <replaceable>basedir</replaceable></option></arg>
-      <arg><option>-o <replaceable>outdir</replaceable></option></arg>
-      <arg><option>-e</option></arg>
-      <arg><option>-E <replaceable>Module.symvers</replaceable></option></arg>
-      <arg><option>-F <replaceable>System.map</replaceable></option></arg>
-      <arg><option>-n</option></arg>
-      <arg><option>-v</option></arg>
-      <arg><option>-A</option></arg>
-      <arg><option>-P <replaceable>prefix</replaceable></option></arg>
-      <arg><option>-w</option></arg>
-      <arg><option><replaceable>version</replaceable></option></arg>
-    </cmdsynopsis>
-
-    <cmdsynopsis>
-      <command>depmod</command>
-      <arg><option>-e</option></arg>
-      <arg><option>-E <replaceable>Module.symvers</replaceable></option></arg>
-      <arg><option>-F <replaceable>System.map</replaceable></option></arg>
-      <arg><option>-n</option></arg>
-      <arg><option>-v</option></arg>
-      <arg><option>-P <replaceable>prefix</replaceable></option></arg>
-      <arg><option>-w</option></arg>
-      <arg><option><replaceable>version</replaceable></option></arg>
-      <arg rep='repeat'><option><replaceable>filename</replaceable></option></arg>
-    </cmdsynopsis>
-  </refsynopsisdiv>
-
-  <refsect1><title>DESCRIPTION</title>
-    <para>
-      Linux kernel modules can provide services (called "symbols") for other
-      modules to use (using one of the EXPORT_SYMBOL variants in the code).  If
-      a second module uses this symbol, that second module clearly depends on
-      the first module.  These dependencies can get quite complex.
-    </para>
-    <para> <command>depmod</command> creates a list of module dependencies by
-      reading each module under
-      <filename>@MODULE_DIRECTORY@/</filename><replaceable>version</replaceable> and
-      determining what symbols it exports and what symbols it needs.  By
-      default, this list is written to <filename>modules.dep</filename>, and a
-      binary hashed version named <filename>modules.dep.bin</filename>, in the
-      same directory.  If filenames are given on the command line, only those
-      modules are examined (which is rarely useful unless all modules are
-      listed).  <command>depmod</command> also creates a list of symbols
-      provided by modules in the file named
-      <filename>modules.symbols</filename> and its binary hashed version,
-      <filename>modules.symbols.bin</filename>.  Finally,
-      <command>depmod</command> will output a file named
-      <filename>modules.devname</filename> if modules supply special device
-      names (devname) that should be populated in /dev on boot (by a utility
-      such as systemd-tmpfiles).
-    </para>
-    <para> If a <replaceable>version</replaceable> is provided, then that kernel
-      version's module directory is used rather than the current kernel version
-      (as returned by <command>uname -r</command>).
-    </para>
-  </refsect1>
-  <refsect1><title>OPTIONS</title>
-    <variablelist>
-      <varlistentry>
-        <term>
-          <option>-a</option>
-        </term>
-        <term>
-          <option>--all</option>
-        </term>
-        <listitem>
-          <para>
-            Probe all modules. This option is enabled by default if no
-            file names are given in the command-line.
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>
-          <option>-A</option>
-        </term>
-        <term>
-          <option>--quick</option>
-        </term>
-        <listitem>
-          <para>
-            This option scans to see if any modules are newer than the
-            <filename>modules.dep</filename> file before any work is done:
-            if not, it silently exits rather than regenerating the files.
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>
-          <option>-b <replaceable>basedir</replaceable></option>
-        </term>
-        <term>
-          <option>--basedir <replaceable>basedir</replaceable></option>
-        </term>
-        <listitem>
-          <para>
-            If your modules are not currently in the (normal) directory
-            <filename>@MODULE_DIRECTORY@/</filename><replaceable>version</replaceable>,
-            but in a staging area, you can specify a
-            <replaceable>basedir</replaceable> which is prepended to the
-            directory name.  This <replaceable>basedir</replaceable> is
-            stripped from the resulting <filename>modules.dep</filename> file,
-            so it is ready to be moved into the normal location. Use this
-            option if you are a distribution vendor who needs to pre-generate
-            the meta-data files rather than running depmod again later.
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>
-          <option>-o <replaceable>outdir</replaceable></option>
-        </term>
-        <term>
-          <option>--outdir <replaceable>outdir</replaceable></option>
-        </term>
-        <listitem>
-          <para>
-            Set the output directory where depmod will store any generated file.
-            <replaceable>outdir</replaceable> serves as a root to that location,
-            similar to how <replaceable>basedir</replaceable> is used. Also this
-            setting takes precedence and if used together with
-            <replaceable>basedir</replaceable> it will result in the input being
-            that directory, but the output being the one set by
-            <replaceable>outdir</replaceable>.
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>
-          <option>-C</option>
-        </term>
-        <term>
-          <option>--config <replaceable>file or directory</replaceable></option>
-        </term>
-        <listitem>
-          <para>
-            This option overrides the default configuration directory at
-            <filename>/etc/depmod.d/</filename>.
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>
-          <option>-e</option>
-        </term>
-        <term>
-          <option>--errsyms</option>
-        </term>
-        <listitem>
-          <para>
-            When combined with the <option>-F</option> option, this reports any
-            symbols which a module needs which are not supplied by other
-            modules or the kernel.  Normally, any symbols not provided by
-            modules are assumed to be provided by the kernel (which should be
-            true in a perfect world), but this assumption can break especially
-            when additionally updated third party drivers are not correctly
-            installed or were built incorrectly.
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>
-          <option>-E</option>
-        </term>
-        <term>
-          <option>--symvers</option>
-        </term>
-          <listitem>
-            <para>
-              When combined with the <option>-e</option> option, this
-              reports any symbol versions supplied by modules that do
-              not match with the symbol versions provided by the
-              kernel in its <filename>Module.symvers</filename>.
-              This option is mutually incompatible with <option>-F</option>.
-            </para>
-          </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>
-          <option>-F</option>
-        </term>
-        <term>
-          <option>--filesyms <replaceable>System.map</replaceable></option>
-        </term>
-        <listitem>
-          <para>
-            Supplied with the <filename>System.map</filename> produced when the
-            kernel was built, this allows the <option>-e</option> option to
-            report unresolved symbols.  This option is mutually incompatible
-            with <option>-E</option>.
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>
-          <option>-h</option>
-        </term>
-        <term>
-          <option>--help</option>
-        </term>
-        <listitem>
-          <para>
-            Print the help message and exit.
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>
-          <option>-n</option>
-        </term>
-        <term>
-          <option>--show</option>
-        </term>
-        <term>
-          <option>--dry-run</option>
-        </term>
-        <listitem>
-          <para>
-            This sends the resulting modules.dep and the various map files to
-            standard output rather than writing them into the module directory.
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>
-          <option>-P</option>
-        </term>
-        <listitem>
-          <para>
-            Some architectures prefix symbols with an extraneous character.
-            This specifies a prefix character (for example '_') to ignore.
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>
-          <option>-v</option>
-        </term>
-        <term>
-          <option>--verbose</option>
-        </term>
-        <listitem>
-          <para>
-            In verbose mode, <command>depmod</command> will print (to stdout)
-            all the symbols each module depends on and the module's file name
-            which provides that symbol.
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>
-          <option>-V</option>
-        </term>
-        <term>
-          <option>--version</option>
-        </term>
-        <listitem>
-          <para>
-            Show version of program and exit. See below for caveats when
-            run on older kernels.
-          </para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>
-          <option>-w</option>
-        </term>
-        <listitem>
-          <para>
-            Warn on duplicate dependencies, aliases, symbol versions, etc.
-          </para>
-        </listitem>
-      </varlistentry>
-    </variablelist>
-  </refsect1>
-
-  <refsect1><title>COPYRIGHT</title>
-    <para>
-      This manual page originally Copyright 2002, Rusty Russell,
-      IBM Corporation. Portions Copyright Jon Masters, and others.
-    </para>
-  </refsect1>
-
-  <refsect1><title>SEE ALSO</title>
-    <para>
-      <citerefentry>
-        <refentrytitle>depmod.d</refentrytitle><manvolnum>5</manvolnum>
-      </citerefentry>,
-      <citerefentry>
-        <refentrytitle>modprobe</refentrytitle><manvolnum>8</manvolnum>
-      </citerefentry>,
-      <citerefentry>
-        <refentrytitle>modules.dep</refentrytitle><manvolnum>5</manvolnum>
-      </citerefentry>
-    </para>
-  </refsect1>
-</refentry>
man/depmod.d.5.xml deleted +0 -164

164 lines not on this page · raw message

man/insmod.8.xml deleted +0 -87

87 lines not on this page · raw message

man/kmod.8.xml deleted +0 -120

120 lines not on this page · raw message

man/lsmod.8.xml deleted +0 -73

73 lines not on this page · raw message

man/modinfo.8.xml deleted +0 -201

201 lines not on this page · raw message

man/modprobe.8.xml deleted +0 -544

544 lines not on this page · raw message

man/modprobe.d.5.xml deleted +0 -265

265 lines not on this page · raw message

man/modules.dep.5.xml deleted +0 -80

80 lines not on this page · raw message

man/rmmod.8.xml deleted +0 -148

148 lines not on this page · raw message

Signature · 1 line
2.45.0
#7 lore raw

PATCH 5/20 man: add some extra bold/italic annotations

In reply to Emil Velikov
---
 man/depmod.8.scd      | 18 +++++++++---------
 man/kmod.8.scd        |  2 +-
 man/modinfo.8.scd     |  8 ++++----
 man/modprobe.8.scd    | 12 ++++++------
 man/modules.dep.5.scd | 11 ++++++-----
 man/rmmod.8.scd       |  2 +-
 6 files changed, 27 insertions(+), 26 deletions(-)
man/depmod.8.scd +9 -9
index 0fe9128..8cb6449 100644
@@ -21,7 +21,7 @@ dependencies can get quite complex.
 
 *depmod* creates a list of module dependencies by reading each module under
 @MODULE_DIRECTORY@/_version_ and determining what symbols it exports and what
-symbols it needs. By default, this list is written to modules.dep, and a binary
+symbols it needs. By default, this list is written to *modules.dep*, and a binary
 hashed version named modules.dep.bin, in the same directory. If filenames are
 given on the command line, only those modules are examined (which is rarely
 useful unless all modules are listed). * depmod* also creates a list of symbols
@@ -41,17 +41,17 @@ rather than the current kernel version (as returned by *uname -r*).
 
 *-A*, *--quick*
 	This option scans to see if any modules are newer than the
-	modules.dep file before any work is done: if not, it silently exits
+	*modules.dep* file before any work is done: if not, it silently exits
 	rather than regenerating the files.
 
 *-b* _basedir_, *--basedir* _basedir_
 	If your modules are not currently in the (normal) directory
 	@MODULE_DIRECTORY@/_version_, but in a staging area, you can specify a
 	_basedir_ which is prepended to the directory name. This _basedir_ is
-	stripped from the resulting modules.dep file, so it is ready to be moved
-	into the normal location. Use this option if you are a distribution
-	vendor who needs to pre-generate the meta-data files rather than running
-	depmod again later.
+	stripped from the resulting *modules.dep* file, so it is ready to be
+	moved into the normal location. Use this option if you are a
+	distribution vendor who needs to pre-generate the meta-data files rather
+	than running *depmod* again later.
 
 *-o* _outdir_, *--outdir* _outdir_
 	Set the output directory where depmod will store any generated file.
@@ -75,11 +75,11 @@ rather than the current kernel version (as returned by *uname -r*).
 *-E*, *--symvers*
 	When combined with the *-e* option, this reports any symbol versions
 	supplied by modules that do not match with the symbol versions provided
-	by the kernel in its Module.symvers. This option is mutually
+	by the kernel in its _Module.symvers_. This option is mutually
 	incompatible with *-F*.
 
 *-F*, *--filesyms* _System.map_
-	Supplied with the System.map produced when the kernel was built, this
+	Supplied with the _System.map_ produced when the kernel was built, this
 	allows the *-e* option to report unresolved symbols. This option is
 	mutually incompatible with *-E*.
 
@@ -87,7 +87,7 @@ rather than the current kernel version (as returned by *uname -r*).
 	Print the help message and exit.
 
 *-n*, *--show*, *--dry-run*
-	This sends the resulting modules.dep and the various map files to
+	This sends the resulting *modules.dep* and the various map files to
 	standard output rather than writing them into the module directory.
 
 *-P*
man/kmod.8.scd +1 -1
index d292a13..7bef863 100644
@@ -6,7 +6,7 @@ kmod - Program to manage Linux Kernel modules
 
 # SYNOPSIS
 
-*kmod* [*OPTIONS*...] [_COMMAND_] [*COMMAND_OPTIONS*...]
+*kmod* [*OPTIONS...*] [_COMMAND_] [*COMMAND_OPTIONS...*]
 
 # DESCRIPTION
 
man/modinfo.8.scd +4 -4
index fd945ce..75267bc 100644
@@ -29,14 +29,14 @@ architecture.
 # OPTIONS
 
 *-V*, *--version*
-	Print the modinfo version.
+	Print the *modinfo* version.
 
 *-F*, *--field*
 	Only print this field value, one per line. This is most useful for
 	scripts. Field names are case-insensitive. Common fields (which may not
 	be in every module) include author, description, license, parm, depends,
 	and alias. There are often multiple parm, alias and depends fields. The
-	special field filename lists the filename of the module.
+	special _field_ filename lists the filename of the module.
 
 *-b* _basedir_, *--basedir* _basedir_
 	Root directory for modules, / by default.
@@ -50,9 +50,9 @@ architecture.
 	image prior to booting.
 
 *-0*, *--null*
-	Use the ASCII zero character to separate field values, instead of a new
+	Use the ASCII zero character to separate _field_ values, instead of a new
 	line. This is useful for scripts, since a new line can theoretically
-	appear inside a field.
+	appear inside a _field_.
 
 *-a* *--author*, *-d* *--description*, *-l* *--license*, *-p* *--parameters*,
 *-n* *--filename*
man/modprobe.8.scd +6 -6
index f678654..653fbd9 100644
@@ -9,11 +9,11 @@ modprobe - Add and remove modules from the Linux Kernel
 *modprobe* [*-v*] [*-V*] [*-C *_config-file_] [*-n*] [*-i*] [*-q*] [*-b*] [_modulename_]
 \ \ \ \ \ \ \ \ \ \[_module parameters_...]
 
-*modprobe* [-r] [*-v*] [*-n*] [*-i*] [_modulename_...]
+*modprobe* [*-r*] [*-v*] [*-n*] [*-i*] [_modulename_...]
 
-*modprobe* [-c]
+*modprobe* [*-c*]
 
-*modprobe* [--dump-modversions] [_filename_]
+*modprobe* [*--dump-modversions*] [_filename_]
 
 # DESCRIPTION
 
@@ -42,7 +42,7 @@ If any arguments are given after the _modulename_, they are passed to the kernel
 
 When loading modules, _modulename_ can also be a path to the module. If the path
 is relative, it must explicitly start with "./". Note that this may fail when
-using a path to a module with dependencies not matching the installed depmod
+using a path to a module with dependencies not matching the installed *depmod*
 database.
 
 # OPTIONS
@@ -78,7 +78,7 @@ database.
 	module which is already present or to remove a module which isn't
 	present. This is ideal for simple scripts; however, more complicated
 	scripts often want to know whether *modprobe* really did something: this
-	option makes modprobe fail in the case that it actually didn't do
+	option makes *modprobe* fail in the case that it actually didn't do
 	anything.
 
 *--force-vermagic*
@@ -97,7 +97,7 @@ database.
 	detailing the versions of every interfaced used by (or supplied by) the
 	module is created. If a module fails to load and the kernel complains
 	that the module disagrees about a version of some interface, you can use
-	"--force-modversion" to remove the version information altogether.
+	*--force-modversion* to remove the version information altogether.
 	Naturally, this check is there for your protection, so using this option
 	is dangerous unless you know what you're doing.
 
man/modules.dep.5.scd +6 -5
index 34ffb83..c4e7653 100644
@@ -12,13 +12,14 @@ modules.dep, modules.dep.bin - Module dependency information
 
 # DESCRIPTION
 
-modules.dep.bin is a binary file generated by *depmod* listing the dependencies
-for every module in the directories under @MODULE_DIRECTORY@/_version_. It is
-used by kmod tools such as *modprobe* and libkmod.
+*modules.dep.bin* is a binary file generated by *depmod* listing the
+dependencies for every module in the directories under
+@MODULE_DIRECTORY@/_version_. It is used by *kmod* tools such as *modprobe* and
+libkmod.
 
 Its text counterpart is located in the same directory with the name
-modules.dep. The text version is maintained only for easy of reading by humans
-and is in no way used by any kmod tool.
+*modules.dep*. The text version is maintained only for easy of reading by humans
+and is in no way used by any *kmod* tool.
 
 These files are not intended for editing or use by any additional utilities as
 their format is subject to change in the future. You should use the *modinfo*(8)
man/rmmod.8.scd +1 -1
index 72947a6..7813448 100644
@@ -29,7 +29,7 @@ is provided) from the kernel. Most users will want to use *modprobe*(8) with the
 *-s*, *--syslog*
 	Send errors to syslog instead of standard error.
 
-*-V --version*
+*-V*, *--version*
 	Show version of program and exit.
 
 # COPYRIGHT
Signature · 1 line
2.45.0
#8 lore raw

Re: [PATCH kmod 05/20] man: add some extra bold/italic annotations

man/modinfo.8.scd architecture. · line 34

Quoted 10 lines · On Tue, Jun 11, 2024 at 04:05:05PM GMT, Emil Velikov via B4 Relay wrote:
man/modinfo.8.scd +1 -1
@@ -29,14 +29,14 @@ architecture.
 # OPTIONS
 
 *-V*, *--version*
-	Print the modinfo version.
+	Print the *modinfo* version.
 
 *-F*, *--field*

missing

		  ^ _field_

so it's consistent with the rest?

Lucas De Marchi

#9 lore raw

Re: [PATCH kmod 05/20] man: add some extra bold/italic annotations

Quoted 10 lines · Lucas De Marchi
Quoted 9 lines · On Tue, Jun 11, 2024 at 04:05:05PM GMT, Emil Velikov via B4 Relay wrote:
man/modinfo.8.scd +1 -1
@@ -29,14 +29,14 @@ architecture.
 # OPTIONS
 
 *-V*, *--version*
-	Print the modinfo version.
+	Print the *modinfo* version.
 
Quoted 5 lines

man/modinfo.8.scd architecture. · line 34

Quoted 1 line
man/modinfo.8.scd +0 -0
 *-F*, *--field*

missing

		  ^ _field_

so it's consistent with the rest?

oh, ok. This is in a later patch.

Lucas De Marchi

Quoted 2 lines

Lucas De Marchi

#10 lore raw

PATCH 6/20 man: white space fixes

In reply to Emil Velikov

These were present in the original xml files and I opted to keep them separate fix to make the transition/comparison easier.

---
 man/depmod.8.scd     | 4 ++--
 man/depmod.d.5.scd   | 2 +-
 man/modprobe.8.scd   | 8 ++++----
 man/modprobe.d.5.scd | 4 ++--
 4 files changed, 9 insertions(+), 9 deletions(-)
man/depmod.8.scd +2 -2
index 8cb6449..80cc48d 100644
@@ -54,8 +54,8 @@ rather than the current kernel version (as returned by *uname -r*).
 	than running *depmod* again later.
 
 *-o* _outdir_, *--outdir* _outdir_
-	Set the output directory where depmod will store any generated file.
-	_ outdir_ serves as a root to that location, similar to how _basedir_ is
+	Set the output directory where *depmod* will store any generated file.
+	_outdir_ serves as a root to that location, similar to how _basedir_ is
 	used. Also this setting takes precedence and if used together with
 	_basedir_ it will result in the input being that directory, but the output
 	being the one set by _outdir_.
man/depmod.d.5.scd +1 -1
index 9c42478..4e05b93 100644
@@ -50,7 +50,7 @@ override _modulename_ _kernelversion_ _modulesubdirectory_
 	This command allows you to override which version of a specific module
 	will be used when more than one module sharing the same name is
 	processed by the *depmod* command. It is possible to specify one kernel
-	or all kernels using the \* wildcard. _ modulesubdirectory_ is the name
+	or all kernels using the \* wildcard. _modulesubdirectory_ is the name
 	of the subdirectory under @MODULE_DIRECTORY@ (or other module location)
 	where the target module is installed.
 
man/modprobe.8.scd +4 -4
index 653fbd9..aac3a74 100644
@@ -6,7 +6,7 @@ modprobe - Add and remove modules from the Linux Kernel
 
 # SYNOPSIS
 
-*modprobe* [*-v*] [*-V*] [*-C *_config-file_] [*-n*] [*-i*] [*-q*] [*-b*] [_modulename_]
+*modprobe* [*-v*] [*-V*] [*-C* _config-file_] [*-n*] [*-i*] [*-q*] [*-b*] [_modulename_]
 \ \ \ \ \ \ \ \ \ \[_module parameters_...]
 
 *modprobe* [*-r*] [*-v*] [*-n*] [*-i*] [_modulename_...]
@@ -19,10 +19,10 @@ modprobe - Add and remove modules from the Linux Kernel
 
 *modprobe* intelligently adds or removes a module from the Linux kernel: note
 that for convenience, there is no difference between \_ and - in module names
-(automatic underscore conversion is performed). * modprobe* looks in the module
+(automatic underscore conversion is performed). *modprobe* looks in the module
 directory @DISTCONFDIR@/`uname -r` for all the modules and other files, except
 for the optional configuration files in the /etc/modprobe.d directory (see
-*modprobe.d*(5)). * modprobe* will also use module options specified on the
+*modprobe.d*(5)). *modprobe* will also use module options specified on the
 kernel command line in the form of <module>.<option> and blacklists in the form
 of modprobe.blacklist=<module>.
 
@@ -167,7 +167,7 @@ database.
 	itself. This produces a (possibly empty) set of module filenames, one
 	per line, each starting with "insmod" and is typically used by
 	distributions to determine which modules to include when generating
-	initrd/initramfs images. * Install* commands which apply are shown
+	initrd/initramfs images. *Install* commands which apply are shown
 	prefixed by "install". It does not run any of the install commands. Note
 	that *modinfo*(8) can be used to extract dependencies of a module from the
 	module itself, but knows nothing of aliases or install commands.
man/modprobe.d.5.scd +2 -2
index 93b9522..2907175 100644
@@ -94,7 +94,7 @@ install _modulename_ _command..._
 options _modulename_ _option..._
 	This command allows you to add options to the module _modulename_ (which
 	might be an alias) every time it is inserted into the kernel: whether
-	directly (using *modprobe* _ modulename_) or because the module being
+	directly (using *modprobe* _modulename_) or because the module being
 	inserted depends on this module.
 
 	All options are added together: they can come from an *option* for the
@@ -106,7 +106,7 @@ remove _modulename_ _command..._
 
 softdep _modulename_ pre: _modules..._ post: _modules..._
 	The *softdep* command allows you to specify soft, or optional, module
-	dependencies. _ modulename_ can be used without these optional modules
+	dependencies. _modulename_ can be used without these optional modules
 	installed, but usually with some features missing. For example, a driver
 	for a storage HBA might require another module be loaded in order to use
 	management features.
Signature · 1 line
2.45.0
#11 lore raw

Re: [PATCH kmod 06/20] man: white space fixes

Quoted 18 lines · On Tue, Jun 11, 2024 at 04:05:06PM GMT, Emil Velikov via B4 Relay wrote:

From: Emil Velikov <[email protected]>

These were present in the original xml files and I opted to keep them separate fix to make the transition/comparison easier.

---

man/depmod.8.scd     | 4 ++--
man/depmod.d.5.scd   | 2 +-
man/modprobe.8.scd   | 8 ++++----
man/modprobe.d.5.scd | 4 ++--
4 files changed, 9 insertions(+), 9 deletions(-)
man/depmod.8.scd +0 -0
index 8cb6449..80cc48d 100644

man/depmod.8.scd rather than the current kernel version (as returned by *uname -r*). · line 57

Quoted 6 lines
man/depmod.8.scd +1 -2
@@ -54,8 +54,8 @@ rather than the current kernel version (as returned by *uname -r*).
 	than running *depmod* again later.
 
 *-o* _outdir_, *--outdir* _outdir_
-	Set the output directory where depmod will store any generated file.
-	_ outdir_ serves as a root to that location, similar to how _basedir_ is
+	Set the output directory where *depmod* will store any generated file.

this one belongs to the previous patch.

Lucas De Marchi

#12 lore raw

PATCH 7/20 man: misc punctuation fixes

In reply to Emil Velikov

Some commas and a full stop was missing ;-)

---
 man/depmod.d.5.scd | 2 +-
 man/kmod.8.scd     | 4 ++--
 man/lsmod.8.scd    | 2 +-
 man/modprobe.8.scd | 2 +-
 man/rmmod.8.scd    | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)
man/depmod.d.5.scd +1 -1
index 4e05b93..9cf99d5 100644
@@ -73,7 +73,7 @@ exclude _excludedir_
 	This specifies the trailing directories that will be excluded during the
 	search for kernel modules.
 
-	The _excludedir_ is the trailing directory to exclude
+	The _excludedir_ is the trailing directory to exclude.
 
 # COPYRIGHT
 
man/kmod.8.scd +2 -2
index 7bef863..2007a2d 100644
@@ -15,10 +15,10 @@ Linux Kernel modules. Most users will only run it using its other names.
 
 # OPTIONS
 
-*-V --version*
+*-V*, *--version*
 	Show the program version and exit.
 
-*-h --help*
+*-h*, *--help*
 	Show the help message.
 
 # COMMANDS
man/lsmod.8.scd +1 -1
index 7195cba..eb2f2e8 100644
@@ -19,7 +19,7 @@ Maintained by Jon Masters and others.
 
 # SEE ALSO
 
-*insmod*(8), *modprobe*(8), *modinfo*(8) *depmod*(8)
+*insmod*(8), *modprobe*(8), *modinfo*(8), *depmod*(8)
 
 # AUTHORS
 
man/modprobe.8.scd +1 -1
index aac3a74..f4ce0be 100644
@@ -202,7 +202,7 @@ Maintained by Jon Masters and others.
 
 # SEE ALSO
 
-*modprobe.d*(5), *insmod*(8), *rmmod*(8), *lsmod*(8), *modinfo*(8) *depmod*(8)
+*modprobe.d*(5), *insmod*(8), *rmmod*(8), *lsmod*(8), *modinfo*(8), *depmod*(8)
 
 # AUTHORS
 
man/rmmod.8.scd +1 -1
index 7813448..e1f656f 100644
@@ -39,7 +39,7 @@ Maintained by Jon Masters and others.
 
 # SEE ALSO
 
-*modprobe*(8), *insmod*(8), *lsmod*(8), *modinfo*(8) *depmod*(8)
+*modprobe*(8), *insmod*(8), *lsmod*(8), *modinfo*(8), *depmod*(8)
 
 # AUTHORS
 
Signature · 1 line
2.45.0
#13 lore raw

PATCH 8/20 man: some options take an argument, mention that

In reply to Emil Velikov

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.

---
There are two different styles across the man pages:
-s, --short foo
-s foo, --short foo

A proposal to resolve these comes with a later patch in this series.

---
 man/depmod.8.scd   | 2 +-
 man/modinfo.8.scd  | 4 ++--
 man/modprobe.8.scd | 6 +++---
 3 files changed, 6 insertions(+), 6 deletions(-)
man/depmod.8.scd +1 -1
index 80cc48d..7a2e84b 100644
@@ -72,7 +72,7 @@ rather than the current kernel version (as returned by *uname -r*).
 	assumption can break especially when additionally updated third party
 	drivers are not correctly installed or were built incorrectly.
 
-*-E*, *--symvers*
+*-E*, *--symvers* _Module.symvers_
 	When combined with the *-e* option, this reports any symbol versions
 	supplied by modules that do not match with the symbol versions provided
 	by the kernel in its _Module.symvers_. This option is mutually
man/modinfo.8.scd +2 -2
index 75267bc..9545257 100644
@@ -31,8 +31,8 @@ architecture.
 *-V*, *--version*
 	Print the *modinfo* version.
 
-*-F*, *--field*
-	Only print this field value, one per line. This is most useful for
+*-F* _field_, *--field* _field_
+	Only print this _field_ value, one per line. This is most useful for
 	scripts. Field names are case-insensitive. Common fields (which may not
 	be in every module) include author, description, license, parm, depends,
 	and alias. There are often multiple parm, alias and depends fields. The
man/modprobe.8.scd +3 -3
index f4ce0be..9594798 100644
@@ -55,7 +55,7 @@ database.
 	configuration files (if any) to module names as well. It is usually used
 	by *udev*(7).
 
-*-C*, *--config*
+*-C* _directory_, *--config* _directory_
 	This option overrides the default configuration directory
 	(/etc/modprobe.d).
 
@@ -151,14 +151,14 @@ database.
 	require it. Your distribution kernel may not have been built to support
 	removal of modules at all.
 
-*-w*, *--wait=*TIMEOUT_MSEC
+*-w* _TIMEOUT_MSEC_, *--wait* _TIMEOUT_MSEC_
 	This option causes *modprobe -r *to continue trying to remove a module
 	if it fails due to the module being busy, i.e. its refcount is not 0 at
 	the time the call is made. Modprobe tries to remove the module with an
 	incremental sleep time between each tentative up until the maximum wait
 	time in milliseconds passed in this option.
 
-*-S*, *--set-version*
+*-S* _version_, *--set-version* _version_
 	Set the kernel version, rather than using *uname*(2) to decide on the
 	kernel version (which dictates where to find the modules).
 
Signature · 1 line
2.45.0
#14 lore raw

PATCH 9/20 man: couple of grammar/language fixes

In reply to Emil Velikov
---
 man/modprobe.8.scd | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
man/modprobe.8.scd +2 -2
index 9594798..b47908b 100644
@@ -101,7 +101,7 @@ database.
 	Naturally, this check is there for your protection, so using this option
 	is dangerous unless you know what you're doing.
 
-	This applies any modules inserted: both the module (or alias) on the
+	This applies to any modules inserted: both the module (or alias) on the
 	command line and any modules on which it depends.
 
 *-f*, *--force*
@@ -112,7 +112,7 @@ database.
 	know what you are doing.
 
 	This applies to any modules inserted: both the module (or alias) on the
-	command line and any modules it on which it depends.
+	command line and any modules on which it depends.
 
 *-i*, *--ignore-install*, *--ignore-remove*
 	This option causes *modprobe* to ignore *install* and *remove* commands
Signature · 1 line
2.45.0
#15 lore raw

PATCH 10/20 man: stop removing DISTCONFDIR lines

In reply to Emil Velikov

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.

---
 man/Makefile.am | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
man/Makefile.am +2 -5
index 0285fdd..25135e9 100644
@@ -14,11 +14,8 @@ EXTRA_DIST = $(MAN5:%.5=%.5.scd) $(MAN8:%.8=%.8.scd)
 CLEANFILES = $(dist_man_MANS)
 
 define generate_manpage
-	$(AM_V_SCDOC)if [ '$(distconfdir)' != '/lib' ] ; then \
-		sed -e 's|@DISTCONFDIR@|$(distconfdir)|g' $< ; \
-	else \
-		sed -e '/@DISTCONFDIR@/d' $< ; \
-	fi | \
+	$(AM_V_SCDOC)cat $< | \
+	sed -e 's|@DISTCONFDIR@|$(distconfdir)|g' | \
 	sed -e 's|@MODULE_DIRECTORY@|$(module_directory)|g' | \
 	$(SCDOC) > $@
 endef
Signature · 1 line
2.45.0
#16 lore raw

PATCH 11/20 man: depmod.d: document the config file order handling

In reply to Emil Velikov

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 copied^Winspired by sysctl.d(5) ;-)

---
 man/Makefile.am    |  1 +
 man/depmod.d.5.scd | 22 ++++++++++++++++++----
 2 files changed, 19 insertions(+), 4 deletions(-)
man/Makefile.am +1 -0
index 25135e9..181f619 100644
@@ -15,6 +15,7 @@ CLEANFILES = $(dist_man_MANS)
 
 define generate_manpage
 	$(AM_V_SCDOC)cat $< | \
+	sed -e 's|@SYSCONFDIR@|$(sysconfdir)|g' | \
 	sed -e 's|@DISTCONFDIR@|$(distconfdir)|g' | \
 	sed -e 's|@MODULE_DIRECTORY@|$(module_directory)|g' | \
 	$(SCDOC) > $@
man/depmod.d.5.scd +18 -4
index 9cf99d5..9ee35e8 100644
@@ -6,15 +6,15 @@ depmod.d - Configuration directory for depmod
 
 # SYNOPSIS
 
-/lib/depmod.d/\*.conf
+@SYSCONFDIR@/depmod.d/\*.conf
 
-@DISTCONFDIR@/depmod.d/\*.conf
+/run/depmod.d/\*.conf
 
 /usr/local/lib/depmod.d/\*.conf
 
-/run/depmod.d/\*.conf
+@DISTCONFDIR@/depmod.d/\*.conf
 
-/etc/depmod.d/\*.conf
+/lib/depmod.d/\*.conf
 
 # DESCRIPTION
 
@@ -29,6 +29,20 @@ lines and lines starting with '#' ignored (useful for adding comments). A '\\'
 at the end of a line causes it to continue on the next line, which makes the
 files a bit neater.
 
+# CONFIGURATION DIRECTORIES AND PRECEDENCE
+
+Configuration files are read from directories in @SYSCONFDIR@/, /run/,
+/usr/local/lib/, @DISTCONFDIR@/, and /lib/ in order of precedence, as listed in
+the SYNOPSIS section above. Files must have the ".conf" extension. Files in
+@SYSCONFDIR@/ override files with the same name in /run/, /usr/local/lib/,
+@DISTCONFDIR@/, and /lib/. Files in /run/ override files with the same name
+under /usr/, @DISTCONFDIR@/ and /lib/.
+
+All configuration files are sorted by their filename in lexicographic order,
+regardless of which of the directories they reside in. If multiple files specify
+the same option, the entry in the file with the lexicographically latest name
+will take precedence.
+
 # COMMANDS
 
 search _subdirectory..._
Signature · 1 line
2.45.0
#17 lore raw

Re: [PATCH kmod 11/20] man: depmod.d: document the config file order handling

Quoted 55 lines · On Tue, Jun 11, 2024 at 04:05:11PM GMT, Emil Velikov via B4 Relay wrote:

From: Emil Velikov <[email protected]>

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 copied^Winspired by sysctl.d(5) ;-)

---
man/Makefile.am | 1 +
man/depmod.d.5.scd | 22 ++++++++++++++++++----

2 files changed, 19 insertions(+), 4 deletions(-)
man/Makefile.am +0 -0
index 25135e9..181f619 100644
@@ -15,6 +15,7 @@ CLEANFILES = $(dist_man_MANS)
 

define generate_manpage

	$(AM_V_SCDOC)cat $< | \
man/Makefile.am +1 -0
+	sed -e 's|@SYSCONFDIR@|$(sysconfdir)|g' | \
	sed -e 's|@DISTCONFDIR@|$(distconfdir)|g' | \
	sed -e 's|@MODULE_DIRECTORY@|$(module_directory)|g' | \
	$(SCDOC) > $@
man/depmod.d.5.scd +2 -2
index 9cf99d5..9ee35e8 100644
@@ -6,15 +6,15 @@ depmod.d - Configuration directory for depmod
 
 # SYNOPSIS
 
-/lib/depmod.d/\*.conf
+@SYSCONFDIR@/depmod.d/\*.conf
 
-@DISTCONFDIR@/depmod.d/\*.conf
+/run/depmod.d/\*.conf
 

/usr/local/lib/depmod.d/\*.conf

man/depmod.d.5.scd +2 -2
-/run/depmod.d/\*.conf
+@DISTCONFDIR@/depmod.d/\*.conf
 
-/etc/depmod.d/\*.conf
+/lib/depmod.d/\*.conf

# DESCRIPTION

man/depmod.d.5.scd +0 -0
@@ -29,6 +29,20 @@ lines and lines starting with '#' ignored (useful for adding comments). A '\\'

at the end of a line causes it to continue on the next line, which makes the files a bit neater.

man/depmod.d.5.scd lines and lines starting with '#' ignored (useful for adding comments). A '\\' · line 37

Quoted 6 lines
man/depmod.d.5.scd +6 -0
+# CONFIGURATION DIRECTORIES AND PRECEDENCE
+
+Configuration files are read from directories in @SYSCONFDIR@/, /run/,
+/usr/local/lib/, @DISTCONFDIR@/, and /lib/ in order of precedence, as listed in
+the SYNOPSIS section above. Files must have the ".conf" extension. Files in
+@SYSCONFDIR@/ override files with the same name in /run/, /usr/local/lib/,

ok until here.

Quoted 2 lines

+@DISTCONFDIR@/, and /lib/. Files in /run/ override files with the same name +under /usr/, @DISTCONFDIR@/ and /lib/.

I actually find this odd. Why mention /run overriding /usr/ (that was not mentioneed before), and not mention the other overrides?

man/depmod.d.5.scd lines and lines starting with '#' ignored (useful for adding comments). A '\\' · line 44

Quoted 5 lines
man/depmod.d.5.scd +5 -0
+
+All configuration files are sorted by their filename in lexicographic order,
+regardless of which of the directories they reside in. If multiple files specify
+the same option, the entry in the file with the lexicographically latest name
+will take precedence.

Looking at sysctl(8) and systemd-system.conf for inspiration, I'd write something like:

# CONFIGURATION DIRECTORIES AND PRECEDENCE

Configuration files are read from directories in listed in SYNOPSYS in that order of precedence. Once a file of a given filename is loaded, any file of the same name in subsequent directories is ignored.

All configuration files are sorted in lexicographic order, regardless of the directory they reside in. Configuration files can either be completely replaced (by having a new configuration file with the same name in a directory of higher priority) or partially replaced (by having a configuration file that is ordered later).

... or maybe also repeat the list of files like sysctl does to have it all in one place.

thanks
Lucas De Marchi

Quoted 9 lines

+
# COMMANDS

search _subdirectory..._

Signature · 1 line
2.45.0
#18 lore raw

PATCH 12/20 man: depmod.d: factor out a CONFIGURATION FORMAT section

In reply to Emil Velikov

Keep the description neat and tidy.

---
 man/depmod.d.5.scd | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
man/depmod.d.5.scd +7 -4
index 9ee35e8..ef57aac 100644
@@ -24,10 +24,13 @@ built-in kernel modules are complemented by custom built versions of the same
 and the user wishes to affect the priority of processing in order to override
 the module version supplied by the kernel.
 
-The format of files under depmod.d is simple: one command per line, with blank
-lines and lines starting with '#' ignored (useful for adding comments). A '\\'
-at the end of a line causes it to continue on the next line, which makes the
-files a bit neater.
+# CONFIGURATION FORMAT
+
+The configuration files contain one command per line, with blank lines and lines
+starting with '#' ignored (useful for adding comments). A '\\' at the end of a
+line causes it to continue on the next line, which makes the files a bit neater.
+
+See the COMMANDS section below for more.
 
 # CONFIGURATION DIRECTORIES AND PRECEDENCE
 
Signature · 1 line
2.45.0
#19 lore raw

PATCH 13/20 man: depmod.d: rework the opening description sentence

In reply to Emil Velikov

Use a slightly longer, more gradual introduction.

---
Lucas, I'm reading the first sentence and struggling a bit. What does the "global or per-module" refer to?

Thanks in advance o/

---
 man/depmod.d.5.scd | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
man/depmod.d.5.scd +8 -5
index ef57aac..0950790 100644
@@ -18,11 +18,14 @@ depmod.d - Configuration directory for depmod
 
 # DESCRIPTION
 
-The order in which modules are processed by the *depmod* command can be altered
-on a global or per-module basis. This is typically useful in cases where
-built-in kernel modules are complemented by custom built versions of the same
-and the user wishes to affect the priority of processing in order to override
-the module version supplied by the kernel.
+On execution *depmod* reads the configuration files from the above location and
+based on that it processes the available modules and their dependencies. For
+example: one can change the search order, exclude folders, override specific
+module's location and more.
+
+This is typically useful in cases where built-in kernel modules are complemented
+by custom built versions of the same and the user wishes to affect the priority
+of processing in order to override the module version supplied by the kernel.
 
 # CONFIGURATION FORMAT
 
Signature · 1 line
2.45.0
#20 lore raw

PATCH 14/20 man: depmod: remove hard-coded /etc/depmod.d references

In reply to Emil Velikov

Point the users to depmod.d(5) instead.

---
 man/depmod.8.scd | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
man/depmod.8.scd +2 -2
index 7a2e84b..0252a72 100644
@@ -61,8 +61,8 @@ rather than the current kernel version (as returned by *uname -r*).
 	being the one set by _outdir_.
 
 *-C*, *--config* _file_ _or_ _directory_
-	This option overrides the default configuration directory at
-	/etc/depmod.d/.
+	This option overrides the default configuration files. See
+	*depmod.d*(5).
 
 *-e*, *--errsyms*
 	When combined with the *-F* option, this reports any symbols which a
Signature · 1 line
2.45.0
#21 lore raw

PATCH 15/20 man: modprobe.d: document the config file order handling

In reply to Emil Velikov

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 copied^Winspired by sysctl.d(5) ;-)

---
The documentation says ".conf", yet the code in libkmod-config.c also permits for .alias files. I haven't dug through history - is that intentional? Should we document why - in-code or manual page?

---
 man/modprobe.d.5.scd | 31 ++++++++++++++++++++++---------
 1 file changed, 22 insertions(+), 9 deletions(-)
man/modprobe.d.5.scd +22 -9
index 2907175..2f78dd7 100644
@@ -6,25 +6,24 @@ modprobe.d - Configuration directory for modprobe
 
 # SYNOPSIS
 
-/lib/modprobe.d/\*.conf
+@SYSCONFDIR@/modprobe.d/\*.conf
 
-@DISTCONFDIR@/modprobe.d/\*.conf
+/run/modprobe.d/\*.conf
 
 /usr/local/lib/modprobe.d/\*.conf
 
-/run/modprobe.d/\*.conf
+@DISTCONFDIR@/modprobe.d/\*.conf
 
-/etc/modprobe.d/\*.conf
+/lib/modprobe.d/\*.conf
 
 # DESCRIPTION
 
 Because the *modprobe* command can add or remove more than one module, due to
 modules having dependencies, we need a method of specifying what options are to
-be used with those modules. All files underneath the /etc/modprobe.d directory
-which end with the .conf extension specify those options as required. They can
-also be used to create convenient aliases: alternate names for a module, or they
-can override the normal *modprobe* behavior altogether for those with special
-requirements (such as inserting more than one module).
+be used with those modules. One can also use them to create convenient aliases:
+alternate names for a module, or they can override the normal *modprobe*
+behavior altogether for those with special requirements (such as inserting more
+than one module).
 
 Note that module and alias names (like other module names) can have - or \_ in
 them: both are interchangeable throughout all the module commands as underscore
@@ -35,6 +34,20 @@ lines and lines starting with '#' ignored (useful for adding comments). A '\\'
 at the end of a line causes it to continue on the next line, which makes the
 file a bit neater.
 
+# CONFIGURATION DIRECTORIES AND PRECEDENCE
+
+Configuration files are read from directories in @SYSCONFDIR@/, /run/,
+/usr/local/lib/, @DISTCONFDIR@/, and /lib/ in order of precedence, as listed in
+the SYNOPSIS section above. Files must have the ".conf" extension. Files in
+@SYSCONFDIR@/ override files with the same name in /run/, /usr/local/lib/,
+@DISTCONFDIR@/, and /lib/. Files in /run/ override files with the same name
+under /usr/, @DISTCONFDIR@/ and /lib/.
+
+All configuration files are sorted by their filename in lexicographic order,
+regardless of which of the directories they reside in. If multiple files specify
+the same option, the entry in the file with the lexicographically latest name
+will take precedence.
+
 # COMMANDS
 
 alias _wildcard_ _modulename_
Signature · 1 line
2.45.0
#22 lore raw

Re: [PATCH kmod 15/20] man: modprobe.d: document the config file order handling

Quoted 7 lines · On Tue, Jun 11, 2024 at 04:05:15PM GMT, Emil Velikov via B4 Relay wrote:

From: Emil Velikov <[email protected]>

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.

Quoted 7 lines

Section is copied^Winspired by sysctl.d(5) ;-)

---
The documentation says ".conf", yet the code in libkmod-config.c also permits for .alias files. I haven't dug through history - is that intentional? Should we document why - in-code or manual page?

to retain compatibility with the previous project used for loading modules in Linux, module-init-tools:

                                if (len < 6 ||
                                    (strcmp(&i->d_name[len-5], ".conf") != 0 &&
                                     strcmp(&i->d_name[len-6], ".alias") != 0))
                                        warn("All config files need .conf: %s/%s, "
                                             "it will be ignored in a future release.\n"
                                             filename, i->d_name);

And by "All config files need .conf" I imagine module-init-tools was doing that to retain compatibility with distros using .alias or because it was also using the same logic to parse modules.alias from the kernel. Not sure.

The oldest commit I found referencing this in module-init-tools is:

	commit 50f21358cf9937906f42be1352ba2b588375a344
	Author: Kay Sievers <[email protected]>
	Date:   Mon Mar 2 13:59:29 2009 +0100

Before that, module-init-tools wouldn't enforce any suffix, but filtered out the known-bad ones.

I think we can leave that undocumented and maybe 15 years is more than enough to finally do what the warning said :)

Lucas De Marchi

#23 lore raw

PATCH 16/20 man: modprobe.d: factor out a CONFIGURATION FORMAT section

In reply to Emil Velikov

Keep the description neat and tidy.

---
 man/modprobe.d.5.scd | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
man/modprobe.d.5.scd +7 -4
index 2f78dd7..b300758 100644
@@ -29,10 +29,13 @@ Note that module and alias names (like other module names) can have - or \_ in
 them: both are interchangeable throughout all the module commands as underscore
 conversion happens automatically.
 
-The format of files under modprobe.d is simple: one command per line, with blank
-lines and lines starting with '#' ignored (useful for adding comments). A '\\'
-at the end of a line causes it to continue on the next line, which makes the
-file a bit neater.
+# CONFIGURATION FORMAT
+
+The configuration files contain one command per line, with blank lines and lines
+starting with '#' ignored (useful for adding comments). A '\\' at the end of a
+line causes it to continue on the next line, which makes the files a bit neater.
+
+See the COMMANDS section below for more.
 
 # CONFIGURATION DIRECTORIES AND PRECEDENCE
 
Signature · 1 line
2.45.0
#24 lore raw

PATCH 17/20 man: modprobe.d: mention about MODPROBE_OPTIONS

In reply to Emil Velikov

The environment variable alters the config file ordering, so mention it in the man page.

---
Hi Lucas,

Looking at modprobe(8), while the variable is mentioned there is no details about:
- the format and it's stability across versions - is it ABI
- is the same option (say config) allowed multiple times
- if so, does the latest(?) instance override the previous ones, or
- all instances are in effect, with the latest(?) having the highest priority

Can you shed some light? I'd be happy to put that in patch form :-)

Thanks
Emil

---
 man/modprobe.d.5.scd | 4 ++++
 1 file changed, 4 insertions(+)
man/modprobe.d.5.scd +4 -0
index b300758..9d03c49 100644
@@ -46,6 +46,10 @@ the SYNOPSIS section above. Files must have the ".conf" extension. Files in
 @DISTCONFDIR@/, and /lib/. Files in /run/ override files with the same name
 under /usr/, @DISTCONFDIR@/ and /lib/.
 
+NOTE: Any configuration directories set via the MODPROBE_OPTIONS environment
+variable are added with the top-most priority. See the ENVIRONMENT section in
+*modprobe*(8).
+
 All configuration files are sorted by their filename in lexicographic order,
 regardless of which of the directories they reside in. If multiple files specify
 the same option, the entry in the file with the lexicographically latest name
Signature · 1 line
2.45.0
#25 lore raw

Re: [PATCH kmod 17/20] man: modprobe.d: mention about MODPROBE_OPTIONS

Quoted 3 lines · On Tue, Jun 11, 2024 at 04:05:17PM GMT, Emil Velikov via B4 Relay wrote:

From: Emil Velikov <[email protected]>

The environment variable alters the config file ordering, so mention it

nops, it's not about config.

Quoted 9 lines

in the man page.

---
Hi Lucas,

Looking at modprobe(8), while the variable is mentioned there is no details about:
- the format and it's stability across versions - is it ABI

yes

Quoted 1 line

- is the same option (say config) allowed multiple times

this is not about config. This is about command line options.

MODPROBE_OPTIONS="-R" modprobe ext4

is equivalent to:

modprobe -R ext4

the format is as if you gave it as command line options, with a minimal of shlex parsing to allow quotes.

Quoted 3 lines

- if so, does the latest(?) instance override the previous ones, or
- all instances are in effect, with the latest(?) having the highest priority

it depends on what arg you are passing. It's exactly the same as if you did:

	modprobe $MODPROBE_OPTIONS --foo --bar -x -y -z

we will preprend MODPROBE_OPTIONS and expand it.

Quoted 2 lines

Can you shed some light? I'd be happy to put that in patch form :-)

yeah, it would be great to document it, although its use is kind of discouraged, together with the reason for it to exist, install rules. AFAIR the reason for it to exist is that when we have install rules, we will call system(install_rule). Once upon a time distros would do something like in their config:

install foo modprobe bar || modprobe foo

... or to simulate pre/post softdep.

Lucas De Marchi

Quoted 27 lines

Thanks
Emil
---
man/modprobe.d.5.scd | 4 ++++

1 file changed, 4 insertions(+)
man/modprobe.d.5.scd +0 -0
index b300758..9d03c49 100644
@@ -46,6 +46,10 @@ the SYNOPSIS section above. Files must have the ".conf" extension. Files in

@DISTCONFDIR@/, and /lib/. Files in /run/ override files with the same name under /usr/, @DISTCONFDIR@/ and /lib/.

man/modprobe.d.5.scd +4 -0
+NOTE: Any configuration directories set via the MODPROBE_OPTIONS environment
+variable are added with the top-most priority. See the ENVIRONMENT section in
+*modprobe*(8).
+

All configuration files are sorted by their filename in lexicographic order, regardless of which of the directories they reside in. If multiple files specify the same option, the entry in the file with the lexicographically latest name

Signature · 1 line
2.45.0
#26 lore raw

PATCH 18/20 man: modprobe: remove hard-coded /etc/modprobe.d references

In reply to Emil Velikov

Point the users to modprobe.d(5) instead.

---
 man/modprobe.8.scd | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
man/modprobe.8.scd +5 -6
index b47908b..8354765 100644
@@ -21,10 +21,9 @@ modprobe - Add and remove modules from the Linux Kernel
 that for convenience, there is no difference between \_ and - in module names
 (automatic underscore conversion is performed). *modprobe* looks in the module
 directory @DISTCONFDIR@/`uname -r` for all the modules and other files, except
-for the optional configuration files in the /etc/modprobe.d directory (see
-*modprobe.d*(5)). *modprobe* will also use module options specified on the
-kernel command line in the form of <module>.<option> and blacklists in the form
-of modprobe.blacklist=<module>.
+for the optional configuration files (see *modprobe.d*(5)). *modprobe* will also
+use module options specified on the kernel command line in the form of
+<module>.<option> and blacklists in the form of modprobe.blacklist=<module>.
 
 Note that unlike in 2.4 series Linux kernels (which are not supported by this
 tool) this version of *modprobe* does not do anything to the module itself: the
@@ -56,8 +55,8 @@ database.
 	by *udev*(7).
 
 *-C* _directory_, *--config* _directory_
-	This option overrides the default configuration directory
-	(/etc/modprobe.d).
+	This option overrides the default configuration directory. See
+	*modprobe.d*(5).
 
 	This option is passed through *install* or *remove* commands to other
 	*modprobe* commands in the MODPROBE_OPTIONS environment variable.
Signature · 1 line
2.45.0
#27 lore raw

PATCH 19/20 man: remove the "Maintained by" references

In reply to Emil Velikov

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.

---
Instead we can add a note in the authors section, pointing people to the ML/kernel.org/Github repo for when seeking contact.

Also should probably s/Developer/Maintainer/ for Lucas, who's been keeping the project afloat the last few decades ;-)

Lucas, what do you think?

---
 man/insmod.8.scd      | 1 -
 man/kmod.8.scd        | 3 +--
 man/lsmod.8.scd       | 1 -
 man/modinfo.8.scd     | 1 -
 man/modprobe.8.scd    | 1 -
 man/modprobe.d.5.scd  | 1 -
 man/modules.dep.5.scd | 1 -
 man/rmmod.8.scd       | 1 -
 8 files changed, 1 insertion(+), 9 deletions(-)
man/insmod.8.scd +0 -1
index b6f8654..27d4409 100644
@@ -21,7 +21,6 @@ information about errors.
 # COPYRIGHT
 
 This manual page originally Copyright 2002, Rusty Russell, IBM Corporation.
-Maintained by Jon Masters and others.
 
 # SEE ALSO
 
man/kmod.8.scd +1 -2
index 2007a2d..6bd9432 100644
@@ -35,8 +35,7 @@ Linux Kernel modules. Most users will only run it using its other names.
 
 # COPYRIGHT
 
-This manual page originally Copyright 2014, Marco d'Itri. Maintained by Lucas De
-Marchi and others.
+This manual page originally Copyright 2014, Marco d'Itri.
 
 # SEE ALSO
 
man/lsmod.8.scd +0 -1
index eb2f2e8..ded619e 100644
@@ -15,7 +15,6 @@ lsmod - Show the status of modules in the Linux Kernel
 # COPYRIGHT
 
 This manual page originally Copyright 2002, Rusty Russell, IBM Corporation.
-Maintained by Jon Masters and others.
 
 # SEE ALSO
 
man/modinfo.8.scd +0 -1
index 9545257..d088c7e 100644
@@ -63,7 +63,6 @@ architecture.
 # COPYRIGHT
 
 This manual page originally Copyright 2003, Rusty Russell, IBM Corporation.
-Maintained by Jon Masters and others.
 
 # SEE ALSO
 
man/modprobe.8.scd +0 -1
index 8354765..657d172 100644
@@ -197,7 +197,6 @@ The MODPROBE_OPTIONS environment variable can also be used to pass arguments to
 # COPYRIGHT
 
 This manual page originally Copyright 2002, Rusty Russell, IBM Corporation.
-Maintained by Jon Masters and others.
 
 # SEE ALSO
 
man/modprobe.d.5.scd +0 -1
index 9d03c49..41d2e78 100644
@@ -170,7 +170,6 @@ directly within the modules.
 # COPYRIGHT
 
 This manual page originally Copyright 2004, Rusty Russell, IBM Corporation.
-Maintained by Jon Masters and others.
 
 # SEE ALSO
 
man/modules.dep.5.scd +0 -1
index c4e7653..7723a16 100644
@@ -29,7 +29,6 @@ fashion rather than touching these files.
 # COPYRIGHT
 
 This manual page originally Copyright 2002, Rusty Russell, IBM Corporation.
-Maintained by Jon Masters and others.
 
 # SEE ALSO
 
man/rmmod.8.scd +0 -1
index e1f656f..c4dcc3e 100644
@@ -35,7 +35,6 @@ is provided) from the kernel. Most users will want to use *modprobe*(8) with the
 # COPYRIGHT
 
 This manual page originally Copyright 2002, Rusty Russell, IBM Corporation.
-Maintained by Jon Masters and others.
 
 # SEE ALSO
 
Signature · 1 line
2.45.0
#28 lore raw

Re: [PATCH kmod 19/20] man: remove the "Maintained by" references

Quoted 7 lines · On Tue, Jun 11, 2024 at 04:05:19PM GMT, Emil Velikov via B4 Relay wrote:

From: Emil Velikov <[email protected]>

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.

Jon was the author and maintainer of module-init-tools, that got replaced by kmod:

https://lwn.net/Articles/472354/
my blog: https://politreco.com/2011/12/announce-kmod-1/
Jon's blog: http://www.jonmasters.org/blog/2011/12/20/libkmod-replaces-module-init-tools/

Quoted 3 lines

Most importantly the Copyright section isn't the best place to reference the maintainer/contact person.

agreed

Quoted 10 lines

---
Instead we can add a note in the authors section, pointing people to the ML/kernel.org/Github repo for when seeking contact.

Also should probably s/Developer/Maintainer/ for Lucas, who's been keeping the project afloat the last few decades ;-)

Lucas, what do you think?

I like the format used by git:

AUTHORS
Git was started by Linus Torvalds, and is currently maintained by Junio C Hamano. Numerous contributions have come from the Git mailing list <[email protected][6]>.
https://openhub.net/p/git/contributors/summary gives you a more complete list of contributors.

If you have a clone of git.git itself, the output of git-shortlog(1) and git-blame(1) can show you the authors for specific parts of the project.

Can we get inspiration from there, remove the COPYRIGHT section and add a new AUTHORS section? A brief history mentioning that kmod replaced module-init-tools can be added in kmod(8). Something like this?

KMOD(8)
...
AUTHORS
kmod project was started by Lucas De Marchi as a drop-in replacement to module-init-tools that was maintained by Jon Masters, adding a library (libkmod) and additional features.

Numerous contributions have come from the linux-modules mailing list <[email protected]> and Github. If you have a clone of kmod.git itself, the output of git-shortlog(1) and git-blame(1) can show you the authors for specific parts of the project.

Lucas De Marchi <[email protected]> is the current maintainer of the project.

The other man pages can omit the first paragraph.

thanks
Lucas De Marchi

Quoted 114 lines

---

man/insmod.8.scd      | 1 -
man/kmod.8.scd        | 3 +--
man/lsmod.8.scd       | 1 -
man/modinfo.8.scd     | 1 -
man/modprobe.8.scd    | 1 -
man/modprobe.d.5.scd  | 1 -
man/modules.dep.5.scd | 1 -
man/rmmod.8.scd       | 1 -
8 files changed, 1 insertion(+), 9 deletions(-)
man/insmod.8.scd +0 -0
index b6f8654..27d4409 100644
@@ -21,7 +21,6 @@ information about errors.
 # COPYRIGHT
 

This manual page originally Copyright 2002, Rusty Russell, IBM Corporation. -Maintained by Jon Masters and others.

# SEE ALSO

man/kmod.8.scd +1 -2
index 2007a2d..6bd9432 100644
@@ -35,8 +35,7 @@ Linux Kernel modules. Most users will only run it using its other names.
 
 # COPYRIGHT
 
-This manual page originally Copyright 2014, Marco d'Itri. Maintained by Lucas De
-Marchi and others.
+This manual page originally Copyright 2014, Marco d'Itri.
 
 # SEE ALSO
 
man/lsmod.8.scd +0 -0
index eb2f2e8..ded619e 100644
@@ -15,7 +15,6 @@ lsmod - Show the status of modules in the Linux Kernel
 # COPYRIGHT
 

This manual page originally Copyright 2002, Rusty Russell, IBM Corporation. -Maintained by Jon Masters and others.

# SEE ALSO

man/modinfo.8.scd +0 -0
index 9545257..d088c7e 100644
@@ -63,7 +63,6 @@ architecture.
 # COPYRIGHT
 

This manual page originally Copyright 2003, Rusty Russell, IBM Corporation. -Maintained by Jon Masters and others.

# SEE ALSO

man/modprobe.8.scd +0 -0
index 8354765..657d172 100644
@@ -197,7 +197,6 @@ The MODPROBE_OPTIONS environment variable can also be used to pass arguments to
 # COPYRIGHT
 

This manual page originally Copyright 2002, Rusty Russell, IBM Corporation. -Maintained by Jon Masters and others.

# SEE ALSO

man/modprobe.d.5.scd +0 -0
index 9d03c49..41d2e78 100644
@@ -170,7 +170,6 @@ directly within the modules.
 # COPYRIGHT
 

This manual page originally Copyright 2004, Rusty Russell, IBM Corporation. -Maintained by Jon Masters and others.

# SEE ALSO

man/modules.dep.5.scd +0 -0
index c4e7653..7723a16 100644
@@ -29,7 +29,6 @@ fashion rather than touching these files.
 # COPYRIGHT
 

This manual page originally Copyright 2002, Rusty Russell, IBM Corporation. -Maintained by Jon Masters and others.

# SEE ALSO

man/rmmod.8.scd +0 -0
index e1f656f..c4dcc3e 100644
@@ -35,7 +35,6 @@ is provided) from the kernel. Most users will want to use *modprobe*(8) with the
 # COPYRIGHT
 

This manual page originally Copyright 2002, Rusty Russell, IBM Corporation. -Maintained by Jon Masters and others.

# SEE ALSO

Signature · 1 line
2.45.0
#29 lore raw

PATCH 20/20 man: list options one per line

In reply to Emil Velikov

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.

---
 man/depmod.8.scd   | 37 +++++++++++++++++++++++++------------
 man/kmod.8.scd     |  6 ++++--
 man/modinfo.8.scd  | 17 ++++++++++++-----
 man/modprobe.8.scd | 50 ++++++++++++++++++++++++++++++++++----------------
 man/rmmod.8.scd    | 12 ++++++++----
 5 files changed, 83 insertions(+), 39 deletions(-)
man/depmod.8.scd +25 -12
index 0252a72..8c87a64 100644
@@ -35,16 +35,19 @@ rather than the current kernel version (as returned by *uname -r*).
 
 # OPTIONS
 
-*-a*, *--all*
+*-a*
+*--all*
 	Probe all modules. This option is enabled by default if no file names
 	are given in the command-line.
 
-*-A*, *--quick*
+*-A*
+*--quick*
 	This option scans to see if any modules are newer than the
 	*modules.dep* file before any work is done: if not, it silently exits
 	rather than regenerating the files.
 
-*-b* _basedir_, *--basedir* _basedir_
+*-b* _basedir_
+*--basedir* _basedir_
 	If your modules are not currently in the (normal) directory
 	@MODULE_DIRECTORY@/_version_, but in a staging area, you can specify a
 	_basedir_ which is prepended to the directory name. This _basedir_ is
@@ -53,18 +56,21 @@ rather than the current kernel version (as returned by *uname -r*).
 	distribution vendor who needs to pre-generate the meta-data files rather
 	than running *depmod* again later.
 
-*-o* _outdir_, *--outdir* _outdir_
+*-o* _outdir_
+*--outdir* _outdir_
 	Set the output directory where *depmod* will store any generated file.
 	_outdir_ serves as a root to that location, similar to how _basedir_ is
 	used. Also this setting takes precedence and if used together with
 	_basedir_ it will result in the input being that directory, but the output
 	being the one set by _outdir_.
 
-*-C*, *--config* _file_ _or_ _directory_
+*-C*  _file_ _or_ _directory_
+*--config* _file_ _or_ _directory_
 	This option overrides the default configuration files. See
 	*depmod.d*(5).
 
-*-e*, *--errsyms*
+*-e*
+*--errsyms*
 	When combined with the *-F* option, this reports any symbols which a
 	module needs which are not supplied by other modules or the kernel.
 	Normally, any symbols not provided by modules are assumed to be provided
@@ -72,21 +78,26 @@ rather than the current kernel version (as returned by *uname -r*).
 	assumption can break especially when additionally updated third party
 	drivers are not correctly installed or were built incorrectly.
 
-*-E*, *--symvers* _Module.symvers_
+*-E* _Module.symvers_
+*--symvers* _Module.symvers_
 	When combined with the *-e* option, this reports any symbol versions
 	supplied by modules that do not match with the symbol versions provided
 	by the kernel in its _Module.symvers_. This option is mutually
 	incompatible with *-F*.
 
-*-F*, *--filesyms* _System.map_
+*-F* _System.map_
+*--filesyms* _System.map_
 	Supplied with the _System.map_ produced when the kernel was built, this
 	allows the *-e* option to report unresolved symbols. This option is
 	mutually incompatible with *-E*.
 
-*-h*, *--help*
+*-h*
+*--help*
 	Print the help message and exit.
 
-*-n*, *--show*, *--dry-run*
+*-n*
+*--show*
+*--dry-run*
 	This sends the resulting *modules.dep* and the various map files to
 	standard output rather than writing them into the module directory.
 
@@ -94,11 +105,13 @@ rather than the current kernel version (as returned by *uname -r*).
 	Some architectures prefix symbols with an extraneous character. This
 	specifies a prefix character (for example '\_') to ignore.
 
-*-v*, *--verbose*
+*-v*
+*--verbose*
 	In verbose mode, *depmod* will print (to stdout) all the symbols each
 	module depends on and the module's file name which provides that symbol.
 
-*-V*, *--version*
+*-V*
+*--version*
 	Show version of program and exit. See below for caveats when run on
 	older kernels.
 
man/kmod.8.scd +4 -2
index 6bd9432..ff80c2f 100644
@@ -15,10 +15,12 @@ Linux Kernel modules. Most users will only run it using its other names.
 
 # OPTIONS
 
-*-V*, *--version*
+*-V*
+*--version*
 	Show the program version and exit.
 
-*-h*, *--help*
+*-h*
+*--help*
 	Show the help message.
 
 # COMMANDS
man/modinfo.8.scd +12 -5
index d088c7e..038234d 100644
@@ -28,17 +28,20 @@ architecture.
 
 # OPTIONS
 
-*-V*, *--version*
+*-V*
+*--version*
 	Print the *modinfo* version.
 
-*-F* _field_, *--field* _field_
+*-F* _field_
+*--field* _field_
 	Only print this _field_ value, one per line. This is most useful for
 	scripts. Field names are case-insensitive. Common fields (which may not
 	be in every module) include author, description, license, parm, depends,
 	and alias. There are often multiple parm, alias and depends fields. The
 	special _field_ filename lists the filename of the module.
 
-*-b* _basedir_, *--basedir* _basedir_
+*-b* _basedir_
+*--basedir* _basedir_
 	Root directory for modules, / by default.
 
 *-k* _kernel_
@@ -49,12 +52,16 @@ architecture.
 	modules in a new kernel for which you must make an initrd/initramfs
 	image prior to booting.
 
-*-0*, *--null*
+*-0*
+*--null*
 	Use the ASCII zero character to separate _field_ values, instead of a new
 	line. This is useful for scripts, since a new line can theoretically
 	appear inside a _field_.
 
-*-a* *--author*, *-d* *--description*, *-l* *--license*, *-p* *--parameters*,
+*-a* *--author*
+*-d* *--description*
+*-l* *--license*
+*-p* *--parameters*
 *-n* *--filename*
 	These are shortcuts for the *--field* flag's author, description,
 	license, parm and filename arguments, to ease the transition from the
man/modprobe.8.scd +34 -16

132 lines not on this page · raw message

man/rmmod.8.scd +8 -4
index c4dcc3e..1baed99 100644
@@ -16,20 +16,24 @@ is provided) from the kernel. Most users will want to use *modprobe*(8) with the
 
 # OPTIONS
 
-*-v*, *--verbose*
+*-v*
+*--verbose*
 	Print messages about what the program is doing. Usually *rmmod* prints
 	messages only if something goes wrong.
 
-*-f*, *--force*
+*-f*
+*--force*
 	This option can be extremely dangerous: it has no effect unless
 	CONFIG_MODULE_FORCE_UNLOAD was set when the kernel was compiled. With
 	this option, you can remove modules which are being used, or which are
 	not designed to be removed, or have been marked as unsafe (see *lsmod*(8)).
 
-*-s*, *--syslog*
+*-s*
+*--syslog*
 	Send errors to syslog instead of standard error.
 
-*-V*, *--version*
+*-V*
+*--version*
 	Show version of program and exit.
 
 # COPYRIGHT
Signature · 1 line
2.45.0
#30 lore raw
In reply to Emil Velikov
Quoted 7 lines · On Tue, Jun 11, 2024 at 04:05:00PM GMT, Emil Velikov via B4 Relay wrote:

Hello all,

As mentioned previously, here is a series converting the existing xml based documentation to scdoc.

Despite the size of this series, one should be able to review nearly all of it during their first morning coffee ;-)

a serious review with git history fossology takes much more than that ;)

Quoted 17 lines

I've went ahead with scdoc instead of other solutions since it's a simple 1K LoC, C99 program with trivial markdown-like syntax. Which is practically available for any distro [1].

A quick search in Arch shows that over 50 packages/projects use scdoc.

This series:
- patch 1 - simple comparison script of man page _output_ (the roff files themselves vary significantly) - DO NOT MERGE
- patch 2 - the scdoc files themselves, including typos to make diff vs original smaller
- patch 3 - wires scdoc to the build and removes the old xml files

- patch 4-9 - trivial fixes as white space, punctuation, etc
- patch 10-18 - expand documentation around {depmod,modprobe}.d handling

Quoted 8 lines

- patch 19 - remove "maintained by" references
- patch 20 - list short and long options on separate lines

The last two might be little controversial, so feel free to drop them.

NOTE: Some patches have respective question or two within.

As always - comments and suggestions are greatly appreciated.

I went through the entire series and unless I left comments, I agree with the changes. Thanks a lot for cleaning this up. Can you submit a v2 with those comments handled?

Lucas De Marchi

Quoted 61 lines

[1] https://repology.org/project/scdoc/versions
[2] https://archlinux.org/packages/extra/x86_64/scdoc/

---
Emil Velikov (20):
man: add script to generate/compare the xslt vs upcoming scdoc
man: add scdoc based man pages
man: build the scdoc based man pages
man: remove no longer used XML files
man: add some extra bold/italic annotations
man: white space fixes
man: misc punctuation fixes
man: some options take an argument, mention that
man: couple of grammar/language fixes
man: stop removing DISTCONFDIR lines
man: depmod.d: document the config file order handling
man: depmod.d: factor out a CONFIGURATION FORMAT section
man: depmod.d: rework the opening description sentence
man: depmod: remove hard-coded /etc/depmod.d references
man: modprobe.d: document the config file order handling
man: modprobe.d: factor out a CONFIGURATION FORMAT section
man: modprobe.d: mention about MODPROBE_OPTIONS
man: modprobe: remove hard-coded /etc/modprobe.d references
man: remove the "Maintained by" references
man: list options one per line

configure.ac          |   2 +-
man/Makefile.am       |  30 +--
man/compare.sh        |  63 ++++++
man/depmod.8.scd      | 139 +++++++++++++
man/depmod.8.xml      | 343 -------------------------------
man/depmod.d.5.scd    | 115 +++++++++++
man/depmod.d.5.xml    | 164 ---------------
man/insmod.8.scd      |  35 ++++
man/insmod.8.xml      |  87 --------
man/kmod.8.scd        |  49 +++++
man/kmod.8.xml        | 120 -----------
man/lsmod.8.scd       |  29 +++
man/lsmod.8.xml       |  73 -------
man/modinfo.8.scd     |  84 ++++++++
man/modinfo.8.xml     | 201 -------------------
man/modprobe.8.scd    | 232 +++++++++++++++++++++
man/modprobe.8.xml    | 544 --------------------------------------------------
man/modprobe.d.5.scd  | 187 +++++++++++++++++
man/modprobe.d.5.xml  | 265 ------------------------
man/modules.dep.5.scd |  43 ++++
man/modules.dep.5.xml |  80 --------
man/modules.dep.bin.5 |   1 +
man/rmmod.8.scd       |  53 +++++
man/rmmod.8.xml       | 148 --------------
24 files changed, 1041 insertions(+), 2046 deletions(-)

---
base-commit: 8837461494761d58be579641f20cc043274adddf
change-id: 20240523-man-743d6e51eb6f

Best regards,

Signature · 1 line
Emil Velikov <[email protected]>