APPLIED: [PATCH] UBUNTU: SAUCE: override KERNELRELEASE instead of KERNELVERSION

Dimitri John Ledkov dimitri.ledkov at canonical.com
Tue Dec 5 00:12:17 UTC 2023


Applied with subject line fixup as per Emil's comment.

On Mon, 4 Dec 2023 at 02:06, Masahiro Yamada
<masahiro.yamada at canonical.com> wrote:
>
> It is wrong to override KERNELVERSION, as doing so does not ensure
> the expected KERNELRELEASE. KERNELRELEASE is the essential part and
> must agree with debian/control because it results in the 'uname -r'
> in the compiled kernel.
>
> scripts/setlocalversion may append additional strings depending on
> CONFIG options and localversion* files. For example, if there exists
> 'localversion' file in the top directory, scripts/setlocalversion
> will append a string written in it. This must not happen.
>
> Debian kernel [1] and the upstream kernel [2] correctly override
> KERNELRELEASE.
>
> Let's fix Ubuntu kernel now.
>
> [1]: https://salsa.debian.org/kernel-team/linux/-/blob/debian/6.5.10-1/debian/rules.real#L141
> [2]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/package/debian/rules?id=v6.7-rc3#n18
>
> Signed-off-by: Masahiro Yamada <masahiro.yamada at canonical.com>
> ---
>
>  debian/rules.d/0-common-vars.mk | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/debian/rules.d/0-common-vars.mk b/debian/rules.d/0-common-vars.mk
> index d62a9b063241..2ac46b6433c5 100644
> --- a/debian/rules.d/0-common-vars.mk
> +++ b/debian/rules.d/0-common-vars.mk
> @@ -238,10 +238,9 @@ kmake = make ARCH=$(build_arch) \
>         CROSS_COMPILE=$(CROSS_COMPILE) \
>         HOSTCC=$(HOSTCC) \
>         CC=$(CROSS_COMPILE)$(gcc) \
> -       KERNELVERSION=$(abi_release)-$(target_flavour) \
> +       KERNELRELEASE=$(abi_release)-$(target_flavour) \
>         CONFIG_DEBUG_SECTION_MISMATCH=y \
>         KBUILD_BUILD_VERSION="$(uploadnum)" \
> -       LOCALVERSION= localver-extra= \
>         CFLAGS_MODULE="-DPKG_ABI=$(abinum)" \
>         PYTHON=$(PYTHON)
>  ifneq ($(LOCAL_ENV_CC),)
> --
> 2.40.1
>
>
> --
> kernel-team mailing list
> kernel-team at lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team



-- 
Dimitri

Sent from Ubuntu Pro
https://ubuntu.com/pro



More information about the kernel-team mailing list