* [PATCH] kbuild: deb-pkg: Allow packages to be excluded from bindeb-pkg
@ 2025-11-23 18:36 Marc Zyngier
2025-11-23 20:34 ` Nicolas Schier
0 siblings, 1 reply; 3+ messages in thread
From: Marc Zyngier @ 2025-11-23 18:36 UTC (permalink / raw)
To: linux-kernel, linux-kbuild; +Cc: Nathan Chancellor, Nicolas Schier
The bindeb-pkg target generates a number of individual packages:
the kernel package itself, the debug package, the kernel and libc
header packages.
It is at times useful to not generate all the packages, such as
the debug package, even if the kernel configuration has CONFIG_DEBUG.
For this purpose, let the user provide a DEB_EXCLUDE_PKG environment
variable that can contain exclusion patterns for some of the build
artefacts. This saves precious cycles when repeatedly building packages
for testing purposes, where not all packages are strictly necessary.
The default behaviour, with no variable defined, is of course unchanged.
Signed-off-by: Marc Zyngier <maz@kernel.org>
---
scripts/package/debian/rules | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/scripts/package/debian/rules b/scripts/package/debian/rules
index a417a7f8bbc1a..cc5ebb8a37e1a 100755
--- a/scripts/package/debian/rules
+++ b/scripts/package/debian/rules
@@ -29,7 +29,12 @@ make-opts = ARCH=$(ARCH) KERNELRELEASE=$(KERNELRELEASE) \
binary-targets := $(addprefix binary-, image image-dbg headers libc-dev)
-all-packages = $(shell dh_listpackages)
+# DEB_EXCLUDE_PKG excludes a list of packages from the set that would
+# normally be produced. Can be either explicit package names or patterns.
+# For example:
+# DEB_EXCLUDE_PKG="linux-headers-% linux-libc-dev linux-image-%-dbg"
+# limits the packages to the linux-image package.
+all-packages = $(filter-out $(DEB_EXCLUDE_PKG), $(shell dh_listpackages))
image-package = $(filter linux-image-% user-%, $(filter-out %-dbg, $(all-packages)))
image-dbg-package = $(filter %-dbg, $(all-packages))
libc-dev-package = $(filter linux-libc-dev, $(all-packages))
--
2.47.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] kbuild: deb-pkg: Allow packages to be excluded from bindeb-pkg
2025-11-23 18:36 [PATCH] kbuild: deb-pkg: Allow packages to be excluded from bindeb-pkg Marc Zyngier
@ 2025-11-23 20:34 ` Nicolas Schier
2025-11-23 21:47 ` Marc Zyngier
0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Schier @ 2025-11-23 20:34 UTC (permalink / raw)
To: Marc Zyngier; +Cc: linux-kernel, linux-kbuild, Nathan Chancellor
[-- Attachment #1: Type: text/plain, Size: 1292 bytes --]
On Sun, Nov 23, 2025 at 06:36:47PM +0000, Marc Zyngier wrote:
> The bindeb-pkg target generates a number of individual packages:
> the kernel package itself, the debug package, the kernel and libc
> header packages.
>
> It is at times useful to not generate all the packages, such as
> the debug package, even if the kernel configuration has CONFIG_DEBUG.
>
> For this purpose, let the user provide a DEB_EXCLUDE_PKG environment
> variable that can contain exclusion patterns for some of the build
> artefacts. This saves precious cycles when repeatedly building packages
> for testing purposes, where not all packages are strictly necessary.
>
> The default behaviour, with no variable defined, is of course unchanged.
>
> Signed-off-by: Marc Zyngier <maz@kernel.org>
> ---
thanks for your suggestion. Could you please check whether the usual
Debian build profiles are sufficient for your needs, e.g.:
DEB_BUILD_PROFILES="pkg.linux-upstream.nokernelheaders pkg.linux-upstream.nokerneldbg" make bindeb-pkg
I do like that we have the Debian build profiles [1] mechanism here, and
would rather extend it, if neccessary, instead of implementing a
different approach additionally.
Kind regards,
Nicolas
[1]: https://wiki.debian.org/BuildProfileSpec
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] kbuild: deb-pkg: Allow packages to be excluded from bindeb-pkg
2025-11-23 20:34 ` Nicolas Schier
@ 2025-11-23 21:47 ` Marc Zyngier
0 siblings, 0 replies; 3+ messages in thread
From: Marc Zyngier @ 2025-11-23 21:47 UTC (permalink / raw)
To: Nicolas Schier; +Cc: linux-kernel, linux-kbuild, Nathan Chancellor
On Sun, 23 Nov 2025 20:34:23 +0000,
Nicolas Schier <nsc@kernel.org> wrote:
>
> On Sun, Nov 23, 2025 at 06:36:47PM +0000, Marc Zyngier wrote:
> > The bindeb-pkg target generates a number of individual packages:
> > the kernel package itself, the debug package, the kernel and libc
> > header packages.
> >
> > It is at times useful to not generate all the packages, such as
> > the debug package, even if the kernel configuration has CONFIG_DEBUG.
> >
> > For this purpose, let the user provide a DEB_EXCLUDE_PKG environment
> > variable that can contain exclusion patterns for some of the build
> > artefacts. This saves precious cycles when repeatedly building packages
> > for testing purposes, where not all packages are strictly necessary.
> >
> > The default behaviour, with no variable defined, is of course unchanged.
> >
> > Signed-off-by: Marc Zyngier <maz@kernel.org>
> > ---
>
> thanks for your suggestion. Could you please check whether the usual
> Debian build profiles are sufficient for your needs, e.g.:
>
> DEB_BUILD_PROFILES="pkg.linux-upstream.nokernelheaders pkg.linux-upstream.nokerneldbg" make bindeb-pkg
>
> I do like that we have the Debian build profiles [1] mechanism here, and
> would rather extend it, if neccessary, instead of implementing a
> different approach additionally.
Ah, amazing!
I had no idea this was even a thing, and 2ad7126c51908 ("kbuild:
deb-pkg: add pkg.linux-upstream.nokerneldbg build profile") is exactly
what I needed,
Many thanks for pointing this out, my patch can therefore be safely
ignored.
Cheers,
M.
--
Jazz isn't dead. It just smells funny.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-11-23 21:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-23 18:36 [PATCH] kbuild: deb-pkg: Allow packages to be excluded from bindeb-pkg Marc Zyngier
2025-11-23 20:34 ` Nicolas Schier
2025-11-23 21:47 ` Marc Zyngier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).