[SRU][R/S][PATCH v3 1/1] UBUNTU: [packaging] Create a linux-main-modules dependency toggle
Alessio Faina
alessio.faina at canonical.com
Wed Sep 2 17:48:45 UTC 2026
Create a dependency toggle to manually remove the dependency on
linux-main-modules-* packages from the linux-modules package. This is
useful for local or CI testing when the companion modules packages are
not available.
Signed-off-by: Alessio Faina <alessio.faina at canonical.com>
---
debian.master/control.d/vars.generic | 2 ++
debian.master/control.d/vars.generic-64k | 2 ++
debian/rules.d/0-common-vars.mk | 11 +++++++++++
debian/rules.d/1-maintainer.mk | 1 +
debian/scripts/control-create | 5 +++++
5 files changed, 21 insertions(+)
diff --git a/debian.master/control.d/vars.generic b/debian.master/control.d/vars.generic
index c5a897daf8d0..31c470d3b62e 100644
--- a/debian.master/control.d/vars.generic
+++ b/debian.master/control.d/vars.generic
@@ -3,4 +3,6 @@ supported="Generic"
target="Geared toward desktop and server systems."
bootloader="grub-pc [amd64] | grub-efi-amd64 [amd64] | grub-efi-ia32 [amd64] | grub [amd64] | lilo [amd64] | flash-kernel [armhf arm64] | grub-efi-arm64 [arm64] | grub-efi-arm [armhf] | grub-ieee1275 [ppc64el]"
provides="kvm-api-4, redhat-cluster-modules, ivtv-modules, virtualbox-guest-modules [amd64]"
+# The depends line will be bypassed by the do_linux_main_modules_depends
+# config if set to false, skipping all the configured modules
depends="linux-main-modules-zfs-PKGVER-ABINUM-generic [amd64 arm64 ppc64el s390x]"
diff --git a/debian.master/control.d/vars.generic-64k b/debian.master/control.d/vars.generic-64k
index 732326c0ad17..721e6ff14037 100644
--- a/debian.master/control.d/vars.generic-64k
+++ b/debian.master/control.d/vars.generic-64k
@@ -3,4 +3,6 @@ supported="Generic 64K pages"
target="Geared toward desktop and server systems."
bootloader="grub-efi-arm64 [arm64] | flash-kernel [arm64]"
provides="kvm-api-4, redhat-cluster-modules, ivtv-modules"
+# The depends line will be bypassed by the do_linux_main_modules_depends
+# config if set to false, skipping all the configured modules
depends="linux-main-modules-zfs-PKGVER-ABINUM-generic-64k [arm64]"
diff --git a/debian/rules.d/0-common-vars.mk b/debian/rules.d/0-common-vars.mk
index 1ea787d668dc..c3a8c4f2ed9e 100644
--- a/debian/rules.d/0-common-vars.mk
+++ b/debian/rules.d/0-common-vars.mk
@@ -47,6 +47,17 @@ else
do_full_build ?= true
endif
+#
+# do_linux_main_modules_depends -- include linux-main-modules-* in linux-modules Depends.
+# Set to false to skip these dependencies, e.g. for local or CI testing when
+# the companion modules packages are not available.
+#
+do_linux_main_modules_depends ?= true
+export do_linux_main_modules_depends
+ifeq ($(do_linux_main_modules_depends),false)
+ $(info II: do_linux_main_modules_depends=false -- skipping linux-main-modules-* dependencies)
+endif
+
#
# The debug packages are ginormous, so you probably want to skip
# building them (as a developer).
diff --git a/debian/rules.d/1-maintainer.mk b/debian/rules.d/1-maintainer.mk
index 6892f71b7964..7055b3c071c5 100644
--- a/debian/rules.d/1-maintainer.mk
+++ b/debian/rules.d/1-maintainer.mk
@@ -64,6 +64,7 @@ printenv:
@echo "do_full_build = $(do_full_build)"
@echo "do_mainline_build = $(do_mainline_build)"
@echo "do_dbgsym_package = $(do_dbgsym_package)"
+ @echo "do_linux_main_modules_depends = $(do_linux_main_modules_depends)"
@echo "do_dtbs = $(do_dtbs)"
@echo "do_source_package = $(do_source_package)"
@echo "do_source_package_content = $(do_source_package_content)"
diff --git a/debian/scripts/control-create b/debian/scripts/control-create
index f96da1ec1168..51baf8fb72a0 100755
--- a/debian/scripts/control-create
+++ b/debian/scripts/control-create
@@ -46,6 +46,11 @@ gen_per_flavour () {
. "${var}"
+ if [ "${do_linux_main_modules_depends}" = false ]; then
+ echo "II: do_linux_main_modules_depends=false -- dropping depends '${depends}' for flavour ${flavour}" >&2
+ depends=''
+ fi
+
if [ "$provides" != '' ]; then
provides+=", "
fi
--
2.43.0
More information about the kernel-team
mailing list