1 |
commit: 0aaa5a38da97a09aa9e03302e3eddbb858cf7139 |
2 |
Author: Martin Kletzander <nert.pinx <AT> gmail <DOT> com> |
3 |
AuthorDate: Thu Jun 23 12:07:35 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jul 3 23:54:00 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0aaa5a38 |
7 |
|
8 |
kernel-build.eclass: Properly install vmlinux(.debug) |
9 |
|
10 |
Previously, in commit ad3b55e32736 we installed vmlinux with debug |
11 |
symbols, but two issues remained. Firstly, the debug symbols were |
12 |
stripped (and optionally extracted), and secondly the build-id was |
13 |
changed due to how estrip works. |
14 |
|
15 |
In order to make systemtap work without complaining about missing |
16 |
debuginfo and mismatch of build-id from the running kernel install the |
17 |
whole vmlinux and exclude it from stripping. |
18 |
|
19 |
Signed-off-by: Martin Kletzander <nert.pinx <AT> gmail.com> |
20 |
Closes: https://github.com/gentoo/gentoo/pull/26065 |
21 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
22 |
|
23 |
eclass/kernel-build.eclass | 15 ++++++++------- |
24 |
1 file changed, 8 insertions(+), 7 deletions(-) |
25 |
|
26 |
diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass |
27 |
index dbd9080ab98a..750a8e873d98 100644 |
28 |
--- a/eclass/kernel-build.eclass |
29 |
+++ b/eclass/kernel-build.eclass |
30 |
@@ -196,16 +196,17 @@ kernel-build_src_install() { |
31 |
local image_path=$(dist-kernel_get_image_path) |
32 |
cp -p "build/${image_path}" "${ED}/usr/src/linux-${ver}/${image_path}" || die |
33 |
|
34 |
- # Install the unstripped uncompressed vmlinux for use with systemtap |
35 |
- # etc. Use mv rather than doins for the same reason as above -- |
36 |
- # space and time. |
37 |
- if use debug; then |
38 |
- mv build/vmlinux "${ED}/usr/src/linux-${ver}/" || die |
39 |
- fi |
40 |
- |
41 |
# building modules fails with 'vmlinux has no symtab?' if stripped |
42 |
use ppc64 && dostrip -x "/usr/src/linux-${ver}/${image_path}" |
43 |
|
44 |
+ # Install vmlinux with debuginfo when requested |
45 |
+ if use debug; then |
46 |
+ if [[ "${image_path}" != "vmlinux" ]]; then |
47 |
+ mv "build/vmlinux" "${ED}/usr/src/linux-${ver}/vmlinux" || die |
48 |
+ fi |
49 |
+ dostrip -x "/usr/src/linux-${ver}/vmlinux" |
50 |
+ fi |
51 |
+ |
52 |
# strip empty directories |
53 |
find "${D}" -type d -empty -exec rmdir {} + || die |