diff mbox series

[SRU,N:linux-hwe-7.0,1/2] UBUNTU: [Packaging] Allow dynamically turning lmm on

Message ID 20260826142416.1322715-3-stefan.bader@canonical.com
State New
Headers show
Series [SRU,N:linux-hwe-7.0,1/2] UBUNTU: [Packaging] Allow dynamically turning lmm on | expand

Commit Message

Stefan Bader Aug. 26, 2026, 2:24 p.m. UTC
BugLink: https://bugs.launchpad.net/bugs/2165131

Prepare to introduce using LMM with HWE-7.0 without ripping out the base
support for doing DKMS modules. That allows to work on things and flip
everything at some point.
The new code follows resolute:linux when do_lmm is true, otherwise the
packaging should remain unchanged.

Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
---
 debian.hwe-7.0/control.d/flavour-control.stub |  2 +-
 debian.hwe-7.0/control.d/vars.generic         |  3 +++
 debian.hwe-7.0/control.d/vars.generic-64k     |  3 +++
 debian.hwe-7.0/rules.d/hooks.mk               |  1 +
 debian.hwe-7.0/scripts/helpers/local-mangle   |  1 +
 debian/rules.d/0-common-vars.mk               |  4 ++++
 debian/rules.d/1-maintainer.mk                |  4 ++++
 debian/scripts/control-create                 | 11 ++++++++++-
 8 files changed, 27 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/debian.hwe-7.0/control.d/flavour-control.stub b/debian.hwe-7.0/control.d/flavour-control.stub
index 87c7b2eae1d5..ea6b2f19ce5b 100644
--- a/debian.hwe-7.0/control.d/flavour-control.stub
+++ b/debian.hwe-7.0/control.d/flavour-control.stub
@@ -25,7 +25,7 @@  Build-Profiles: <!stage1>
 Architecture: ARCH
 Section: kernel
 Priority: optional
-Depends: ${misc:Depends}, ${shlibs:Depends}
+Depends: ${misc:Depends}, ${shlibs:Depends}, =DEPENDS=wireless-regdb
 Built-Using: ${linux:BuiltUsing}
 Description: Linux kernel modules for version PKGVER
  Contains the corresponding System.map file, the modules built by the
diff --git a/debian.hwe-7.0/control.d/vars.generic b/debian.hwe-7.0/control.d/vars.generic
index 3fd9beb0a776..1cc1934aa41c 100644
--- a/debian.hwe-7.0/control.d/vars.generic
+++ b/debian.hwe-7.0/control.d/vars.generic
@@ -3,3 +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]"
+if [ "$do_lmm" != "false" ]; then
+	depends="linux-main-modules-zfs-PKGVER-ABINUM-generic [amd64 arm64 ppc64el s390x], linux-main-modules-v4l2linux-PKGVER-ABINUM-generic [amd64 arm64 ppc64el s390x]"
+fi
diff --git a/debian.hwe-7.0/control.d/vars.generic-64k b/debian.hwe-7.0/control.d/vars.generic-64k
index cd772b42f9d7..a3260732248c 100644
--- a/debian.hwe-7.0/control.d/vars.generic-64k
+++ b/debian.hwe-7.0/control.d/vars.generic-64k
@@ -3,3 +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"
+if [ "$do_lmm" != "false" ]; then
+	depends="linux-main-modules-zfs-PKGVER-ABINUM-generic-64k [arm64], linux-main-modules-v4l2linux-PKGVER-ABINUM-generic-64k [arm64]"
+fi
diff --git a/debian.hwe-7.0/rules.d/hooks.mk b/debian.hwe-7.0/rules.d/hooks.mk
index 09b56d1bb5f6..07194f022de1 100644
--- a/debian.hwe-7.0/rules.d/hooks.mk
+++ b/debian.hwe-7.0/rules.d/hooks.mk
@@ -2,6 +2,7 @@  do_tools_common		= false
 do_tools_host		= false
 do_tools_noble_hwe	= true
 do_lib_rust		= true
+do_lmm			= false
 gcc			= gcc-13
 rustc			= rustc-1.91
 rustfmt			= /usr/lib/rust-1.91/bin/rustfmt
