[SRU][R][PATCH v2 1/1] UBUNTU: [packaging] Create a linux-main-modules dependency toggle
Alessio Faina
alessio.faina at canonical.com
Wed Sep 2 07:18:34 UTC 2026
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 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 | 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
More information about the kernel-team
mailing list