Debian: kernel: fix /proc/version content

One example for "cat /proc/version" on stx debian is:
Linux version 5.10.0-6-amd64 (debian-kernel@lists.debian.org)
......
...SMP PREEMPT Debian 5.10.99-1.stx.12 (2022-04-26)

Remove below settings from DEBIAN when building kernel:
KBUILD_BUILD_USER
KBUILD_BUILD_HOST
It makes /proc/version not contain the debian maillist any more
and uses the default " LINUX_COMPILE_BY "@" LINUX_COMPILE_HOST " in
linux code.

Add "StarlingX" in KBUILD_BUILD_VERSION_TIMESTAMP
to correct only "Debian" in the utsname::version string.

After those changes, the example for "cat /proc/version" on stx debian
is:
Linux version 5.10.0-6-amd64 (root@stx-stx-pkgbuilder-865f876545-tplr5)
......
...SMP PREEMPT StarlingX Debian 5.10.112-1.stx.15 (2022-07-05)

Test Plan:
 - PASS: Build and boot up on qemu. Run "cat /proc/version".
 - PASS: The test is done on both std and rt kernel.

Story: 2009221
Task: 45733

Signed-off-by: Li Zhou <li.zhou@windriver.com>
Change-Id: I6a0da00a3457c909224f1022a54322bcda7b1362
This commit is contained in:
Li Zhou 2022-07-05 14:58:11 +08:00
parent 199198fc97
commit 5db5ea4570
4 changed files with 70 additions and 0 deletions

View File

@ -0,0 +1,34 @@
From 9488453d8b47d886f472d2046ca1e1b841b704fa Mon Sep 17 00:00:00 2001
From: Li Zhou <li.zhou@windriver.com>
Date: Tue, 5 Jul 2022 14:51:33 +0800
Subject: [PATCH] kernel-rt: fix /proc/version content
Remove below settings from DEBIAN when building kernel:
KBUILD_BUILD_USER
KBUILD_BUILD_HOST
To make /proc/version not contain debian maillist.
Add "StarlingX" in KBUILD_BUILD_VERSION_TIMESTAMP
to correct only "Debian" in the utsname::version string.
Signed-off-by: Li Zhou <li.zhou@windriver.com>
---
debian/rules.real | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/debian/rules.real b/debian/rules.real
index 4e74b5b..3ddfcd4 100644
--- a/debian/rules.real
+++ b/debian/rules.real
@@ -43,7 +43,7 @@ export LINK_DOC_PACKAGE
stamp = [ -d $(dir $@) ] || mkdir $(dir $@); touch $@
setup_env := env -u ABINAME -u ARCH -u FEATURESET -u FLAVOUR -u VERSION -u LOCALVERSION
-setup_env += DISTRIBUTION_OFFICIAL_BUILD=1 DISTRIBUTOR="$(DISTRIBUTOR)" DISTRIBUTION_VERSION="$(SOURCEVERSION)" KBUILD_BUILD_TIMESTAMP="$(SOURCE_DATE)" KBUILD_BUILD_VERSION_TIMESTAMP="$(DISTRIBUTOR) $(SOURCEVERSION) ($(SOURCE_DATE_UTC_ISO))" KBUILD_BUILD_USER="$(word 1,$(subst @, ,$(MAINTAINER)))" KBUILD_BUILD_HOST="$(word 2,$(subst @, ,$(MAINTAINER)))"
+setup_env += DISTRIBUTION_OFFICIAL_BUILD=1 DISTRIBUTOR="$(DISTRIBUTOR)" DISTRIBUTION_VERSION="$(SOURCEVERSION)" KBUILD_BUILD_TIMESTAMP="$(SOURCE_DATE)" KBUILD_BUILD_VERSION_TIMESTAMP="StarlingX $(DISTRIBUTOR) $(SOURCEVERSION) ($(SOURCE_DATE_UTC_ISO))"
setup_env += KBUILD_VERBOSE=$(if $(filter terse,$(DEB_BUILD_OPTIONS)),0,1)
MAKE_CLEAN = $(setup_env) $(MAKE) KCFLAGS=-fdebug-prefix-map=$(CURDIR)/=
--
2.17.1

View File

@ -11,3 +11,4 @@
0011-Debian-Hardcode-net.naming-scheme-in-CONFIG_CMDLINE.patch
0012-kernel-rt-add-rt-to-abiname.patch
0013-Debian-update-5.10-Kernel-to-5.10.112.patch
0014-kernel-rt-fix-proc-version-content.patch

View File

@ -0,0 +1,34 @@
From 75e10ef94efd1b511793fd64be4e12f2c31a3c10 Mon Sep 17 00:00:00 2001
From: Li Zhou <li.zhou@windriver.com>
Date: Tue, 5 Jul 2022 14:37:18 +0800
Subject: [PATCH] kernel-std: fix /proc/version content
Remove below settings from DEBIAN when building kernel:
KBUILD_BUILD_USER
KBUILD_BUILD_HOST
To make /proc/version not contain debian maillist.
Add "StarlingX" in KBUILD_BUILD_VERSION_TIMESTAMP
to correct only "Debian" in the utsname::version string.
Signed-off-by: Li Zhou <li.zhou@windriver.com>
---
debian/rules.real | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/debian/rules.real b/debian/rules.real
index 01b568c..ffd75e7 100644
--- a/debian/rules.real
+++ b/debian/rules.real
@@ -43,7 +43,7 @@ export LINK_DOC_PACKAGE
stamp = [ -d $(dir $@) ] || mkdir $(dir $@); touch $@
setup_env := env -u ABINAME -u ARCH -u FEATURESET -u FLAVOUR -u VERSION -u LOCALVERSION
-setup_env += DISTRIBUTION_OFFICIAL_BUILD=1 DISTRIBUTOR="$(DISTRIBUTOR)" DISTRIBUTION_VERSION="$(SOURCEVERSION)" KBUILD_BUILD_TIMESTAMP="$(SOURCE_DATE)" KBUILD_BUILD_VERSION_TIMESTAMP="$(DISTRIBUTOR) $(SOURCEVERSION) ($(SOURCE_DATE_UTC_ISO))" KBUILD_BUILD_USER="$(word 1,$(subst @, ,$(MAINTAINER)))" KBUILD_BUILD_HOST="$(word 2,$(subst @, ,$(MAINTAINER)))"
+setup_env += DISTRIBUTION_OFFICIAL_BUILD=1 DISTRIBUTOR="$(DISTRIBUTOR)" DISTRIBUTION_VERSION="$(SOURCEVERSION)" KBUILD_BUILD_TIMESTAMP="$(SOURCE_DATE)" KBUILD_BUILD_VERSION_TIMESTAMP="StarlingX $(DISTRIBUTOR) $(SOURCEVERSION) ($(SOURCE_DATE_UTC_ISO))"
setup_env += KBUILD_VERBOSE=$(if $(filter terse,$(DEB_BUILD_OPTIONS)),0,1)
MAKE_CLEAN = $(setup_env) $(MAKE) KCFLAGS=-fdebug-prefix-map=$(CURDIR)/=
--
2.17.1

View File

@ -10,3 +10,4 @@
0010-Debian-Disable-CONFIG_BNXT.patch
0011-Debian-Hardcode-net.naming-scheme-in-CONFIG_CMDLINE.patch
0012-Debian-update-5.10-Kernel-to-5.10.112.patch
0013-kernel-std-fix-proc-version-content.patch