SHA256
1
0
forked from pool/kmod
This commit is contained in:
Jan Engelhardt 2025-02-22 00:38:46 +01:00
parent c0d997b9f8
commit 8937595f47
14 changed files with 199 additions and 175 deletions

View File

@ -0,0 +1,53 @@
From a8a2fd5a84a74726e11edb92ac20b5c5918b2edd Mon Sep 17 00:00:00 2001
From: Jan Engelhardt <jengelh@inai.de>
Date: Sat, 22 Feb 2025 00:17:40 +0100
Subject: [PATCH] build: resolve build failure due to missing include
On openSUSE Tumbleweed with gcc-14.2.1, I observe:
```
libtool: compile: gcc -DHAVE_CONFIG_H -I. -include ./config.h -I.
-DSYSCONFDIR=\"/etc\" -DDISTCONFDIR=\"/usr/lib\"
-DMODULE_DIRECTORY=\"/usr/lib/modules\" -pipe -fdata-sections
-fdiagnostics-show-option -ffunction-sections -fno-common -fvisibility=hidden
-W -Wall -Wchar-subscripts -Wdeclaration-after-statement -Wendif-labels -Wextra
-Wfloat-equal -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations
-Wmissing-include-dirs -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs
-Wno-unused-parameter -Wold-style-definition -Wpointer-arith -Wredundant-decls
-Wshadow -Wsign-compare -Wstrict-aliasing=3 -Wstrict-prototypes -Wtype-limits
-Wundef -Wuninitialized -Wvla -Wwrite-strings -O2 -Wall -U_FORTIFY_SOURCE
-D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables
-fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type
-flto=auto -g -c libkmod/libkmod-unsupported.c -fPIC -DPIC -o
libkmod/.libs/libkmod-unsupported.o
In file included from libkmod/libkmod-internal.h:8,
from libkmod/libkmod-unsupported.c:1:
shared/macro.h: In function 'freep':
shared/macro.h:69:9: error: implicit declaration of function 'free'
[-Wimplicit-function-declaration]
69 | free(*(void **)p);
shared/macro.h:69:9: warning: incompatible implicit declaration of built-in
function 'free' [-Wbuiltin-declaration-mismatch]
69 | free(*(void **)p);
shared/macro.h:69:9: note: include '<stdlib.h>' or provide a declaration of 'free'
make[2]: *** [Makefile:1597: libkmod/libkmod-unsupported.lo] Error 1
```
---
shared/macro.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/shared/macro.h b/shared/macro.h
index 8829d0b..e684884 100644
--- a/shared/macro.h
+++ b/shared/macro.h
@@ -5,6 +5,7 @@
#pragma once
#include <stddef.h>
+#include <stdlib.h>
#if defined(HAVE_STATIC_ASSERT)
#define assert_cc(expr) _Static_assert((expr), #expr)
--
2.48.1

View File

