From c1eae7ce13d372d9fffc873d0661eb367d2f289d Mon Sep 17 00:00:00 2001 From: Kairui Song Date: Mon, 28 Nov 2022 03:05:26 +0800 Subject: [PATCH] dist: Erase LOCALVERSION on build Upstream: no It's harmful for a formal build to set LOCALVERSION, as some kernel subpackage will look at it and assume the kernel is using a different SCM naming style, so erase it on build. Signed-off-by: Kairui Song --- dist/templates/kernel.template.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dist/templates/kernel.template.spec b/dist/templates/kernel.template.spec index 6fd98af38..327d315af 100644 --- a/dist/templates/kernel.template.spec +++ b/dist/templates/kernel.template.spec @@ -566,6 +566,9 @@ BuildConfig() { # Ensures build-ids are unique to allow parallel debuginfo sed -i -e "s/^CONFIG_BUILD_SALT.*/CONFIG_BUILD_SALT=\"$KernUnameR\"/" .config + # Erase LOCALVERSION to prevent it from mucking with our version numbers + sed -i -e 's/^CONFIG_LOCALVERSION=.*/CONFIG_LOCALVERSION=""/' .config + # Call olddefconfig before make all, set all unset config to default value. # The packager uses CROSS_COMPILE=scripts/dummy-tools for generating .config # so compiler related config are always unset, let's just use defconfig for them for now