diff --git a/debian.hwe-7.0/scripts/helpers/local-mangle b/debian.hwe-7.0/scripts/helpers/local-mangle
index 1965649a9120..e6a8fe96e2f2 100755
--- a/debian.hwe-7.0/scripts/helpers/local-mangle
+++ b/debian.hwe-7.0/scripts/helpers/local-mangle
@@ -13,6 +13,7 @@  do_tools_common		= false
 do_tools_host		= false
 do_tools_noble_hwe	= true
 do_lib_rust		= true
+do_lmm			= false
 gcc			= $GCC
 rustc			= rustc-1.91
 rustfmt			= /usr/lib/rust-1.91/bin/rustfmt
diff --git a/debian/rules.d/0-common-vars.mk b/debian/rules.d/0-common-vars.mk
index 4fb84f689cea..35ac13cdd2c0 100644
--- a/debian/rules.d/0-common-vars.mk
+++ b/debian/rules.d/0-common-vars.mk
@@ -225,6 +225,9 @@  custom_override = $(or $($(1)_$(2)),$($(1)))
 # selftests that Ubuntu cares about
 ubuntu_selftests = breakpoints cpu-hotplug efivarfs memfd memory-hotplug mount net ptrace seccomp timers powerpc user ftrace
 
+export do_lmm?=false
+
+ifeq ($(do_lmm),false)
 # DKMS
 all_dkms_modules =
 
@@ -271,3 +274,4 @@  $(foreach _line,$(shell gawk '{ OFS = "!"; $$1 = $$1; print }' $(DEBIAN)/dkms-ve
     $(eval dkms_$(_m)_subdir = kernel) \
   ) \
 )
+endif
diff --git a/debian/rules.d/1-maintainer.mk b/debian/rules.d/1-maintainer.mk
index 6892f71b7964..2ea2696fc9a1 100644
--- a/debian/rules.d/1-maintainer.mk
+++ b/debian/rules.d/1-maintainer.mk
@@ -88,9 +88,13 @@  printenv:
 	@echo "do_cloud_tools            = $(do_cloud_tools)"
 	@echo " do_tools_hyperv          = $(do_tools_hyperv)"
 	@echo
+ifeq ($(do_lmm),false)
 	@echo "all_dkms_modules          = $(all_dkms_modules)"
 	@$(foreach mod,$(all_dkms_modules),$(foreach var,$(do_$(mod)),\
 		printf " %-24s = %s\n" "do_$(mod)" "$(var)";))
+else
+	@echo "all_dkms_modules		= <in lmm>"
+endif
 
 .PHONY: printchanges
 printchanges:
diff --git a/debian/scripts/control-create b/debian/scripts/control-create
index 887f28633d4b..84da3c8cdf27 100755
--- a/debian/scripts/control-create
+++ b/debian/scripts/control-create
@@ -38,7 +38,7 @@  gen_common () {
 
 gen_per_flavour () {
 	local arch bootloader conflicts flavour provides supported target
-	local sed_common_patterns signed_arch unsigned_arch
+	local sed_common_patterns signed_arch unsigned_arch depends
 
 	var=$1
 
@@ -50,6 +50,10 @@  gen_per_flavour () {
 		provides+=", "
 	fi
 
+	if [ "$depends" != '' ]; then
+		depends+=", "
+	fi
+
 	for a in ${arch}
 	do
 		# This is a makefile, so grepping...
@@ -62,6 +66,7 @@  gen_per_flavour () {
 
 	sed_common_patterns=(
 		-e "/^#/d"
+		-e "s/=DEPENDS=/${depends}/g"
 		-e "s/BOOTLOADER/${bootloader}/g"
 		-e "s/=CONFLICTS=/${conflicts}/g"
 		-e "s/FLAVOUR/${flavour}/g"
@@ -96,6 +101,10 @@  gen_per_flavour () {
 	    -e "s/ARCH/${arch}/g" \
 	    "debian/control.d/flavour-buildinfo.stub"
 
+	if [ "$do_lmm" != "false" ]; then
+		return
+	fi
+
 	while read -r package version extras
 	do
 		module="$package"