summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/kmod
diff options
context:
space:
mode:
authorAlexander Kanavin <alex@linutronix.de>2024-08-22 11:35:00 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-08-23 09:12:37 +0100
commit58b02e0c3c424fd7eb01e0e2a9a40f475452774f (patch)
tree1376e76be5bce8430c69bdb9c1632bd345aaaa31 /meta/recipes-kernel/kmod
parent3ac5612fd5205ced2d7203325f1d13bd23679271 (diff)
downloadpoky-58b02e0c3c424fd7eb01e0e2a9a40f475452774f.tar.gz
kmod: upgrade 32 -> 33
Disable manpages, as they require scdoc, which is not currently available in core (and adjust a related selftest). Drop 0001-Use-portable-implementation-for-basename-API.patch as upstream fixed the issue differently. (From OE-Core rev: f868b75ab22cd528d9add744042f13d475715ef4) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-kernel/kmod')
-rw-r--r--meta/recipes-kernel/kmod/kmod/0001-Use-portable-implementation-for-basename-API.patch136
-rw-r--r--meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch10
-rw-r--r--meta/recipes-kernel/kmod/kmod/gtkdocdir.patch9
-rw-r--r--meta/recipes-kernel/kmod/kmod_33.bb (renamed from meta/recipes-kernel/kmod/kmod_32.bb)7
4 files changed, 10 insertions, 152 deletions
diff --git a/meta/recipes-kernel/kmod/kmod/0001-Use-portable-implementation-for-basename-API.patch b/meta/recipes-kernel/kmod/kmod/0001-Use-portable-implementation-for-basename-API.patch
deleted file mode 100644
index 6a7f9ded4f..0000000000
--- a/meta/recipes-kernel/kmod/kmod/0001-Use-portable-implementation-for-basename-API.patch
+++ /dev/null
@@ -1,136 +0,0 @@
1From 721ed6040c7aa47070faf6378c433089e178bd43 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 9 Dec 2023 17:35:59 -0800
4Subject: [PATCH] Use portable implementation for basename API
5
6musl has removed the non-prototype declaration of basename from
7string.h [1] which now results in build errors with clang-17+ compiler
8
9Implement GNU basename behavior using strchr which is portable across libcs
10
11Fixes
12../git/tools/kmod.c:71:19: error: call to undeclared function 'basename'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
1371 | "Commands:\n", basename(argv[0]));
14| ^
15
16[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
17
18Upstream-Status: Submitted [https://github.com/kmod-project/kmod/pull/32]
19
20Suggested-by: Rich Felker
21
22Signed-off-by: Khem Raj <raj.khem@gmail.com>
23---
24 libkmod/libkmod-config.c | 2 +-
25 shared/util.c | 4 ++--
26 shared/util.h | 7 +++++++
27 testsuite/testsuite.c | 2 +-
28 tools/depmod.c | 2 +-
29 tools/kmod.c | 4 ++--
30 6 files changed, 14 insertions(+), 7 deletions(-)
31
32diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c
33index e83621b..8aa555a 100644
34--- a/libkmod/libkmod-config.c
35+++ b/libkmod/libkmod-config.c
36@@ -794,7 +794,7 @@ static int conf_files_insert_sorted(struct kmod_ctx *ctx,
37 bool is_single = false;
38
39 if (name == NULL) {
40- name = basename(path);
41+ name = gnu_basename(path);
42 is_single = true;
43 }
44
45diff --git a/shared/util.c b/shared/util.c
46index e2bab83..0e16670 100644
47--- a/shared/util.c
48+++ b/shared/util.c
49@@ -172,9 +172,9 @@ char *modname_normalize(const char *modname, char buf[static PATH_MAX], size_t *
50
51 char *path_to_modname(const char *path, char buf[static PATH_MAX], size_t *len)
52 {
53- char *modname;
54+ const char *modname;
55
56- modname = basename(path);
57+ modname = gnu_basename(path);
58 if (modname == NULL || modname[0] == '\0')
59 return NULL;
60
61diff --git a/shared/util.h b/shared/util.h
62index c4a3916..073dc5a 100644
63--- a/shared/util.h
64+++ b/shared/util.h
65@@ -5,6 +5,7 @@
66 #include <stdbool.h>
67 #include <stdlib.h>
68 #include <stdio.h>
69+#include <string.h>
70 #include <sys/types.h>
71 #include <sys/stat.h>
72 #include <time.h>
73@@ -76,6 +77,12 @@ do { \
74 __p->__v = (val); \
75 } while(0)
76
77+static _always_inline_ const char *gnu_basename(const char *s)
78+{
79+ const char *p = strrchr(s, '/');
80+ return p ? p+1 : s;
81+}
82+
83 static _always_inline_ unsigned int ALIGN_POWER2(unsigned int u)
84 {
85 return 1 << ((sizeof(u) * 8) - __builtin_clz(u - 1));
86diff --git a/testsuite/testsuite.c b/testsuite/testsuite.c
87index 318343a..aafc987 100644
88--- a/testsuite/testsuite.c
89+++ b/testsuite/testsuite.c
90@@ -70,7 +70,7 @@ static void help(void)
91
92 printf("Usage:\n"
93 "\t%s [options] <test>\n"
94- "Options:\n", basename(progname));
95+ "Options:\n", gnu_basename(progname));
96
97 for (itr = options, itr_short = options_short;
98 itr->name != NULL; itr++, itr_short++)
99diff --git a/tools/depmod.c b/tools/depmod.c
100index 43fc354..cfb15b1 100644
101--- a/tools/depmod.c
102+++ b/tools/depmod.c
103@@ -762,7 +762,7 @@ static int cfg_files_insert_sorted(struct cfg_file ***p_files, size_t *p_n_files
104 if (name != NULL)
105 namelen = strlen(name);
106 else {
107- name = basename(dir);
108+ name = gnu_basename(dir);
109 namelen = strlen(name);
110 dirlen -= namelen + 1;
111 }
112diff --git a/tools/kmod.c b/tools/kmod.c
113index 55689c0..df91e5c 100644
114--- a/tools/kmod.c
115+++ b/tools/kmod.c
116@@ -68,7 +68,7 @@ static int kmod_help(int argc, char *argv[])
117 "Options:\n"
118 "\t-V, --version show version\n"
119 "\t-h, --help show this help\n\n"
120- "Commands:\n", basename(argv[0]));
121+ "Commands:\n", gnu_basename(argv[0]));
122
123 for (i = 0; i < ARRAY_SIZE(kmod_cmds); i++) {
124 if (kmod_cmds[i]->help != NULL) {
125@@ -156,7 +156,7 @@ static int handle_kmod_compat_commands(int argc, char *argv[])
126 const char *cmd;
127 size_t i;
128
129- cmd = basename(argv[0]);
130+ cmd = gnu_basename(argv[0]);
131
132 for (i = 0; i < ARRAY_SIZE(kmod_compat_cmds); i++) {
133 if (streq(kmod_compat_cmds[i]->name, cmd))
134--
1352.43.0
136
diff --git a/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch b/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch
index 04a8204815..6db4fa7e97 100644
--- a/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch
+++ b/meta/recipes-kernel/kmod/kmod/avoid_parallel_tests.patch
@@ -1,4 +1,4 @@
1From be6f82c54f694617c646ca1f8b5bcf93694e20ad Mon Sep 17 00:00:00 2001 1From 7a22abf188e5b688080bb1321a77588474114339 Mon Sep 17 00:00:00 2001
2From: Tudor Florea <tudor.florea@enea.com> 2From: Tudor Florea <tudor.florea@enea.com>
3Date: Fri, 6 Sep 2013 21:11:57 +0000 3Date: Fri, 6 Sep 2013 21:11:57 +0000
4Subject: [PATCH] kmod: avoid parallel-tests 4Subject: [PATCH] kmod: avoid parallel-tests
@@ -11,16 +11,15 @@ serial-tests is now required
11 11
12Signed-off-by: Tudor Florea <tudor.florea@enea.com> 12Signed-off-by: Tudor Florea <tudor.florea@enea.com>
13Upstream-Status: Inappropriate (disable feature incompatible with ptest) 13Upstream-Status: Inappropriate (disable feature incompatible with ptest)
14
15--- 14---
16 configure.ac | 2 +- 15 configure.ac | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-) 16 1 file changed, 1 insertion(+), 1 deletion(-)
18 17
19diff --git a/configure.ac b/configure.ac 18diff --git a/configure.ac b/configure.ac
20index ee72283..60980c0 100644 19index 2f1c525..7056aae 100644
21--- a/configure.ac 20--- a/configure.ac
22+++ b/configure.ac 21+++ b/configure.ac
23@@ -14,8 +14,8 @@ AC_USE_SYSTEM_EXTENSIONS 22@@ -14,7 +14,7 @@ AC_USE_SYSTEM_EXTENSIONS
24 AC_SYS_LARGEFILE 23 AC_SYS_LARGEFILE
25 AC_PREFIX_DEFAULT([/usr]) 24 AC_PREFIX_DEFAULT([/usr])
26 AM_MAINTAINER_MODE([enable]) 25 AM_MAINTAINER_MODE([enable])
@@ -28,5 +27,4 @@ index ee72283..60980c0 100644
28+AM_INIT_AUTOMAKE([check-news foreign 1.11 silent-rules tar-pax no-dist-gzip dist-xz subdir-objects color-tests serial-tests]) 27+AM_INIT_AUTOMAKE([check-news foreign 1.11 silent-rules tar-pax no-dist-gzip dist-xz subdir-objects color-tests serial-tests])
29 AM_SILENT_RULES([yes]) 28 AM_SILENT_RULES([yes])
30 LT_INIT([disable-static pic-only]) 29 LT_INIT([disable-static pic-only])
31 30
32 AS_IF([test "x$enable_static" = "xyes"], [AC_MSG_ERROR([--enable-static is not supported by kmod])])
diff --git a/meta/recipes-kernel/kmod/kmod/gtkdocdir.patch b/meta/recipes-kernel/kmod/kmod/gtkdocdir.patch
index a34ea466e8..91d622b8c7 100644
--- a/meta/recipes-kernel/kmod/kmod/gtkdocdir.patch
+++ b/meta/recipes-kernel/kmod/kmod/gtkdocdir.patch
@@ -1,4 +1,4 @@
1From dd59095f70f774f6d1e767010e25b35ef6db4c4b Mon Sep 17 00:00:00 2001 1From 90fb7bb85002cde39de3b3d2e2481933390832af Mon Sep 17 00:00:00 2001
2From: Ross Burton <ross.burton@arm.com> 2From: Ross Burton <ross.burton@arm.com>
3Date: Fri, 8 Dec 2023 22:35:45 +0000 3Date: Fri, 8 Dec 2023 22:35:45 +0000
4Subject: [PATCH] configure: set docdir in GTK_DOC_CHECK 4Subject: [PATCH] configure: set docdir in GTK_DOC_CHECK
@@ -16,10 +16,10 @@ Signed-off-by: Ross Burton <ross.burton@arm.com>
16 1 file changed, 1 insertion(+), 1 deletion(-) 16 1 file changed, 1 insertion(+), 1 deletion(-)
17 17
18diff --git a/configure.ac b/configure.ac 18diff --git a/configure.ac b/configure.ac
19index de01e08..67696c4 100644 19index 7056aae..d53a20c 100644
20--- a/configure.ac 20--- a/configure.ac
21+++ b/configure.ac 21+++ b/configure.ac
22@@ -255,7 +255,7 @@ AS_IF([test "x$enable_coverage" = "xyes"], [ 22@@ -236,7 +236,7 @@ AS_IF([test "x$enable_coverage" = "xyes"], [
23 AM_CONDITIONAL([ENABLE_COVERAGE], [test "x$enable_coverage" = "xyes"]) 23 AM_CONDITIONAL([ENABLE_COVERAGE], [test "x$enable_coverage" = "xyes"])
24 24
25 m4_ifdef([GTK_DOC_CHECK], [ 25 m4_ifdef([GTK_DOC_CHECK], [
@@ -28,6 +28,3 @@ index de01e08..67696c4 100644
28 ], [ 28 ], [
29 AM_CONDITIONAL([ENABLE_GTK_DOC], false)]) 29 AM_CONDITIONAL([ENABLE_GTK_DOC], false)])
30 30
31--
322.34.1
33
diff --git a/meta/recipes-kernel/kmod/kmod_32.bb b/meta/recipes-kernel/kmod/kmod_33.bb
index 1c4e5a94db..15f42766f3 100644
--- a/meta/recipes-kernel/kmod/kmod_32.bb
+++ b/meta/recipes-kernel/kmod/kmod_33.bb
@@ -13,14 +13,13 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
13 file://libkmod/COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \ 13 file://libkmod/COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343 \
14 file://tools/COPYING;md5=751419260aa954499f7abaabaa882bbe \ 14 file://tools/COPYING;md5=751419260aa954499f7abaabaa882bbe \
15 " 15 "
16inherit autotools bash-completion gtk-doc pkgconfig manpages update-alternatives 16inherit autotools bash-completion gtk-doc pkgconfig update-alternatives
17 17
18SRCREV = "41faa59711742c1476d59985011ee0f27ed91d30" 18SRCREV = "e193aeb99a04fb4b63ce47eb2c7f119db59446a0"
19 19
20SRC_URI = "git://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git;branch=master;protocol=https \ 20SRC_URI = "git://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git;branch=master;protocol=https \
21 file://depmod-search.conf \ 21 file://depmod-search.conf \
22 file://avoid_parallel_tests.patch \ 22 file://avoid_parallel_tests.patch \
23 file://0001-Use-portable-implementation-for-basename-API.patch \
24 file://gtkdocdir.patch \ 23 file://gtkdocdir.patch \
25 " 24 "
26 25
@@ -31,7 +30,7 @@ EXTRA_OECONF += "--enable-tools"
31PACKAGECONFIG ??= "zlib xz openssl" 30PACKAGECONFIG ??= "zlib xz openssl"
32PACKAGECONFIG[debug] = "--enable-debug,--disable-debug" 31PACKAGECONFIG[debug] = "--enable-debug,--disable-debug"
33PACKAGECONFIG[logging] = " --enable-logging,--disable-logging" 32PACKAGECONFIG[logging] = " --enable-logging,--disable-logging"
34PACKAGECONFIG[manpages] = "--enable-manpages, --disable-manpages, libxslt-native xmlto-native" 33PACKAGECONFIG[manpages] = "--enable-manpages, --disable-manpages, scdoc-native"
35PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl" 34PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl"
36PACKAGECONFIG[xz] = "--with-xz,--without-xz,xz" 35PACKAGECONFIG[xz] = "--with-xz,--without-xz,xz"
37PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib" 36PACKAGECONFIG[zlib] = "--with-zlib,--without-zlib,zlib"