From 0c2fd5238e87b994e8bd8bfe1778d050798c164a Mon Sep 17 00:00:00 2001 From: Ricardo Branco Date: Sun, 9 Nov 2025 14:57:53 +0000 Subject: [PATCH 01/11] man: drop optional qualifiers for file/modulename Most tools don't consider the file/module name as optional, so we can drop the square brackets denoting so. Mind you, if we want to be extra pedantic - it is not required for --help, --version et al. Although that should be obvious, as we are (starting to) simplify yet enhance the documentation. Signed-off-by: Ricardo Branco [Emil: drop kmod hunk, squash + commit message] Signed-off-by: Emil Velikov --- man/insmod.8.scd | 2 +- man/modinfo.8.scd | 2 +- man/modprobe.8.scd | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/man/insmod.8.scd b/man/insmod.8.scd index ec53f8fb..103d9360 100644 --- a/man/insmod.8.scd +++ b/man/insmod.8.scd @@ -6,7 +6,7 @@ insmod - Simple program to insert a module into the Linux Kernel # SYNOPSIS -*insmod* [_OPTIONS_] [_filename_] [_module options_] +*insmod* [_OPTIONS_] _filename_ [_module options_] # DESCRIPTION diff --git a/man/modinfo.8.scd b/man/modinfo.8.scd index 5d66fac4..aefcee08 100644 --- a/man/modinfo.8.scd +++ b/man/modinfo.8.scd @@ -6,7 +6,7 @@ modinfo - Show information about a Linux Kernel module # SYNOPSIS -*modinfo* [*-0*] [*-F* _field_] [*-k* _kernel_] [modulename|filename...] +*modinfo* [*-0*] [*-F* _field_] [*-k* _kernel_] modulename|filename... *modinfo* *-V* diff --git a/man/modprobe.8.scd b/man/modprobe.8.scd index aaf04c34..2e0f3949 100644 --- a/man/modprobe.8.scd +++ b/man/modprobe.8.scd @@ -6,14 +6,14 @@ 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_...] +*modprobe* [*-r*] [*-v*] [*-n*] [*-i*] _modulename_... *modprobe* [*-c*] -*modprobe* [*--show-modversions*] [_filename_] +*modprobe* [*--show-modversions*] _filename_ # DESCRIPTION From 0f366e3ce19c58fdfeed8464cb8a990605b66ba6 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Sun, 9 Nov 2025 21:11:50 +0000 Subject: [PATCH 02/11] rmmod: s/list of modulenames/modulenames/ Drop the "list of" part - we are already (somewhat) consistently using modulenames across the tree. While in here, also drop the square brackets - the modulename(s) is not an optional argument. Signed-off-by: Emil Velikov --- man/rmmod.8.scd | 2 +- tools/rmmod.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/man/rmmod.8.scd b/man/rmmod.8.scd index 2f6bd56c..d4c22628 100644 --- a/man/rmmod.8.scd +++ b/man/rmmod.8.scd @@ -6,7 +6,7 @@ rmmod - Simple program to remove a module from the Linux Kernel # SYNOPSIS -*rmmod* [_OPTIONS_] [_list of modulenames_] +*rmmod* [_OPTIONS_] _modulenames_ # DESCRIPTION diff --git a/tools/rmmod.c b/tools/rmmod.c index 61f2e008..62c07894 100644 --- a/tools/rmmod.c +++ b/tools/rmmod.c @@ -36,7 +36,7 @@ static const struct option cmdopts[] = { static void help(void) { printf("Usage:\n" - "\t%s [options] [list of modulenames]\n" + "\t%s [options] modulenames\n" "Options:\n" "\t-f, --force DANGEROUS: forces a module unload and may\n" "\t crash your machine\n" From d7256e36aebba03daea4e96cb2ffcbff1afa5e33 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Sun, 9 Nov 2025 15:13:19 +0000 Subject: [PATCH 03/11] man: remove inconsistent ellipsis In a number of places we are using ellipsis to indicate plural/multiple instances. It's not fairly consistent plus we can live without them in my opinion. Signed-off-by: Emil Velikov --- man/depmod.8.scd | 2 +- man/depmod.d.5.scd | 4 ++-- man/kmod.8.scd | 2 +- man/modinfo.8.scd | 2 +- man/modprobe.8.scd | 4 ++-- man/modprobe.d.5.scd | 10 +++++----- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/man/depmod.8.scd b/man/depmod.8.scd index 1cb6cfc2..10bcfc8e 100644 --- a/man/depmod.8.scd +++ b/man/depmod.8.scd @@ -10,7 +10,7 @@ depmod - Generate modules.dep and map files. \ \ \ \ \ \ \ \[*-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_...] +\ \ \ \ \ \ \ \[*-w*] [_version_] [_filename_] # DESCRIPTION diff --git a/man/depmod.d.5.scd b/man/depmod.d.5.scd index cb8de4de..797a184f 100644 --- a/man/depmod.d.5.scd +++ b/man/depmod.d.5.scd @@ -49,7 +49,7 @@ later). # COMMANDS -search _subdirectory..._ +search _subdirectory_ This allows you to specify the order in which @MODULE_DIRECTORY@ (or other configured module location) subdirectories will be processed by *depmod*. Directories are listed in order, with the highest priority @@ -79,7 +79,7 @@ override _modulename_ _kernelversion_ _modulesubdirectory_ module location) will take priority over any likenamed module already provided by the kernel. -external _kernelversion_ _absolutemodulesdirectory..._ +external _kernelversion_ _absolutemodulesdirectory_ This specifies a list of directories, which will be checked according to the priorities in the *search* command. The order matters also, the first directory has the higher priority. diff --git a/man/kmod.8.scd b/man/kmod.8.scd index b196bc1d..c3c12543 100644 --- a/man/kmod.8.scd +++ b/man/kmod.8.scd @@ -6,7 +6,7 @@ kmod - Program to manage Linux Kernel modules # SYNOPSIS -*kmod* [*OPTIONS...*] [_COMMAND_] [*COMMAND_OPTIONS...*] +*kmod* [*OPTIONS*] [_COMMAND_] [*COMMAND_OPTIONS*] # DESCRIPTION diff --git a/man/modinfo.8.scd b/man/modinfo.8.scd index aefcee08..d69a4531 100644 --- a/man/modinfo.8.scd +++ b/man/modinfo.8.scd @@ -6,7 +6,7 @@ modinfo - Show information about a Linux Kernel module # SYNOPSIS -*modinfo* [*-0*] [*-F* _field_] [*-k* _kernel_] modulename|filename... +*modinfo* [*-0*] [*-F* _field_] [*-k* _kernel_] modulename|filename *modinfo* *-V* diff --git a/man/modprobe.8.scd b/man/modprobe.8.scd index 2e0f3949..8c4cceae 100644 --- a/man/modprobe.8.scd +++ b/man/modprobe.8.scd @@ -7,9 +7,9 @@ modprobe - Add and remove modules from the Linux Kernel # SYNOPSIS *modprobe* [*-v*] [*-V*] [*-C* _config-file_] [*-n*] [*-i*] [*-q*] [*-b*] _modulename_ -\ \ \ \ \ \ \ \ \ \[_module parameters_...] +\ \ \ \ \ \ \ \ \ \[_module parameters_] -*modprobe* [*-r*] [*-v*] [*-n*] [*-i*] _modulename_... +*modprobe* [*-r*] [*-v*] [*-n*] [*-i*] _modulename_ *modprobe* [*-c*] diff --git a/man/modprobe.d.5.scd b/man/modprobe.d.5.scd index 5d028e23..40df89c7 100644 --- a/man/modprobe.d.5.scd +++ b/man/modprobe.d.5.scd @@ -77,7 +77,7 @@ blacklist _modulename_ *blacklist* keyword indicates that all of that particular module's internal aliases are to be ignored. -install _modulename_ _command..._ +install _modulename_ _command_ This command instructs *modprobe* to run your command instead of inserting the module in the kernel as normal. The command can be any shell command: this allows you to do any kind of complex processing you @@ -108,7 +108,7 @@ install _modulename_ _command..._ /sbin/modprobe barney; /sbin/modprobe --ignore-install fred $CMDLINE_OPTS" -options _modulename_ _option..._ +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 @@ -117,11 +117,11 @@ options _modulename_ _option..._ All options are added together: they can come from an *option* for the module itself, for an alias, and on the command line. -remove _modulename_ _command..._ +remove _modulename_ _command_ This is similar to the *install* command above, except it is invoked when "modprobe -r" is run. -softdep _modulename_ pre: _modules..._ post: _modules..._ +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 installed, but usually with some features missing. For example, a driver @@ -141,7 +141,7 @@ softdep _modulename_ pre: _modules..._ post: _modules..._ Note: if there are *install* or *remove* commands with the same _modulename_ argument, *softdep* takes precedence. -weakdep _modulename_ _modules..._ +weakdep _modulename_ _modules_ The *weakdep* command allows you to specify weak module dependencies. Those are similar to pre softdep, with the difference that userspace doesn't attempt to load that dependency before the specified module. From d6b462f7b4dbadcae7dd6f7295887ece75529cb1 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Sun, 9 Nov 2025 21:13:51 +0000 Subject: [PATCH 04/11] man: underline the module/file name in modinfo(8) We do so in all other manual pages, so update the outlier. Signed-off-by: Emil Velikov --- man/modinfo.8.scd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/modinfo.8.scd b/man/modinfo.8.scd index d69a4531..b32e7118 100644 --- a/man/modinfo.8.scd +++ b/man/modinfo.8.scd @@ -6,7 +6,7 @@ modinfo - Show information about a Linux Kernel module # SYNOPSIS -*modinfo* [*-0*] [*-F* _field_] [*-k* _kernel_] modulename|filename +*modinfo* [*-0*] [*-F* _field_] [*-k* _kernel_] _modulename_|_filename_ *modinfo* *-V* From 16b161471e59188ff0458fb59222c1e919ed1bce Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Sun, 9 Nov 2025 23:12:01 +0000 Subject: [PATCH 05/11] meson: remove most build_by_default instances With earlier meson versions (pre 0.50) build_by_default and install didn't have great integration. With newer meson versions, as the former is undefined the latter will control both. Signed-off-by: Emil Velikov --- man/meson.build | 6 ++---- meson.build | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/man/meson.build b/man/meson.build index a9eb3cf0..1ea1820d 100644 --- a/man/meson.build +++ b/man/meson.build @@ -29,8 +29,7 @@ foreach tuple : _man_pages input : '@0@.@1@.scd'.format(man, section), output : '@0@.@1@'.format(man, section), capture : true, - build_by_default : get_option('manpages'), - install : true, + install : get_option('manpages'), install_dir : get_option('mandir') / 'man@0@'.format(section) ) endforeach @@ -50,8 +49,7 @@ foreach tuple : _man_aliases command : ['echo', '.so @0@'.format(dest)], output : '@0@.@1@'.format(man, section), capture : true, - build_by_default : get_option('manpages'), - install : true, + install : get_option('manpages'), install_dir : get_option('mandir') / 'man@0@'.format(section) ) endforeach diff --git a/meson.build b/meson.build index 5740e135..77422b8b 100644 --- a/meson.build +++ b/meson.build @@ -447,7 +447,6 @@ kmod = executable( kmod_sources, link_with : [libshared, libkmod_internal], gnu_symbol_visibility : 'hidden', - build_by_default : get_option('tools'), install : get_option('tools'), ) From 82a182b16590da3f6a43bee098a2ed1e0d4eed80 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Sun, 9 Nov 2025 21:41:20 +0000 Subject: [PATCH 06/11] man: remove manual .so links These are left overs from the autotools-side of the build system. Signed-off-by: Emil Velikov --- man/modprobe.conf.5 | 1 - man/modules.dep.bin.5 | 1 - 2 files changed, 2 deletions(-) delete mode 100644 man/modprobe.conf.5 delete mode 100644 man/modules.dep.bin.5 diff --git a/man/modprobe.conf.5 b/man/modprobe.conf.5 deleted file mode 100644 index 07e777a0..00000000 --- a/man/modprobe.conf.5 +++ /dev/null @@ -1 +0,0 @@ -.so modprobe.d.5 diff --git a/man/modules.dep.bin.5 b/man/modules.dep.bin.5 deleted file mode 100644 index 795636b7..00000000 --- a/man/modules.dep.bin.5 +++ /dev/null @@ -1 +0,0 @@ -.so modules.dep.5 From 92d4fb33238d4363184f8cbbf4486704cd33aa49 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Sun, 9 Nov 2025 22:21:44 +0000 Subject: [PATCH 07/11] meson: reuse f strings where possible With meson 0.61 we can use f strings, over the explicit .format(). Multi-line f-strings are introduced with meson 0.63, which we don't require yet, plus it's not like we have many instances. Signed-off-by: Emil Velikov --- libkmod/docs/meson.build | 8 ++++---- man/meson.build | 16 ++++++++-------- meson.build | 29 ++++++++++++++++------------- testsuite/meson.build | 22 +++++++++++----------- 4 files changed, 39 insertions(+), 36 deletions(-) diff --git a/libkmod/docs/meson.build b/libkmod/docs/meson.build index b4d41cc3..b0a47ef8 100644 --- a/libkmod/docs/meson.build +++ b/libkmod/docs/meson.build @@ -10,12 +10,12 @@ built_docs = gnome.gtkdoc( 'libkmod', content_files : version_file, ignore_headers : [ - '@0@/libkmod/libkmod-index.h'.format(meson.project_source_root()), - '@0@/libkmod/libkmod-internal-file.h'.format(meson.project_source_root()), - '@0@/libkmod/libkmod-internal.h'.format(meson.project_source_root()), + f'@project_source_root@/libkmod/libkwod-index.h', + f'@project_source_root@/libkmod/libkmod-internal-file.h', + f'@project_source_root@/libkmod/libkmod-internal.h', ], scan_args : '--ignore-decorators="KMOD_EXPORT"', - src_dir : '@0@/libkmod/'.format(meson.project_source_root()), + src_dir : f'@project_source_root@/libkmod/', namespace : 'kmod', module_version : '3', main_xml : 'libkmod-docs.xml', diff --git a/man/meson.build b/man/meson.build index 1ea1820d..bcc846d5 100644 --- a/man/meson.build +++ b/man/meson.build @@ -17,7 +17,7 @@ foreach tuple : _man_pages man = tuple[1] custom_target( - 'man_@0@_@1@'.format(section, man), + f'man_@section@_@man@', command : [ build_scdoc, scdoc, @@ -26,11 +26,11 @@ foreach tuple : _man_pages 's|@DISTCONFDIR@|@0@|g;'.format(distconfdir) + 's|@MODULE_DIRECTORY@|@0@|g;'.format(moduledir), ], - input : '@0@.@1@.scd'.format(man, section), - output : '@0@.@1@'.format(man, section), + input : f'@man@.@section@.scd', + output : f'@man@.@section@', capture : true, install : get_option('manpages'), - install_dir : get_option('mandir') / 'man@0@'.format(section) + install_dir : get_option('mandir') / f'man@section@', ) endforeach @@ -45,11 +45,11 @@ foreach tuple : _man_aliases dest = tuple[2] custom_target( - 'man_@0@_@1@'.format(section, man), - command : ['echo', '.so @0@'.format(dest)], - output : '@0@.@1@'.format(man, section), + f'man_@section@_@man@', + command : ['echo', f'.so @dest@'], + output : f'@man@.@section@', capture : true, install : get_option('manpages'), - install_dir : get_option('mandir') / 'man@0@'.format(section) + install_dir : get_option('mandir') / f'man@section@', ) endforeach diff --git a/meson.build b/meson.build index 77422b8b..805683a7 100644 --- a/meson.build +++ b/meson.build @@ -36,7 +36,8 @@ _funcs = [ 'secure_getenv', ] foreach func : _funcs - cdata.set10('HAVE_@0@'.format(func.to_upper()), cc.has_function(func, args : '-D_GNU_SOURCE')) + func_to_upper = func.to_upper() + cdata.set10(f'HAVE_@func_to_upper@', cc.has_function(func, args : '-D_GNU_SOURCE')) endforeach # Meson has some amount of support for finding builtins by passing the symbol @@ -57,12 +58,13 @@ foreach tuple : _builtins args = tuple[1] required = tuple[2] # XXX: meson 1.5.0 has links(... required ) flag - have = cc.links('int main(void){@0@(@1@);return 0;}'.format(builtin, args)) + have = cc.links(f'int main(void){@builtin@(@args@);return 0;}') if required and not have - error('required builtin function not found: @0@'.format(builtin)) + error(f'required builtin function not found: @builtin@') endif - cdata.set10('HAVE_@0@'.format(builtin.to_upper()), have) + builtin_to_upper = builtin.to_upper() + cdata.set10(f'HAVE_@builtin_to_upper@', have) endforeach # basename may be only available in libgen.h with the POSIX behavior, @@ -75,7 +77,8 @@ foreach tuple : _decls decl = tuple[0] header = tuple[1] have = cc.has_header_symbol(header, decl, args : '-D_GNU_SOURCE') - cdata.set10('HAVE_DECL_@0@'.format(decl.to_upper()), have) + decl_to_upper = decl.to_upper() + cdata.set10(f'HAVE_DECL_@decl_to_upper@', have) endforeach cdata.set10('HAVE_STATIC_ASSERT', cc.compiles('_Static_assert(1, "Test");', name : '_Static_assert')) @@ -158,6 +161,9 @@ dlopen_all = get_option('dlopen').contains('all') # Directories #------------------------------------------------------------------------------- +project_source_root = meson.project_source_root() +project_build_root = meson.project_build_root() + prefixdir = get_option('prefix') sysconfdir = get_option('sysconfdir') bindir = prefixdir / get_option('bindir') @@ -191,8 +197,7 @@ foreach tuple : _customdirs customdir = def_path else if not customdir.startswith('/') - error('User provided @0@, \'@1@\' is not an absolute path.' - .format(dir_option, customdir)) + error(f'User provided @dir_option@, \'@customdir@\' is not an absolute path.') endif # Strip all leading/trailing and re-add only the leading one. customdir = '/' / customdir.strip('/') @@ -224,10 +229,8 @@ foreach tuple : _completiondirs if completion.found() completion_prefix = completion.get_variable(pkgconfig : 'prefix') if completion_prefix != prefixdir - warning('User provided prefix \'@0@\' differs from @1@ one \'@2@\'.' - .format(prefixdir, pkg_dep, completion_prefix)) - warning('Not installing completion. To re-enable, manually set @0@.' - .format(dir_option)) + warning(f'User provided prefix \'@prefixdir@\' differs from @pkg_dep@ one \'@completion_prefix@\'.') + warning(f'Not installing completion. To re-enable, manually set @dir_option@.') completiondir = 'no' else completiondir = completion.get_variable(pkgconfig : 'completionsdir') @@ -279,7 +282,7 @@ foreach tuple : _compression dlopen = dlopen_all or get_option('dlopen').contains(opt) if not dlopen_all and dlopen and get_option(opt).disabled() - error('Incompatiable options: dlopen=@0@ for disabled @0@'.format(opt)) + error(f'Incompatiable options: dlopen=@opt@ for disabled @opt@') endif dep = dependency(pkg_dep, version : pkg_dep_version, required : get_option(opt)) @@ -292,7 +295,7 @@ foreach tuple : _compression cdata.set10('ENABLE_' + opt.to_upper() + '_DLOPEN', have and dlopen) if have - module_compressions += '@0@ '.format(opt) + module_compressions += f'@opt@ ' endif features += ['@0@@1@'.format(have ? '+' : '-', opt.to_upper())] diff --git a/testsuite/meson.build b/testsuite/meson.build index b4810aed..0cb0ca37 100644 --- a/testsuite/meson.build +++ b/testsuite/meson.build @@ -6,7 +6,7 @@ build_module_playground = custom_target( 'build-module-playground', command : [ setup_modules, - meson.project_source_root(), + project_source_root, 'testsuite/module-playground', # do not prepend source/build root ], # The command ensures we don't do extra work, so the missing output token file @@ -21,10 +21,10 @@ create_rootfs = custom_target( 'create-rootfs', command : [ setup_rootfs, - meson.project_source_root() / 'testsuite/rootfs-pristine', - meson.project_build_root() / 'testsuite/rootfs', - meson.project_build_root() / 'testsuite/module-playground', - meson.project_build_root() / 'config.h', + f'@project_source_root@/testsuite/rootfs-pristine', + f'@project_build_root@/testsuite/rootfs', + f'@project_build_root@/testsuite/module-playground', + f'@project_build_root@/config.h', sysconfdir, moduledir, ], @@ -48,9 +48,9 @@ test_override_mods = [] foreach mod : _test_override_mods test_override_mods += shared_module( mod, - files('@0@.c'.format(mod)), + files(f'@mod@.c'), include_directories : top_include, - c_args : '-DABS_TOP_BUILDDIR="@0@"'.format(meson.project_build_root()), + c_args : f'-DABS_TOP_BUILDDIR="@project_build_root@"', dependencies : libdl, link_with : [libshared, libkmod_internal], gnu_symbol_visibility : 'hidden', @@ -62,9 +62,9 @@ endforeach testsuite_c_args = [ '-UNDEBUG', - '-DTESTSUITE_ROOTFS="@0@/testsuite/rootfs/"'.format(meson.project_build_root()), - '-DTOOLS_DIR="@0@/"'.format(meson.project_build_root()), - '-DOVERRIDE_LIBDIR="@0@/testsuite/"'.format(meson.project_build_root()), + f'-DTESTSUITE_ROOTFS="@project_build_root@/testsuite/rootfs/"', + f'-DTOOLS_DIR="@project_build_root@/"', + f'-DOVERRIDE_LIBDIR="@project_build_root@/testsuite/"', ] libtestsuite = static_library( @@ -107,7 +107,7 @@ endif foreach input : _testsuite exec = executable( input, - files('@0@.c'.format(input)), + files(f'@input@.c'), include_directories : top_include, c_args : testsuite_c_args, link_with : [libshared, libkmod_internal, libtestsuite], From 1385ca3a59984b6b638056df875d11034a54b64e Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Sun, 9 Nov 2025 21:47:09 +0000 Subject: [PATCH 08/11] .gitignore: remove majority of listings With the move to meson. only out-of-tree builds are allowed. As such, we can remove ~90% of the contents of our .gitignore file(s). Signed-off-by: Emil Velikov --- .gitignore | 23 -------- libkmod/.gitignore | 6 --- libkmod/docs/.gitignore | 14 ----- man/.gitignore | 4 -- shared/.gitignore | 5 -- testsuite/.gitignore | 54 ------------------- testsuite/module-playground/.gitignore | 11 ---- .../sys/module/btusb/holders/.gitignore | 0 .../test-rootfs/testdir/.gitignore | 0 tools/.gitignore | 15 ------ 10 files changed, 132 deletions(-) delete mode 100644 libkmod/.gitignore delete mode 100644 libkmod/docs/.gitignore delete mode 100644 man/.gitignore delete mode 100644 shared/.gitignore delete mode 100644 testsuite/.gitignore delete mode 100644 testsuite/module-playground/.gitignore delete mode 100644 testsuite/rootfs-pristine/test-loaded/sys/module/btusb/holders/.gitignore delete mode 100644 testsuite/rootfs-pristine/test-rootfs/testdir/.gitignore delete mode 100644 tools/.gitignore diff --git a/.gitignore b/.gitignore index 55915135..65d02aee 100644 --- a/.gitignore +++ b/.gitignore @@ -1,32 +1,9 @@ -*.o -*.gcda -*.gcno -*.pc /*.tar.xz /*.md5sum /*.mbx /*.cover -.deps/ -.libs/ -/Makefile -/Makefile.in -/aclocal.m4 -/autom4te.cache/ -/build-aux/ -/config.h -/config.h.in -/config.log -/config.status -/configure -/cov-int -/coverage -/gtk-doc.make -/gtk-doc.m4 /kmod-*.tar.* -/libtool -/stamp-h1 -/test-suite.log /build /build-* diff --git a/libkmod/.gitignore b/libkmod/.gitignore deleted file mode 100644 index 826fd623..00000000 --- a/libkmod/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -.dirstamp -.deps/ -.libs/ -*.la -*.lo -libkmod.pc diff --git a/libkmod/docs/.gitignore b/libkmod/docs/.gitignore deleted file mode 100644 index 7514b08b..00000000 --- a/libkmod/docs/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -*.bak -*.stamp -*.sgml -libkmod.* -libkmod-*.xml -!libkmod-docs.xml -libkmod-*.txt -!libkmod-sections.txt -version.xml -xml -html -gtk-doc.make -Makefile -Makefile.in diff --git a/man/.gitignore b/man/.gitignore deleted file mode 100644 index a229b2f7..00000000 --- a/man/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -*.5 -*.8 -Makefile -Makefile.in diff --git a/shared/.gitignore b/shared/.gitignore deleted file mode 100644 index 088ef797..00000000 --- a/shared/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -.dirstamp -.deps/ -.libs/ -*.la -*.lo diff --git a/testsuite/.gitignore b/testsuite/.gitignore deleted file mode 100644 index f0289d47..00000000 --- a/testsuite/.gitignore +++ /dev/null @@ -1,54 +0,0 @@ -*.lo -*.la -*.so -/.dirstamp -/test-strbuf -/test-array -/test-util -/test-blacklist -/test-dependencies -/test-depmod -/test-init -/test-initstate -/test-loaded -/test-modinfo -/test-new-module -/test-testsuite -/test-modprobe -/test-hash -/test-list -/test-weakdep -/rootfs -/stamp-rootfs -/test-strbuf.log -/test-strbuf.trs -/test-array.log -/test-array.trs -/test-util.log -/test-util.trs -/test-blacklist.log -/test-blacklist.trs -/test-dependencies.log -/test-dependencies.trs -/test-depmod.log -/test-depmod.trs -/test-init.log -/test-init.trs -/test-initstate.log -/test-initstate.trs -/test-loaded.log -/test-loaded.trs -/test-modinfo.log -/test-modinfo.trs -/test-modprobe.log -/test-modprobe.trs -/test-hash.log -/test-hash.trs -/test-new-module.log -/test-new-module.trs -/test-testsuite.log -/test-testsuite.trs -/test-list.log -/test-list.trs -/test-weakdep.log -/test-weakdep.trs diff --git a/testsuite/module-playground/.gitignore b/testsuite/module-playground/.gitignore deleted file mode 100644 index e4d99cf7..00000000 --- a/testsuite/module-playground/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -*.ko -.cache.mk -*.mod.c -.tmp_versions -*.mod -*.a -*.cmd -*.o.d - -modules.order -Module.symvers diff --git a/testsuite/rootfs-pristine/test-loaded/sys/module/btusb/holders/.gitignore b/testsuite/rootfs-pristine/test-loaded/sys/module/btusb/holders/.gitignore deleted file mode 100644 index e69de29b..00000000 diff --git a/testsuite/rootfs-pristine/test-rootfs/testdir/.gitignore b/testsuite/rootfs-pristine/test-rootfs/testdir/.gitignore deleted file mode 100644 index e69de29b..00000000 diff --git a/tools/.gitignore b/tools/.gitignore deleted file mode 100644 index 3e341600..00000000 --- a/tools/.gitignore +++ /dev/null @@ -1,15 +0,0 @@ -/.dirstamp -/depmod -/insmod -/kmod -/kmod-depmod -/kmod-insmod -/kmod-lsmod -/kmod-modinfo -/kmod-modprobe -/kmod-rmmod -/lsmod -/modinfo -/modprobe -/rmmod -/test From 3a5fe3cdfff33e893a9083358f51f729a2debc52 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Sun, 9 Nov 2025 23:20:44 +0000 Subject: [PATCH 09/11] scripts/build-scdoc.sh: stop using cat We don't need the cat + extra pipe - sed can take the input filename as an argument. This also means, we can drop the coreutils from the Alpine CI. This change is meant to ease de-duplication of the man pages - coming with a later commit. Signed-off-by: Emil Velikov --- .github/actions/setup-os/setup-alpine.sh | 1 - scripts/build-scdoc.sh | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/actions/setup-os/setup-alpine.sh b/.github/actions/setup-os/setup-alpine.sh index 990accb7..9ce3666c 100755 --- a/.github/actions/setup-os/setup-alpine.sh +++ b/.github/actions/setup-os/setup-alpine.sh @@ -8,7 +8,6 @@ apk update apk add \ bash \ build-base \ - coreutils \ clang \ git \ gtk-doc \ diff --git a/scripts/build-scdoc.sh b/scripts/build-scdoc.sh index 66aa673d..0a4ffc38 100755 --- a/scripts/build-scdoc.sh +++ b/scripts/build-scdoc.sh @@ -6,4 +6,4 @@ SCDOC=$1 INPUT=$2 SED_PATTERN=$3 -cat $INPUT | sed -e $SED_PATTERN | $SCDOC +sed -e $SED_PATTERN $INPUT | $SCDOC From 0d7eb27f65a1b356f0d1722a1fcda620a4f2849f Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Sun, 9 Nov 2025 23:30:08 +0000 Subject: [PATCH 10/11] man: de-duplicate AUTHOR/BUGS sections Move the sections into a dedicated trailer.scd file, which gets added during manpage generation. Signed-off-by: Emil Velikov --- man/depmod.8.scd | 16 ---------------- man/depmod.d.5.scd | 16 ---------------- man/insmod.8.scd | 16 ---------------- man/kmod.8.scd | 20 -------------------- man/lsmod.8.scd | 16 ---------------- man/meson.build | 4 ++-- man/modinfo.8.scd | 16 ---------------- man/modprobe.8.scd | 16 ---------------- man/modprobe.d.5.scd | 16 ---------------- man/modules.dep.5.scd | 16 ---------------- man/rmmod.8.scd | 16 ---------------- man/trailer.scd | 16 ++++++++++++++++ scripts/build-scdoc.sh | 6 ++++-- 13 files changed, 22 insertions(+), 168 deletions(-) create mode 100644 man/trailer.scd diff --git a/man/depmod.8.scd b/man/depmod.8.scd index 10bcfc8e..1d98da18 100644 --- a/man/depmod.8.scd +++ b/man/depmod.8.scd @@ -163,19 +163,3 @@ Portions Copyright Jon Masters, and others. # SEE ALSO *depmod.d*(5), *modprobe*(8), *modules.dep*(5) - -# BUGS - -Please direct any bug reports to kmod's issue tracker at -https://github.com/kmod-project/kmod/issues/ alongside with version used, steps -to reproduce the problem and the expected outcome. - -# AUTHORS - -Numerous contributions have come from the linux-modules mailing list - 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* is the current maintainer of the -project. diff --git a/man/depmod.d.5.scd b/man/depmod.d.5.scd index 797a184f..10861162 100644 --- a/man/depmod.d.5.scd +++ b/man/depmod.d.5.scd @@ -100,19 +100,3 @@ This manual page Copyright 2006-2010, Jon Masters, Red Hat, Inc. # SEE ALSO *depmod*(8) - -# BUGS - -Please direct any bug reports to kmod's issue tracker at -https://github.com/kmod-project/kmod/issues/ alongside with version used, steps -to reproduce the problem and the expected outcome. - -# AUTHORS - -Numerous contributions have come from the linux-modules mailing list - 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* is the current maintainer of the -project. diff --git a/man/insmod.8.scd b/man/insmod.8.scd index 103d9360..a9a32c83 100644 --- a/man/insmod.8.scd +++ b/man/insmod.8.scd @@ -62,19 +62,3 @@ This manual page originally Copyright 2002, Rusty Russell, IBM Corporation. # SEE ALSO *modprobe*(8), *rmmod*(8), *lsmod*(8), *modinfo*(8), *depmod*(8) - -# BUGS - -Please direct any bug reports to kmod's issue tracker at -https://github.com/kmod-project/kmod/issues/ alongside with version used, steps -to reproduce the problem and the expected outcome. - -# AUTHORS - -Numerous contributions have come from the linux-modules mailing list - 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* is the current maintainer of the -project. diff --git a/man/kmod.8.scd b/man/kmod.8.scd index c3c12543..cf8a0e47 100644 --- a/man/kmod.8.scd +++ b/man/kmod.8.scd @@ -40,23 +40,3 @@ This manual page originally Copyright 2014, Marco d'Itri. # SEE ALSO *lsmod*(8), *rmmod*(8), *insmod*(8), *modinfo*(8), *modprobe*(8), *depmod*(8) - -# BUGS - -Please direct any bug reports to kmod's issue tracker at -https://github.com/kmod-project/kmod/issues/ alongside with version used, steps -to reproduce the problem and the expected outcome. - -# AUTHOR - -*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 - 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* is the current maintainer of the -project. diff --git a/man/lsmod.8.scd b/man/lsmod.8.scd index 339526df..9147a4ad 100644 --- a/man/lsmod.8.scd +++ b/man/lsmod.8.scd @@ -35,19 +35,3 @@ This manual page originally Copyright 2002, Rusty Russell, IBM Corporation. # SEE ALSO *insmod*(8), *modprobe*(8), *modinfo*(8), *depmod*(8) - -# BUGS - -Please direct any bug reports to kmod's issue tracker at -https://github.com/kmod-project/kmod/issues/ alongside with version used, steps -to reproduce the problem and the expected outcome. - -# AUTHORS - -Numerous contributions have come from the linux-modules mailing list - 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* is the current maintainer of the -project. diff --git a/man/meson.build b/man/meson.build index bcc846d5..3c24d58d 100644 --- a/man/meson.build +++ b/man/meson.build @@ -21,12 +21,12 @@ foreach tuple : _man_pages command : [ build_scdoc, scdoc, - '@INPUT@', 's|@SYSCONFDIR@|@0@|g;'.format(sysconfdir) + 's|@DISTCONFDIR@|@0@|g;'.format(distconfdir) + 's|@MODULE_DIRECTORY@|@0@|g;'.format(moduledir), + '@INPUT@', ], - input : f'@man@.@section@.scd', + input : [f'@man@.@section@.scd', files('trailer.scd')], output : f'@man@.@section@', capture : true, install : get_option('manpages'), diff --git a/man/modinfo.8.scd b/man/modinfo.8.scd index b32e7118..2469f38e 100644 --- a/man/modinfo.8.scd +++ b/man/modinfo.8.scd @@ -69,19 +69,3 @@ This manual page originally Copyright 2003, Rusty Russell, IBM Corporation. # SEE ALSO *modprobe*(8) - -# BUGS - -Please direct any bug reports to kmod's issue tracker at -https://github.com/kmod-project/kmod/issues/ alongside with version used, steps -to reproduce the problem and the expected outcome. - -# AUTHORS - -Numerous contributions have come from the linux-modules mailing list - 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* is the current maintainer of the -project. diff --git a/man/modprobe.8.scd b/man/modprobe.8.scd index 8c4cceae..12c72fdd 100644 --- a/man/modprobe.8.scd +++ b/man/modprobe.8.scd @@ -229,19 +229,3 @@ This manual page originally Copyright 2002, Rusty Russell, IBM Corporation. # SEE ALSO *modprobe.d*(5), *insmod*(8), *rmmod*(8), *lsmod*(8), *modinfo*(8), *depmod*(8) - -# BUGS - -Please direct any bug reports to kmod's issue tracker at -https://github.com/kmod-project/kmod/issues/ alongside with version used, steps -to reproduce the problem and the expected outcome. - -# AUTHORS - -Numerous contributions have come from the linux-modules mailing list - 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* is the current maintainer of the -project. diff --git a/man/modprobe.d.5.scd b/man/modprobe.d.5.scd index 40df89c7..334b382b 100644 --- a/man/modprobe.d.5.scd +++ b/man/modprobe.d.5.scd @@ -171,19 +171,3 @@ This manual page originally Copyright 2004, Rusty Russell, IBM Corporation. # SEE ALSO *modprobe*(8), *modules.dep*(5) - -# BUGS - -Please direct any bug reports to kmod's issue tracker at -https://github.com/kmod-project/kmod/issues/ alongside with version used, steps -to reproduce the problem and the expected outcome. - -# AUTHORS - -Numerous contributions have come from the linux-modules mailing list - 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* is the current maintainer of the -project. diff --git a/man/modules.dep.5.scd b/man/modules.dep.5.scd index 37c38bf0..5fa6bf97 100644 --- a/man/modules.dep.5.scd +++ b/man/modules.dep.5.scd @@ -33,19 +33,3 @@ This manual page originally Copyright 2002, Rusty Russell, IBM Corporation. # SEE ALSO *depmod*(8), *modprobe*(8) - -# BUGS - -Please direct any bug reports to kmod's issue tracker at -https://github.com/kmod-project/kmod/issues/ alongside with version used, steps -to reproduce the problem and the expected outcome. - -# AUTHORS - -Numerous contributions have come from the linux-modules mailing list - 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* is the current maintainer of the -project. diff --git a/man/rmmod.8.scd b/man/rmmod.8.scd index d4c22628..66bc8487 100644 --- a/man/rmmod.8.scd +++ b/man/rmmod.8.scd @@ -48,19 +48,3 @@ This manual page originally Copyright 2002, Rusty Russell, IBM Corporation. # SEE ALSO *modprobe*(8), *insmod*(8), *lsmod*(8), *modinfo*(8), *depmod*(8) - -# BUGS - -Please direct any bug reports to kmod's issue tracker at -https://github.com/kmod-project/kmod/issues/ alongside with version used, steps -to reproduce the problem and the expected outcome. - -# AUTHORS - -Numerous contributions have come from the linux-modules mailing list - 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* is the current maintainer of the -project. diff --git a/man/trailer.scd b/man/trailer.scd new file mode 100644 index 00000000..0f0364c6 --- /dev/null +++ b/man/trailer.scd @@ -0,0 +1,16 @@ + +# AUTHORS + +Numerous contributions have come from the linux-modules mailing list + 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* is the current maintainer of the +project. + +# BUGS + +Please direct any bug reports to kmod's issue tracker at +https://github.com/kmod-project/kmod/issues/ alongside with version used, steps +to reproduce the problem and the expected outcome. diff --git a/scripts/build-scdoc.sh b/scripts/build-scdoc.sh index 0a4ffc38..72fdee27 100755 --- a/scripts/build-scdoc.sh +++ b/scripts/build-scdoc.sh @@ -3,7 +3,9 @@ set -euo pipefail SCDOC=$1 -INPUT=$2 -SED_PATTERN=$3 +shift +SED_PATTERN=$1 +shift +INPUT=$* sed -e $SED_PATTERN $INPUT | $SCDOC From 8848d3cd9999fe0d3985b0620002b8248124741e Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Mon, 10 Nov 2025 00:05:02 +0000 Subject: [PATCH 11/11] WIP: man: move COPYRIGHT section to trailer.scd The section is very outdated, listing only the original author and/or copyright holder. A quick git log shows that over 20 individuals have helped. Swap the original for a more comprehensive solution (WHAT EXACTLY ... A see git log reference similar to the AUTHORS one?) Signed-off-by: Emil Velikov --- man/depmod.8.scd | 5 ----- man/trailer.scd | 4 ++++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/man/depmod.8.scd b/man/depmod.8.scd index 1d98da18..d0c25b1d 100644 --- a/man/depmod.8.scd +++ b/man/depmod.8.scd @@ -155,11 +155,6 @@ depmod -b /tmp/build -m kernel-modules *-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) diff --git a/man/trailer.scd b/man/trailer.scd index 0f0364c6..fa532479 100644 --- a/man/trailer.scd +++ b/man/trailer.scd @@ -14,3 +14,7 @@ project. Please direct any bug reports to kmod's issue tracker at https://github.com/kmod-project/kmod/issues/ alongside with version used, steps to reproduce the problem and the expected outcome. + +# COPYRIGHT + +FOOBAR