summaryrefslogtreecommitdiffstats
path: root/meta/classes/kernel.bbclass
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2024-02-08 12:52:45 +0100
committerSteve Sakoman <steve@sakoman.com>2024-02-15 03:51:57 -1000
commit552288e0c83084097cf38611bd82315aa9d892df (patch)
tree870efb5fa75dbd81a0054084a4e89b4909a16cf2 /meta/classes/kernel.bbclass
parentb8a07a0ed25734738c5c6e557b8829b229191cee (diff)
downloadpoky-552288e0c83084097cf38611bd82315aa9d892df.tar.gz
kernel: fix localversion in v6.3+
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. (From OE-Core rev: d9273edae80978c34f8426f34f991b9598828aa9) 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> Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/classes/kernel.bbclass')
-rw-r--r--meta/classes/kernel.bbclass10
1 files changed, 8 insertions, 2 deletions
diff --git a/meta/classes/kernel.bbclass b/meta/classes/kernel.bbclass
index 5951347361..940f1a3cf4 100644
--- a/meta/classes/kernel.bbclass
+++ b/meta/classes/kernel.bbclass
@@ -418,7 +418,7 @@ do_compile_kernelmodules() {
418 if (grep -q -i -e '^CONFIG_MODULES=y$' ${B}/.config); then 418 if (grep -q -i -e '^CONFIG_MODULES=y$' ${B}/.config); then
419 oe_runmake -C ${B} ${PARALLEL_MAKE} modules ${KERNEL_EXTRA_ARGS} 419 oe_runmake -C ${B} ${PARALLEL_MAKE} modules ${KERNEL_EXTRA_ARGS}
420 420
421 # Module.symvers gets updated during the 421 # Module.symvers gets updated during the
422 # building of the kernel modules. We need to 422 # building of the kernel modules. We need to
423 # update this in the shared workdir since some 423 # update this in the shared workdir since some
424 # external kernel modules has a dependency on 424 # external kernel modules has a dependency on
@@ -635,7 +635,13 @@ kernel_do_configure() {
635 # $ scripts/setlocalversion . => + 635 # $ scripts/setlocalversion . => +
636 # $ make kernelversion => 2.6.37 636 # $ make kernelversion => 2.6.37
637 # $ make kernelrelease => 2.6.37+ 637 # $ make kernelrelease => 2.6.37+
638 touch ${B}/.scmversion ${S}/.scmversion 638 # See kernel-arch.bbclass for post v6.3 removal of the extra
639 # + in localversion. .scmversion is no longer used, and the
640 # variable LOCALVERSION must be used
641 if [ ! -e ${B}/.scmversion -a ! -e ${S}/.scmversion ]; then
642 echo ${KERNEL_LOCALVERSION} > ${B}/.scmversion
643 echo ${KERNEL_LOCALVERSION} > ${S}/.scmversion
644 fi
639 645
640 if [ "${S}" != "${B}" ] && [ -f "${S}/.config" ] && [ ! -f "${B}/.config" ]; then 646 if [ "${S}" != "${B}" ] && [ -f "${S}/.config" ] && [ ! -f "${B}/.config" ]; then
641 mv "${S}/.config" "${B}/.config" 647 mv "${S}/.config" "${B}/.config"