From 07400734eefaee08f3048d18a380f806b4630d1b106cc624593c3dd9c8db3d8d Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 27 May 2021 22:33:54 +0000 Subject: [PATCH 1/3] - Update to release 29 OBS-URL: https://build.opensuse.org/package/show/Base:System/kmod?expand=0&rev=187 --- ...fo-F-always-shows-name-for-built-ins.patch | 38 --- ...evamp-kcmdline-parsing-into-a-state-.patch | 143 ---------- ...-re-quote-option-from-kernel-cmdline.patch | 263 ------------------ kmod-28.tar.sign | 16 -- kmod-28.tar.xz | 3 - kmod-29.tar.sign | 16 ++ kmod-29.tar.xz | 3 + kmod-testsuite.spec | 7 +- kmod.changes | 12 + kmod.spec | 11 +- usr-lib-modprobe.patch | 73 +++-- 11 files changed, 85 insertions(+), 500 deletions(-) delete mode 100644 0001-Fix-modinfo-F-always-shows-name-for-built-ins.patch delete mode 100644 0001-libkmod-config-revamp-kcmdline-parsing-into-a-state-.patch delete mode 100644 0002-libkmod-config-re-quote-option-from-kernel-cmdline.patch delete mode 100644 kmod-28.tar.sign delete mode 100644 kmod-28.tar.xz create mode 100644 kmod-29.tar.sign create mode 100644 kmod-29.tar.xz diff --git a/0001-Fix-modinfo-F-always-shows-name-for-built-ins.patch b/0001-Fix-modinfo-F-always-shows-name-for-built-ins.patch deleted file mode 100644 index 5ea1ecb..0000000 --- a/0001-Fix-modinfo-F-always-shows-name-for-built-ins.patch +++ /dev/null @@ -1,38 +0,0 @@ -From fa67110f896cdef67f42cbc2206ae2a8524acee6 Mon Sep 17 00:00:00 2001 -From: Marco d'Itri -Date: Thu, 7 Jan 2021 20:17:48 -0800 -Subject: [PATCH] Fix "modinfo -F always shows name for built-ins" - -Bug reported by Ben Hutchings : -https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=970871 - - Now that the kernel provides module information for potentially - modular code that's actually built-in, it's possible to query these - built-ins with "modinfo -F". However, this doesn't work quite right: - - $ modinfo -Flicense e1000e - GPL v2 - $ modinfo -Flicense bitrev - name: bitrev - GPL ---- - tools/modinfo.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -Index: kmod-27/tools/modinfo.c -=================================================================== ---- kmod-27.orig/tools/modinfo.c -+++ kmod-27/tools/modinfo.c -@@ -178,7 +178,11 @@ static int modinfo_do(struct kmod_module - is_builtin = (filename == NULL); - - if (is_builtin) { -- printf("%-16s%s%c", "name:", kmod_module_get_name(mod), separator); -+ if (field == NULL) -+ printf("%-16s%s%c", "name:", -+ kmod_module_get_name(mod), separator); -+ else if (field != NULL && streq(field, "name")) -+ printf("%s%c", kmod_module_get_name(mod), separator); - filename = "(builtin)"; - } - diff --git a/0001-libkmod-config-revamp-kcmdline-parsing-into-a-state-.patch b/0001-libkmod-config-revamp-kcmdline-parsing-into-a-state-.patch deleted file mode 100644 index e3b1985..0000000 --- a/0001-libkmod-config-revamp-kcmdline-parsing-into-a-state-.patch +++ /dev/null @@ -1,143 +0,0 @@ -From: Lucas De Marchi -Date: Fri, 12 Feb 2021 01:45:21 -0800 -Subject: libkmod-config: revamp kcmdline parsing into a state machine -Git-repo: git://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git -Git-commit: 01ed9af61e239b40514edf527ac87c79377266ac -Patch-mainline: v29 -References: bsc#1181111 - -The handling of spaces and quotes is becoming hard to maintain. Convert -the parser into a state machine so we can check all the states. This -should make it easier to fix a corner case we have right now: -The kernel also accepts a quote before the module name instead of the -value. But this additional is left for later. This is purely an -algorithm change with no behavior change. - -Tested-by: Jessica Yu -Signed-off-by: Jiri Slaby ---- - libkmod/libkmod-config.c | 86 ++++++++++++++++++++++++---------------- - 1 file changed, 52 insertions(+), 34 deletions(-) - -diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c -index 971f20b8a352..d3cd10d42a10 100644 ---- a/libkmod/libkmod-config.c -+++ b/libkmod/libkmod-config.c -@@ -499,7 +499,14 @@ static int kmod_config_parse_kcmdline(struct kmod_config *config) - char buf[KCMD_LINE_SIZE]; - int fd, err; - char *p, *modname, *param = NULL, *value = NULL; -- bool is_quoted = false, is_module = true; -+ bool is_quoted = false, iter = true; -+ enum state { -+ STATE_IGNORE, -+ STATE_MODNAME, -+ STATE_PARAM, -+ STATE_VALUE, -+ STATE_COMPLETE, -+ } state; - - fd = open("/proc/cmdline", O_RDONLY|O_CLOEXEC); - if (fd < 0) { -@@ -516,54 +523,65 @@ static int kmod_config_parse_kcmdline(struct kmod_config *config) - return err; - } - -- for (p = buf, modname = buf; *p != '\0' && *p != '\n'; p++) { -- if (*p == '"') { -+ state = STATE_MODNAME; -+ for (p = buf, modname = buf; iter; p++) { -+ switch (*p) { -+ case '"': - is_quoted = !is_quoted; -- -- if (is_quoted) { -- /* don't consider a module until closing quotes */ -- is_module = false; -- } else if (param != NULL && value != NULL) { -+ break; -+ case '\0': -+ case '\n': -+ /* Stop iterating on new chars */ -+ iter = false; -+ /* fall-through */ -+ case ' ': -+ if (is_quoted && state == STATE_VALUE) { -+ /* no state change*/; -+ } else if (is_quoted) { -+ /* spaces are only allowed in the value part */ -+ state = STATE_IGNORE; -+ } else if (state == STATE_VALUE || state == STATE_PARAM) { -+ *p = '\0'; -+ state = STATE_COMPLETE; -+ } else { - /* -- * If we are indeed expecting a value and -- * closing quotes, then this can be considered -- * a valid option for a module -+ * go to next option, ignoring any possible -+ * partial match we have - */ -- is_module = true; -+ modname = p + 1; -+ state = STATE_MODNAME; - } -- -- continue; -- } -- if (is_quoted) -- continue; -- -- switch (*p) { -- case ' ': -- *p = '\0'; -- if (is_module) -- kcmdline_parse_result(config, modname, param, value); -- param = value = NULL; -- modname = p + 1; -- is_module = true; - break; - case '.': -- if (param == NULL) { -+ if (state == STATE_MODNAME) { - *p = '\0'; - param = p + 1; -+ state = STATE_PARAM; -+ } else if (state == STATE_PARAM) { -+ state = STATE_IGNORE; - } - break; - case '=': -- if (param != NULL) -+ if (state == STATE_PARAM) { -+ /* -+ * Don't set *p to '\0': the value var shadows -+ * param -+ */ - value = p + 1; -- else -- is_module = false; -+ state = STATE_VALUE; -+ } else if (state == STATE_MODNAME) { -+ state = STATE_IGNORE; -+ } - break; - } -- } - -- *p = '\0'; -- if (is_module) -- kcmdline_parse_result(config, modname, param, value); -+ if (state == STATE_COMPLETE) { -+ kcmdline_parse_result(config, modname, param, value); -+ /* start over on next iteration */ -+ modname = p + 1; -+ state = STATE_MODNAME; -+ } -+ } - - return 0; - } --- -2.30.1 - diff --git a/0002-libkmod-config-re-quote-option-from-kernel-cmdline.patch b/0002-libkmod-config-re-quote-option-from-kernel-cmdline.patch deleted file mode 100644 index f9390c8..0000000 --- a/0002-libkmod-config-re-quote-option-from-kernel-cmdline.patch +++ /dev/null @@ -1,263 +0,0 @@ -From: Lucas De Marchi -Date: Fri, 12 Feb 2021 01:45:22 -0800 -Subject: libkmod-config: re-quote option from kernel cmdline -Git-repo: git://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git -Git-commit: d3a1fe67b64cad103ff4f93dfd9f2cf19cab09ba -Patch-mainline: v29 -References: bsc#1181111 - -It was reported that grub mangles the kernel cmdline. It turns - - acpi_cpufreq.dyndbg="file drivers/cpufreq/acpi-cpufreq.c +mpf" - - into - - "acpi_cpufreq.dyndbg=file drivers/cpufreq/acpi-cpufreq.c +mpf" - -However, even though we could blame grub for doing that, the kernel -happily accepts and re-quotes it when the module is built-in. -So, it's better if kmod also understands it this way and does the same. - -Here we basically add additional code to un-mangle it, moving the quote -in way that is acceptable to pass through init_module(). Note that the -interface [f]init_module() gives us mandates the quote to be part of the -value: the module name is not passed and the options are separated by -space. - -Reported-by: Jiri Slaby -Tested-by: Jessica Yu -Link: https://bugzilla.suse.com/show_bug.cgi?id=1181111#c10 -Signed-off-by: Jiri Slaby ---- - libkmod/libkmod-config.c | 36 ++++++++++++- - .../module-param-kcmdline7/correct.txt | 5 ++ - .../module-param-kcmdline7/correct.txt | 5 ++ - .../module-param-kcmdline7/proc/cmdline | 1 + - .../module-param-kcmdline7/proc/cmdline | 1 + - .../module-param-kcmdline8/correct.txt | 5 ++ - .../module-param-kcmdline7/correct.txt | 5 ++ - .../module-param-kcmdline7/proc/cmdline | 1 + - .../module-param-kcmdline8/proc/cmdline | 1 + - testsuite/test-modprobe.c | 50 +++++++++++++++++++ - 10 files changed, 109 insertions(+), 1 deletion(-) - create mode 100644 testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline7/correct.txt - create mode 100644 testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline7/module-param-kcmdline7/correct.txt - create mode 100644 testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline7/module-param-kcmdline7/proc/cmdline - create mode 100644 testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline7/proc/cmdline - create mode 100644 testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline8/correct.txt - create mode 100644 testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline8/module-param-kcmdline7/correct.txt - create mode 100644 testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline8/module-param-kcmdline7/proc/cmdline - create mode 100644 testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline8/proc/cmdline - -diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c -index d3cd10d42a10..2873f061dc9e 100644 ---- a/libkmod/libkmod-config.c -+++ b/libkmod/libkmod-config.c -@@ -498,7 +498,7 @@ static int kmod_config_parse_kcmdline(struct kmod_config *config) - { - char buf[KCMD_LINE_SIZE]; - int fd, err; -- char *p, *modname, *param = NULL, *value = NULL; -+ char *p, *p_quote_start, *modname, *param = NULL, *value = NULL; - bool is_quoted = false, iter = true; - enum state { - STATE_IGNORE, -@@ -524,10 +524,23 @@ static int kmod_config_parse_kcmdline(struct kmod_config *config) - } - - state = STATE_MODNAME; -+ p_quote_start = NULL; - for (p = buf, modname = buf; iter; p++) { - switch (*p) { - case '"': - is_quoted = !is_quoted; -+ -+ /* -+ * only allow starting quote as first char when looking -+ * for a modname: anything else is considered ill-formed -+ */ -+ if (is_quoted && state == STATE_MODNAME && p == modname) { -+ p_quote_start = p; -+ modname = p + 1; -+ } else if (state != STATE_VALUE) { -+ state = STATE_IGNORE; -+ } -+ - break; - case '\0': - case '\n': -@@ -550,6 +563,7 @@ static int kmod_config_parse_kcmdline(struct kmod_config *config) - */ - modname = p + 1; - state = STATE_MODNAME; -+ p_quote_start = NULL; - } - break; - case '.': -@@ -576,10 +590,30 @@ static int kmod_config_parse_kcmdline(struct kmod_config *config) - } - - if (state == STATE_COMPLETE) { -+ /* -+ * We may need to re-quote to unmangle what the -+ * bootloader passed. Example: grub passes the option as -+ * "parport.dyndbg=file drivers/parport/ieee1284_ops.c +mpf" -+ * instead of -+ * parport.dyndbg="file drivers/parport/ieee1284_ops.c +mpf" -+ */ -+ if (p_quote_start && p_quote_start < modname) { -+ /* -+ * p_quote_start -+ * | -+ * |modname param value -+ * || | | -+ * vv v v -+ * "parport\0dyndbg=file drivers/parport/ieee1284_ops.c +mpf" */ -+ memmove(p_quote_start, modname, value - modname); -+ value--; modname--; param--; -+ *value = '"'; -+ } - kcmdline_parse_result(config, modname, param, value); - /* start over on next iteration */ - modname = p + 1; - state = STATE_MODNAME; -+ p_quote_start = NULL; - } - } - -diff --git a/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline7/correct.txt b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline7/correct.txt -new file mode 100644 -index 000000000000..d80da6d802af ---- /dev/null -+++ b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline7/correct.txt -@@ -0,0 +1,5 @@ -+options psmouse foo -+options parport dyndbg="file drivers/parport/ieee1284_ops.c +mpf" -+ -+# End of configuration files. Dumping indexes now: -+ -diff --git a/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline7/module-param-kcmdline7/correct.txt b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline7/module-param-kcmdline7/correct.txt -new file mode 100644 -index 000000000000..d80da6d802af ---- /dev/null -+++ b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline7/module-param-kcmdline7/correct.txt -@@ -0,0 +1,5 @@ -+options psmouse foo -+options parport dyndbg="file drivers/parport/ieee1284_ops.c +mpf" -+ -+# End of configuration files. Dumping indexes now: -+ -diff --git a/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline7/module-param-kcmdline7/proc/cmdline b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline7/module-param-kcmdline7/proc/cmdline -new file mode 100644 -index 000000000000..86f9052394a0 ---- /dev/null -+++ b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline7/module-param-kcmdline7/proc/cmdline -@@ -0,0 +1 @@ -+psmouse.foo parport.dyndbg="file drivers/parport/ieee1284_ops.c +mpf" quiet rw -diff --git a/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline7/proc/cmdline b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline7/proc/cmdline -new file mode 100644 -index 000000000000..86f9052394a0 ---- /dev/null -+++ b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline7/proc/cmdline -@@ -0,0 +1 @@ -+psmouse.foo parport.dyndbg="file drivers/parport/ieee1284_ops.c +mpf" quiet rw -diff --git a/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline8/correct.txt b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline8/correct.txt -new file mode 100644 -index 000000000000..d80da6d802af ---- /dev/null -+++ b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline8/correct.txt -@@ -0,0 +1,5 @@ -+options psmouse foo -+options parport dyndbg="file drivers/parport/ieee1284_ops.c +mpf" -+ -+# End of configuration files. Dumping indexes now: -+ -diff --git a/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline8/module-param-kcmdline7/correct.txt b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline8/module-param-kcmdline7/correct.txt -new file mode 100644 -index 000000000000..d80da6d802af ---- /dev/null -+++ b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline8/module-param-kcmdline7/correct.txt -@@ -0,0 +1,5 @@ -+options psmouse foo -+options parport dyndbg="file drivers/parport/ieee1284_ops.c +mpf" -+ -+# End of configuration files. Dumping indexes now: -+ -diff --git a/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline8/module-param-kcmdline7/proc/cmdline b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline8/module-param-kcmdline7/proc/cmdline -new file mode 100644 -index 000000000000..86f9052394a0 ---- /dev/null -+++ b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline8/module-param-kcmdline7/proc/cmdline -@@ -0,0 +1 @@ -+psmouse.foo parport.dyndbg="file drivers/parport/ieee1284_ops.c +mpf" quiet rw -diff --git a/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline8/proc/cmdline b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline8/proc/cmdline -new file mode 100644 -index 000000000000..eab04adbd5f8 ---- /dev/null -+++ b/testsuite/rootfs-pristine/test-modprobe/module-param-kcmdline8/proc/cmdline -@@ -0,0 +1 @@ -+psmouse.foo "parport.dyndbg=file drivers/parport/ieee1284_ops.c +mpf" quiet rw -diff --git a/testsuite/test-modprobe.c b/testsuite/test-modprobe.c -index f6bed8bd3487..dbc54f37b377 100644 ---- a/testsuite/test-modprobe.c -+++ b/testsuite/test-modprobe.c -@@ -359,6 +359,56 @@ DEFINE_TEST(modprobe_param_kcmdline6, - ); - - -+static noreturn int modprobe_param_kcmdline7(const struct test *t) -+{ -+ const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe"; -+ const char *const args[] = { -+ progname, -+ "-c", -+ NULL, -+ }; -+ -+ test_spawn_prog(progname, args); -+ exit(EXIT_FAILURE); -+} -+DEFINE_TEST(modprobe_param_kcmdline7, -+ .description = "check if dots on other parts of kcmdline don't confuse our parser", -+ .config = { -+ [TC_UNAME_R] = "4.4.4", -+ [TC_ROOTFS] = TESTSUITE_ROOTFS "test-modprobe/module-param-kcmdline7", -+ }, -+ .output = { -+ .out = TESTSUITE_ROOTFS "test-modprobe/module-param-kcmdline7/correct.txt", -+ }, -+ .modules_loaded = "", -+ ); -+ -+ -+static noreturn int modprobe_param_kcmdline8(const struct test *t) -+{ -+ const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe"; -+ const char *const args[] = { -+ progname, -+ "-c", -+ NULL, -+ }; -+ -+ test_spawn_prog(progname, args); -+ exit(EXIT_FAILURE); -+} -+DEFINE_TEST(modprobe_param_kcmdline8, -+ .description = "check if dots on other parts of kcmdline don't confuse our parser", -+ .config = { -+ [TC_UNAME_R] = "4.4.4", -+ [TC_ROOTFS] = TESTSUITE_ROOTFS "test-modprobe/module-param-kcmdline8", -+ }, -+ .output = { -+ .out = TESTSUITE_ROOTFS "test-modprobe/module-param-kcmdline8/correct.txt", -+ }, -+ .modules_loaded = "", -+ ); -+ -+ - static noreturn int modprobe_force(const struct test *t) - { - const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe"; --- -2.30.1 - diff --git a/kmod-28.tar.sign b/kmod-28.tar.sign deleted file mode 100644 index 0787a7c..0000000 --- a/kmod-28.tar.sign +++ /dev/null @@ -1,16 +0,0 @@ ------BEGIN PGP SIGNATURE----- - -iQIzBAABCAAdFiEE6rM8lpABPHM5FqyDm6KlpjDL6lMFAl/3VpUACgkQm6KlpjDL -6lP1zQ/7BNcz4G6460xko6TypvAiZ7VDvJzBWgdH9EgNgXMPxIAE9PhpfVgvtT+w -k0dHy8zKAvnjoaPaa1vbP2ZGUDjaWoviJGOkmEwc2RVrWcwESDLJx1BKEAT7qh++ -0isr8OhCMeiaW1+hcz/XcZ6arHL29/lIpeWw2ZgSj4JlRC4YVD+t+v6Citkko53v -t6odio4yF06EuGhAmffMDWwrjscMNtW6UR1ce/69UENkR3Kq8c9blu5Q0Go4I3yI -K7U5nKyJxhoEm1OPml6x1td940Z4EqC/BR+sUYK1izXM9Uo8d+3J5hiHI83xOFz4 -9xrzcftHnM524aUYmHe5h83Li9XfW1BfIyePIYEMseEewfFF60bQqugciK+RCPoc -F+mC//ZBj1Xs2FLyAZhHdeZPjPCcGF6MrCuWUWavy8nxFStJgw8R59tatRhTGv5+ -QMk5DhJsKk8sCDeFWo6CBOHN99lNTJ06yI4hYfzcVCXE8deqHI5tBxmhhgFioqfE -UGj7fiG8bYqy4foXCW5SgD7Gmvg5fy/zpc8+h9MtmXW0Fqx3jABFknnolbEsJzBu -YJQ+UypKrARy8RpdRHsX8k2zH+hw5p5p7uHGGOy2j3Zff/Mx8zxAsOlpplt4b4cZ -PC+/D/cwNtEUDcW7ql33YmpkylAguKbivzMKSe2yb9DgNw3o3N4= -=FrBq ------END PGP SIGNATURE----- diff --git a/kmod-28.tar.xz b/kmod-28.tar.xz deleted file mode 100644 index dc16ace..0000000 --- a/kmod-28.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3969fc0f13daa98084256337081c442f8749310089e48aa695c9b4dfe1b3a26c -size 552448 diff --git a/kmod-29.tar.sign b/kmod-29.tar.sign new file mode 100644 index 0000000..4305c6a --- /dev/null +++ b/kmod-29.tar.sign @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCAAdFiEE6rM8lpABPHM5FqyDm6KlpjDL6lMFAmCm6vQACgkQm6KlpjDL +6lNQNg/+KiyVKaM7w7Kc3aoHxewYxDbqpRUYIhmcmRXWM5UNjLWnPudHJv7i7b8f +Ztj5TECYkR5cnw4klKbQERGH9jX/ZlGMp4xGDnmdVZ72T202N3JSAj7Hieew8569 +b0rfUwXN9dUK6nJTUmi79IXJfV3Tmik4Eqsb9fVUJN0mJmHSZjGPIfTbVOgtq/9F +tiGIAQXc/YZuXoV7fcppAXxLbKsftTliYd/B9U3Sz+4ZZ6Lx3Ki77utg9p3KhVux +F60Y3JvbhiY72BkVToEAb+TadenJKc+4GquAA4/RivGhTW8aPHCDVqRR6aVGsWZs +tE/7jKHXqnwNzu8CodG6aIGia9EvMOegJlypDbaeHYlVCn6aoH8fHi3GcTg2aUdA +10LahavjAw6542XdM84SClMTqjHuHjYCOMSu8wjoCSoMQKxkI74LLndcTntXMJ8v +EQ6I5NPJqCtZLdTpWppKC3BZAcQFdaksSBmISsoRZq2ruleOdglnujTf6QmpgcE6 +fZNajslMcMQ1CIMwlvTWBLSlkk7Tr+Msca1fFm3FA3WrYDhcRpkLYnERjW6tkEI/ +mUhRTIB67haNwn8Y+HNc0Bl7toJr4nmYA85I4Ffqo7/VEPw5WkSa3yNiEgT/cy0b +Ubd6epfJqFG2VqGbw+dsiXKhbnxe9wiLibGm1XFIwB3bbRoz0XY= +=1dko +-----END PGP SIGNATURE----- diff --git a/kmod-29.tar.xz b/kmod-29.tar.xz new file mode 100644 index 0000000..95c19f5 --- /dev/null +++ b/kmod-29.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0b80eea7aa184ac6fd20cafa2a1fdf290ffecc70869a797079e2cc5c6225a52a +size 560160 diff --git a/kmod-testsuite.spec b/kmod-testsuite.spec index 6190502..7153fe3 100644 --- a/kmod-testsuite.spec +++ b/kmod-testsuite.spec @@ -18,10 +18,10 @@ Name: kmod-testsuite %define lname libkmod2 -Version: 28 +Version: 29 Release: 0 Summary: Testsuite of the kmod package -License: LGPL-2.1-or-later AND GPL-2.0-or-later +License: GPL-2.0-or-later AND LGPL-2.1-or-later Group: System/Kernel URL: https://www.kernel.org/pub/linux/utils/kernel/kmod/ @@ -37,7 +37,6 @@ Patch5: 0011-Do-not-filter-unsupported-modules-when-running-a-van.patch Patch6: 0012-modprobe-print-unsupported-status.patch Patch7: usr-lib-modprobe.patch Patch8: no-stylesheet-download.patch -Patch9: 0001-Fix-modinfo-F-always-shows-name-for-built-ins.patch Patch10: kmod-populate-modules-Use-more-bash-more-quotes.patch Patch11: kmod-testsuite-compress-modules-if-feature-is-enabled.patch Patch12: kmod-also-test-xz-compression.patch @@ -79,7 +78,7 @@ export LDFLAGS="-Wl,-z,relro,-z,now" --includedir="%_includedir/kmod" \ --with-rootlibdir="%_libdir" \ --bindir="%_bindir" -make %{?_smp_mflags} V=1 KDIR="%kdir" +%make_build KDIR="%kdir" %install # empty diff --git a/kmod.changes b/kmod.changes index 9b4049e..be03e23 100644 --- a/kmod.changes +++ b/kmod.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Thu May 27 22:20:42 UTC 2021 - Jan Engelhardt + +- Update to release 29 + * Fix `modinfo -F` not working for built-in modules and + certain fields. + * Fix a memory leak, overflow and double free on error path. +- Drop 0001-Fix-modinfo-F-always-shows-name-for-built-ins.patch, + 0001-libkmod-config-revamp-kcmdline-parsing-into-a-state-.patch, + 0002-libkmod-config-re-quote-option-from-kernel-cmdline.patch + (all merged) + ------------------------------------------------------------------- Thu Feb 18 08:19:01 UTC 2021 - Jiri Slaby diff --git a/kmod.spec b/kmod.spec index a0f8b3e..d14b9cd 100644 --- a/kmod.spec +++ b/kmod.spec @@ -18,10 +18,10 @@ Name: kmod %define lname libkmod2 -Version: 28 +Version: 29 Release: 0 Summary: Utilities to load modules into the kernel -License: LGPL-2.1-or-later AND GPL-2.0-or-later +License: GPL-2.0-or-later AND LGPL-2.1-or-later Group: System/Kernel URL: https://www.kernel.org/pub/linux/utils/kernel/kmod/ @@ -37,9 +37,6 @@ Patch5: 0011-Do-not-filter-unsupported-modules-when-running-a-van.patch Patch6: 0012-modprobe-print-unsupported-status.patch Patch7: usr-lib-modprobe.patch Patch8: no-stylesheet-download.patch -Patch9: 0001-Fix-modinfo-F-always-shows-name-for-built-ins.patch -Patch10: 0001-libkmod-config-revamp-kcmdline-parsing-into-a-state-.patch -Patch11: 0002-libkmod-config-re-quote-option-from-kernel-cmdline.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: docbook5-xsl-stylesheets @@ -69,7 +66,7 @@ indexes from module-init-tools project. %package bash-completion Summary: Bash completion routines for the kmod utilities -License: LGPL-2.1-or-later AND GPL-2.0-or-later +License: GPL-2.0-or-later AND LGPL-2.1-or-later Group: System/Shells BuildArch: noarch Requires: %{name} @@ -116,7 +113,7 @@ export LDFLAGS="-Wl,-z,relro,-z,now" --includedir="%_includedir/kmod" \ --with-rootlibdir="%_libdir" \ --bindir="%_bindir" -make %{?_smp_mflags} V=1 +%make_build %install b="%buildroot" diff --git a/usr-lib-modprobe.patch b/usr-lib-modprobe.patch index a686eca..4d2a70b 100644 --- a/usr-lib-modprobe.patch +++ b/usr-lib-modprobe.patch @@ -1,4 +1,3 @@ -From 294bdb1b231e8076de37ed35afef64dd6be37755 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Tue, 12 Jan 2021 16:54:46 +0100 Subject: [PATCH] modprobe.d: load from /usr/lib. @@ -11,16 +10,26 @@ Cc: Marcus Rückert Cc: Takashi Iwai Cc: Dominique Leuenberger Signed-off-by: Michal Suchanek ---- - Makefile.am | 1 + - libkmod/libkmod.c | 1 + - man/modprobe.d.xml | 1 + - 3 files changed, 3 insertions(+) -diff --git a/Makefile.am b/Makefile.am -index b29e943a4d29..702a665f0334 100644 ---- a/Makefile.am -+++ b/Makefile.am +From: Jan Engelhardt +Date: 2021-05-28 00:17:47.552369139 +0200 + +If you make the build flexible and allow varying values for ``--sysconfdir``, +then permit the same for ``--prefix``. + +An obvious side effect is that with little change, the unnecessary hard +dependency on merged /usr goes away. +--- + Makefile.am | 1 + + libkmod/libkmod.c | 2 +- + man/modprobe.d.xml | 2 +- + tools/depmod.c | 2 +- + 4 files changed, 4 insertions(+), 3 deletions(-) + +Index: kmod-29/Makefile.am +=================================================================== +--- kmod-29.orig/Makefile.am ++++ kmod-29/Makefile.am @@ -19,6 +19,7 @@ AM_CPPFLAGS = \ -include $(top_builddir)/config.h \ -I$(top_srcdir) \ @@ -29,30 +38,42 @@ index b29e943a4d29..702a665f0334 100644 ${zlib_CFLAGS} AM_CFLAGS = $(OUR_CFLAGS) -diff --git a/libkmod/libkmod.c b/libkmod/libkmod.c -index 43423d63a889..9399c6c902f8 100644 ---- a/libkmod/libkmod.c -+++ b/libkmod/libkmod.c -@@ -65,6 +65,7 @@ static const char *default_config_paths[] = { +Index: kmod-29/libkmod/libkmod.c +=================================================================== +--- kmod-29.orig/libkmod/libkmod.c ++++ kmod-29/libkmod/libkmod.c +@@ -65,7 +65,7 @@ static const char *default_config_paths[ SYSCONFDIR "/modprobe.d", "/run/modprobe.d", - "/lib/modprobe.d", + "/usr/local/lib/modprobe.d", +- "/lib/modprobe.d", + PREFIX "/lib/modprobe.d", NULL }; -diff --git a/man/modprobe.d.xml b/man/modprobe.d.xml -index 211af8488abb..ae5a83986a52 100644 ---- a/man/modprobe.d.xml -+++ b/man/modprobe.d.xml -@@ -40,6 +40,7 @@ +Index: kmod-29/man/modprobe.d.xml +=================================================================== +--- kmod-29.orig/man/modprobe.d.xml ++++ kmod-29/man/modprobe.d.xml +@@ -40,7 +40,7 @@ +- /lib/modprobe.d/*.conf + /usr/lib/modprobe.d/*.conf - /lib/modprobe.d/*.conf - /etc/modprobe.d/*.conf + /usr/local/lib/modprobe.d/*.conf /run/modprobe.d/*.conf --- -2.26.2 - + /etc/modprobe.d/*.conf +Index: kmod-29/tools/depmod.c +=================================================================== +--- kmod-29.orig/tools/depmod.c ++++ kmod-29/tools/depmod.c +@@ -54,7 +54,7 @@ static const char *default_cfg_paths[] = + SYSCONFDIR "/depmod.d", + "/run/depmod.d", + "/usr/local/lib/depmod.d", +- "/lib/depmod.d", ++ PREFIX "/lib/depmod.d", + NULL + }; + From d0a8f9a8ff1e7185dc5bd7ebf88859f2fc520c77589e1b6c80c6cbe3e9327048 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 29 May 2021 17:41:53 +0000 Subject: [PATCH 2/3] Accepting request 896081 from home:michals - Adjust to usermerge. On Tumbleweed /lib and /usr/lib are the same directory and the canonical location is in /usr. Document and read only /usr to prevent reading the same file twice. On earlier releases preserve compatibility for files placed in /lib and read both. + kmod-usrmerge.patch * Refresh usr-lib-modprobe.patch - Remove test patches included in release 29 - kmod-populate-modules-Use-more-bash-more-quotes.patch - kmod-testsuite-compress-modules-if-feature-is-enabled.patch - kmod-also-test-xz-compression.patch OBS-URL: https://build.opensuse.org/request/show/896081 OBS-URL: https://build.opensuse.org/package/show/Base:System/kmod?expand=0&rev=188 --- kmod-also-test-xz-compression.patch | 39 ------- ...te-modules-Use-more-bash-more-quotes.patch | 65 ----------- ...mpress-modules-if-feature-is-enabled.patch | 103 ------------------ kmod-testsuite.spec | 4 +- kmod-usrmerge.patch | 68 ++++++++++++ kmod.changes | 15 +++ kmod.spec | 6 + usr-lib-modprobe.patch | 86 ++++++++------- 8 files changed, 137 insertions(+), 249 deletions(-) delete mode 100644 kmod-also-test-xz-compression.patch delete mode 100644 kmod-populate-modules-Use-more-bash-more-quotes.patch delete mode 100644 kmod-testsuite-compress-modules-if-feature-is-enabled.patch create mode 100644 kmod-usrmerge.patch diff --git a/kmod-also-test-xz-compression.patch b/kmod-also-test-xz-compression.patch deleted file mode 100644 index da136ec..0000000 --- a/kmod-also-test-xz-compression.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 07aed32d80f306372e13701181cb827e6d0d7cff Mon Sep 17 00:00:00 2001 -From: Lucas De Marchi -Date: Fri, 29 Jan 2021 18:36:00 -0800 -Subject: [PATCH 2/2] testsuite: also test xz compression - ---- - testsuite/populate-modules.sh | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/testsuite/populate-modules.sh b/testsuite/populate-modules.sh -index ae43884984b8..099f02669156 100755 ---- a/testsuite/populate-modules.sh -+++ b/testsuite/populate-modules.sh -@@ -72,6 +72,9 @@ map=( - - gzip_array=( - "test-depmod/modules-order-compressed/lib/modules/4.4.4/kernel/drivers/block/cciss.ko" -+ ) -+ -+xz_array=( - "test-depmod/modules-order-compressed/lib/modules/4.4.4/kernel/drivers/scsi/scsi_mod.ko" - ) - -@@ -112,6 +115,12 @@ if feature_enabled ZLIB; then - done - fi - -+if feature_enabled XZ; then -+ for m in "${xz_array[@]}"; do -+ xz "$ROOTFS/$m" -+ done -+fi -+ - if feature_enabled ZSTD; then - for m in "${zstd_array[@]}"; do - zstd --rm $ROOTFS/$m --- -2.26.2 - diff --git a/kmod-populate-modules-Use-more-bash-more-quotes.patch b/kmod-populate-modules-Use-more-bash-more-quotes.patch deleted file mode 100644 index 1ca7958..0000000 --- a/kmod-populate-modules-Use-more-bash-more-quotes.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 3cee67ddd75114f9557ab7e13ef1751c277d9bd3 Mon Sep 17 00:00:00 2001 -From: Dave Reisner -Date: Wed, 25 Mar 2020 11:03:58 -0400 -Subject: [PATCH] populate-modules: Use more bash, more quotes - -We're already using associatives arrays, so there's no reason we should -be using 'test'. ---- - testsuite/populate-modules.sh | 18 +++++++++--------- - 1 file changed, 9 insertions(+), 9 deletions(-) - -diff --git a/testsuite/populate-modules.sh b/testsuite/populate-modules.sh -index 358e7405dcf8..b0cc932818e0 100755 ---- a/testsuite/populate-modules.sh -+++ b/testsuite/populate-modules.sh -@@ -85,15 +85,15 @@ attach_pkcs7_array=( - "test-modinfo/mod-simple-pkcs7.ko" - ) - --for k in ${!map[@]}; do -+for k in "${!map[@]}"; do - dst=${ROOTFS}/$k - src=${MODULE_PLAYGROUND}/${map[$k]} - -- if test "${dst: -1}" = "/"; then -- install -d $dst -- install -t $dst $src -+ if [[ $dst = */ ]]; then -+ install -d "$dst" -+ install -t "$dst" "$src" - else -- install -D $src $dst -+ install -D "$src" "$dst" - fi - done - -@@ -101,7 +101,7 @@ done - - # gzip these modules - for m in "${gzip_array[@]}"; do -- gzip $ROOTFS/$m -+ gzip "$ROOTFS/$m" - done - - # zstd-compress these modules -@@ -110,13 +110,13 @@ for m in "${zstd_array[@]}"; do - done - - for m in "${attach_sha1_array[@]}"; do -- cat ${MODULE_PLAYGROUND}/dummy.sha1 >> ${ROOTFS}/$m -+ cat "${MODULE_PLAYGROUND}/dummy.sha1" >>"${ROOTFS}/$m" - done - - for m in "${attach_sha256_array[@]}"; do -- cat ${MODULE_PLAYGROUND}/dummy.sha256 >> ${ROOTFS}/$m -+ cat "${MODULE_PLAYGROUND}/dummy.sha256" >>"${ROOTFS}/$m" - done - - for m in "${attach_pkcs7_array[@]}"; do -- cat ${MODULE_PLAYGROUND}/dummy.pkcs7 >> ${ROOTFS}/$m -+ cat "${MODULE_PLAYGROUND}/dummy.pkcs7" >>"${ROOTFS}/$m" - done --- -2.26.2 - diff --git a/kmod-testsuite-compress-modules-if-feature-is-enabled.patch b/kmod-testsuite-compress-modules-if-feature-is-enabled.patch deleted file mode 100644 index 12c4147..0000000 --- a/kmod-testsuite-compress-modules-if-feature-is-enabled.patch +++ /dev/null @@ -1,103 +0,0 @@ -From 4be01b2fc8f44c35184138ee9e21f2bc146c9056 Mon Sep 17 00:00:00 2001 -From: Lucas De Marchi -Date: Fri, 29 Jan 2021 18:35:59 -0800 -Subject: [PATCH 1/2] testsuite: compress modules if feature is enabled -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Since the output needs to be the same, regardless if the module is -compressed, change populate-modules.sh to conditionally compress the -module if that feature is enabled. - -This way we can execute the tests with any build-time configuration and -it should still pass. - -Suggested-by: Michal Suchánek ---- - Makefile.am | 2 +- - testsuite/populate-modules.sh | 27 ++++++++++++++++++--------- - testsuite/test-depmod.c | 2 -- - 3 files changed, 19 insertions(+), 12 deletions(-) - -diff --git a/Makefile.am b/Makefile.am -index 702a665f0334..8c79349f1eb9 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -250,7 +250,7 @@ CREATE_ROOTFS = $(AM_V_GEN) ( $(RM) -rf $(ROOTFS) && mkdir -p $(dir $(ROOTFS)) & - find $(ROOTFS) -type d -exec chmod +w {} \; && \ - find $(ROOTFS) -type f -name .gitignore -exec rm -f {} \; && \ - $(top_srcdir)/testsuite/populate-modules.sh \ -- $(MODULE_PLAYGROUND) $(ROOTFS) ) && \ -+ $(MODULE_PLAYGROUND) $(ROOTFS) $(top_builddir)/config.h ) && \ - touch testsuite/stamp-rootfs - - build-module-playground: -diff --git a/testsuite/populate-modules.sh b/testsuite/populate-modules.sh -index b0cc932818e0..ae43884984b8 100755 ---- a/testsuite/populate-modules.sh -+++ b/testsuite/populate-modules.sh -@@ -4,6 +4,12 @@ set -e - - MODULE_PLAYGROUND=$1 - ROOTFS=$2 -+CONFIG_H=$3 -+ -+feature_enabled() { -+ local feature=$1 -+ grep KMOD_FEATURES $CONFIG_H | head -n 1 | grep -q \+$feature -+} - - declare -A map - map=( -@@ -99,15 +105,18 @@ done - - # start poking the final rootfs... - --# gzip these modules --for m in "${gzip_array[@]}"; do -- gzip "$ROOTFS/$m" --done -- --# zstd-compress these modules --for m in "${zstd_array[@]}"; do -- zstd --rm $ROOTFS/$m --done -+# compress modules with each format if feature is enabled -+if feature_enabled ZLIB; then -+ for m in "${gzip_array[@]}"; do -+ gzip "$ROOTFS/$m" -+ done -+fi -+ -+if feature_enabled ZSTD; then -+ for m in "${zstd_array[@]}"; do -+ zstd --rm $ROOTFS/$m -+ done -+fi - - for m in "${attach_sha1_array[@]}"; do - cat "${MODULE_PLAYGROUND}/dummy.sha1" >>"${ROOTFS}/$m" -diff --git a/testsuite/test-depmod.c b/testsuite/test-depmod.c -index 261559cab89b..d7802d7b2e0b 100644 ---- a/testsuite/test-depmod.c -+++ b/testsuite/test-depmod.c -@@ -25,7 +25,6 @@ - - #include "testsuite.h" - --#ifdef ENABLE_ZLIB - #define MODULES_ORDER_UNAME "4.4.4" - #define MODULES_ORDER_ROOTFS TESTSUITE_ROOTFS "test-depmod/modules-order-compressed" - #define MODULES_ORDER_LIB_MODULES MODULES_ORDER_ROOTFS "/lib/modules/" MODULES_ORDER_UNAME -@@ -57,7 +56,6 @@ DEFINE_TEST(depmod_modules_order_for_compressed, - { } - }, - }); --#endif - - #define SEARCH_ORDER_SIMPLE_ROOTFS TESTSUITE_ROOTFS "test-depmod/search-order-simple" - static noreturn int depmod_search_order_simple(const struct test *t) --- -2.26.2 - diff --git a/kmod-testsuite.spec b/kmod-testsuite.spec index 7153fe3..b62c8ad 100644 --- a/kmod-testsuite.spec +++ b/kmod-testsuite.spec @@ -37,9 +37,7 @@ Patch5: 0011-Do-not-filter-unsupported-modules-when-running-a-van.patch Patch6: 0012-modprobe-print-unsupported-status.patch Patch7: usr-lib-modprobe.patch Patch8: no-stylesheet-download.patch -Patch10: kmod-populate-modules-Use-more-bash-more-quotes.patch -Patch11: kmod-testsuite-compress-modules-if-feature-is-enabled.patch -Patch12: kmod-also-test-xz-compression.patch +Patch9: kmod-usrmerge.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: docbook5-xsl-stylesheets diff --git a/kmod-usrmerge.patch b/kmod-usrmerge.patch new file mode 100644 index 0000000..026b845 --- /dev/null +++ b/kmod-usrmerge.patch @@ -0,0 +1,68 @@ +From 6572069f71045f304780cb63a5a090a275fc22dd Mon Sep 17 00:00:00 2001 +From: Michal Suchanek +Date: Sat, 29 May 2021 08:10:36 +0200 +Subject: [PATCH] modprobe.d, depmod.d: Only read from /usr/lib, not /lib. + +With usrmerge /lib is linked to /usr/lib and the modprobe.d files would +be interpreted twice. It is possible to write non-idempotent modprobe.d +files leading to weird errors. + +Signed-off-by: Michal Suchanek +--- + libkmod/libkmod.c | 1 - + man/depmod.d.xml | 1 - + man/modprobe.d.xml | 1 - + tools/depmod.c | 1 - + 4 files changed, 4 deletions(-) + +diff --git a/libkmod/libkmod.c b/libkmod/libkmod.c +index ddf13fb3d822..262f5d1512c9 100644 +--- a/libkmod/libkmod.c ++++ b/libkmod/libkmod.c +@@ -66,7 +66,6 @@ static const char *default_config_paths[] = { + "/run/modprobe.d", + "/usr/local/lib/modprobe.d", + PREFIX "/lib/modprobe.d", +- "/lib/modprobe.d", + NULL + }; + +diff --git a/man/depmod.d.xml b/man/depmod.d.xml +index 8a898cf4a9eb..b315e931d635 100644 +--- a/man/depmod.d.xml ++++ b/man/depmod.d.xml +@@ -39,7 +39,6 @@ + + + +- /lib/depmod.d/*.conf + /usr/lib/depmod.d/*.conf + /usr/local/lib/depmod.d/*.conf + /run/depmod.d/*.conf +diff --git a/man/modprobe.d.xml b/man/modprobe.d.xml +index 8a7c696dcee1..08d789176dd3 100644 +--- a/man/modprobe.d.xml ++++ b/man/modprobe.d.xml +@@ -40,7 +40,6 @@ + + + +- /lib/modprobe.d/*.conf + /usr/lib/modprobe.d/*.conf + /usr/local/lib/modprobe.d/*.conf + /run/modprobe.d/*.conf +diff --git a/tools/depmod.c b/tools/depmod.c +index 8f6a4f8cd7cb..3a4708316581 100644 +--- a/tools/depmod.c ++++ b/tools/depmod.c +@@ -55,7 +55,6 @@ static const char *default_cfg_paths[] = { + "/run/depmod.d", + "/usr/local/lib/depmod.d", + PREFIX "/lib/depmod.d", +- "/lib/depmod.d", + NULL + }; + +-- +2.26.2 + diff --git a/kmod.changes b/kmod.changes index be03e23..358ceb8 100644 --- a/kmod.changes +++ b/kmod.changes @@ -1,3 +1,18 @@ +------------------------------------------------------------------- +Sat May 29 09:58:09 UTC 2021 - Michal Suchanek + +- Adjust to usermerge. On Tumbleweed /lib and /usr/lib are the same directory + and the canonical location is in /usr. Document and read only /usr to prevent + reading the same file twice. + On earlier releases preserve compatibility for files placed in /lib and read + both. + + kmod-usrmerge.patch + * Refresh usr-lib-modprobe.patch +- Remove test patches included in release 29 + - kmod-populate-modules-Use-more-bash-more-quotes.patch + - kmod-testsuite-compress-modules-if-feature-is-enabled.patch + - kmod-also-test-xz-compression.patch + ------------------------------------------------------------------- Thu May 27 22:20:42 UTC 2021 - Jan Engelhardt diff --git a/kmod.spec b/kmod.spec index d14b9cd..b89ba1b 100644 --- a/kmod.spec +++ b/kmod.spec @@ -37,6 +37,7 @@ Patch5: 0011-Do-not-filter-unsupported-modules-when-running-a-van.patch Patch6: 0012-modprobe-print-unsupported-status.patch Patch7: usr-lib-modprobe.patch Patch8: no-stylesheet-download.patch +Patch9: kmod-usrmerge.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: docbook5-xsl-stylesheets @@ -100,6 +101,11 @@ in %lname. %prep %autosetup -p1 +# When not on tumbleweed read both /lib and /usr/lib +# on Tumbleweed /lib and /usr/lib are the same - don't apply files twice +%if 0%{?suse_version} <= 1500 +%patch9 -p1 -R +%endif %build autoreconf -fi diff --git a/usr-lib-modprobe.patch b/usr-lib-modprobe.patch index 4d2a70b..ed5746b 100644 --- a/usr-lib-modprobe.patch +++ b/usr-lib-modprobe.patch @@ -1,6 +1,10 @@ +From fc1b2c14e2ca4d7ccd4a3b75a435ab7d927533bc Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: Tue, 12 Jan 2021 16:54:46 +0100 -Subject: [PATCH] modprobe.d: load from /usr/lib. +Subject: [PATCH] modprobe.d, depmod.d: load from /usr/lib. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit There is an ongoing effort to limit use of files outside of /usr (or $prefix on general). Currently all modprobe.d paths are hardcoded to @@ -10,26 +14,18 @@ Cc: Marcus Rückert Cc: Takashi Iwai Cc: Dominique Leuenberger Signed-off-by: Michal Suchanek - -From: Jan Engelhardt -Date: 2021-05-28 00:17:47.552369139 +0200 - -If you make the build flexible and allow varying values for ``--sysconfdir``, -then permit the same for ``--prefix``. - -An obvious side effect is that with little change, the unnecessary hard -dependency on merged /usr goes away. --- - Makefile.am | 1 + - libkmod/libkmod.c | 2 +- - man/modprobe.d.xml | 2 +- - tools/depmod.c | 2 +- - 4 files changed, 4 insertions(+), 3 deletions(-) + Makefile.am | 1 + + libkmod/libkmod.c | 1 + + man/depmod.d.xml | 1 + + man/modprobe.d.xml | 1 + + tools/depmod.c | 1 + + 5 files changed, 5 insertions(+) -Index: kmod-29/Makefile.am -=================================================================== ---- kmod-29.orig/Makefile.am -+++ kmod-29/Makefile.am +diff --git a/Makefile.am b/Makefile.am +index d859c240178f..8553368988c0 100644 +--- a/Makefile.am ++++ b/Makefile.am @@ -19,6 +19,7 @@ AM_CPPFLAGS = \ -include $(top_builddir)/config.h \ -I$(top_srcdir) \ @@ -38,42 +34,54 @@ Index: kmod-29/Makefile.am ${zlib_CFLAGS} AM_CFLAGS = $(OUR_CFLAGS) -Index: kmod-29/libkmod/libkmod.c -=================================================================== ---- kmod-29.orig/libkmod/libkmod.c -+++ kmod-29/libkmod/libkmod.c -@@ -65,7 +65,7 @@ static const char *default_config_paths[ +diff --git a/libkmod/libkmod.c b/libkmod/libkmod.c +index 7c2b889d713e..ddf13fb3d822 100644 +--- a/libkmod/libkmod.c ++++ b/libkmod/libkmod.c +@@ -65,6 +65,7 @@ static const char *default_config_paths[] = { SYSCONFDIR "/modprobe.d", "/run/modprobe.d", "/usr/local/lib/modprobe.d", -- "/lib/modprobe.d", + PREFIX "/lib/modprobe.d", + "/lib/modprobe.d", NULL }; - -Index: kmod-29/man/modprobe.d.xml -=================================================================== ---- kmod-29.orig/man/modprobe.d.xml -+++ kmod-29/man/modprobe.d.xml -@@ -40,7 +40,7 @@ +diff --git a/man/depmod.d.xml b/man/depmod.d.xml +index b315e931d635..8a898cf4a9eb 100644 +--- a/man/depmod.d.xml ++++ b/man/depmod.d.xml +@@ -39,6 +39,7 @@ -- /lib/modprobe.d/*.conf ++ /lib/depmod.d/*.conf + /usr/lib/depmod.d/*.conf + /usr/local/lib/depmod.d/*.conf + /run/depmod.d/*.conf +diff --git a/man/modprobe.d.xml b/man/modprobe.d.xml +index 0ab3e9110a7e..8a7c696dcee1 100644 +--- a/man/modprobe.d.xml ++++ b/man/modprobe.d.xml +@@ -41,6 +41,7 @@ + + + /lib/modprobe.d/*.conf + /usr/lib/modprobe.d/*.conf /usr/local/lib/modprobe.d/*.conf /run/modprobe.d/*.conf /etc/modprobe.d/*.conf -Index: kmod-29/tools/depmod.c -=================================================================== ---- kmod-29.orig/tools/depmod.c -+++ kmod-29/tools/depmod.c -@@ -54,7 +54,7 @@ static const char *default_cfg_paths[] = +diff --git a/tools/depmod.c b/tools/depmod.c +index eb810b811e35..8f6a4f8cd7cb 100644 +--- a/tools/depmod.c ++++ b/tools/depmod.c +@@ -54,6 +54,7 @@ static const char *default_cfg_paths[] = { SYSCONFDIR "/depmod.d", "/run/depmod.d", "/usr/local/lib/depmod.d", -- "/lib/depmod.d", + PREFIX "/lib/depmod.d", + "/lib/depmod.d", NULL }; - +-- +2.26.2 + From de3c77de0c035dd795515a5941e4a1080464c61f250d1fdaea4aee19a7789753 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Mon, 31 May 2021 10:00:17 +0000 Subject: [PATCH 3/3] Accepting request 896324 from home:michals - /usr/lib should override /lib where both are available. Support /usr/lib for depmod.d as well. OBS-URL: https://build.opensuse.org/request/show/896324 OBS-URL: https://build.opensuse.org/package/show/Base:System/kmod?expand=0&rev=189 --- kmod-testsuite.spec | 1 - kmod-usrmerge.patch | 68 --------------------------------------------- kmod.changes | 8 ++---- kmod.spec | 6 ---- 4 files changed, 2 insertions(+), 81 deletions(-) delete mode 100644 kmod-usrmerge.patch diff --git a/kmod-testsuite.spec b/kmod-testsuite.spec index b62c8ad..5b32048 100644 --- a/kmod-testsuite.spec +++ b/kmod-testsuite.spec @@ -37,7 +37,6 @@ Patch5: 0011-Do-not-filter-unsupported-modules-when-running-a-van.patch Patch6: 0012-modprobe-print-unsupported-status.patch Patch7: usr-lib-modprobe.patch Patch8: no-stylesheet-download.patch -Patch9: kmod-usrmerge.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: docbook5-xsl-stylesheets diff --git a/kmod-usrmerge.patch b/kmod-usrmerge.patch deleted file mode 100644 index 026b845..0000000 --- a/kmod-usrmerge.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 6572069f71045f304780cb63a5a090a275fc22dd Mon Sep 17 00:00:00 2001 -From: Michal Suchanek -Date: Sat, 29 May 2021 08:10:36 +0200 -Subject: [PATCH] modprobe.d, depmod.d: Only read from /usr/lib, not /lib. - -With usrmerge /lib is linked to /usr/lib and the modprobe.d files would -be interpreted twice. It is possible to write non-idempotent modprobe.d -files leading to weird errors. - -Signed-off-by: Michal Suchanek ---- - libkmod/libkmod.c | 1 - - man/depmod.d.xml | 1 - - man/modprobe.d.xml | 1 - - tools/depmod.c | 1 - - 4 files changed, 4 deletions(-) - -diff --git a/libkmod/libkmod.c b/libkmod/libkmod.c -index ddf13fb3d822..262f5d1512c9 100644 ---- a/libkmod/libkmod.c -+++ b/libkmod/libkmod.c -@@ -66,7 +66,6 @@ static const char *default_config_paths[] = { - "/run/modprobe.d", - "/usr/local/lib/modprobe.d", - PREFIX "/lib/modprobe.d", -- "/lib/modprobe.d", - NULL - }; - -diff --git a/man/depmod.d.xml b/man/depmod.d.xml -index 8a898cf4a9eb..b315e931d635 100644 ---- a/man/depmod.d.xml -+++ b/man/depmod.d.xml -@@ -39,7 +39,6 @@ - - - -- /lib/depmod.d/*.conf - /usr/lib/depmod.d/*.conf - /usr/local/lib/depmod.d/*.conf - /run/depmod.d/*.conf -diff --git a/man/modprobe.d.xml b/man/modprobe.d.xml -index 8a7c696dcee1..08d789176dd3 100644 ---- a/man/modprobe.d.xml -+++ b/man/modprobe.d.xml -@@ -40,7 +40,6 @@ - - - -- /lib/modprobe.d/*.conf - /usr/lib/modprobe.d/*.conf - /usr/local/lib/modprobe.d/*.conf - /run/modprobe.d/*.conf -diff --git a/tools/depmod.c b/tools/depmod.c -index 8f6a4f8cd7cb..3a4708316581 100644 ---- a/tools/depmod.c -+++ b/tools/depmod.c -@@ -55,7 +55,6 @@ static const char *default_cfg_paths[] = { - "/run/depmod.d", - "/usr/local/lib/depmod.d", - PREFIX "/lib/depmod.d", -- "/lib/depmod.d", - NULL - }; - --- -2.26.2 - diff --git a/kmod.changes b/kmod.changes index 358ceb8..bef670a 100644 --- a/kmod.changes +++ b/kmod.changes @@ -1,12 +1,8 @@ ------------------------------------------------------------------- Sat May 29 09:58:09 UTC 2021 - Michal Suchanek -- Adjust to usermerge. On Tumbleweed /lib and /usr/lib are the same directory - and the canonical location is in /usr. Document and read only /usr to prevent - reading the same file twice. - On earlier releases preserve compatibility for files placed in /lib and read - both. - + kmod-usrmerge.patch +- /usr/lib should override /lib where both are available. Support /usr/lib for + depmod.d as well. * Refresh usr-lib-modprobe.patch - Remove test patches included in release 29 - kmod-populate-modules-Use-more-bash-more-quotes.patch diff --git a/kmod.spec b/kmod.spec index b89ba1b..d14b9cd 100644 --- a/kmod.spec +++ b/kmod.spec @@ -37,7 +37,6 @@ Patch5: 0011-Do-not-filter-unsupported-modules-when-running-a-van.patch Patch6: 0012-modprobe-print-unsupported-status.patch Patch7: usr-lib-modprobe.patch Patch8: no-stylesheet-download.patch -Patch9: kmod-usrmerge.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: docbook5-xsl-stylesheets @@ -101,11 +100,6 @@ in %lname. %prep %autosetup -p1 -# When not on tumbleweed read both /lib and /usr/lib -# on Tumbleweed /lib and /usr/lib are the same - don't apply files twice -%if 0%{?suse_version} <= 1500 -%patch9 -p1 -R -%endif %build autoreconf -fi