new file mode 100644
@@ -0,0 +1,7 @@
+Package: linux-bpf-dev
+Architecture: amd64 armhf arm64 i386 ppc64el riscv64 s390x
+Depends: ${misc:Depends}
+Multi-Arch: same
+Description: Headers for BPF development
+ The vmlinux.h header is provided to allow userspace to build BPF CO-RE
+ programs targeting the packaged kernel.
@@ -175,6 +175,7 @@ ifeq ($(src_pkg_name),linux)
control_files += debian/control.d/linux-tools-host.stub
control_files += debian/control.d/linux-source.stub
control_files += debian/control.d/linux-doc.stub
+ control_files += debian/control.d/linux-bpf-dev.stub
endif
# Calculate Ubuntu Compatible Signing levels
@@ -256,9 +256,7 @@ ifeq ($(do_dbgsym_package),true)
rm -f $(dbgpkgdir)/usr/lib/debug/lib/modules/$(abi_release)-$*/modules.*
rm -fr $(dbgpkgdir)/usr/lib/debug/lib/firmware
endif
-ifeq ($(do_tools_bpftool),true)
cp $(builddir)/build-$*/vmlinux tools/bpf/bpftool/
-endif
# The flavour specific headers image
# TODO: Would be nice if we didn't have to dupe the original builddir
@@ -616,6 +614,7 @@ endif
ifeq ($(do_cloud_tools),true)
$(call dh_all,$(pkgcloud))
endif
+ $(call dh_all,linux-bpf-dev)
#
# per-architecture packages
@@ -658,11 +657,10 @@ ifeq ($(do_tools_perf),true)
cd $(builddirpa)/tools/perf && \
$(kmake) prefix=/usr NO_LIBTRACEEVENT=1 HAVE_CPLUS_DEMANGLE_SUPPORT=1 CROSS_COMPILE=$(CROSS_COMPILE) NO_LIBPERL=1 WERROR=0
endif
-ifeq ($(do_tools_bpftool),true)
mv $(builddirpa)/tools/bpf/bpftool/vmlinux $(builddirpa)/vmlinux
$(kmake) NO_LIBTRACEEVENT=1 CROSS_COMPILE=$(CROSS_COMPILE) -C $(builddirpa)/tools/bpf/bpftool
+ $(builddirpa)/tools/bpf/bpftool/bpftool btf dump file $(builddirpa)/vmlinux format c > $(builddirpa)/vmlinux.h
rm -f $(builddirpa)/vmlinux
-endif
ifeq ($(do_tools_x86),true)
cd $(builddirpa)/tools/power/x86/x86_energy_perf_policy && make CROSS_COMPILE=$(CROSS_COMPILE)
cd $(builddirpa)/tools/power/x86/turbostat && make CROSS_COMPILE=$(CROSS_COMPILE)
@@ -713,6 +711,8 @@ endif
ifeq ($(do_tools_bpftool),true)
install -m755 $(builddirpa)/tools/bpf/bpftool/bpftool $(toolspkgdir)/usr/lib/$(src_pkg_name)-tools-$(abi_release)
endif
+ install -d -m755 $(CURDIR)/debian/linux-bpf-dev/usr/include/$(DEB_HOST_MULTIARCH)/linux/
+ install -m644 $(builddirpa)/vmlinux.h $(CURDIR)/debian/linux-bpf-dev/usr/include/$(DEB_HOST_MULTIARCH)/linux/vmlinux.h
ifeq ($(do_tools_x86),true)
install -m755 \
$(addprefix $(builddirpa)/tools/power/x86/, x86_energy_perf_policy/x86_energy_perf_policy turbostat/turbostat) \