From 878cde170c719536e12610a21fd502ba6939b436 Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Tue, 22 Aug 2017 22:01:37 -0700 Subject: [PATCH 1/2] sys-kernel/coreos-modules: copy unstripped modules into /usr/lib/debug This shouldn't affect the SDK or the OS image, but ensures that debug symbols are available from the binary package. Modules are installed into: /usr/lib/debug/usr/lib/modules//kernel/ --- ...dules-4.12.8.ebuild => coreos-modules-4.12.8-r1.ebuild} | 7 +++++++ 1 file changed, 7 insertions(+) rename sdk_container/src/third_party/coreos-overlay/sys-kernel/coreos-modules/{coreos-modules-4.12.8.ebuild => coreos-modules-4.12.8-r1.ebuild} (85%) diff --git a/sdk_container/src/third_party/coreos-overlay/sys-kernel/coreos-modules/coreos-modules-4.12.8.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-kernel/coreos-modules/coreos-modules-4.12.8-r1.ebuild similarity index 85% rename from sdk_container/src/third_party/coreos-overlay/sys-kernel/coreos-modules/coreos-modules-4.12.8.ebuild rename to sdk_container/src/third_party/coreos-overlay/sys-kernel/coreos-modules/coreos-modules-4.12.8-r1.ebuild index 763d6d9dfe..685aa802e6 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-kernel/coreos-modules/coreos-modules-4.12.8.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/sys-kernel/coreos-modules/coreos-modules-4.12.8-r1.ebuild @@ -41,6 +41,13 @@ src_install() { INSTALL_FW_PATH="${T}/fw" \ modules_install + # Install to /usr/lib/debug with debug symbols intact + kmake INSTALL_MOD_PATH="${D}/usr/lib/debug/usr" \ + INSTALL_FW_PATH="${T}/fw" \ + modules_install + rm "${D}/usr/lib/debug/usr/lib/modules/${KV_FULL}/"modules.* || die + rm "${D}/usr/lib/debug/usr/lib/modules/${KV_FULL}/"{source,build} || die + # Clean up the build tree shred_keys kmake clean From 9bd0973251f5555bc6c7b177c77bd5329bd406f3 Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Tue, 22 Aug 2017 22:04:37 -0700 Subject: [PATCH 2/2] sys-kernel/coreos-kernel: copy vmlinux and vdso libs into /usr/lib/debug This shouldn't affect the SDK or the OS image, but ensures that debug symbols are available from the binary package. vmlinux is installed to: /usr/lib/debug/usr/boot/vmlinux- vdso binaries are installed to: /usr/lib/debug/usr/lib/modules//vdso/ A symlink is created: /usr/lib/debug/usr/lib/modules//vmlinux -> ../../../boot/vmlinux- --- ...l-4.12.8.ebuild => coreos-kernel-4.12.8-r1.ebuild} | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) rename sdk_container/src/third_party/coreos-overlay/sys-kernel/coreos-kernel/{coreos-kernel-4.12.8.ebuild => coreos-kernel-4.12.8-r1.ebuild} (85%) diff --git a/sdk_container/src/third_party/coreos-overlay/sys-kernel/coreos-kernel/coreos-kernel-4.12.8.ebuild b/sdk_container/src/third_party/coreos-overlay/sys-kernel/coreos-kernel/coreos-kernel-4.12.8-r1.ebuild similarity index 85% rename from sdk_container/src/third_party/coreos-overlay/sys-kernel/coreos-kernel/coreos-kernel-4.12.8.ebuild rename to sdk_container/src/third_party/coreos-overlay/sys-kernel/coreos-kernel/coreos-kernel-4.12.8-r1.ebuild index 090cb5ec8a..abc3b4ff57 100644 --- a/sdk_container/src/third_party/coreos-overlay/sys-kernel/coreos-kernel/coreos-kernel-4.12.8.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/sys-kernel/coreos-kernel/coreos-kernel-4.12.8-r1.ebuild @@ -77,9 +77,12 @@ src_install() { insinto "/usr/lib/modules/${KV_FULL}/build" doins build/System.map - # TODO: vmlinux would be useful for debugging but it is >300MB - # Uncomment vdso_install for easy access to debug symbols in gdb: - # set debug-file-directory /lib/modules/4.0.7-coreos-r2/vdso/ - #kmake INSTALL_MOD_PATH="${D}/usr" vdso_install + insinto "/usr/lib/debug/usr/boot" + newins build/vmlinux "vmlinux-${KV_FULL}" + dosym "../../../boot/vmlinux-${KV_FULL}" "/usr/lib/debug/usr/lib/modules/${KV_FULL}/vmlinux" + + # For easy access to vdso debug symbols in gdb: + # set debug-file-directory /usr/lib/debug/usr/lib/modules/${KV_FULL}/vdso/ + kmake INSTALL_MOD_PATH="${D}/usr/lib/debug/usr" vdso_install }