]>
git.ipfire.org Git - thirdparty/kmod.git/log
Emil Velikov [Sat, 14 Sep 2024 13:57:44 +0000 (14:57 +0100)]
testsuite: remove *lstat* wrappers
The majority of these were initially introduced with commit
123e827
("testsuite preload: Factorize into macros, add more stat and open
variants").
The commit itself was meant to refactor existing wrappers and add new
_xstat (aka stat) variants. The lstat variants were never used in kmod
directly nor indirectly via header macros.
The rest were added to mimic the original, without much testing it
seems.
They are all dead code - remove them.
In theory one could have a macro/helper that calls `lstat` for `stat`
itself, although that isn't a practical solution for a few reasons.
The functionality across the two varies, where if the path provided is
a symlink `stat` follows it, while `lstat` gets the details for the link
itself. To fix this, the wrapper would need second syscall to resolve
the symlink, which will cause notable performance regression wrt using
using the `stat`/`stat64` syscall alone.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/131
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Sat, 14 Sep 2024 15:12:33 +0000 (16:12 +0100)]
ci: add codeql code-scanning action
Effectively a trimmed down copy of main.yml, running only on
ubuntu-22.04 for now.
The action flags a handful of interesting issues and allows us to
prevent more from creeping in.
The action does not need need docs/manpages so we disable those.
v2:
- script lives in .github/
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/132
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Sat, 14 Sep 2024 15:48:19 +0000 (16:48 +0100)]
scripts/print-kdir: error out on multiple kernels
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/132
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Sat, 14 Sep 2024 15:46:27 +0000 (16:46 +0100)]
ci: flesh out print-kdir.sh script, bash ftw
We'll be adding another action, where this script is handy. Flesh it out
to scripts and convert to bash.
v2:
- move script to .github/
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/132
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Sat, 14 Sep 2024 15:55:52 +0000 (16:55 +0100)]
ci: don't abort all pipeline if one is failing
Our jobs are pretty quick sub 2m for meson builds and sub 1m, when if
going without tests.
Wait for all jobs so we get all the (potential) issues at once.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/132
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Mon, 16 Sep 2024 22:39:23 +0000 (23:39 +0100)]
CONTRIBUTING.md: mention license and SPDX
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/134
[ Mention LGPL is preferred, even for tools/ ]
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Mon, 16 Sep 2024 10:35:47 +0000 (11:35 +0100)]
CONTRIBUTING.md: add inline TOC
While the file is small, it does cover a handful of topics. So include a
simple TOC and the start to make browsing a little bit easier.
v2:
- tag -> trailer
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/134
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Mon, 16 Sep 2024 10:18:39 +0000 (11:18 +0100)]
CONTRIBUTING.md: mention s-o-b tag, includ DCO copy
While CODING-STYLE states that using Signed-off-by is an error, a large
number of contributors have been using it. Most, if not all, of those
are people who have contributed to the kernel, and by extension know
about the DCO.
So let's add an in-tree copy of the file, explicitly document what is
meant with the tag (other projects use if for different purposes) and
drop the note from CODING-STYLE.
I have not went full bananas to require it, since based on the numbers
below, majority of commits lack it. We could reconsider that at later
point, if needed.
Numbers, as of commit
11ccabd ("libkmod: document the symbols file")
- total number of commits - 1640
- number of commits with at least one s-o-b - 357
- this can be s-o-b by the author, maintainer and/or both
- total number of contributors (bots including) - 109
- number of individuals with at least one s-o-b - 42
v2
- drop html bits from DCO
- tag -> trailer
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/134
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Mon, 16 Sep 2024 10:12:11 +0000 (11:12 +0100)]
CONTRIBUTING.md: mention the "Link:" tag
v2:
- tag -> trailer
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/134
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Mon, 16 Sep 2024 10:05:28 +0000 (11:05 +0100)]
CONTRIBUTING.md: small grammar/typo/style fixes
v2
- drop erroneous "a"
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/134
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Mon, 16 Sep 2024 10:04:36 +0000 (11:04 +0100)]
CONTRIBUTING.md: tweaks the section names a bit
Make them a little less terse and natural.
v2:
- tag -> trailer
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/134
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Mon, 16 Sep 2024 22:27:09 +0000 (23:27 +0100)]
CONTRIBUTING.md: s/tag/trailer/
There are multiple things commonly referred to as "tags". Use the proper
term for what we mean here - trailer.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/134
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Sat, 14 Sep 2024 13:48:20 +0000 (14:48 +0100)]
libkmod: document the symbols file
Add a note about the v5 sections and note we should not change existing
sections.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/128
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Sat, 14 Sep 2024 13:38:57 +0000 (14:38 +0100)]
docs: annotate the v33 API
Namely:
- kmod_config_get_weakdeps
- kmod_module_get_weakdeps
Closes: https://github.com/kmod-project/kmod/issues/98
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/128
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Sat, 14 Sep 2024 13:38:23 +0000 (14:38 +0100)]
docs: annotate the v30 API
Namely:
- kmod_module_new_from_name_lookup
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/128
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Sat, 14 Sep 2024 13:37:25 +0000 (14:37 +0100)]
docs: annotate the v22 API
Namely:
- kmod_get_dirname
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/128
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Fri, 13 Sep 2024 11:48:55 +0000 (12:48 +0100)]
docs: annotate the v6 API
Namely:
- kmod_module_apply_filter
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/128
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Sat, 14 Sep 2024 13:18:31 +0000 (14:18 +0100)]
docs: annotate the v4 API
Namely:
- kmod_config_get_aliases
- kmod_config_get_blacklists
- kmod_config_get_install_commands
- kmod_config_get_options
- kmod_config_get_remove_commands
- kmod_config_get_softdeps
- kmod_config_iter_free_iter
- kmod_config_iter_get_key
- kmod_config_iter_get_value
- kmod_config_iter_next
- kmod_dump_index
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/128
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Sat, 14 Sep 2024 13:16:16 +0000 (14:16 +0100)]
docs: annotate the v3 API
Namely:
- kmod_module_get_dependency_symbols
- kmod_module_dependency_symbol_get_bind
- kmod_module_dependency_symbol_get_crc
- kmod_module_dependency_symbol_get_symbol
- kmod_module_dependency_symbols_free_list
- kmod_module_get_symbols
- kmod_module_symbol_get_crc
- kmod_module_symbol_get_symbol
- kmod_module_symbols_free_list
- kmod_module_probe_insert_module
- kmod_validate_resources
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/128
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Sat, 14 Sep 2024 13:09:27 +0000 (14:09 +0100)]
docs: annotate the v2 API
Namely:
- kmod_list_last
- kmod_module_get_softdeps
- kmod_module_get_info
- kmod_module_info_get_key
- kmod_module_info_get_value
- kmod_module_info_free_list
- kmod_module_get_versions
- kmod_module_version_get_crc
- kmod_module_version_get_symbol
- kmod_module_versions_free_list
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/128
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Sat, 14 Sep 2024 13:05:32 +0000 (14:05 +0100)]
docs: annotate the v1 API
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/128
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Sun, 8 Sep 2024 09:41:16 +0000 (10:41 +0100)]
libkmod: remove internal kmod_list iterators
These were introduced to workaround since the compiler cannot properly
optimise things, since the symbols have external linkage.
These days this is not so much an issue. For example comparing a gcc 14
build, with -O2 shows 24 bytes growth with this reverted.
Although in practise anyone looking for extreme optimisations - be that
speed or size - should be using LTO and/or PGO.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/117
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Fri, 13 Sep 2024 12:02:54 +0000 (13:02 +0100)]
man: remove slash before @MODULE_DIRECTORY@
... otherwise we get a double-slash in the manual.
Fixes: e2536ab ("man: Provide examples for paths")
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/129
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Wed, 11 Sep 2024 16:27:52 +0000 (17:27 +0100)]
libkmod: fix clang-format ofr -> off typo
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/118
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Mon, 9 Sep 2024 15:14:54 +0000 (16:14 +0100)]
CONTRIBUTING.md: add initial contributing guideline
Document some of the practises and expectations that we've been using
in the project.
Large chunks of the document are inspired by wlroots - thank you o/
Going further, I think we'd want to document the use of SoB/DCO and
mention about our CI pipelines, so that people try them before opening
PRs/sending patches.
Although I think that can follow-up at another day.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/122
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Mon, 9 Sep 2024 14:10:38 +0000 (15:10 +0100)]
README.md: recommend meson, mention autotools EOL
The meson build has the default options already set, so I don't think we
need the verbosity of the configure example.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/122
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Sat, 7 Sep 2024 18:30:49 +0000 (19:30 +0100)]
README.md: make it a proper markdown
Resolve the formatting so the file renders correctly.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/122
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Sat, 7 Sep 2024 18:50:10 +0000 (19:50 +0100)]
README.md: rework the Information section
Move the section after the Overview, so that people can first see what
the project is about, before talking about ML, issues, etc.
Fold the git/gitweb sections, since the distinction is no longer needed
adding some mirrors. Document the IRC freenode -> oftc move.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/122
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Sat, 7 Sep 2024 18:44:32 +0000 (19:44 +0100)]
README.md: remove outdated Coverity Scan
It hasn't been run in years, so let's drop it. We might reintroduce it
sooner or later at which point we'll add back the badge.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/122
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Lucas De Marchi [Wed, 11 Sep 2024 13:51:23 +0000 (08:51 -0500)]
build: Fix KDIR again
KDIR is not related to the what we configure in kmod's build. It's only
used in kmod to locate where the distro's kernel source/headers is,
which may be different from what we are configuring the (under
development) kmod with.
Remove the setting from meson/autotools and figure it out inside the
module-playground Makefile what should be used. For advanced use cases,
KDIR= can be passed to override the location.
For our own tests, which includes testing with a different module_directory,
scripts/setup-rootfs.sh will copy the module to the desired location
according to the map defined in the script.
Fixes: 27ff72732666 ("testsuite: correct the default KDIR")
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/125
Tobias Stoeckmann [Tue, 10 Sep 2024 20:02:24 +0000 (22:02 +0200)]
kmod: Avoid negative exit codes
Exit codes shall be non-negative to comply with standards.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Link: https://github.com/kmod-project/kmod/pull/124
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Lucas De Marchi [Tue, 10 Sep 2024 18:27:06 +0000 (13:27 -0500)]
Remove depmod_module_directory_override from .pc
Hopefully this is not needed to implement the kernel side.
Let's remove it and bring it back in case it really is.
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Lucas De Marchi [Mon, 9 Sep 2024 06:36:12 +0000 (01:36 -0500)]
man: Provide examples for paths
Add some examples to help clarifying each part of the paths.
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/100
Lucas De Marchi [Mon, 9 Sep 2024 06:13:55 +0000 (01:13 -0500)]
man: Reword depmod's paths
Main goal is to give the reader the complete picture of each component
of the path being used, divided in <BASEDIR>, <MODULEDIR>, version.
Then reword the options accordingly to refer to what they are
overriding.
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/100
Lucas De Marchi [Mon, 9 Sep 2024 06:03:01 +0000 (01:03 -0500)]
testsuite: Test depmod's -m flag
Link: https://github.com/kmod-project/kmod/pull/100
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Lucas De Marchi [Mon, 9 Sep 2024 06:50:29 +0000 (01:50 -0500)]
depmod: Rewrite basedir/moduledir/outputdir/ help
Follow the same logic for all of them: short help message about
what the option is and default value inside parenthesis.
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/100
Michal Suchanek [Wed, 4 Sep 2024 06:54:06 +0000 (08:54 +0200)]
depmod: Add option to override MODULE_DIRECTORY
This a compile time option. When building modules for a different system
that uses a different value of this option it is useful to be able to
override it without rebuilding kmod.
Closes: https://github.com/kmod-project/kmod/issues/85
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Link: https://github.com/kmod-project/kmod/pull/100
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Michal Suchanek [Thu, 5 Sep 2024 14:47:15 +0000 (16:47 +0200)]
depmod: Remove deprecated options
These options are deprecated and undocumented since import of depmod
into git (Dec 2011).
Link: https://github.com/kmod-project/kmod/pull/100
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Lucas De Marchi [Mon, 9 Sep 2024 13:33:35 +0000 (08:33 -0500)]
meson: Stop rebuilding modules over and over
Instead of removing the sources every time and rebuilding, just use
rsync to preserve the timestamps and allow Make to do its job of
rebuilding if it changed.
There's a bug in meson that keeps building the testsuite even outside of
`ninja test`, but if the build result is cached, we can greatly minimize
the impact for developers.
Closes: https://github.com/kmod-project/kmod/issues/119
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/121
Lucas De Marchi [Mon, 9 Sep 2024 07:08:54 +0000 (02:08 -0500)]
meson: Move symlinks up
Currently it's only possible to test the tools by using the symlink.
However, differently from autotools, the symlink is created inside the
testsuite dir, and only if build-tests=true. Move it to the same
directory that kmod is so it's possible to test without the testsuite.
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/120
Emil Velikov [Sat, 7 Sep 2024 00:28:19 +0000 (01:28 +0100)]
testsuite: use size_t with strbuf
We recently updated the API, but forgot to update the tests.
Fixes: 38943b2 ("shared: use size_t for strbuf")
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/115
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Sun, 8 Sep 2024 10:38:12 +0000 (11:38 +0100)]
.editorconfig: max_line_length=90 like clang-format
Ideally the config (and editors) will have hard and soft limit for the
line length. Until then, update the config so that clang-format does not
excessively reformat.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/118
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Lucas De Marchi [Sun, 8 Sep 2024 10:38:12 +0000 (11:38 +0100)]
clang-format: Override settings
- Define our own foreach macros
- Add defines for attributes. This also needs the minimum clang-format
version to be raised so it has the AttributeMacros setting.
- Redefine a few settings related to max number of columns and
penalties for breaking lines
v2
- [Emil] update attributes list
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/118
Lucas De Marchi [Sun, 8 Sep 2024 10:38:12 +0000 (11:38 +0100)]
clang-format: Import from kernel
Import .clang-format from Linux kernel as of v6.11-rc6.
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/118
Emil Velikov [Sun, 8 Sep 2024 10:38:12 +0000 (11:38 +0100)]
testsuite: reformat and clang-format off arrays
For some arrays, clang-format does far than ideal jobs reformatting. Do
so manually and ban clang-format from interfering.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/118
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Sun, 8 Sep 2024 10:38:12 +0000 (11:38 +0100)]
testsuite: reformat and clang-format off args[]
Reformat a bunch of the args blocks and freeze them as-is. The remaining
instances clang-format handles correctly. The format is:
progname,
'--list', 'of', '--arguments',
'modname',
NULL
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/118
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Sun, 8 Sep 2024 10:38:12 +0000 (11:38 +0100)]
testsuite: remove .needspawn = false instances
The .needspawn = false is the default so just remove them. Tall the
other tests don't set it, so remove the test-util.c instances.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/118
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Sun, 8 Sep 2024 10:38:12 +0000 (11:38 +0100)]
tools: reformat and clang-format off arrays
For some arrays, clang-format does far than ideal jobs reformatting. Do
so manually and ban clang-format from interfering.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/118
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Sun, 8 Sep 2024 10:38:12 +0000 (11:38 +0100)]
libkmod: reformat and clang-format off arrays
For some arrays, clang-format does far than ideal jobs reformatting. Do
so manually and ban clang-format from interfering.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/118
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Sun, 8 Sep 2024 10:38:12 +0000 (11:38 +0100)]
libkmod: guard some functions with clang-format off
Running this through clang-format results in a massacre. In some cases
we get function names starting at column 1, in others, every argument is
on separate line.
Just block the lot, so things are somewhat sane and consistent.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/118
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Fri, 6 Sep 2024 21:48:40 +0000 (22:48 +0100)]
libkmod: remove the "Ugly assignment + check."
Check if the module is blacklisted first and then perform the individual
flag checks. As result drop the no-longer needed comment.
This might be a dozen CPU cycles slower, but overall clarity triumphs.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/112
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Fri, 6 Sep 2024 21:46:30 +0000 (22:46 +0100)]
libkmod: module_is_blacklisted takes a const mod
Update the API to reflect reality.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/112
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Fri, 6 Sep 2024 21:40:03 +0000 (22:40 +0100)]
libkmod: smoke test all the API
Aka make sure the library does not crash if we give it a NULL as input
argument.
All entry-points but kmod_config_iter_free_iter look to be safe. Update
the final instance.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/111
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Sat, 7 Sep 2024 00:15:04 +0000 (01:15 +0100)]
Remove -Wno-unused-result
With the code base now fixed, this warning doesn't need to be suppressed
anymore.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Lucas De Marchi [Sat, 7 Sep 2024 06:19:24 +0000 (01:19 -0500)]
testsuite: Check return value of underscores()
Error returned from underscores() shouldn't be ignored.
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Sat, 7 Sep 2024 00:15:04 +0000 (01:15 +0100)]
shared: use _nonnull_() decoration
Use the recently introduced attribute macro.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/114
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Sat, 7 Sep 2024 00:15:04 +0000 (01:15 +0100)]
libkmod: introduce and use _nonnull_() decoration
Introduce a new attribute macro and use it, placing it on the left hand
side of the function return value. This aligns with the attributes style
used in C23.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/114
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Sat, 7 Sep 2024 00:15:04 +0000 (01:15 +0100)]
shared: use _nonnull_all_ decoration
Use the recently introduced attribute macro.
Note that functions such as memdup() and path_ends_with_kmod_ext() take
the (non-zero) length of their non-null string, thus can be annotated
with this _all_ variant.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/114
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Sat, 7 Sep 2024 00:15:04 +0000 (01:15 +0100)]
libkmod: introduce and use _nonnull_all_ decoration
Introduce a new attribute macro and use it, placing it on the left hand
side of the function return value. This aligns with the attributes style
used in C23.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/114
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Sat, 7 Sep 2024 00:15:04 +0000 (01:15 +0100)]
libkmod: remove open-coded _printf_format_
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/114
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Lucas De Marchi [Sat, 7 Sep 2024 06:02:49 +0000 (01:02 -0500)]
Move _must_check to the left side
Move the attribute to the left hand side since it's clearer and will
help with better formatting when running clang-format.
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Sat, 7 Sep 2024 00:15:04 +0000 (01:15 +0100)]
testsuite: remove unused __noreturn decorations
The last user was removed in 2013 with commit
d96ca9c ("Use C11's
noreturn")
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/114
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Lucas De Marchi [Sat, 7 Sep 2024 00:15:04 +0000 (01:15 +0100)]
Drop empty statements
The double ';;' were clearly a mistake and clang-format only makes it
worse if we try running it. Remove the mistake before mass-converting
the source code.
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/114
Emil Velikov [Sat, 7 Sep 2024 00:15:04 +0000 (01:15 +0100)]
tools: add trailing comma for multi-line enums
... otherwise the upcoming clang-format will try to fold them on single
line, making the end result far from ideal.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/114
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Sat, 7 Sep 2024 00:15:04 +0000 (01:15 +0100)]
libkmod: add trailing comma for multi-line enums
... otherwise the upcoming clang-format will try to fold them on single
line, making the end result far from ideal.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/114
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Sat, 7 Sep 2024 00:15:04 +0000 (01:15 +0100)]
tools: add trailing comma for multi-line arrays
... otherwise the upcoming clang-format will try to fold them on single
line, making the end result far from ideal.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/114
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Sat, 7 Sep 2024 00:15:04 +0000 (01:15 +0100)]
testsuite: add trailing comma for multi-line arrays
... otherwise the upcoming clang-format will try to fold them on single
line, making the end result far from ideal.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/114
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Sat, 7 Sep 2024 00:15:04 +0000 (01:15 +0100)]
shared: add trailing comma for multi-line arrays
... otherwise the upcoming clang-format will try to fold them on single
line, making the end result far from ideal.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/114
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Sat, 7 Sep 2024 00:15:04 +0000 (01:15 +0100)]
libkmod: add trailing comma for multi-line arrays
... otherwise the upcoming clang-format will try to fold them on single
line, making the end result far from ideal.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/114
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Fri, 6 Sep 2024 21:21:44 +0000 (22:21 +0100)]
meson: make all warnings fatal on ci/developer builds
Aka "-D werror=true", so we catch as many issues as possible in
automated manner.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/110
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Fri, 6 Sep 2024 19:45:51 +0000 (20:45 +0100)]
ci: add multilib (32bit) CI for Arch, Debian, Ubuntu
Enable it only for meson, as we plan to phase out autotools soonish.
Also don't bother with the openssl/compression paths for now.
AFAICT there is no multilib package on Alpine. Fedora should have one,
but I couldn't find it from a quick search.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/110
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Fri, 6 Sep 2024 20:44:51 +0000 (21:44 +0100)]
ci: remove duplicate libssl-dev entries
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/110
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Tobias Stoeckmann [Wed, 4 Sep 2024 16:26:15 +0000 (18:26 +0200)]
libkmod: check fstatat return value
If fstatat fails, st is not set, which leads to undefined results of
subsequent S_ISDIR call.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/103
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Lucas De Marchi [Fri, 6 Sep 2024 19:47:36 +0000 (14:47 -0500)]
scripts: Make build-scdoc.sh executable
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Lucas De Marchi [Fri, 6 Sep 2024 19:46:28 +0000 (14:46 -0500)]
meson: normalize s/check/test/
The testsuite is executed by calling the 'test' target in meson, as
opposed to 'check' with autotools. Let's normalize it aligned to the new
build system.
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Fri, 6 Sep 2024 16:45:21 +0000 (11:45 -0500)]
ci: build: add docs in ci/developer builds
To make it a little bit more obvious that those should be updated as
well...
On Alpine it fails (as below), so we've disabled it for now.
When gtkdoc-mkhtml calls xsltproc, the latter throws dozens of errors and
fails to produce the libkmod.devhelp2 file. Which meson tries to move
and fails.
Error: no ID for constraint linkend: "int"
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/94
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Wed, 4 Sep 2024 18:25:44 +0000 (19:25 +0100)]
meson: add test for gtkdoc coverage
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/94
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Mon, 2 Sep 2024 22:20:18 +0000 (23:20 +0100)]
meson: add support for building the gtk-doc pages
v2:
- track the version.xml dependency
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/94
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Lucas De Marchi [Fri, 6 Sep 2024 16:47:10 +0000 (11:47 -0500)]
meson: Align summary to option names
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/94
Lucas De Marchi [Thu, 5 Sep 2024 05:30:49 +0000 (00:30 -0500)]
meson: Add build-tests to build-dev.ini
Developers are supposed to run tests to test their code.
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/104
Emil Velikov [Mon, 2 Sep 2024 22:20:19 +0000 (23:20 +0100)]
libkmod/docs: drop pre gtk-doc comments
Drop the misc comments, which are effectively superseded by the gtk-doc
decorations.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/94
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Mon, 2 Sep 2024 22:20:19 +0000 (23:20 +0100)]
libkmod/docs: tweak kmod_module_get_sections
Adjust the grammar and split the getter information in new paragraph.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/94
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Mon, 2 Sep 2024 22:20:19 +0000 (23:20 +0100)]
libkmod/docs: move in-argument kmod_module*get* reffs
Move the references out of the argument's description, to the main
description. With that the "how-to-free" is now duplicate, so remove it.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/94
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Mon, 2 Sep 2024 22:20:19 +0000 (23:20 +0100)]
libkmod/docs: remove misleading "After use, free"
In a couple of instances, the doc suggests freeing the (whole) list
after operating on a (single) list entry.
This is somewhat misleading - drop the instances, since the getters doc
(the ones allocating the lists) are pretty clear about freeing.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/94
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Mon, 2 Sep 2024 22:20:19 +0000 (23:20 +0100)]
libkmod/docs: document kmod_list iterators
... and change the argument names to match the other kmod_list APIs.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/94
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Mon, 2 Sep 2024 22:20:19 +0000 (23:20 +0100)]
libkmod/docs: add outstanding struct description(s)
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/94
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Mon, 2 Sep 2024 22:20:19 +0000 (23:20 +0100)]
libkmod/docs: document logging priority definitions
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/94
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Mon, 2 Sep 2024 22:20:19 +0000 (23:20 +0100)]
libkmod/docs: add outstanding long_description(s)
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/94
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Mon, 2 Sep 2024 22:20:19 +0000 (23:20 +0100)]
libkmod/docs: document and reference kmod_symbol_bind
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/94
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Mon, 2 Sep 2024 22:20:19 +0000 (23:20 +0100)]
libkmod/docs: s/in kernel/in the kernel/
Add the definite article to the remaining instances.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/94
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Mon, 2 Sep 2024 22:20:19 +0000 (23:20 +0100)]
libkmod/docs: s/Linux [Kk]ernel/the kernel/
The project is Linux specific, let's little point in repeating it.
More so, when we predominantly use "kernel" already. Adjust, while also
adding the definite article to adjust the grammar.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/94
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Mon, 2 Sep 2024 22:20:19 +0000 (23:20 +0100)]
libkmod/docs: document and reference kmod_module_initstate
Mostly move the existing documentation from kmod_module_get_initstate()
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/94
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Mon, 2 Sep 2024 22:20:19 +0000 (23:20 +0100)]
libkmod/docs: document and reference kmod_filter
Mostly move the existing documentation from kmod_module_apply_filter().
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/94
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Mon, 2 Sep 2024 22:20:19 +0000 (23:20 +0100)]
libkmod/docs: document and reference kmod_remove
Mostly move the existing documentation from kmod_module_remove_module().
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/94
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Mon, 2 Sep 2024 22:20:19 +0000 (23:20 +0100)]
libkmod/docs: document and reference kmod_probe
Mostly move the existing documentation from
kmod_module_probe_insert_module().
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/94
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Mon, 2 Sep 2024 22:20:19 +0000 (23:20 +0100)]
libkmod/docs: document and reference kmod_insert
Mostly move the existing documentation from kmod_module_insert_module().
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/94
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Mon, 2 Sep 2024 22:20:19 +0000 (23:20 +0100)]
libkmod/docs: document and reference kmod_index
Mostly move the existing documentation from kmod_dump_index().
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/94
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Mon, 2 Sep 2024 22:20:19 +0000 (23:20 +0100)]
libkmod/docs: document and reference kmod_resources
Mostly move the existing documentation from kmod_validate_resources().
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/94
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Mon, 2 Sep 2024 22:20:19 +0000 (23:20 +0100)]
libkmod/docs: correct a function doc name
A trivial typo, which has been around since the doc was added in 2011.
s/kmod_module_section_get_module_name/kmod_module_section_get_name/
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/94
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Emil Velikov [Mon, 2 Sep 2024 22:20:19 +0000 (23:20 +0100)]
libkmod/docs: add missing second asterisk
... for kmod_module_get_weakdeps. Otherwise gtk-doc doesn't pick up the
documentation.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/94
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>