None of the RPMs created by make rpm-pkg appear to contain vmlinux debug symbols (though debug symbols for modules are left in the .ko files in the kernel-%{KERNELRELEASE} package). This causes issues when trying to run tools like systemtap against kernels produced via make rpm-pkg. Add the vmlinux debug symbols to the kernel-%{KERNELRELEASE} package (at /lib/modules/${KERNELRELEASE}/vmlinux.debug). Signed-off-by: Uday Shankar <ushankar@xxxxxxxxxxxxxxx> --- scripts/package/kernel.spec | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/package/kernel.spec b/scripts/package/kernel.spec index ac3e5ac01d8a..f5d6ce95b4f0 100644 --- a/scripts/package/kernel.spec +++ b/scripts/package/kernel.spec @@ -60,6 +60,15 @@ cp $(%{make} %{makeflags} -s image_name) %{buildroot}/lib/modules/%{KERNELRELEAS # DEPMOD=true makes depmod no-op. We do not package depmod-generated files. %{make} %{makeflags} INSTALL_MOD_PATH=%{buildroot} DEPMOD=true modules_install %{make} %{makeflags} INSTALL_HDR_PATH=%{buildroot}/usr headers_install +( + # eu-strip tries to truncate its output file, which does not end + # well with -o /dev/null. so output to a junk temp file instead + tmp=$(mktemp) + trap "rm -f $tmp" 0 + eu-strip --remove-comment \ + -f %{buildroot}/lib/modules/%{KERNELRELEASE}/vmlinux.debug \ + -o $tmp vmlinux +) cp System.map %{buildroot}/lib/modules/%{KERNELRELEASE} cp .config %{buildroot}/lib/modules/%{KERNELRELEASE}/config if %{make} %{makeflags} run-command KBUILD_RUN_COMMAND='test -d ${srctree}/arch/${SRCARCH}/boot/dts' 2>/dev/null; then base-commit: e3bf4ec9d54ed96fb3eb7dd53edcc9452897604d -- 2.34.1