@ -1,31 +0,0 @@
From 590074281e8463128ac92ed2640405cd05b10cb1 Mon Sep 17 00:00:00 2001
From: Christian Hesse <mail@eworm.de>
Date: Wed, 14 Aug 2024 09:58:16 +0200
Subject: [PATCH] testsuite: fix path for test-user
... as this just does not find its paths.
Closes: https://github.com/kmod-project/kmod/issues/69
Fixes: 9d1fb31 ("libkmod, depmod, modprobe: Make directory for kernel modules configurable")
Signed-off-by: Christian Hesse <mail@eworm.de>
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
---
testsuite/test-user.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/testsuite/test-user.c b/testsuite/test-user.c
index 97a4747..0db48c3 100644
--- a/testsuite/test-user.c
+++ b/testsuite/test-user.c
@@ -16,7 +16,7 @@
#include "testsuite.h"
#define TEST_USER_ROOTFS TESTSUITE_ROOTFS "test-user/"
-#define TEST_USER_KERNEL_DIR TEST_USER_ROOTFS "lib/modules/4.4.4/"
+#define TEST_USER_KERNEL_DIR TEST_USER_ROOTFS MODULE_DIRECTORY "/4.4.4/"
static const char *const test_user_config_paths[] = {
TEST_USER_ROOTFS "etc/modprobe.d",
--
2.46.0

View File

@ -13,11 +13,11 @@ Patch-mainline: never
tools/modprobe.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tools/modprobe.c b/tools/modprobe.c
index a9e2331..3be2989 100644
--- a/tools/modprobe.c
+++ b/tools/modprobe.c
@@ -85,6 +85,8 @@ static const struct option cmdopts[] = {
Index: kmod-34/tools/modprobe.c
===================================================================
--- kmod-34.orig/tools/modprobe.c
+++ kmod-34/tools/modprobe.c
@@ -78,6 +78,8 @@ static const struct option cmdopts[] = {
{ "dirname", required_argument, 0, 'd' },
{ "set-version", required_argument, 0, 'S' },
@ -26,7 +26,7 @@ index a9e2331..3be2989 100644
{ "syslog", no_argument, 0, 's' },
{ "quiet", no_argument, 0, 'q' },
{ "verbose", no_argument, 0, 'v' },
@@ -843,6 +845,9 @@ static int do_modprobe(int argc, char **orig_argv)
@@ -859,6 +861,9 @@ static int do_modprobe(int argc, char **
case 'S':
kversion = optarg;
break;
@ -35,7 +35,4 @@ index a9e2331..3be2989 100644
+ break;
case 's':
env_modprobe_options_append("-s");
use_syslog = 1;
--
2.20.1
use_syslog = true;

View File

@ -10,12 +10,12 @@ Patch-mainline: never
libkmod/libkmod-config.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c
index aaac0a1..1b24536 100644
--- a/libkmod/libkmod-config.c
+++ b/libkmod/libkmod-config.c
@@ -650,6 +650,9 @@ static int kmod_config_parse(struct kmod_config *config, int fd,
|| streq(cmd, "config")) {
Index: kmod-34/libkmod/libkmod-config.c
===================================================================
--- kmod-34.orig/libkmod/libkmod-config.c
+++ kmod-34/libkmod/libkmod-config.c
@@ -855,6 +855,9 @@ static int kmod_config_parse(struct kmod
} else if (streq(cmd, "include") || streq(cmd, "config")) {
ERR(ctx, "%s: command %s is deprecated and not parsed anymore\n",
filename, cmd);
+ } else if (streq(cmd, "allow_unsupported_modules")) {
@ -24,6 +24,3 @@ index aaac0a1..1b24536 100644
} else {
syntax_error:
ERR(ctx, "%s line %u: ignoring bad line starting with '%s'\n",
--
2.20.1

View File

@ -12,11 +12,11 @@ Patch-mainline: never
libkmod/libkmod-module.c | 31 +++++++++++++++++++++++++++++++
3 files changed, 42 insertions(+), 2 deletions(-)
Index: kmod-33/libkmod/libkmod-config.c
Index: kmod-34/libkmod/libkmod-config.c
===================================================================
--- kmod-33.orig/libkmod/libkmod-config.c
+++ kmod-33/libkmod/libkmod-config.c
@@ -869,8 +869,16 @@ static int kmod_config_parse(struct kmod
--- kmod-34.orig/libkmod/libkmod-config.c
+++ kmod-34/libkmod/libkmod-config.c
@@ -856,8 +856,16 @@ static int kmod_config_parse(struct kmod
ERR(ctx, "%s: command %s is deprecated and not parsed anymore\n",
filename, cmd);
} else if (streq(cmd, "allow_unsupported_modules")) {
@ -35,23 +35,23 @@ Index: kmod-33/libkmod/libkmod-config.c
} else {
syntax_error:
ERR(ctx, "%s line %u: ignoring bad line starting with '%s'\n",
Index: kmod-33/libkmod/libkmod-internal.h
Index: kmod-34/libkmod/libkmod-internal.h
===================================================================
--- kmod-33.orig/libkmod/libkmod-internal.h
+++ kmod-33/libkmod/libkmod-internal.h
@@ -131,6 +131,7 @@ struct kmod_config {
--- kmod-34.orig/libkmod/libkmod-internal.h
+++ kmod-34/libkmod/libkmod-internal.h
@@ -105,6 +105,7 @@ struct kmod_config {
struct kmod_list *weakdeps;
struct kmod_list *paths;
+ int block_unsupported;
};
int kmod_config_new(struct kmod_ctx *ctx, struct kmod_config **config, const char * const *config_paths) __attribute__((nonnull(1, 2,3)));
Index: kmod-33/libkmod/libkmod-module.c
_nonnull_all_ int kmod_config_new(struct kmod_ctx *ctx, struct kmod_config **config, const char * const *config_paths);
Index: kmod-34/libkmod/libkmod-module.c
===================================================================
--- kmod-33.orig/libkmod/libkmod-module.c
+++ kmod-33/libkmod/libkmod-module.c
@@ -767,6 +767,24 @@ KMOD_EXPORT const char *kmod_module_get_
--- kmod-34.orig/libkmod/libkmod-module.c
+++ kmod-34/libkmod/libkmod-module.c
@@ -568,6 +568,24 @@ KMOD_EXPORT const char *kmod_module_get_
return mod->name;
}
@ -62,7 +62,7 @@ Index: kmod-33/libkmod/libkmod-module.c
+ struct kmod_elf *elf;
+
+ elf = kmod_file_get_elf(mod->file);
+ count = kmod_elf_get_strings(elf, ".modinfo", &strings);
+ count = kmod_elf_get_modinfo_strings(elf, &strings);
+ if (count < 0)
+ return count;
+ for (i = 0; i < count; i++)
@ -73,10 +73,10 @@ Index: kmod-33/libkmod/libkmod-module.c
+ return 0;
+}
+
/**
* kmod_module_get_path:
* @mod: kmod module
@@ -947,6 +965,7 @@ KMOD_EXPORT int kmod_module_insert_modul
KMOD_EXPORT const char *kmod_module_get_path(const struct kmod_module *mod)
{
if (mod == NULL)
@@ -690,6 +708,7 @@ KMOD_EXPORT int kmod_module_insert_modul
int err;
const char *path;
const char *args = options ? options : "";
@ -84,7 +84,7 @@ Index: kmod-33/libkmod/libkmod-module.c
if (mod == NULL)
return -ENOENT;
@@ -965,6 +984,18 @@ KMOD_EXPORT int kmod_module_insert_modul
@@ -708,6 +727,18 @@ KMOD_EXPORT int kmod_module_insert_modul
}
}

View File

@ -9,15 +9,17 @@ Patch-mainline: never
Makefile.am | 4 +++-
libkmod/libkmod-unsupported.c | 9 +++++++++
libkmod/libkmod-unsupported.h | 8 ++++++++
shared/macro.h | 1 +
tools/modprobe.c | 8 +++++++-
4 files changed, 27 insertions(+), 2 deletions(-)
5 files changed, 28 insertions(+), 2 deletions(-)
create mode 100644 libkmod/libkmod-unsupported.c
create mode 100644 libkmod/libkmod-unsupported.h
diff -u kmod-28.orig/Makefile.am kmod-28/Makefile.am
--- kmod-28.orig/Makefile.am 2021-01-07 19:29:12.972438665 +0100
+++ kmod-28/Makefile.am 2021-01-28 12:59:16.613421834 +0100
@@ -108,7 +108,9 @@
Index: kmod-34/Makefile.am
===================================================================
--- kmod-34.orig/Makefile.am
+++ kmod-34/Makefile.am
@@ -113,7 +113,9 @@ libkmod_libkmod_la_LIBADD = \
${libzstd_LIBS} ${liblzma_LIBS} ${zlib_LIBS} ${libcrypto_LIBS}
noinst_LTLIBRARIES += libkmod/libkmod-internal.la
@ -28,10 +30,10 @@ diff -u kmod-28.orig/Makefile.am kmod-28/Makefile.am
libkmod_libkmod_internal_la_LDFLAGS = $(AM_LDFLAGS) \
-Wl,--version-script=$(top_srcdir)/libkmod/libkmod.sym
libkmod_libkmod_internal_la_DEPENDENCIES = $(libkmod_libkmod_la_DEPENDENCIES)
Index: kmod-27/libkmod/libkmod-unsupported.c
Index: kmod-34/libkmod/libkmod-unsupported.c
===================================================================
--- /dev/null
+++ kmod-27/libkmod/libkmod-unsupported.c
+++ kmod-34/libkmod/libkmod-unsupported.c
@@ -0,0 +1,9 @@
+#include "libkmod-internal.h"
+#include "libkmod-unsupported.h"
@ -42,10 +44,10 @@ Index: kmod-27/libkmod/libkmod-unsupported.c
+
+ config->block_unsupported = 0;
+}
Index: kmod-27/libkmod/libkmod-unsupported.h
Index: kmod-34/libkmod/libkmod-unsupported.h
===================================================================
--- /dev/null
+++ kmod-27/libkmod/libkmod-unsupported.h
+++ kmod-34/libkmod/libkmod-unsupported.h
@@ -0,0 +1,8 @@
+#pragma once
+
@ -55,20 +57,32 @@ Index: kmod-27/libkmod/libkmod-unsupported.h
+ * library
+ */
+void kmod_internal_allow_unsupported(struct kmod_ctx *ctx);
Index: kmod-27/tools/modprobe.c
Index: kmod-34/shared/macro.h
===================================================================
--- kmod-27.orig/tools/modprobe.c
+++ kmod-27/tools/modprobe.c
@@ -38,6 +38,8 @@
--- kmod-34.orig/shared/macro.h
+++ kmod-34/shared/macro.h
@@ -5,6 +5,7 @@
#pragma once
#include <stddef.h>
+#include <stdlib.h>
#if defined(HAVE_STATIC_ASSERT)
#define assert_cc(expr) _Static_assert((expr), #expr)
Index: kmod-34/tools/modprobe.c
===================================================================
--- kmod-34.orig/tools/modprobe.c
+++ kmod-34/tools/modprobe.c
@@ -27,6 +27,8 @@
#include "kmod.h"
+#include "libkmod/libkmod-unsupported.h"
+
static int log_priority = LOG_CRIT;
static int use_syslog = 0;
#define LOG(...) log_printf(log_priority, __VA_ARGS__)
@@ -761,6 +763,7 @@ static int do_modprobe(int argc, char **
@@ -759,6 +761,7 @@ static int do_modprobe(int argc, char **
const char *dirname = NULL;
const char *root = NULL;
const char *kversion = NULL;
@ -76,7 +90,7 @@ Index: kmod-27/tools/modprobe.c
int use_all = 0;
int do_remove = 0;
int do_show_config = 0;
@@ -852,7 +855,7 @@ static int do_modprobe(int argc, char **
@@ -862,7 +865,7 @@ static int do_modprobe(int argc, char **
kversion = optarg;
break;
case 128:
@ -85,7 +99,7 @@ Index: kmod-27/tools/modprobe.c
break;
case 's':
env_modprobe_options_append("-s");
@@ -925,6 +928,9 @@ static int do_modprobe(int argc, char **
@@ -944,6 +947,9 @@ static int do_modprobe(int argc, char **
log_setup_kmod_log(ctx, verbose);

View File

@ -18,13 +18,13 @@ Patch-mainline: never
tools/modprobe.c | 5 +++++
3 files changed, 19 insertions(+)
diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c
index 550a612..0fc2250 100644
--- a/libkmod/libkmod-config.c
+++ b/libkmod/libkmod-config.c
@@ -1008,6 +1008,19 @@ static struct kmod_config_iter *kmod_config_iter_new(const struct kmod_ctx* ctx,
* @short_description: retrieve current libkmod configuration
*/
Index: kmod-34/libkmod/libkmod-config.c
===================================================================
--- kmod-34.orig/libkmod/libkmod-config.c
+++ kmod-34/libkmod/libkmod-config.c
@@ -1204,6 +1204,19 @@ static struct kmod_config_iter *kmod_con
return iter;
}
+/*
+ * kmod_config_unsupported_allowed:
@ -39,26 +39,26 @@ index 550a612..0fc2250 100644
+ return !config->block_unsupported;
+}
+
/**
* kmod_config_get_blacklists:
* @ctx: kmod library context
diff --git a/libkmod/libkmod.h b/libkmod/libkmod.h
index 352627e..c2b9657 100644
--- a/libkmod/libkmod.h
+++ b/libkmod/libkmod.h
@@ -115,6 +115,7 @@ const char *kmod_config_iter_get_key(const struct kmod_config_iter *iter);
const char *kmod_config_iter_get_value(const struct kmod_config_iter *iter);
bool kmod_config_iter_next(struct kmod_config_iter *iter);
KMOD_EXPORT struct kmod_config_iter *kmod_config_get_blacklists(const struct kmod_ctx *ctx)
{
if (ctx == NULL)
Index: kmod-34/libkmod/libkmod.h
===================================================================
--- kmod-34.orig/libkmod/libkmod.h
+++ kmod-34/libkmod/libkmod.h
@@ -530,6 +530,7 @@ bool kmod_config_iter_next(struct kmod_c
* Since: 4
*/
void kmod_config_iter_free_iter(struct kmod_config_iter *iter);
+bool kmod_config_unsupported_allowed(const struct kmod_ctx *ctx);
/*
* kmod_module
diff --git a/tools/modprobe.c b/tools/modprobe.c
index aa4033d..4f1c54a 100644
--- a/tools/modprobe.c
+++ b/tools/modprobe.c
@@ -201,6 +201,11 @@ static int show_config(struct kmod_ctx *ctx)
/**
* SECTION:libkmod-module
Index: kmod-34/tools/modprobe.c
===================================================================
--- kmod-34.orig/tools/modprobe.c
+++ kmod-34/tools/modprobe.c
@@ -198,6 +198,11 @@ static int show_config(struct kmod_ctx *
kmod_config_iter_free_iter(iter);
}
@ -70,6 +70,3 @@ index aa4033d..4f1c54a 100644
puts("\n# End of configuration files. Dumping indexes now:\n");
fflush(stdout);
--
2.20.1

View File

@ -1,16 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEE6rM8lpABPHM5FqyDm6KlpjDL6lMFAma7li4ACgkQm6KlpjDL
6lM6OA//W5nsBow53HlqVH4I4uPO743SREE469uT0t9rF43IY+rngUNQAZGA9RP+
rw+vy4/v3uJ5YhZd6Z2mdPZFoG8WfM8xxhDhjhyZXpBlDCf9sp+hxZTG3/2Y5qy8
j0RUWwnunYzIAu+icLI1Svtq3ksp/7Il5nXYoPKVnEFxMN/y7bpbniac20osvsx4
gzJEQrNUwDlWx10jm+C2ijWFrdCEAZd8wBfDVWIZPzXxPrzGZULvkYVTe4MZ8y4p
1gWW6MTJU8ayiAJjM29RFqY2oPWLUw9hocCHDlsNuhMJ2mam+n9qSeWy7vgHm1F4
LUR90Kx9z0AUiwYS4tAQUHbfg/NJlhVjeMGG9jBsU4bjV/ljX6ofnweAPokKRvrt
ehdzJpwvbBa2FdVyQ7WCiIo5Rf7Ry73BE5KsmGrhDWtun+DMYiYPCMQJdNWs0mXb
KDBe4A8hKU3NIRzXl7X/bPNIkMc0SFD2RuS10SqQbKS23LwGVqtwBfhrsHmD95fA
cZiT+hSjBHC/ixlF36SzlBSLgQlPmfcbmvz5WIrs9GVJ720vYrKqsOhA5LVovmjd
jUkRaQPoKb3RVeX7J8QCPYU5/3/wysSYk8NekGW4id5kc8Pk6W4/+TB7kGkk/bkT
Xbg3r3BFy7s+mWv7BG1N51XKWaF18RcrI3mTNLrxuJe6MeNczDo=
=Feot
-----END PGP SIGNATURE-----

BIN
kmod-33.tar.xz (Stored with Git LFS)

Binary file not shown.

16
kmod-34.tar.sign Normal file
View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEE6rM8lpABPHM5FqyDm6KlpjDL6lMFAme45F4ACgkQm6KlpjDL
6lPi9RAAj8FyJYcqVfZp4oOf36HGw9YXaaKWQcEBXys9UHFXWv553Gdh7pYkCSS4
oUX4kEe6yBuZi1k/WXxpttqSuL8gY9hEk7zLGeXzqttX3RuN2FkKPca2LSSFotMO
uUTWGI7exdG+FzyJFJQQftuCRni5+SxzvI11hkoTPaLWCuiCZgxI1w2AooT1kf84
esIvWp5z1c8ih4rVA2zy+cJUeCauvUN/R3G6SLE0IZjgSPErbUG24Gb1j0Rx5XHS
K9svzwiKxWZG77W9JkNnsi0zKxsbw5UvfViKdMPlq6Ypr7eJCHIMufYqj3YHjX7w
E6valX6KX9F5Scwu/84TUYEMm0BWCQZ9NaMvj4RYYlWnQLk1dR3b2K53SP8c6TKM
m9H03nRB6CN1SuNPxTCu47D22asgJE+5g+KAio/ALfvBmPRdSKniNiWAnjCeMqwl
QT2TeP3g4BhbqEgg3JTVDTChXItkfwRsRzUQJdnyJQzOC2OnO2qfk09PqFjxgyhq
M6IovupdO4iZs30kkG/gb+4sWXKqUYkGQrUWCgrhA6B7UdEgPyejDvBD1K0VhWbu
aO60cVoWvznvreylXN+Q/4BTOHWBkyQdoiLqWDfTST7aH8NvNKIpEDb46hfuKT5P
ZZ0o5OZFkHPzBC9bOtIBpk25FvxEDNRvJhF12co8UIu/cs0JbXE=
=jtsg
-----END PGP SIGNATURE-----

BIN
kmod-34.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -1,7 +1,7 @@
#
# spec file for package kmod-testsuite
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -22,7 +22,7 @@
Name: kmod-testsuite
%define lname libkmod2
Version: 33
Version: 34
Release: 0
Summary: Testsuite of the kmod package
License: GPL-2.0-or-later AND LGPL-2.1-or-later
@ -40,7 +40,6 @@ Patch3: 0009-libkmod-Implement-filtering-of-unsupported-modules-o.patch
Patch4: 0010-modprobe-Implement-allow-unsupported-modules.patch
Patch5: 0011-Do-not-filter-unsupported-modules-when-running-a-van.patch
Patch6: 0012-modprobe-print-unsupported-status.patch
Patch7: 0001-testsuite-fix-path-for-test-user.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: docbook-xsl-stylesheets
@ -72,6 +71,8 @@ buildloop with the kernel.
%autopatch -p1
%build
rm -f m4/gtk-doc.m4 libkmod/docs/gtk-doc.make # dangling symlinks
touch m4/gtk-doc.m4 libkmod/docs/gtk-doc.make
GTKDOCIZE=/bin/true autoreconf -fi
export LDFLAGS="-Wl,-z,relro,-z,now"
# The extra --includedir gives us the possibility to detect dependent

View File

@ -1,3 +1,18 @@
-------------------------------------------------------------------
Fri Feb 21 22:41:36 UTC 2025 - Jan Engelhardt <jengelh@inai.de>
- Update to release 34
* modinfo now dlopens compression libraries, and only if needed.
(insmod/modprobe exercises the kernel's built-in decompression
anyway, so is unaffected).
* depmod: add -m option for overriding the module directory at
runtime.
* depmod: deleted deprecated options --unresolved-error, --quiet,
-root and --map.
* rmmod: deleted deprecated option -w.
* insmod: deleted deprecated options -p, -s.
- Delete 0001-testsuite-fix-path-for-test-user.patch (obsolete)
-------------------------------------------------------------------
Wed Aug 21 21:19:38 UTC 2024 - Jan Engelhardt <jengelh@inai.de>

View File

@ -1,7 +1,7 @@
#
# spec file for package kmod
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -22,7 +22,7 @@
Name: kmod
%define lname libkmod2
Version: 33
Version: 34
Release: 0
Summary: Utilities to load modules into the kernel
License: GPL-2.0-or-later AND LGPL-2.1-or-later
@ -41,7 +41,6 @@ Patch3: 0009-libkmod-Implement-filtering-of-unsupported-modules-o.patch
Patch4: 0010-modprobe-Implement-allow-unsupported-modules.patch
Patch5: 0011-Do-not-filter-unsupported-modules-when-running-a-van.patch
Patch6: 0012-modprobe-print-unsupported-status.patch
Patch7: 0001-testsuite-fix-path-for-test-user.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libopenssl-devel >= 1.1.0
@ -66,6 +65,8 @@ Requires: suse-module-tools
Obsoletes: module-init-tools < 3.16
Provides: module-init-tools = 3.16
Provides: modutils
Obsoletes: %name-bash-completion < %version-%release
Provides: %name-bash-completion = %version-%release
%description
kmod is a set of tools to handle common tasks with Linux kernel
@ -76,18 +77,6 @@ These tools are designed on top of libkmod, a library that is shipped
with kmod. The aim is to be compatible with tools, configurations and
indexes from module-init-tools project.
%package bash-completion
Summary: Bash completion routines for the kmod utilities
License: GPL-2.0-or-later AND LGPL-2.1-or-later
Group: System/Shells
BuildArch: noarch
Requires: %{name}
Requires: bash-completion
Supplements: (%{name} and bash-completion)
%description bash-completion
Contains bash completion support for kmod utilities.
%package -n %lname
Summary: Library to interact with Linux kernel modules
License: LGPL-2.1-or-later
@ -115,6 +104,8 @@ in %lname.
cp %{SOURCE4} .
%build
rm -f m4/gtk-doc.m4 libkmod/docs/gtk-doc.make # dangling symlinks
touch m4/gtk-doc.m4 libkmod/docs/gtk-doc.make
GTKDOCIZE=/bin/true autoreconf -fi
export LDFLAGS="-Wl,-z,relro,-z,now"
# The extra --includedir gives us the possibility to detect dependent
@ -138,15 +129,6 @@ export LDFLAGS="-Wl,-z,relro,-z,now"
b="%buildroot"
%make_install
rm -f "$b/%_libdir"/*.la
mkdir -p "$b/%_sbindir" "$b/sbin"
for i in depmod insmod lsmod modinfo modprobe rmmod; do
ln -s "%_bindir/kmod" "$b/%_sbindir/$i"
rm "$b/%_bindir/$i"
%if 0%{?suse_version} < 1550
ln -s "%_bindir/kmod" "$b/sbin/$i"
%endif
done
mkdir -p "$b/%_bindir" "$b/bin"
for i in lsmod; do
ln -s "%_bindir/kmod" "$b/%_bindir/$i"
@ -161,8 +143,7 @@ done
%posttrans
%{?regenerate_initrd_posttrans}
%post -n %lname -p /sbin/ldconfig
%postun -n %lname -p /sbin/ldconfig
%ldconfig_scriptlets -n %lname
%files
%if 0%{?suse_version} > 1500
@ -187,9 +168,9 @@ done
/sbin/modprobe
/sbin/rmmod
%endif
%files bash-completion
%_datadir/bash-completion/
%_datadir/fish/
%_datadir/zsh/
%files -n %lname
%_libdir/libkmod.so.2*