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 [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>
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.
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
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.
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>
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.
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.
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
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.
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.
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.
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.
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.
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: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.
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.
Emil Velikov [Mon, 2 Sep 2024 22:20:19 +0000 (23:20 +0100)]
libkmod/docs: add a trailing colon
Namely the doc for kmod_module_apply_filter is missing the trailing
colon. It seems that gtk-doc is smart enough to not needed, but we might
as well stay consistent.
This tripped me as I was grepping for "\* kmod_foo.*:$", while checking
the header against the gtk-doc sections file.
Emil Velikov [Mon, 2 Sep 2024 22:20:18 +0000 (23:20 +0100)]
libkmod/docs: move libkmod-loaded section to the header
In part to ease my life as I'm going through (shortly) and updating the
log. In part so that developers how don't install the gtk-doc html
pages, still have the information at hand.
While here, sort the API akin to the HTML documentation.
Emil Velikov [Mon, 2 Sep 2024 22:20:18 +0000 (23:20 +0100)]
libkmod/docs: move libkmod(-core) section to the header
In part to ease my life as I'm going through (shortly) and updating the
log. In part so that developers how don't install the gtk-doc html
pages, still have the information at hand.
While here, sort the API akin to the HTML documentation.
Emil Velikov [Mon, 2 Sep 2024 22:20:18 +0000 (23:20 +0100)]
libkmod/docs: move libkmod-module section to the header
In part to ease my life as I'm going through (shortly) and updating the
log. In part so that developers how don't install the gtk-doc html
pages, still have the information at hand.
While here, sort the API akin to the HTML documentation.
Emil Velikov [Mon, 2 Sep 2024 22:20:18 +0000 (23:20 +0100)]
libkmod/docs: move libkmod-list section to the header
In part to ease my life as I'm going through (shortly) and updating the
log. In part so that developers how don't install the gtk-doc html
pages, still have the information at hand.
While here, sort the API akin to the HTML documentation.
Emil Velikov [Mon, 2 Sep 2024 22:20:18 +0000 (23:20 +0100)]
libkmod/docs: move libkmod-config section to the header
In part to ease my life as I'm going through (shortly) and updating the
log. In part so that developers how don't install the gtk-doc html
pages, still have the information at hand.
Emil Velikov [Mon, 2 Sep 2024 22:20:18 +0000 (23:20 +0100)]
libkmod/docs: ignore libkmod-internal-file.h
Recently we introduced another internal header, yet forgot to add it to
the ignore headers list.
Fixes: 929ca4c ("libkmod: Move xz-related functions to separate file") 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)]
libkmod/docs: remove non-applicable __must_check
Drop the __must_check from ignore-decorations, since it's nowhere to be
found. The correct name is _must_check_, although amongst others the
decoration is only for the internal API.
Emil Velikov [Tue, 3 Sep 2024 21:31:04 +0000 (22:31 +0100)]
testsuite/path: wrap 64 variants for _GLIBC_
Since musl v1.2.4 and Alpine 3.18, circa May 2023, the LFS64 variants
are no longer exported by libc.so.
In addition musl headers provide relevant "#define foo64 foo" macros,
when _LARGEFILE64_SOURCE is defined and symbol resolution is deferred to
the runtime linker. See musl commit 246f1c811448 ("remove LFS64 symbol
aliases; replace with dynamic linker remapping") more details.
Earlier versions of musl had the symbols exposed by libc, although the
^^ macros were also available when _GNU_SOURCE is set, as our build
does.
Most importantly, we do not explicitly use the 64 variants and musl
doesn't implicitly pull them either. So in practise building with musl,
the binaries do not have any 64 references, thus there is no need to
wrap them.
AFAICT there is no obvious way of detecting musl, apart from the lack of
of __GLIBC__, so pull features.h (which defines it) and check on that.
There is a small chance the __GLIBC__ check will miss-fire on other
implementations like bionic, dietlibc or ulibc(-ng). We don't run the
tests on those platforms (although we could) so it should be fine.
With that we can install tar (for make distcheck) and enable the tests
in CI \o/
Closes: https://github.com/kmod-project/kmod/issues/65 Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Link: https://github.com/kmod-project/kmod/pull/97 Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>