Vendor: The Linux Community
URL: https://www.kernel.org
Source0: linux-kernel-%{version}.tar.xz
+Source1001: linux-bpif3.manifest
BuildRoot: %{_tmppath}/%{name}-%{PACKAGE_VERSION}-root
%define fullVersion %{version}-%{target_board}
BuildRequires: bison
BuildRequires: flex
BuildRequires: pkgconfig(openssl3)
+BuildRequires: libelf-devel
+BuildRequires: python3
BuildRequires: rsync
# kernel
headers are used by the installed headers for GNU glibc and other system
libraries.
+%package -n linux-kernel-bpftool
+Summary: The bpftool utility
+Group: System/Kernel
+Provides: bpftool = %{version}
+
+%description -n linux-kernel-bpftool
+This package provides bpftool. Bpftool is a command-line utility designed
+for managing, inspecting, debugging, and generating skeletons for eBPF
+programs within the Linux kernel. Its skeleton generation feature
+("bpftool gen skeleton") enables easier integration of compiled BPF
+objects with user-space applications, making bpftool a critical component
+for building and running eBPF-based monitoring and instrumentation.
+
%prep
%setup -q -n linux-kernel-%{version}
+cp %{SOURCE1001} .
%build
%{?asan:/usr/bin/gcc-unforce-options}
# Build modules
make modules %{?_smp_mflags}
+# Build bpftool
+WERROR=0 make -s -C tools/bpf/bpftool %{?_smp_mflags}
+
%install
QA_SKIP_BUILD_ROOT="DO_NOT_WANT"; export QA_SKIP_BUILD_ROOT
# Install modules
make INSTALL_MOD_STRIP=1 INSTALL_MOD_PATH=%{buildroot} modules_install
+# Install bpftool
+mkdir -p %{buildroot}/usr/sbin
+install -m 755 tools/bpf/bpftool/bpftool %{buildroot}/usr/sbin/
+
# Copy files for devel package
mkdir -p %{buildroot}/boot/kernel/devel/kernel-devel-%{variant}
rsync -r \
%files -n %{variant}-linux-kernel-headers
/usr/include/*
+
+%files -n linux-kernel-bpftool
+%manifest linux-bpif3.manifest
+%license COPYING
+/usr/sbin/bpftool