From: Jiri Olsa <[email protected]>

spec: Add vmlinux.h to kernel-devel package

Adding/generating vmlinux.h by bpftool to the kernel-devel
package:

  $ rpm -ql -p kernel-devel-5.13.0-0.rc...x86_64.rpm | grep vmlinux.h
  /usr/src/kernels/5.13.0-0.rc...x86_64/vmlinux.h

Some tools like bpftool or selftest need vmlinux.h to properly
compile. The vmlinux.h will be used by build system to compile
tools separately.

Signed-off-by: Jiri Olsa <[email protected]>

diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template
index blahblah..blahblah 100755
--- a/redhat/kernel.spec.template
+++ b/redhat/kernel.spec.template
@@ -554,6 +554,7 @@ BuildRequires: net-tools, hostname, bc, elfutils-devel
 BuildRequires: dwarves
 BuildRequires: python3-devel
 BuildRequires: gcc-plugin-devel
+BuildRequires: bpftool
 %if %{with_headers}
 BuildRequires: rsync
 %endif
@@ -2026,6 +2027,11 @@ BuildKernel() {
     # the F17 UsrMove feature.
     ln -sf $DevelDir $RPM_BUILD_ROOT/lib/modules/$KernelVer/build
 
+%ifnarch armv7hl
+    # Generate vmlinux.h and put it to kernel-devel path
+    bpftool btf dump file vmlinux format c > 
$RPM_BUILD_ROOT/$DevelDir/vmlinux.h
+%endif
+
     # prune junk from kernel-devel
     find $RPM_BUILD_ROOT/usr/src/kernels -name ".*.cmd" -delete
 

--
https://gitlab.com/cki-project/kernel-ark/-/merge_requests/1153
_______________________________________________
kernel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/[email protected]
Do not reply to spam on the list, report it: 
https://pagure.io/fedora-infrastructure

Reply via email to