commit:     0aaa5a38da97a09aa9e03302e3eddbb858cf7139
Author:     Martin Kletzander <nert.pinx <AT> gmail <DOT> com>
AuthorDate: Thu Jun 23 12:07:35 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jul  3 23:54:00 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0aaa5a38

kernel-build.eclass: Properly install vmlinux(.debug)

Previously, in commit ad3b55e32736 we installed vmlinux with debug
symbols, but two issues remained.  Firstly, the debug symbols were
stripped (and optionally extracted), and secondly the build-id was
changed due to how estrip works.

In order to make systemtap work without complaining about missing
debuginfo and mismatch of build-id from the running kernel install the
whole vmlinux and exclude it from stripping.

Signed-off-by: Martin Kletzander <nert.pinx <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/26065
Signed-off-by: Sam James <sam <AT> gentoo.org>

 eclass/kernel-build.eclass | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass
index dbd9080ab98a..750a8e873d98 100644
--- a/eclass/kernel-build.eclass
+++ b/eclass/kernel-build.eclass
@@ -196,16 +196,17 @@ kernel-build_src_install() {
        local image_path=$(dist-kernel_get_image_path)
        cp -p "build/${image_path}" "${ED}/usr/src/linux-${ver}/${image_path}" 
|| die
 
-       # Install the unstripped uncompressed vmlinux for use with systemtap
-       # etc.  Use mv rather than doins for the same reason as above --
-       # space and time.
-       if use debug; then
-               mv build/vmlinux "${ED}/usr/src/linux-${ver}/" || die
-       fi
-
        # building modules fails with 'vmlinux has no symtab?' if stripped
        use ppc64 && dostrip -x "/usr/src/linux-${ver}/${image_path}"
 
+       # Install vmlinux with debuginfo when requested
+       if use debug; then
+               if [[ "${image_path}" != "vmlinux" ]]; then
+                       mv "build/vmlinux" "${ED}/usr/src/linux-${ver}/vmlinux" 
|| die
+               fi
+               dostrip -x "/usr/src/linux-${ver}/vmlinux"
+       fi
+
        # strip empty directories
        find "${D}" -type d -empty -exec rmdir {} + || die
 

Reply via email to