[Unstable][P][PATCH] UBUNTU: [Packaging]: Fix linux-bpf-dev build error for non-main kernels

Juerg Haefliger juerg.haefliger at canonical.com
Mon Jan 13 13:13:58 UTC 2025


Non-main kernels don't have linux-build-dev listed in the control file
so the if-package macro evaluates to an empty string which results in a
bash error. Fix that by adding an additional explicit guard.

Reported-by: Vinicius Peixoto <vinicius.peixoto at canonical.com>
Signed-off-by: Juerg Haefliger <juerg.haefliger at canonical.com>
---
 debian/rules.d/2-binary-arch.mk | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
index f62f5ac17f70..1dc6bdc574c0 100644
--- a/debian/rules.d/2-binary-arch.mk
+++ b/debian/rules.d/2-binary-arch.mk
@@ -147,11 +147,13 @@ ifeq ($(do_extras_package),true)
 endif
 ifeq ($(do_linux_tools),true)
  ifeq ($(do_tools_bpftool),true)
+  ifneq ($(filter linux-bpf-dev,$(packages_enabled)),)
 	# Do this only for the primary (first) flavor
 	# linux-bpf-dev is broken: It provides vmlinux.h which is a flavored header file!
 	if [ $* = $(firstword $(flavours)) ] ; then \
-		$(call if_package, linux-bpf-dev, dh_prep -plinux-bpf-dev) ; \
+		dh_prep -plinux-bpf-dev ; \
 	fi
+  endif
  endif
 endif
 
@@ -353,6 +355,7 @@ ifeq ($(do_linux_tools),true)
 	install -d $(toolspkgdir)/usr/lib/linux-tools
 	$(LN) ../$(DEB_SOURCE)-tools-$(abi_release) $(toolspkgdir)/usr/lib/linux-tools/$(abi_release)-$*
  ifeq ($(do_tools_bpftool),true)
+  ifneq ($(filter linux-bpf-dev,$(packages_enabled)),)
 	# Do this only for the primary (first) flavor
 	# linux-bpf-dev is broken: It provides vmlinux.h which is a flavored header file!
 	if [ $* = $(firstword $(flavours)) ] ; then \
@@ -360,6 +363,7 @@ ifeq ($(do_linux_tools),true)
 		install -m644 $(build_dir)/vmlinux.h \
 			 $(bpfdevpkgdir)/usr/include/$(DEB_HOST_MULTIARCH)/linux/ ; \
 	fi
+  endif
  endif
 endif
 
@@ -603,11 +607,13 @@ ifeq ($(do_cloud_tools),true)
 endif
 ifeq ($(do_linux_tools),true)
  ifeq ($(do_tools_bpftool),true)
+  ifneq ($(filter linux-bpf-dev,$(packages_enabled)),)
 	# Do this only for the primary (first) flavor
 	# linux-bpf-dev is broken: It provides vmlinux.h which is a flavored header file!
 	if [ $* = $(firstword $(flavours)) ] ; then \
-		$(call if_package, linux-bpf-dev, $(call dh_all_inline,linux-bpf-dev)) ; \
+		$(call dh_all_inline,linux-bpf-dev) ; \
 	fi
+  endif
  endif
 endif
 
-- 
2.43.0




More information about the kernel-team mailing list