From: Andreas Helbech Kleist <andreaskleist@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: reatmon@ti.com
Subject: [kirkstone][PATCH 2/3] kernel: fix localversion in v6.3+
Date: Thu, 22 Feb 2024 11:35:44 +0100 [thread overview]
Message-ID: <20240222103545.2970387-3-andreaskleist@gmail.com> (raw)
In-Reply-To: <20240222103545.2970387-1-andreaskleist@gmail.com>
From: Bruce Ashfield <bruce.ashfield@gmail.com>
During testing of the v6.4 reference kernel, it was noticed that
on-target modules no longer matched the magic value of the running
kernel.
This was due to a different localversion in the cross built kernel
and the scripts / resources created on target.
This was due to changes in the setlocalversion script introduced
in the v6.3 series.
The .scmversion file is no longer used (or packaged) to inhibit
the addition of a "+" (through querying of the git status of the
kernel) or the setting of a local version.
We recently introduced the KERNEL_LOCALVERSION variable to allow
recipes to place a value in .scmversion, so we extend the use of
that variable to kernel-arch.bbclass and use it to set the
exported variable LOCALVERSION.
We must do it at the kernel-arch level, as the variable must be
exported in any kernel build to ensure that setlocalversion always
correctly sets the localversion.
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
cherry-picked from master 765b13b7305c8d2f222cfc66d77c02e6a088c691
Signed-off-by: Andreas Helbech Kleist <andreaskleist@gmail.com>
---
meta/classes/kernel-arch.bbclass | 7 +++++++
meta/classes/kernel.bbclass | 6 ++++--
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/meta/classes/kernel-arch.bbclass b/meta/classes/kernel-arch.bbclass
index 4cd08b96fb..0a79dea0af 100644
--- a/meta/classes/kernel-arch.bbclass
+++ b/meta/classes/kernel-arch.bbclass
@@ -66,3 +66,10 @@ KERNEL_LD = "${CCACHE}${HOST_PREFIX}ld.bfd ${HOST_LD_KERNEL_ARCH}"
KERNEL_AR = "${CCACHE}${HOST_PREFIX}ar ${HOST_AR_KERNEL_ARCH}"
TOOLCHAIN ?= "gcc"
+# 6.3+ requires the variable LOCALVERSION to be set to not get a "+" in
+# the local version. Having it empty means nothing will be added, and any
+# value will be appended to the local kernel version. This replaces the
+# use of .scmversion file for setting a localversion without using
+# the CONFIG_LOCALVERSION option.
+KERNEL_LOCALVERSION ??= ""
+export LOCALVERSION ?= "${KERNEL_LOCALVERSION}"
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 80fb1879b0..940f1a3cf4 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -418,7 +418,7 @@ do_compile_kernelmodules() {
if (grep -q -i -e '^CONFIG_MODULES=y$' ${B}/.config); then
oe_runmake -C ${B} ${PARALLEL_MAKE} modules ${KERNEL_EXTRA_ARGS}
- # Module.symvers gets updated during the
+ # Module.symvers gets updated during the
# building of the kernel modules. We need to
# update this in the shared workdir since some
# external kernel modules has a dependency on
@@ -614,7 +614,6 @@ do_shared_workdir () {
# We don't need to stage anything, not the modules/firmware since those would clash with linux-firmware
SYSROOT_DIRS = ""
-KERNEL_LOCALVERSION ??= ""
KERNEL_CONFIG_COMMAND ?= "oe_runmake_call -C ${S} O=${B} olddefconfig || oe_runmake -C ${S} O=${B} oldnoconfig"
python check_oldest_kernel() {
@@ -636,6 +635,9 @@ kernel_do_configure() {
# $ scripts/setlocalversion . => +
# $ make kernelversion => 2.6.37
# $ make kernelrelease => 2.6.37+
+ # See kernel-arch.bbclass for post v6.3 removal of the extra
+ # + in localversion. .scmversion is no longer used, and the
+ # variable LOCALVERSION must be used
if [ ! -e ${B}/.scmversion -a ! -e ${S}/.scmversion ]; then
echo ${KERNEL_LOCALVERSION} > ${B}/.scmversion
echo ${KERNEL_LOCALVERSION} > ${S}/.scmversion
--
2.43.2
next prev parent reply other threads:[~2024-02-22 10:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-22 10:35 [kirkstone][PATCH 0/3] kernel: Backport v6.3+ localversion fixes Andreas Helbech Kleist
2024-02-22 10:35 ` [kirkstone][PATCH 1/3] kernel.bbclass: introduce KERNEL_LOCALVERSION Andreas Helbech Kleist
2024-02-22 10:35 ` Andreas Helbech Kleist [this message]
2024-02-22 10:35 ` [kirkstone][PATCH 3/3] kernel: make LOCALVERSION consistent between recipes Andreas Helbech Kleist
2024-02-22 21:51 ` Ryan Eatmon
2024-02-22 21:56 ` [OE-core] " Bruce Ashfield
2024-02-22 22:46 ` Ryan Eatmon
[not found] ` <17B650DBED7FC1F0.14827@lists.openembedded.org>
2024-02-23 17:11 ` Ryan Eatmon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240222103545.2970387-3-andreaskleist@gmail.com \
--to=andreaskleist@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=reatmon@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox