diff mbox series

UBUNTU: SAUCE: override KERNELRELEASE instead of KERNELVERSION

Message ID 20231204020545.2036116-1-masahiro.yamada@canonical.com
State New
Headers show
Series UBUNTU: SAUCE: override KERNELRELEASE instead of KERNELVERSION | expand

Commit Message

Masahiro Yamada Dec. 4, 2023, 2:05 a.m. UTC
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@canonical.com>
---

 debian/rules.d/0-common-vars.mk | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Masahiro Yamada Dec. 4, 2023, 2:07 a.m. UTC | #1
On Mon, Dec 4, 2023 at 11:05 AM Masahiro Yamada
<masahiro.yamada@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@canonical.com>
> ---



I forgot to add the tag.

This is intended for [noble] although I think it is wrong
for all releases.







>  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
>
Agathe Porte Dec. 4, 2023, 10:14 a.m. UTC | #2
2023-12-04 03:06 CET, Masahiro Yamada:
> 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@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),)

Acked-by: Agathe Porte <agathe.porte@canonical.com>
Emil Renner Berthing Dec. 4, 2023, 11:10 a.m. UTC | #3
Masahiro Yamada 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@canonical.com>

Acked-by: Emil Renner Berthing <emil.renner.berthing@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@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
Emil Renner Berthing Dec. 4, 2023, 11:19 a.m. UTC | #4
Emil Renner Berthing wrote:
> Masahiro Yamada 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@canonical.com>
>
> Acked-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>

On second thought. I think the subject should be

UBUNTU: [Packaging] override KERNELRELEASE instead of KERNELVERSION

..and not SAUCE.

/Emil

>
> > ---
> >
> >  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@lists.ubuntu.com
> > https://lists.ubuntu.com/mailman/listinfo/kernel-team
>
>
Dimitri John Ledkov Dec. 5, 2023, 12:12 a.m. UTC | #5
Applied with subject line fixup as per Emil's comment.

On Mon, 4 Dec 2023 at 02:06, Masahiro Yamada
<masahiro.yamada@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@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@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
diff mbox series

Patch

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),)