From 2c6f4a5b52b9314519a92c2aa5053136091680ab9add69c2eefb391da826251f Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sun, 13 Aug 2023 21:35:48 +0000 Subject: [PATCH] Accepting request 1103710 from home:michals - Remove compatibility patches, add README.usrmerge (boo#1212835). * Delete Provide-fallback-for-successfully-running-make-modules_install.patch * Delete compat-module_directory-module_prefix.patch OBS-URL: https://build.opensuse.org/request/show/1103710 OBS-URL: https://build.opensuse.org/package/show/Base:System/kmod?expand=0&rev=229 --- ...ssfully-running-make-modules_install.patch | 33 ------- README.usrmerge | 9 ++ compat-module_directory-module_prefix.patch | 91 ------------------- kmod-testsuite.spec | 4 +- kmod.changes | 7 ++ kmod.spec | 9 +- 6 files changed, 23 insertions(+), 130 deletions(-) delete mode 100644 Provide-fallback-for-successfully-running-make-modules_install.patch create mode 100644 README.usrmerge delete mode 100644 compat-module_directory-module_prefix.patch diff --git a/Provide-fallback-for-successfully-running-make-modules_install.patch b/Provide-fallback-for-successfully-running-make-modules_install.patch deleted file mode 100644 index 8fca929..0000000 --- a/Provide-fallback-for-successfully-running-make-modules_install.patch +++ /dev/null @@ -1,33 +0,0 @@ -From e15c268ba92d53dbb97fa0211696226656780713 Mon Sep 17 00:00:00 2001 -From: Jan Engelhardt -Date: Sun, 16 Jul 2023 15:55:38 +0000 -Subject: [PATCH 6/7] Provide fallback for successfully running `make - modules_install` in pristine tarballs. - ---- - tools/depmod.c | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/tools/depmod.c b/tools/depmod.c -index 5ef490473186..70cfefb81005 100644 ---- a/tools/depmod.c -+++ b/tools/depmod.c -@@ -3030,6 +3030,15 @@ static int do_depmod(int argc, char *argv[]) - cfg.outdirnamelen = snprintf(cfg.outdirname, PATH_MAX, - "%s" MODULE_DIRECTORY "/%s", - out_root ?: (root ?: ""), cfg.kversion); -+ struct stat sb; -+ if (stat(cfg.dirname, &sb) != 0) { -+ cfg.dirnamelen = snprintf(cfg.dirname, PATH_MAX, -+ "%s/lib/modules/%s", -+ root ?: "", cfg.kversion); -+ cfg.outdirnamelen = snprintf(cfg.outdirname, PATH_MAX, -+ "%s/lib/modules/%s", -+ out_root ?: (root ?: ""), cfg.kversion); -+ } - - if (optind == argc) - all = 1; --- -2.41.0 - diff --git a/README.usrmerge b/README.usrmerge new file mode 100644 index 0000000..8f377ab --- /dev/null +++ b/README.usrmerge @@ -0,0 +1,9 @@ +The Tumbleweed kmod and kernel are patched to install modules into +/usr/lib/modules (the --with-module-directory configure argument.) + +This is not compatible with upstream kernel, and upstream rejected patch to +make the kernel build system detect this. Suggested solution is to use + +make MODLIB='$(INSTALL_MOD_PATH)/usr/lib/modules/$(KERNELRELEASE)' + +when building the upstream kernel. diff --git a/compat-module_directory-module_prefix.patch b/compat-module_directory-module_prefix.patch deleted file mode 100644 index 8ddd3d4..0000000 --- a/compat-module_directory-module_prefix.patch +++ /dev/null @@ -1,91 +0,0 @@ -From 004a365112b56402cca5d0097fccb74d38490aeb Mon Sep 17 00:00:00 2001 -From: Michal Suchanek -Date: Mon, 17 Jul 2023 12:56:45 +0200 -Subject: [PATCH 7/7] compat: module_directory -> module_prefix - -Signed-off-by: Michal Suchanek ---- - Makefile.am | 1 + - configure.ac | 10 ++++++++++ - tools/kmod.c | 15 +++++++++++++++ - 3 files changed, 26 insertions(+) - -diff --git a/Makefile.am b/Makefile.am -index 1d51a43d68ba..e0df13c589bc 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -20,6 +20,7 @@ AM_CPPFLAGS = \ - -I$(top_srcdir) \ - -DSYSCONFDIR=\""$(sysconfdir)"\" \ - -DDISTCONFDIR=\""$(distconfdir)"\" \ -+ -DMODULE_PREFIX=\""$(module_prefix)"\" \ - -DMODULE_DIRECTORY=\""$(module_directory)"\" \ - ${zlib_CFLAGS} - -diff --git a/configure.ac b/configure.ac -index 602d3d3dbdf1..a1e64e190d2f 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -96,6 +96,15 @@ AC_ARG_WITH([module_directory], - [], [with_module_directory=/lib/modules]) - AC_SUBST([module_directory], [$with_module_directory]) - -+case $module_directory in -+ /lib/modules) -+ with_module_prefix="" -+ AC_SUBST([module_prefix], [$with_module_prefix]);; -+ */lib/modules) with_module_prefix=$(dirname $with_module_directory) -+ with_module_prefix=$(dirname $with_module_prefix) -+ AC_SUBST([module_prefix], [$with_module_prefix]);; -+esac -+ - AC_ARG_WITH([zstd], - AS_HELP_STRING([--with-zstd], [handle Zstandard-compressed modules @<:@default=disabled@:>@]), - [], [with_zstd=no]) -@@ -324,6 +333,7 @@ AC_MSG_RESULT([ - - module_directory: ${module_directory} - prefix: ${prefix} -+ module_prefix: ${module_prefix} - sysconfdir: ${sysconfdir} - distconfdir: ${distconfdir} - libdir: ${libdir} -diff --git a/tools/kmod.c b/tools/kmod.c -index 55689c075ab1..1ab62e86116e 100644 ---- a/tools/kmod.c -+++ b/tools/kmod.c -@@ -37,9 +37,11 @@ static const struct option options[] = { - }; - - static const struct kmod_cmd kmod_cmd_help; -+static const struct kmod_cmd kmod_cmd_config; - - static const struct kmod_cmd *kmod_cmds[] = { - &kmod_cmd_help, -+ &kmod_cmd_config, - &kmod_cmd_list, - &kmod_cmd_static_nodes, - -@@ -95,6 +97,19 @@ static const struct kmod_cmd kmod_cmd_help = { - .help = "Show help message", - }; - -+static int kmod_config(int argc, char *argv[]) -+{ -+ printf("{\"module_prefix\":\"" MODULE_PREFIX "\"}\n"); -+ -+ return EXIT_SUCCESS; -+} -+ -+static const struct kmod_cmd kmod_cmd_config = { -+ .name = "config", -+ .cmd = kmod_config, -+ .help = "Show compile time options in JSON", -+}; -+ - static int handle_kmod_commands(int argc, char *argv[]) - { - const char *cmd; --- -2.41.0 - diff --git a/kmod-testsuite.spec b/kmod-testsuite.spec index 097a6b7..c123cb8 100644 --- a/kmod-testsuite.spec +++ b/kmod-testsuite.spec @@ -50,9 +50,7 @@ Patch13: testsuite-depmod-use-defines-for-the-rootfs-lib_modu.patch Patch14: kmod-Add-pkgconfig-file-with-kmod-compile-time-confi.patch Patch15: usr-lib-modules.patch Patch16: no-stylesheet-download.patch -Patch17: Provide-fallback-for-successfully-running-make-modules_install.patch -Patch18: compat-module_directory-module_prefix.patch -Patch19: configure-Detect-openssl-sm3-support.patch +Patch17: configure-Detect-openssl-sm3-support.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: docbook-xsl-stylesheets diff --git a/kmod.changes b/kmod.changes index dcfaf2c..71898c8 100644 --- a/kmod.changes +++ b/kmod.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Jul 24 12:50:23 UTC 2023 - Michal Suchanek + +- Remove compatibility patches, add README.usrmerge (boo#1212835). + * Delete Provide-fallback-for-successfully-running-make-modules_install.patch + * Delete compat-module_directory-module_prefix.patch + ------------------------------------------------------------------- Mon Jul 17 17:54:54 UTC 2023 - Michal Suchanek diff --git a/kmod.spec b/kmod.spec index 128dc14..98923a9 100644 --- a/kmod.spec +++ b/kmod.spec @@ -34,6 +34,7 @@ URL: https://www.kernel.org/pub/linux/utils/kernel/kmod/ Source: https://www.kernel.org/pub/linux/utils/kernel/kmod/kmod-%version.tar.xz Source2: https://www.kernel.org/pub/linux/utils/kernel/kmod/kmod-%version.tar.sign Source3: %name.keyring +Source4: README.usrmerge Patch1: 0002-modprobe-Recognize-allow-unsupported-modules-on-comm.patch Patch2: 0003-libkmod-config-Recognize-allow_unsupported_modules-i.patch Patch3: 0009-libkmod-Implement-filtering-of-unsupported-modules-o.patch @@ -50,9 +51,7 @@ Patch13: testsuite-depmod-use-defines-for-the-rootfs-lib_modu.patch Patch14: kmod-Add-pkgconfig-file-with-kmod-compile-time-confi.patch Patch15: usr-lib-modules.patch Patch16: no-stylesheet-download.patch -Patch17: Provide-fallback-for-successfully-running-make-modules_install.patch -Patch18: compat-module_directory-module_prefix.patch -Patch19: configure-Detect-openssl-sm3-support.patch +Patch17: configure-Detect-openssl-sm3-support.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: docbook-xsl-stylesheets @@ -124,6 +123,7 @@ in %lname. %prep %autosetup -p1 +cp %{SOURCE4} . %build GTKDOCIZE=/bin/true autoreconf -fi @@ -175,6 +175,9 @@ done %postun -n %lname -p /sbin/ldconfig %files +%if 0%{?suse_version} > 1500 +%doc README.usrmerge +%endif %_bindir/kmod %_bindir/lsmod %_sbindir/depmod