From: Justin M. Forbes <jforbes(a)fedoraproject.org>
Add libperf-debuginfo subpackage
When libperf was added, I failed to add the libperf-debuginfo
subpackage. This leaves libperf debuginfo in kernel-debuginfo-common
which is installonly, and creaes file conflicts. Add the debuginfo
subpackage so things are where they belong.
Signed-off-by: Justin M. Forbes <jforbes(a)fedoraproject.org>
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100644
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -1137,6 +1137,19 @@ Summary: Developement files for the perf library from kernel source
This package includes libraries and header files needed for development
of applications which use perf library from kernel source.
+%package -n libperf-debuginfo
+Summary: Debug information for package libperf
+Group: Development/Debug
+Requires: %{name}-debuginfo-common-%{_target_cpu} = %{version}-%{release}
+AutoReqProv: no
+%description -n libperf-debuginfo
+This package provides debug information for the libperf package.
+
+# Note that this pattern only works right to match the .build-id
+# symlinks because of the trailing nonmatching alternation and
+# the leading .*, because of find-debuginfo.sh's buggy handling
+# of matching the pattern against the symlinks file.
+%{expand:%%global _find_debuginfo_opts %{?_find_debuginfo_opts} -p '.*%%{_libdir}/libperf.so(\.debug)?|XXX' -o libperf-debuginfo.list}
# with_libperf
%endif
@@ -3561,6 +3574,7 @@ fi\
%{_docdir}/libperf/html/libperf-counting.html
%{_docdir}/libperf/html/libperf-sampling.html
+%files -f libperf-debuginfo.list -n libperf-debuginfo
# with_libperf
%endif
--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2950
From: Justin M. Forbes <jforbes(a)fedoraproject.org>
Add libperf-debuginfo subpackage
When libperf was added, I failed to add the libperf-debuginfo
subpackage. This leaves libperf debuginfo in kernel-debuginfo-common
which is installonly, and creaes file conflicts. Add the debuginfo
subpackage so things are where they belong.
Signed-off-by: Justin M. Forbes <jforbes(a)fedoraproject.org>
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100644
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -1137,6 +1137,19 @@ Summary: Developement files for the perf library from kernel source
This package includes libraries and header files needed for development
of applications which use perf library from kernel source.
+%package -n libperf-debuginfo
+Summary: Debug information for package libperf
+Group: Development/Debug
+Requires: %{name}-debuginfo-common-%{_target_cpu} = %{version}-%{release}
+AutoReqProv: no
+%description -n libperf-debuginfo
+This package provides debug information for the libperf package.
+
+# Note that this pattern only works right to match the .build-id
+# symlinks because of the trailing nonmatching alternation and
+# the leading .*, because of find-debuginfo.sh's buggy handling
+# of matching the pattern against the symlinks file.
+%{expand:%%global _find_debuginfo_opts %{?_find_debuginfo_opts} -p '.*%%{_libdir}/libperf.so(\.debug)?|XXX' -o libperf-debuginfo.list}
# with_libperf
%endif
@@ -3561,6 +3574,7 @@ fi\
%{_docdir}/libperf/html/libperf-counting.html
%{_docdir}/libperf/html/libperf-sampling.html
+%files -f libperf-debuginfo.list -n libperf-debuginfo
# with_libperf
%endif
--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2950
From: Ondrej Mosnacek <omosnace(a)redhat.com>
kernel.spec: include the GDB plugin in kernel-debuginfo
Provide the GDB plugin files in the debuginfo package so that consumers
can use it when dubugging the kernel via GDB [1]. While it spossible to
do it without this plugin to some extent, it becomes essential when you
want to debug also code inside modules. And it provides many more
convenience commands on top of that.
Place the plugin files beside vmlinux so that gdb can auto-load it
(after some path setup). Example gdb command line using manually
extracted debuginfo RPM contents:
gdb --directory <extracted_dir>/usr/src/debug/*/linux-<kver> \
--cd <extracted_dir>/usr/lib/debug/lib/modules/<kver> \
-iex 'add-auto-load-safe-path <extracted_dir>/usr/lib/debug/lib/modules/<kver>' \
-ex 'target remote <gdb_socket_or_port>' vmlinux
I occasionally use this to debug kernels built as an RPM and having the
plugin included will be very useful to me.
[1] https://docs.kernel.org/dev-tools/gdb-kernel-debugging.html
Signed-off-by: Ondrej Mosnacek <omosnace(a)redhat.com>
diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100644
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -2415,6 +2415,13 @@ BuildKernel() {
cp %{vmlinux_decompressor} $RPM_BUILD_ROOT%{debuginfodir}/lib/modules/$KernelVer/vmlinux.decompressor
fi
fi
+
+ # build and copy the vmlinux-gdb plugin files into kernel-debuginfo
+ %{make} %{?_smp_mflags} scripts_gdb
+ cp -a --parents scripts/gdb/{,linux/}*.py $RPM_BUILD_ROOT%{debuginfodir}/lib/modules/$KernelVer
+ # this should be a relative symlink (Kbuild creates an absolute one)
+ ln -s scripts/gdb/vmlinux-gdb.py $RPM_BUILD_ROOT%{debuginfodir}/lib/modules/$KernelVer/vmlinux-gdb.py
+ %py_byte_compile %{python3} $RPM_BUILD_ROOT%{debuginfodir}/lib/modules/$KernelVer/scripts/gdb
%endif
find $RPM_BUILD_ROOT/lib/modules/$KernelVer -name "*.ko" -type f >modnames
--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2929