From: "Mario Limonciello (AMD)" <superm1@kernel.org>
To: mario.limonciello@amd.com, nathan@kernel.org, nsc@kernel.org,
corbet@lwn.net, skhan@linuxfoundation.org
Cc: "Mario Limonciello (AMD)" <superm1@kernel.org>,
linux-kbuild@vger.kernel.org, linux-doc@vger.kernel.org
Subject: [PATCH] kbuild: deb-pkg: Allow setting package name at build
Date: Tue, 5 May 2026 10:29:54 -0500 [thread overview]
Message-ID: <20260505152957.695641-1-superm1@kernel.org> (raw)
Users can change the source package by setting variable `KDEB_SOURCENAME`,
but the binary package name is hardcoded.
Add support for setting binary package name by using `KDEB_PACKAGENAME`
and let it affect both kernel image and debug image packages.
Update kbuild documentation to include defaults and mention both
`KDEB_PACKAGENAME` and `KDEB_SOURCENAME`.
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
---
Documentation/kbuild/kbuild.rst | 10 ++++++++++
scripts/package/mkdebian | 6 ++++--
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/Documentation/kbuild/kbuild.rst b/Documentation/kbuild/kbuild.rst
index 5a9013bacfb75..cbdd2224c3a55 100644
--- a/Documentation/kbuild/kbuild.rst
+++ b/Documentation/kbuild/kbuild.rst
@@ -177,6 +177,16 @@ the UTS_MACHINE variable, and on some architectures also the kernel config.
The value of KBUILD_DEBARCH is assumed (not checked) to be a valid Debian
architecture.
+KDEB_SOURCENAME
+----------------
+For the deb-pkg target, allows overriding the default source package name.
+The default package name is "linux-upstream".
+
+KDEB_PACKAGENAME
+----------------
+For the deb-pkg target, allows overriding the default binary package name.
+The default package name is "linux-image".
+
KDOCFLAGS
---------
Specify extra (warning/error) flags for kernel-doc checks during the build,
diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index d4b007b38a475..cbe4266fac732 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -166,7 +166,9 @@ else
fi
sourcename=${KDEB_SOURCENAME:-linux-upstream}
-if [ "$ARCH" = "um" ] ; then
+if [ "${KDEB_PACKAGENAME:+set}" ]; then
+ packagename=$KDEB_PACKAGENAME
+elif [ "$ARCH" = "um" ]; then
packagename=user-mode-linux
else
packagename=linux-image
@@ -252,7 +254,7 @@ fi
if is_enabled CONFIG_DEBUG_INFO; then
cat <<EOF >> debian/control
-Package: linux-image-${KERNELRELEASE}-dbg
+Package: $packagename-${KERNELRELEASE}-dbg
Section: debug
Architecture: $debarch
Build-Profiles: <!pkg.${sourcename}.nokerneldbg>
--
2.53.0
next reply other threads:[~2026-05-05 15:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-05 15:29 Mario Limonciello (AMD) [this message]
2026-05-17 6:57 ` [PATCH] kbuild: deb-pkg: Allow setting package name at build Nicolas Schier
2026-05-19 0:08 ` Mario Limonciello
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=20260505152957.695641-1-superm1@kernel.org \
--to=superm1@kernel.org \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=nathan@kernel.org \
--cc=nsc@kernel.org \
--cc=skhan@linuxfoundation.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.