Re: [PATCH v1] kbuild: rpm-pkg: provide kernel{-devel}-uname-r
From: Nathan Chancellor
Date: Wed Apr 29 2026 - 18:59:06 EST
On Wed, 15 Apr 2026 00:04:57 +0300, Avi Kivity <avi@xxxxxxxxxxxxxxxxxx> wrote:
> diff --git a/scripts/package/kernel.spec b/scripts/package/kernel.spec
> index b3c956205af0..dcb04c1e7e8e 100644
> --- a/scripts/package/kernel.spec
> +++ b/scripts/package/kernel.spec
> @@ -15,6 +15,7 @@ Source0: linux.tar.gz
> Source1: config
> Source2: diff.patch
> Provides: kernel-%{KERNELRELEASE}
> +Provides: kernel-uname-r = %{KERNELRELEASE}
Sashiko notes that this will cause the build to fail when there are two
or more hyphens in KERNELRELEASE:
https://sashiko.dev/#/message/20260414210457.41675-1-avi@xxxxxxxxxxxxxxxxxx
I can confirm this easily reproduces when CONFIG_LOCALVERSION_AUTO is
enabled:
| $ make -skj"$(nproc)" ARCH=arm64 CROSS_COMPILE=aarch64-linux- mrproper defconfig binrpm-pkg
| Building target platforms: aarch64-linux
| Building for target aarch64-linux
| error: line 24: Invalid version (double separator '-'): 7.0.0-08202-g663bd6ce5b7f: Provides: kernel-uname-r = 7.0.0-08202-g663bd6ce5b7f
| ...
This should probably be %{version}? Please test and verify that change
still works for your use case then send a v2.
--
Cheers,
Nathan