From 9f45e866d35ea12e4a8f98184e7ddec7f6d17cb4 Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Mon, 4 Dec 2023 11:05:45 +0900 Subject: [PATCH] UBUNTU: [Packaging] override KERNELRELEASE instead of KERNELVERSION 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 Acked-by: Agathe Porte Acked-by: Emil Renner Berthing (fixed up subject line as per Emil's comment) Signed-off-by: Dimitri John Ledkov --- 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 afc043eb7815..2110020d03fa 100644 --- a/debian/rules.d/0-common-vars.mk +++ b/debian/rules.d/0-common-vars.mk @@ -230,10 +230,9 @@ kmake = make ARCH=$(build_arch) \ HOSTCC=$(HOSTCC) \ CC=$(CROSS_COMPILE)$(gcc) \ BINDGEN=bindgen-0.65 \ - 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),)