Upgrade kmod 33 -> 34.1
v2 cover Upgrade kmod 33 -> 34.1
Bring scdoc in from meta-wayland to support generation of the manpages. Convert to meson from autotools. Clean up usage of kmod in eudev.
---
Changes in v2:
- Set installation directories to base_bindir/base_sbindir
- Link to v1: https://lore.kernel.org/r/[email protected]
---
Alex Kiernan (4):
scdoc: Import from meta-wayland
scdoc: Upgrade 1.11.2 -> 1.11.3
kmod: Upgrade 33 -> 34.1
eudev: Drop --output=... from kmod call in init script
meta/conf/distro/include/maintainers.inc | 1 +
meta/recipes-core/udev/eudev/init | 3 +-
meta/recipes-extended/scdoc/scdoc_1.11.3.bb | 22 ++++++++
.../kmod/kmod/avoid_parallel_tests.patch | 30 -----------
meta/recipes-kernel/kmod/kmod/gtkdocdir.patch | 30 -----------
meta/recipes-kernel/kmod/kmod/run-ptest | 5 --
.../kmod/{kmod_33.bb => kmod_34.1.bb} | 58 +++++++++-------------
7 files changed, 47 insertions(+), 102 deletions(-)---
base-commit: 3c808ebd910ae68491109c73e644354f90eb5a13
change-id: 20250312-upgrade-kmod-8292a5003aa2
Best regards,
Signature · 1 line
Alex Kiernan <[email protected]>
PATCH v2 1/4 scdoc: Import from meta-wayland
scdoc is a simple man page generator for POSIX systems written in C99.
--- meta/conf/distro/include/maintainers.inc | 1 + .../0001-Makefile-dont-add-static-to-LDFLAGS.patch | 27 ++++++++++++++++++++++ meta/recipes-extended/scdoc/scdoc_git.bb | 25 ++++++++++++++++++++ 3 files changed, 53 insertions(+)
meta/conf/distro/include/maintainers.inc +1 -0
@@ -761,6 +761,7 @@ RECIPE_MAINTAINER:pn-sassc = "Simone Weiß <[email protected]>" RECIPE_MAINTAINER:pn-sato-screenshot = "Ross Burton <[email protected]>" RECIPE_MAINTAINER:pn-sato-icon-theme = "Richard Purdie <[email protected]>" RECIPE_MAINTAINER:pn-sbc = "Unassigned <[email protected]>" +RECIPE_MAINTAINER:pn-scdoc = "Unassigned <[email protected]>" RECIPE_MAINTAINER:pn-screen = "Anuj Mittal <[email protected]>" RECIPE_MAINTAINER:pn-seatd = "Unassigned <[email protected]>" RECIPE_MAINTAINER:pn-sed = "Chen Qi <[email protected]>"
meta/recipes-extended/scdoc/scdoc/0001-Makefile-dont-add-static-to-LDFLAGS.patch new file +27 -0
@@ -0,0 +1,27 @@ +From 2cac433806d9622dbc005fe5738f1ae8c33a98cb Mon Sep 17 00:00:00 2001 +From: Markus Volk <[email protected]> +Date: Thu, 13 Jul 2023 19:26:40 +0200 +Subject: [PATCH] Makefile: dont add -static to LDFLAGS + +Signed-off-by: Markus Volk <[email protected]> + +Upstream-Status: Inappropriate [oe-specific] +--- + Makefile | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/Makefile b/Makefile +index 60a80b8..49021fa 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,7 +1,6 @@ + VERSION=1.11.2 + CFLAGS?=-g + MAINFLAGS:=-DVERSION='"$(VERSION)"' -Wall -Wextra -Werror -Wno-unused-parameter +-LDFLAGS+=-static + INCLUDE+=-Iinclude + PREFIX?=/usr/local + BINDIR?=$(PREFIX)/bin +-- +2.39.3 +
meta/recipes-extended/scdoc/scdoc_git.bb new file +25 -0
@@ -0,0 +1,25 @@ +SUMMARY = "scdoc is a simple man page generator for POSIX systems written in C99." +HOMEPAGE = "https://github.com/ddevault/scdoc" +BUGTRACKER = "https://github.com/ddevault/scdoc/issues" +SECTION = "base/doc" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://COPYING;md5=31752b4a8edd3fb9ddba1cb90fada74d" + +SRC_URI = " \ + git://git.sr.ht/~sircmpwn/scdoc;protocol=https;branch=master \ + file://0001-Makefile-dont-add-static-to-LDFLAGS.patch \ +" + +DEPENDS = "scdoc-native" + +S = "${WORKDIR}/git" +PV = "1.11.2" +SRCREV = "afeda241f3f9b2c27e461f32d9c2a704ab82ef61" + +EXTRA_OEMAKE:class-native = "PREFIX=${prefix}" +EXTRA_OEMAKE:class-target = "PREFIX=${prefix} HOST_SCDOC=${STAGING_BINDIR_NATIVE}/scdoc" + +inherit autotools-brokensep + +BBCLASSEXTEND = "native" +
Signature · 1 line
2.25.1
PATCH v2 2/4 scdoc: Upgrade 1.11.2 -> 1.11.3
In reply to Alex KiernanDrop "dont add -static to LDFLAGS" patch as this is now upstream.
Changes:
Dimitry Andric (1):
Fix clang 15 -Wstrict-prototypes warnings
Drew DeVault (3):
README.md: mention system packages
Update version to 1.11.3
Makefile: drop -static
Eli Schwartz (2):
remove useless re-declarations of standard functions get rid of some unused includes
Humm (3):
use .PP for paragraph breaks
scdoc(1), scdoc(5): follow conventions more closely simplify list output
Kirill Chibisov (1):
Emit \(ti and \(ha instead of ~ and ^
Max Schillinger (1):
fix formatting of escaped backticks
Nico Wagner (1):
Makefile: remove unnecessary path separator
Simon Branch (2):
scdoc.5: fix capitalization of subsection headers scdoc.5: fix formatting in the preamble
Simon Ser (1):
man: add section about SOURCE_DATE_EPOCH
Viacheslav Kruglov (1):
Fix logical error in comparison with ULONG_MAX
elij (1):
strip indentation after a hard line break ++
jturtle (1):
Emit '\e' instead of '\\'
---
.../0001-Makefile-dont-add-static-to-LDFLAGS.patch | 27 ----------------------
.../scdoc/{scdoc_git.bb => scdoc_1.11.3.bb} | 21 ++++++++---------
2 files changed, 9 insertions(+), 39 deletions(-)meta/recipes-extended/scdoc/scdoc/0001-Makefile-dont-add-static-to-LDFLAGS.patch deleted +0 -27
@@ -1,27 +0,0 @@ -From 2cac433806d9622dbc005fe5738f1ae8c33a98cb Mon Sep 17 00:00:00 2001 -From: Markus Volk <[email protected]> -Date: Thu, 13 Jul 2023 19:26:40 +0200 -Subject: [PATCH] Makefile: dont add -static to LDFLAGS - -Signed-off-by: Markus Volk <[email protected]> - -Upstream-Status: Inappropriate [oe-specific] ---- - Makefile | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/Makefile b/Makefile -index 60a80b8..49021fa 100644 ---- a/Makefile -+++ b/Makefile -@@ -1,7 +1,6 @@ - VERSION=1.11.2 - CFLAGS?=-g - MAINFLAGS:=-DVERSION='"$(VERSION)"' -Wall -Wextra -Werror -Wno-unused-parameter --LDFLAGS+=-static - INCLUDE+=-Iinclude - PREFIX?=/usr/local - BINDIR?=$(PREFIX)/bin --- -2.39.3 -
meta/recipes-extended/scdoc/scdoc_1.11.3.bb renamed from meta/recipes-extended/scdoc/scdoc_git.bb +9 -12
@@ -5,21 +5,18 @@ SECTION = "base/doc" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://COPYING;md5=31752b4a8edd3fb9ddba1cb90fada74d" -SRC_URI = " \ - git://git.sr.ht/~sircmpwn/scdoc;protocol=https;branch=master \ - file://0001-Makefile-dont-add-static-to-LDFLAGS.patch \ -" - DEPENDS = "scdoc-native" -S = "${WORKDIR}/git" -PV = "1.11.2" -SRCREV = "afeda241f3f9b2c27e461f32d9c2a704ab82ef61" +PV .= "+git" -EXTRA_OEMAKE:class-native = "PREFIX=${prefix}" -EXTRA_OEMAKE:class-target = "PREFIX=${prefix} HOST_SCDOC=${STAGING_BINDIR_NATIVE}/scdoc" +SRC_URI = "git://git.sr.ht/~sircmpwn/scdoc;protocol=https;branch=master" +SRCREV = "29306d8dde650f5ac2bcc067f3c1d3bcfcac7a1d" + +S = "${WORKDIR}/git" inherit autotools-brokensep - -BBCLASSEXTEND = "native" +EXTRA_OEMAKE = "PREFIX=${prefix}" +EXTRA_OEMAKE:append:class-target = " HOST_SCDOC=${STAGING_BINDIR_NATIVE}/scdoc" + +BBCLASSEXTEND = "native"
Signature · 1 line
2.25.1
Re: [OE-core] [PATCH OE-Core v2 2/4] scdoc: Upgrade 1.11.2 -> 1.11.3
Quoted 1 line · Alex Kiernan via lists.openembedded.org
inherit autotools-brokensep
As this recipe doesn’t actually use autotools, this is just misleading.
Please emove this inherit and just implement do_install instead:
do_install() {
oe_runmake 'DESTDIR=${D}' install
}
Quoted 1 line
+PV .= "+git”
This is only needed if the SHA doesn’t match up with a release, and your patch clearly states “upgrade to 1.11.3”. But in git:
commit 0528bcb993cac6c412acd3ae2e09539e994c0a59 (tag: 1.11.3)
commit 29306d8dde650f5ac2bcc067f3c1d3bcfcac7a1d (HEAD -> master, origin/master, origin/HEAD)
If we’re adding a git snapshot of effectively an arbitrary git commit (just the current master), please make that obvious. I’d prefer to stick with a release and apply patches unless there’s a good reason to use arbitrary commits (like, there would be tens of patches).
Quoted 2 lines
HOMEPAGE = "https://github.com/ddevault/scdoc" BUGTRACKER = "https://github.com/ddevault/scdoc/issues"
Both of these are wrong now that the repository isn’t on github anymore, please update.
Quoted 1 line
+RECIPE_MAINTAINER:pn-scdoc = "Unassigned <[email protected]>”
If you’re adding it, please consider being the maintainer. It’s a trivial tool so the burden shouldn't be too much effort.
Ross
Re: [OE-core] [PATCH OE-Core v2 2/4] scdoc: Upgrade 1.11.2 -> 1.11.3
Quoted 4 lines · Ross Burton
Quoted 1 line · Alex Kiernan via lists.openembedded.org
inherit autotools-brokensep
Quoted 8 lines
As this recipe doesn’t actually use autotools, this is just misleading.
Please emove this inherit and just implement
do_installinstead:
do_install(){
oe_runmake'DESTDIR=${D}' install
}
ok
Quoted 9 lines
Quoted 1 line
+PV .= "+git”
This is only needed if the SHA doesn’t match up with a release, and your patch clearly states “upgrade to 1.11.3”. But in git:
commit
0528bcb993cac6c412acd3ae2e09539e994c0a59(tag: 1.11.3)
commit29306d8dde650f5ac2bcc067f3c1d3bcfcac7a1d(HEAD -> master, origin/master, origin/HEAD)If we’re adding a git snapshot of effectively an arbitrary git commit (just the current master), please make that obvious. I’d prefer to stick with a release and apply patches unless there’s a good reason to use arbitrary commits (like, there would be tens of patches).
I'll pick out the patch which use that in place of the local one so it clearly gets dropped next update - the others commits look minor
Quoted 5 lines
Quoted 2 lines
HOMEPAGE = "https://github.com/ddevault/scdoc" BUGTRACKER = "https://github.com/ddevault/scdoc/issues"
Both of these are wrong now that the repository isn’t on github anymore, please update.
okay
Quoted 4 lines
Quoted 1 line
+RECIPE_MAINTAINER:pn-scdoc = "Unassigned <[email protected]>”
If you’re adding it, please consider being the maintainer. It’s a trivial tool so the burden shouldn't be too much effort.
Huh, I really thought I did that, but clearly didn't.
Signature · 1 line
Alex Kiernan
PATCH v2 3/4 kmod: Upgrade 33 -> 34.1
In reply to Alex KiernanMigrate to meson from autotools. Drop remnants of ptest support which was removed in 2015:
https://git.openembedded.org/openembedded-core/commit/?id=f80d136bdd578468035a88125fa1b84973fd912b
Remove configuration directory/symlink handling which is now done by the meson build. Fix manpage generation.
kmod 34
=======
- Improvements
- Drop pre-built .ko modules from git - distros/packages will need the linux-headers to be able to run the testsuite. There was limited use of the feature, while linters complained about "source-not-included" or "source-contains-prebuilt-binary".
- Switch build system to meson: autotools is still supported but slated for removal on next release. This is the transition release to help distros and integrators to move to the new build system. Default options target distros while developers can use the build-dev.ini configuration file.
- Allow to load decompression libraries on demand: liblzma.so, libz.so and libzstd.so can now be loaded on demand, only when there is such a need. For use during early boot for loading modules, if configured well it means none of these libraries are loaded: the module loading logic via finit_module() will just hand over to kernel the open file descriptor and kernel will use its own decompress routine.
If kernel doesn't handle decompression or if the module is compressed with a different algorithm than the one configured in the kernel, libkmod can still open the module by dynamically loading the correspondent library.
Tools inspecting the module contents, like modinfo, will load that single decompression library instead all of them.
For distros building with meson it's possible to choose the behavior per library. Examples: a) -Ddlopen=all uses dlopen behavior for all the libraries; b) -Ddlopen=xz, will make only xz to be dlopen'ed while other enabled libraries will be linked in at build time.
The use of dlopen is annotated in the ELF file by using the ELF Package Metadata spec as documented in
https://systemd.io/ELF_PACKAGE_METADATA/. Example:
$ dlopen-notes.py libkmod.so
# build/libkmod.so
[
{
"feature": "xz",
"description": "Support for uncompressing xz-compressed modules", "priority": "recommended",
"soname": [
"liblzma.so.5"
]
}
]
- Add -m / --moduledir to depmod to override in runtime the module directory that was already possible to set on build time. Document the interaction between the dir options: base, module and output.
- Better error propagation in libkmod for its internal APIs and libc functions up to the callers.
- Improve libkmod API documentation by adding new sections, documenting functions previously missing, rewording existing ones, adding version information, cross-referencing, etc.
- Remove deprecated arguments for depmod: --unresolved-error, --quiet, --root and --map.
- Remove deprecated arguments for rmmod: -w.
- Remove deprecated arguments for insmod: -p and -s.
- Add --syslog and --force for insmod to normalize it with other tools.
- Add bash, fish and zsh shell-completion for insmod, rmmod and lsmod.
- Remove depmod_module_directory_override from .pc as the kernel side is not making use of it and will likely not need it.
- Improve builtin module listing and retrieving information from its modinfo index which reduces the amount of needed syscalls by 90%.
- Improve zstd decompression by using streaming bufferless mode which reduces the amount of syscalls by 65%.
- Increase use of pread while parsing ELF and indexes in order to reduce syscalls and improve performance.
- Improve module sorting in depmod to speedup the use of the modules.order index and support duplicate lines in it.
- Avoid misaligned memory access while reading module signature in libkmod.
- Add more documentation for contributing to kmod. New developers are welcome to look at the new README.md and CONTRIBUTING.md files for information on process, coding style, build/installation, etc.
- Overhaul man pages with multiple clarifications, section rewrites and additional documentation.
- Drop --with-rootlibdir as it's seldom used and was partially broken.
- Drop strndupa() and alloca() for increased libc compatibility.
- Better handling of LFS for increased compatibility with libc.
- Protect kmod_get_dirname() and kmod_new() against NULL argument.
- Normalize --version / --help output across all tools.
- Always include log priority in messages, even when building with debug.
- Optimize index reading by lazily reading nodes on demand, reducing FILE overhead and reducing code duplication wrt FILE vs mmap implementations, etc.
- Switch index to pre-order to improve performance in both read and write, meaning faster lookup and faster depmod. Some examples:
a) traversing all indexes via configuration dump shows a 9% improvement on Raspberry Pi 2. b) writing the indexes takes 90% less lseek() calls, leading to a performance gain of 13%.
- Make symlink install locations more similar to what distros are
using: by default it installs the kmod binary as bin/kmod and the symlinks are located in e.g. sbin/depmod -> ../bin/kmod. Changing the sbin location is sufficient to move the symlinks to the appropriate place, so distros using --sbin /usr/bin will have them installed in that directory. This avoids distros having to remove the symlink and add the symlinks by themselves. (meson only)
- Install configuration directories, /{etc,usr/lib}/{depmod,modprobe}.d/ as part of installation, matching what several distros do during packaging. (meson only)
- Bug fixes
- Fix testsuite using when using configurable module dir.
- Fix typos on documentation and source code.
- Fix out of bound access in multiple places when using long paths, synthetic huge files, or handling memory allocation errors, or inconsistent variable types, particularly on 32b builds.
- Fix internal array APIs, with better error checking: improve execution on very memory-constrained scenarios or very long paths.
- Fix absolute path handling in depmod.
- Fix libkmod memory leaks on error handling when getting builtin module list.
- Do not crash on invalid modules.builtin.modinfo file.
- Fix link with lld resulting in empty testsuite.
- Fix testsuite build/execution with musl.
- Others
- Adopt clang-format and editorconfig for coding style and setup CI action to keep the codebase consistent.
- Adopt codespell in CI.
- Adopt CodeQL integration in CI.
- Adopt Codecov in CI.
- Adopt SPDX copyright and license identifiers throughout the project.
- Add more distros to CI, 32b builds, clang as compiler and lld as linker.
- Add support for clang sanitizers and squelch warnings.
- Add tests for builtin modules from modinfo index file.
- Multiple testsuite refactors and fixes to make it simpler to write tests.
- Add CI coverage for docs
- Improve strbuf implementation with more error checks and generalize it to cover the role of scratchbuf. This allows to remove the scratchbuf implementation.
- Use common array and strbuf code in depmod to remove duplication.
- Add abstraction and use more compiler builtins for addition and multiplication with overflow checking.
- Normalize use of C attributes throughout the project.
---
.../kmod/kmod/avoid_parallel_tests.patch | 30 -----------
meta/recipes-kernel/kmod/kmod/gtkdocdir.patch | 30 -----------
meta/recipes-kernel/kmod/kmod/run-ptest | 5 --
.../kmod/{kmod_33.bb => kmod_34.1.bb} | 58 +++++++++-------------
4 files changed, 23 insertions(+), 100 deletions(-)meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch deleted +0 -30
@@ -1,30 +0,0 @@ -From 7a22abf188e5b688080bb1321a77588474114339 Mon Sep 17 00:00:00 2001 -From: Tudor Florea <[email protected]> -Date: Fri, 6 Sep 2013 21:11:57 +0000 -Subject: [PATCH] kmod: avoid parallel-tests - -Avoid parallel-tests as it remove -buildtest-TESTS and runtest-TESTS targets required by ptest. -In automake 1.13.4 parallel-tests is assumed by defauls. -In order to have buildtest-TESTS and runtest-TESTS targets -serial-tests is now required - -Signed-off-by: Tudor Florea <[email protected]> -Upstream-Status: Inappropriate (disable feature incompatible with ptest) ---- - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 2f1c525..7056aae 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -14,7 +14,7 @@ AC_USE_SYSTEM_EXTENSIONS - AC_SYS_LARGEFILE - AC_PREFIX_DEFAULT([/usr]) - AM_MAINTAINER_MODE([enable]) --AM_INIT_AUTOMAKE([check-news foreign 1.11 silent-rules tar-pax no-dist-gzip dist-xz subdir-objects color-tests parallel-tests]) -+AM_INIT_AUTOMAKE([check-news foreign 1.11 silent-rules tar-pax no-dist-gzip dist-xz subdir-objects color-tests serial-tests]) - AM_SILENT_RULES([yes]) - LT_INIT([disable-static pic-only]) -
meta/recipes-kernel/kmod/kmod/gtkdocdir.patch deleted +0 -30
@@ -1,30 +0,0 @@ -From 90fb7bb85002cde39de3b3d2e2481933390832af Mon Sep 17 00:00:00 2001 -From: Ross Burton <[email protected]> -Date: Fri, 8 Dec 2023 22:35:45 +0000 -Subject: [PATCH] configure: set docdir in GTK_DOC_CHECK - -By passing --docdir in the GTK_DOC_CHECK arguments (to match -autogen.sh) autoreconf will work out of the box. - -Without this autoreconf fails due to the documentation not being in -./docs, the default location. - -Upstream-Status: Submitted [https://lore.kernel.org/linux-modules/[email protected]/T/#u] -Signed-off-by: Ross Burton <[email protected]> ---- - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 7056aae..d53a20c 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -236,7 +236,7 @@ AS_IF([test "x$enable_coverage" = "xyes"], [ - AM_CONDITIONAL([ENABLE_COVERAGE], [test "x$enable_coverage" = "xyes"]) - - m4_ifdef([GTK_DOC_CHECK], [ --GTK_DOC_CHECK([1.14],[--flavour no-tmpl-flat]) -+GTK_DOC_CHECK([1.14],[--flavour no-tmpl-flat --docdir libkmod/docs]) - ], [ - AM_CONDITIONAL([ENABLE_GTK_DOC], false)]) -
meta/recipes-kernel/kmod/kmod/run-ptest deleted +0 -5
@@ -1,5 +0,0 @@ -#!/bin/sh -touch testsuite/stamp-rootfs -tar xf testmodule.tar -make -k runtest-TESTS 2>/dev/null| grep -e ^PASS -e ^FAIL -find testsuite -name *.ko -exec rm -f {} \;
meta/recipes-kernel/kmod/kmod_34.1.bb renamed from meta/recipes-kernel/kmod/kmod_33.bb +23 -35
90 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH v2 4/4 eudev: Drop --output=... from kmod call in init script
In reply to Alex KiernanThis awkward invocation is no longer required as kmod just uses the stdout file descriptor, rather than explicitly opening /dev/stdout.
--- meta/recipes-core/udev/eudev/init | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
meta/recipes-core/udev/eudev/init +1 -2
@@ -27,8 +27,7 @@ make_static_nodes () { [ -e /lib/modules/$(uname -r)/modules.devname ] || return 0 [ -x @KMOD@ ] || return 0 - #output to /proc/self/fd/1 since /dev/stdout not created by udevd yet - @KMOD@ static-nodes --format=tmpfiles --output=/proc/self/fd/1 | + @KMOD@ static-nodes --format=tmpfiles | while read TTYPE TPATH TMODE TUSER TGROUP TAGE TARG; do case "${TTYPE}" in 'd')
Signature · 1 line
2.25.1