kbuild: deb-pkg: allow to set package name version
v2 cover kbuild: deb-pkg: allow to set package name version
Instead of hardcoding ${KERNELRELEASE} in the package name allow the user to override this.
This can be useful if one doesn't want to accumulate different packages for every commit or micro version bump by setting KDEB_PKGNAMEVERSION=7.3 or even KDEB_PKGNAMEVERSION=stable.
---
Changes in v2:
- Let "scripts/package/builddeb" use ${KERNELRELEASE} when referring to the kernel release rather than using $version. Split into a separate commit as this can be useful on its own.
- Link to v1: https://patch.msgid.link/[email protected]
To: Nathan Chancellor <[email protected]>
To: Nicolas Schier <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
Guido Günther (2):
kbuild: builddeb: Use ${KERNELRELEASE} consistently
kbuild: deb-pkg: allow to set package name version
scripts/package/builddeb | 4 ++-- scripts/package/mkdebian | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-)
---
base-commit: c03c1a14507dfaf8b856c2608f9ac216021fc222
change-id: 20261019-deb-pkg-a6ef2837687e
Best regards,
Signature · 1 line
Guido Günther <[email protected]>
PATCH v2 1/2 kbuild: builddeb: Use ${KERNELRELEASE} consistently
Only use $version when it affects the package name, other places should use ${KERNELRELEASE}.
--- scripts/package/builddeb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/package/builddeb +2 -2
@@ -147,8 +147,8 @@ install_kernel_headers () { "${srctree}/scripts/package/install-extmod-build" "${pdir}/usr/src/linux-headers-${version}" fi - mkdir -p $pdir/lib/modules/$version/ - ln -s /usr/src/linux-headers-$version $pdir/lib/modules/$version/build + mkdir -p $pdir/lib/modules/${KERNELRELEASE}/ + ln -s /usr/src/linux-headers-$version $pdir/lib/modules/${KERNELRELEASE}/build } install_libc_headers () {
Signature · 1 line
2.53.0
Nicolas Schier
maintainerRe: [PATCH v2 1/2] kbuild: builddeb: Use ${KERNELRELEASE} consistently
Quoted 10 lines
Only use $version when it affects the package name, other places should use ${KERNELRELEASE}.
Signed-off-by Guido Günther <[email protected]>scripts/package/builddeb +0
-0
scripts/package/builddeb install_kernel_headers () { · line 151
Quoted 7 lines
scripts/package/builddeb +2
-2@@ -147,8 +147,8 @@ install_kernel_headers () { "${srctree}/scripts/package/install-extmod-build" "${pdir}/usr/src/linux-headers-${version}" fi - mkdir -p $pdir/lib/modules/$version/ - ln -s /usr/src/linux-headers-$version $pdir/lib/modules/$version/build + mkdir -p $pdir/lib/modules/${KERNELRELEASE}/ + ln -s /usr/src/linux-headers-$version $pdir/lib/modules/${KERNELRELEASE}/build
yeah, well. I am afraid, that this may lead to non-obvious conflicts between packages, if KDEB_PKGNAMEVERSION is used with badly chosen values. But as KDEB_PKGNAMEVERSION is not (yet) advertised in the documentation, I think it's ok for now.
Signature · 1 line
Nicolas
PATCH v2 2/2 kbuild: deb-pkg: allow to set package name version
In reply to Guido GüntherInstead of hardcoding ${KERNELRELEASE} in the package name allow the user to override this.
This can be useful if one doesn't want to accumulate different packages for every commit or micro version bump by setting KDEB_PKGNAMEVERSION=7.3 or even KDEB_PKGNAMEVERSION=stable.
--- scripts/package/mkdebian | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
scripts/package/mkdebian +9 -3
@@ -172,6 +172,12 @@ else packagename=linux-image fi +if [ "${KDEB_PKGNAMEVERSION:+set}" ]; then + packagenameversion=$KDEB_PKGNAMEVERSION +else + packagenameversion=$KERNELRELEASE +fi + debarch= set_debarch
@@ -215,7 +221,7 @@ Build-Depends-Arch: bc, bison, flex, python3:native, rsync Homepage: https://www.kernel.org/ -Package: $packagename-${KERNELRELEASE} +Package: $packagename-${packagenameversion} Architecture: $debarch Description: Linux kernel, version ${KERNELRELEASE} This package contains the Linux kernel, modules and corresponding other
@@ -238,7 +244,7 @@ EOF if is_enabled CONFIG_MODULES; then cat <<EOF >> debian/control -Package: linux-headers-${KERNELRELEASE} +Package: linux-headers-${packagenameversion} Architecture: $debarch Build-Profiles: <!pkg.${sourcename}.nokernelheaders> Description: Linux kernel headers for ${KERNELRELEASE} on $debarch
@@ -252,7 +258,7 @@ fi if is_enabled CONFIG_DEBUG_INFO; then cat <<EOF >> debian/control -Package: linux-image-${KERNELRELEASE}-dbg +Package: linux-image-${packagenameversion}-dbg Section: debug Architecture: $debarch Build-Profiles: <!pkg.${sourcename}.nokerneldbg>
Signature · 1 line
2.53.0
Nicolas Schier
maintainerQuoted 27 lines
Instead of hardcoding ${KERNELRELEASE} in the package name allow the user to override this.
This can be useful if one doesn't want to accumulate different packages for every commit or micro version bump by setting KDEB_PKGNAMEVERSION=7.3 or even KDEB_PKGNAMEVERSION=stable.
Signed-off-by Guido Günther <[email protected]>scripts/package/mkdebian +6
-0@@ -172,6 +172,12 @@ else packagename=linux-image fi +if [ "${KDEB_PKGNAMEVERSION:+set}" ]; then + packagenameversion=$KDEB_PKGNAMEVERSION +else + packagenameversion=$KERNELRELEASE +fi + debarch= set_debarch
scripts/package/mkdebian Build-Depends-Arch: bc, bison, flex, · line 227
Quoted 8 lines
scripts/package/mkdebian +1
-1@@ -215,7 +221,7 @@ Build-Depends-Arch: bc, bison, flex, python3:native, rsync Homepage: https://www.kernel.org/ -Package: $packagename-${KERNELRELEASE} +Package: $packagename-${packagenameversion} Architecture: $debarch Description: Linux kernel, version ${KERNELRELEASE} This package contains the Linux kernel, modules and corresponding other
For completeness, I'd like to have something like
Conflicts: linux-image-${KERNELRELEASE}
Replaces: linux-image-${KERNELRELEASE}here (and similar below), if ${KERNELRELEASE} != ${packagenameversion}; but probably it's not worth the effort.
I'll queue this patch set for 7.5, thanks!
Signature · 1 line
Nicolas
Quoted 6 lines
Instead of hardcoding ${KERNELRELEASE} in the package name allow the user to override this.
This can be useful if one doesn't want to accumulate different packages for every commit or micro version bump by setting KDEB_PKGNAMEVERSION=7.3 or even KDEB_PKGNAMEVERSION=stable.
...
Quoted 7 lines
Guido Günther (2):
kbuild: builddeb: Use ${KERNELRELEASE} consistently
kbuild: deb-pkg: allow to set package name versionscripts/package/builddeb | 4 ++-- scripts/package/mkdebian | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-)
Sure, this seems reasonable enough to support.
Signature · 2 lines
Cheers, Nathan