Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/kmod/, sys-apps/kmod/files/
Date: Thu, 03 Sep 2020 14:16:58
Message-Id: 1599142598.4e4dff82bbb63e8b5a6e97880b085c3ee2e2e583.whissi@gentoo
1 commit: 4e4dff82bbb63e8b5a6e97880b085c3ee2e2e583
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Wed Sep 2 23:15:16 2020 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 3 14:16:38 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4e4dff82
7
8 sys-apps/kmod: rev bump to fix crash
9
10 Fixes
11
12 depmod: tools/depmod.c:416: index_write: Assertion `initial_offset >= 0' failed.
13
14 Package-Manager: Portage-3.0.4, Repoman-3.0.1
15 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
16
17 ...od-27-depmod-do-not-output-.bin-to-stdout.patch | 53 ++++++++++++++++++++++
18 .../kmod/{kmod-27-r1.ebuild => kmod-27-r2.ebuild} | 2 +
19 2 files changed, 55 insertions(+)
20
21 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
22 new file mode 100644
23 index 00000000000..dc776b515bc
24 --- /dev/null
25 +++ b/sys-apps/kmod/files/kmod-27-depmod-do-not-output-.bin-to-stdout.patch
26 @@ -0,0 +1,53 @@
27 +From 53b30aeba2dedae9f5558f560231d9462e063dfc Mon Sep 17 00:00:00 2001
28 +From: Lucas De Marchi <lucas.demarchi@×××××.com>
29 +Date: Thu, 5 Mar 2020 13:33:10 -0800
30 +Subject: depmod: do not output .bin to stdout
31 +
32 +index_write() relies on fseek/ftell to manage the position to which we
33 +are write and thus needs the file stream to support it.
34 +
35 +Right now when trying to write the index to stdout we fail with:
36 +
37 + depmod: tools/depmod.c:416: index_write: Assertion `initial_offset >= 0' failed.
38 + Aborted (core dumped)
39 +
40 +We have no interest in outputting our index to stdout, so just skip it
41 +like is done with other indexes.
42 +
43 +While at it, add/remove some newlines to improve readability.
44 +
45 +Reported-by: Yanko Kaneti <yaneti@×××××××.com>
46 +Fix: b866b2165ae6 ("Lookup aliases in the modules.builtin.modinfo")
47 +---
48 + tools/depmod.c | 6 +++++-
49 + 1 file changed, 5 insertions(+), 1 deletion(-)
50 +
51 +diff --git a/tools/depmod.c b/tools/depmod.c
52 +index fbbce10..875e314 100644
53 +--- a/tools/depmod.c
54 ++++ b/tools/depmod.c
55 +@@ -2408,8 +2408,10 @@ static int output_builtin_alias_bin(struct depmod *depmod, FILE *out)
56 + struct index_node *idx;
57 + struct kmod_list *l, *builtin = NULL;
58 +
59 +- idx = index_create();
60 ++ if (out == stdout)
61 ++ return 0;
62 +
63 ++ idx = index_create();
64 + if (idx == NULL) {
65 + ret = -ENOMEM;
66 + goto fail;
67 +@@ -2456,7 +2458,9 @@ static int output_builtin_alias_bin(struct depmod *depmod, FILE *out)
68 +
69 + if (count)
70 + index_write(idx, out);
71 ++
72 + index_destroy(idx);
73 ++
74 + fail:
75 + if (builtin)
76 + kmod_module_unref_list(builtin);
77 +--
78 +cgit 1.2.3-1.el7
79 +
80
81 diff --git a/sys-apps/kmod/kmod-27-r1.ebuild b/sys-apps/kmod/kmod-27-r2.ebuild
82 similarity index 98%
83 rename from sys-apps/kmod/kmod-27-r1.ebuild
84 rename to sys-apps/kmod/kmod-27-r2.ebuild
85 index c9e60cdc33f..d01054db3c4 100644
86 --- a/sys-apps/kmod/kmod-27-r1.ebuild
87 +++ b/sys-apps/kmod/kmod-27-r2.ebuild
88 @@ -63,6 +63,8 @@ REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
89
90 DOCS="NEWS README TODO"
91
92 +PATCHES=( "${FILESDIR}"/${P}-depmod-do-not-output-.bin-to-stdout.patch )
93 +
94 src_prepare() {
95 default