[Noble/Unstable][PATCH] UBUNTU: [Packaging] Build linux-tools-{common, host} only for linux and linux-unstable

Juerg Haefliger juerg.haefliger at canonical.com
Thu Nov 23 09:29:30 UTC 2023


The linux-tools-common and linux-tools-host packages are binary indep
packages and may only be built for the main linux and linux-unstable
source packages. Enforce this rule for the make variables
do_tools_common and do_tools_host which control the package builds.

Package builds are disabled by default, to enable them, the following
needs to be explicitly added to debian.master/rules.d/amd64.mk:
  do_tools_common = true
  do_tools_host   = true

Signed-off-by: Juerg Haefliger <juerg.haefliger at canonical.com>
---
 debian.master/rules.d/i386.mk    |  1 -
 debian.master/rules.d/riscv64.mk |  1 -
 debian/rules                     | 17 +++++++++++++----
 3 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/debian.master/rules.d/i386.mk b/debian.master/rules.d/i386.mk
index a9327adb7052..77216b5a3594 100644
--- a/debian.master/rules.d/i386.mk
+++ b/debian.master/rules.d/i386.mk
@@ -9,7 +9,6 @@ vdso		= vdso_install
 no_dumpfile	= true
 do_flavour_image_package = false
 do_tools	= false
-do_tools_common	= false
 do_extras_package = false
 do_source_package = false
 do_doc_package	= false
diff --git a/debian.master/rules.d/riscv64.mk b/debian.master/rules.d/riscv64.mk
index 2fa468ae8c1e..5486912f7483 100644
--- a/debian.master/rules.d/riscv64.mk
+++ b/debian.master/rules.d/riscv64.mk
@@ -11,7 +11,6 @@ no_dumpfile	= true
 
 do_flavour_image_package = false
 do_tools	= false
-do_tools_common	= false
 do_extras_package = false
 do_source_package = false
 do_doc_package	= false
diff --git a/debian/rules b/debian/rules
index 70ad432a2e90..ce2fbc8978b0 100755
--- a/debian/rules
+++ b/debian/rules
@@ -45,10 +45,19 @@ include $(DROOT)/rules.d/1-maintainer.mk
 
 do_linux_tools=$(sort $(filter-out false,$(do_tools_usbip) $(do_tools_cpupower) $(do_tools_perf) $(do_tools_bpftool) $(do_tools_x86)))
 do_cloud_tools=$(sort $(filter-out false,$(do_tools_hyperv)))
-do_tools_common?=true
-do_tools_host?=false
 do_tools_perf_jvmti?=false
 
+# linux-tools-{common,host} may only be built for the main linux and
+# linux-unstable source packages and must be explicitly enabled
+# in rules.d/amd64.mk.
+ifneq ($(filter $(src_pkg_name),linux linux-unstable),)  # logical OR
+	do_tools_common ?= false
+	do_tools_host ?= false
+else
+	do_tools_common = false
+	do_tools_host = false
+endif
+
 # Default settings for DKMS modules.
 $(foreach _m,$(all_dkms_modules), \
   $(eval do_$(_m) ?= $(if $(filter $(_m),$(filter-out $(dkms_exclude),$(dkms_include) $(subst any,$(_m),$(subst $(arch),$(_m),$(dkms_$(_m)_archs))))),true,false)) \
@@ -103,8 +112,8 @@ endif
 ifneq ($(do_tools),true)
 	do_linux_tools=
 	do_cloud_tools=
-	do_tools_common=
-	do_tools_host=
+	do_tools_common = false
+	do_tools_host = false
 endif
 
 $(foreach _m,$(all_built-in_dkms_modules), \
-- 
2.40.1




More information about the kernel-team mailing list