linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org
Cc: Nathan Chancellor <nathan@kernel.org>,
	Nicolas Schier <nicolas.schier@linux.dev>
Subject: [PATCH] kbuild: deb-pkg: Allow packages to be excluded from bindeb-pkg
Date: Sun, 23 Nov 2025 18:36:47 +0000	[thread overview]
Message-ID: <20251123183647.76559-1-maz@kernel.org> (raw)

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


             reply	other threads:[~2025-11-23 18:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-23 18:36 Marc Zyngier [this message]
2025-11-23 20:34 ` [PATCH] kbuild: deb-pkg: Allow packages to be excluded from bindeb-pkg Nicolas Schier
2025-11-23 21:47   ` Marc Zyngier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251123183647.76559-1-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nathan@kernel.org \
    --cc=nicolas.schier@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).