Gentoo Archives: gentoo-commits

From: Nick Sarnie <sarnex@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/vendor-reset/, app-emulation/vendor-reset/files/
Date: Mon, 24 May 2021 22:44:53
Message-Id: 1621896279.fce45a24e00bf2192e0c8bfa3c80b4dad33c201b.sarnex@gentoo
1 commit: fce45a24e00bf2192e0c8bfa3c80b4dad33c201b
2 Author: Nick Sarnie <sarnex <AT> gentoo <DOT> org>
3 AuthorDate: Mon May 24 22:43:25 2021 +0000
4 Commit: Nick Sarnie <sarnex <AT> gentoo <DOT> org>
5 CommitDate: Mon May 24 22:44:39 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fce45a24
7
8 app-emulation/vendor-reset: Add patch
9
10 Closes: https://bugs.gentoo.org/791877
11 Package-Manager: Portage-3.0.19, Repoman-3.0.3
12 Signed-off-by: Nick Sarnie <sarnex <AT> gentoo.org>
13
14 .../vendor-reset/files/Fix-5.11-build.patch | 52 ++++++++++++++++++++++
15 .../vendor-reset/vendor-reset-0.1.0.ebuild | 2 +
16 2 files changed, 54 insertions(+)
17
18 diff --git a/app-emulation/vendor-reset/files/Fix-5.11-build.patch b/app-emulation/vendor-reset/files/Fix-5.11-build.patch
19 new file mode 100644
20 index 00000000000..845ea08afc5
21 --- /dev/null
22 +++ b/app-emulation/vendor-reset/files/Fix-5.11-build.patch
23 @@ -0,0 +1,52 @@
24 +From 225a49a40941e350899e456366265cf82b87ad25 Mon Sep 17 00:00:00 2001
25 +From: =?UTF-8?q?T=C3=A9rence=20Clastres?= <t.clastres@×××××.com>
26 +Date: Sun, 31 Jan 2021 20:22:00 +0100
27 +Subject: [PATCH] [core] add support for linux 5.11
28 +
29 +This approach maintains compatibility with previous kernel versions.
30 +
31 +Thanks to @justinkb for finding the commit that broke it (torvalds/linux@d19ad07).
32 +---
33 + dkms.conf | 2 +-
34 + src/ftrace.c | 8 ++++++++
35 + 2 files changed, 9 insertions(+), 1 deletion(-)
36 +
37 +diff --git a/dkms.conf b/dkms.conf
38 +index 396abd3..09fbcf0 100644
39 +--- a/dkms.conf
40 ++++ b/dkms.conf
41 +@@ -1,5 +1,5 @@
42 + PACKAGE_NAME="vendor-reset"
43 +-PACKAGE_VERSION="0.1.0"
44 ++PACKAGE_VERSION="0.1.1"
45 + BUILT_MODULE_NAME[0]="${PACKAGE_NAME}"
46 + MAKE[0]="make KDIR=${kernel_source_dir}"
47 + CLEAN="make KDIR=${kernel_source_dir} clean"
48 +diff --git a/src/ftrace.c b/src/ftrace.c
49 +index 80bb4aa..7eed223 100644
50 +--- a/src/ftrace.c
51 ++++ b/src/ftrace.c
52 +@@ -22,6 +22,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
53 + #include <linux/ftrace.h>
54 + #include <linux/kprobes.h>
55 + #include <linux/pci.h>
56 ++#include <linux/version.h>
57 +
58 + #include "ftrace.h"
59 +
60 +@@ -48,8 +49,15 @@ static int resolve_hook_address(struct ftrace_hook *hook)
61 + return 0;
62 + }
63 +
64 ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0))
65 + static void notrace fh_trace_thunk(unsigned long ip, unsigned long parent_ip, struct ftrace_ops *ops, struct pt_regs *regs)
66 + {
67 ++#else
68 ++static void notrace fh_trace_thunk(unsigned long ip, unsigned long parent_ip, struct ftrace_ops *ops, struct ftrace_regs *fregs)
69 ++{
70 ++ struct pt_regs *regs;
71 ++ regs = ftrace_get_regs(fregs);
72 ++#endif
73 + struct ftrace_hook *hook = to_ftrace_hook(ops);
74 +
75 + if (!within_module(parent_ip, THIS_MODULE))
76
77 diff --git a/app-emulation/vendor-reset/vendor-reset-0.1.0.ebuild b/app-emulation/vendor-reset/vendor-reset-0.1.0.ebuild
78 index c772c455876..192727933e8 100644
79 --- a/app-emulation/vendor-reset/vendor-reset-0.1.0.ebuild
80 +++ b/app-emulation/vendor-reset/vendor-reset-0.1.0.ebuild
81 @@ -22,6 +22,8 @@ SLOT="0"
82 DEPEND=""
83 RDEPEND="${DEPEND}"
84
85 +PATCHES=( "${FILESDIR}/Fix-5.11-build.patch" )
86 +
87 pkg_setup() {
88 local CONFIG_CHECK="FTRACE KPROBES PCI_QUIRKS KALLSYMS FUNCTION_TRACER"
89 linux-mod_pkg_setup