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 <kasong@tencent.com>
This commit is contained in:
Kairui Song 2022-11-28 03:05:26 +08:00
parent fcb31fa2cc
commit c1eae7ce13
1 changed files with 3 additions and 0 deletions

View File

@ -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