diff mbox series

[SRU,R,v2,1/1] UBUNTU: [packaging] Create a linux-main-modules dependency toggle

Message ID e2aac6798edbba19dfcffc371faa0e6778121592.1788185264.git.alessio.faina@canonical.com
State New
Headers show
Series UBUNTU: SAUCE: Create a linux-main-modules dependency toggle | expand

Commit Message

Alessio Faina Aug. 31, 2026, 2:20 p.m. UTC
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@canonical.com>
---
 debian.master/control.d/vars.generic     | 2 ++
 debian.master/control.d/vars.generic-64k | 2 ++
 debian/rules.d/0-common-vars.mk          | 8 ++++++++
 debian/scripts/control-create            | 4 ++++
 4 files changed, 16 insertions(+)

Comments

Andrei Gherzan Sept. 1, 2026, 7:57 p.m. UTC | #1
Hello!

On 26/08/31 04:20PM, Alessio Faina via kernel-team wrote:

No bug link provided for this?

> 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@canonical.com>
> ---
>  debian.master/control.d/vars.generic     | 2 ++
>  debian.master/control.d/vars.generic-64k | 2 ++
>  debian/rules.d/0-common-vars.mk          | 8 ++++++++
>  debian/scripts/control-create            | 4 ++++
>  4 files changed, 16 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..356eb05adf59 100644
> --- a/debian/rules.d/0-common-vars.mk
> +++ b/debian/rules.d/0-common-vars.mk
> @@ -47,6 +47,14 @@ 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
> +
>  #
>  # The debug packages are ginormous, so you probably want to skip
>  # building them (as a developer).
> diff --git a/debian/scripts/control-create b/debian/scripts/control-create
> index f96da1ec1168..0605254d209e 100755
> --- a/debian/scripts/control-create
> +++ b/debian/scripts/control-create
> @@ -46,6 +46,10 @@ gen_per_flavour () {
>  
>  	. "${var}"
>  
> +	if [ "${do_linux_main_modules_depends}" = false ]; then
> +		depends=''

I would suggest having a build-log warning when the dependency bypass is
active. This will reduce the risk of this knob being silently active.

> +	fi
> +
>  	if [ "$provides" != '' ]; then
>  		provides+=", "
>  	fi
Alessio Faina Sept. 2, 2026, 7:18 a.m. UTC | #2
On Tue, Sep 01, 2026 at 08:57:11PM +0100, Andrei Gherzan wrote:
> Hello!
> 
> On 26/08/31 04:20PM, Alessio Faina via kernel-team wrote:
> 
> No bug link provided for this?
> 
I've noticed that people tend to not have buglinks for this kind of
change in the mailing list, so I thought it was not necessary.
I'll add it in a subsequent version.
> > 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@canonical.com>
> > ---
> >  debian.master/control.d/vars.generic     | 2 ++
> >  debian.master/control.d/vars.generic-64k | 2 ++
> >  debian/rules.d/0-common-vars.mk          | 8 ++++++++
> >  debian/scripts/control-create            | 4 ++++
> >  4 files changed, 16 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..356eb05adf59 100644
> > --- a/debian/rules.d/0-common-vars.mk
> > +++ b/debian/rules.d/0-common-vars.mk
> > @@ -47,6 +47,14 @@ 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
> > +
> >  #
> >  # The debug packages are ginormous, so you probably want to skip
> >  # building them (as a developer).
> > diff --git a/debian/scripts/control-create b/debian/scripts/control-create
> > index f96da1ec1168..0605254d209e 100755
> > --- a/debian/scripts/control-create
> > +++ b/debian/scripts/control-create
> > @@ -46,6 +46,10 @@ gen_per_flavour () {
> >  
> >  	. "${var}"
> >  
> > +	if [ "${do_linux_main_modules_depends}" = false ]; then
> > +		depends=''
> 
> I would suggest having a build-log warning when the dependency bypass is
> active. This will reduce the risk of this knob being silently active.
>
It's actually a very good idea. I will be adding it in a v3 version,
thanks!
> > +	fi
> > +
> >  	if [ "$provides" != '' ]; then
> >  		provides+=", "
> >  	fi
> 
> -- 
> Andrei Gherzan
> gpg: rsa4096/D4D94F67AD0E9640
diff mbox series

Patch

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..356eb05adf59 100644
--- a/debian/rules.d/0-common-vars.mk
+++ b/debian/rules.d/0-common-vars.mk
@@ -47,6 +47,14 @@  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
+
 #
 # The debug packages are ginormous, so you probably want to skip
 # building them (as a developer).
diff --git a/debian/scripts/control-create b/debian/scripts/control-create
index f96da1ec1168..0605254d209e 100755
--- a/debian/scripts/control-create
+++ b/debian/scripts/control-create
@@ -46,6 +46,10 @@  gen_per_flavour () {
 
 	. "${var}"
 
+	if [ "${do_linux_main_modules_depends}" = false ]; then
+		depends=''
+	fi
+
 	if [ "$provides" != '' ]; then
 		provides+=", "
 	fi