summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Deutschmann <whissi@gentoo.org>2020-09-03 01:15:16 +0200
committerThomas Deutschmann <whissi@gentoo.org>2020-09-03 16:16:38 +0200
commit4e4dff82bbb63e8b5a6e97880b085c3ee2e2e583 (patch)
tree360a6e5010a89fd224f84c351f1347352f1056d0 /sys-apps/kmod
parentsys-kernel/gentoo-sources: keyword riscv (diff)
downloadgentoo-4e4dff82bbb63e8b5a6e97880b085c3ee2e2e583.tar.gz
gentoo-4e4dff82bbb63e8b5a6e97880b085c3ee2e2e583.tar.bz2
gentoo-4e4dff82bbb63e8b5a6e97880b085c3ee2e2e583.zip
sys-apps/kmod: rev bump to fix crash
Fixes depmod: tools/depmod.c:416: index_write: Assertion `initial_offset >= 0' failed. Package-Manager: Portage-3.0.4, Repoman-3.0.1 Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'sys-apps/kmod')
-rw-r--r--sys-apps/kmod/files/kmod-27-depmod-do-not-output-.bin-to-stdout.patch53
-rw-r--r--sys-apps/kmod/kmod-27-r2.ebuild (renamed from sys-apps/kmod/kmod-27-r1.ebuild)2
2 files changed, 55 insertions, 0 deletions
diff --git a/sys-apps/kmod/files/kmod-27-depmod-do-not-output-.bin-to-stdout.patch b/sys-apps/kmod/files/kmod-27-depmod-do-not-output-.bin-to-stdout.patch
new file mode 100644
index 000000000000..dc776b515bc0
--- /dev/null
+++ b/sys-apps/kmod/files/kmod-27-depmod-do-not-output-.bin-to-stdout.patch
@@ -0,0 +1,53 @@
+From 53b30aeba2dedae9f5558f560231d9462e063dfc Mon Sep 17 00:00:00 2001
+From: Lucas De Marchi <lucas.demarchi@intel.com>
+Date: Thu, 5 Mar 2020 13:33:10 -0800
+Subject: depmod: do not output .bin to stdout
+
+index_write() relies on fseek/ftell to manage the position to which we
+are write and thus needs the file stream to support it.
+
+Right now when trying to write the index to stdout we fail with:
+
+ depmod: tools/depmod.c:416: index_write: Assertion `initial_offset >= 0' failed.
+ Aborted (core dumped)
+
+We have no interest in outputting our index to stdout, so just skip it
+like is done with other indexes.
+
+While at it, add/remove some newlines to improve readability.
+
+Reported-by: Yanko Kaneti <yaneti@declera.com>
+Fix: b866b2165ae6 ("Lookup aliases in the modules.builtin.modinfo")
+---
+ tools/depmod.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/tools/depmod.c b/tools/depmod.c
+index fbbce10..875e314 100644
+--- a/tools/depmod.c
++++ b/tools/depmod.c
+@@ -2408,8 +2408,10 @@ static int output_builtin_alias_bin(struct depmod *depmod, FILE *out)
+ struct index_node *idx;
+ struct kmod_list *l, *builtin = NULL;
+
+- idx = index_create();
++ if (out == stdout)
++ return 0;
+
++ idx = index_create();
+ if (idx == NULL) {
+ ret = -ENOMEM;
+ goto fail;
+@@ -2456,7 +2458,9 @@ static int output_builtin_alias_bin(struct depmod *depmod, FILE *out)
+
+ if (count)
+ index_write(idx, out);
++
+ index_destroy(idx);
++
+ fail:
+ if (builtin)
+ kmod_module_unref_list(builtin);
+--
+cgit 1.2.3-1.el7
+
diff --git a/sys-apps/kmod/kmod-27-r1.ebuild b/sys-apps/kmod/kmod-27-r2.ebuild
index c9e60cdc33f1..d01054db3c4b 100644
--- a/sys-apps/kmod/kmod-27-r1.ebuild
+++ b/sys-apps/kmod/kmod-27-r2.ebuild
@@ -63,6 +63,8 @@ REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
DOCS="NEWS README TODO"
+PATCHES=( "${FILESDIR}"/${P}-depmod-do-not-output-.bin-to-stdout.patch )
+
src_prepare() {
default