summaryrefslogtreecommitdiffstats
path: root/meta/classes/kernel.bbclass
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2024-02-22 11:35:44 +0100
committerSteve Sakoman <steve@sakoman.com>2024-03-01 05:19:54 -1000
commit2b7c113459a602c91badaa7543d02811feac0151 (patch)
tree24c3ba17a3f0fd713914c933c542624d4ae8e24d /meta/classes/kernel.bbclass
parent57b8a1adb54a3adab22f4e04ced66a92ffc78a96 (diff)
downloadpoky-2b7c113459a602c91badaa7543d02811feac0151.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: 74897e505db19a23a5b864a48a4fa97d657605c8) 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.bbclass6
1 files changed, 4 insertions, 2 deletions
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() {
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
@@ -614,7 +614,6 @@ do_shared_workdir () {
614# We don't need to stage anything, not the modules/firmware since those would clash with linux-firmware 614# We don't need to stage anything, not the modules/firmware since those would clash with linux-firmware
615SYSROOT_DIRS = "" 615SYSROOT_DIRS = ""
616 616
617KERNEL_LOCALVERSION ??= ""
618KERNEL_CONFIG_COMMAND ?= "oe_runmake_call -C ${S} O=${B} olddefconfig || oe_runmake -C ${S} O=${B} oldnoconfig" 617KERNEL_CONFIG_COMMAND ?= "oe_runmake_call -C ${S} O=${B} olddefconfig || oe_runmake -C ${S} O=${B} oldnoconfig"
619 618
620python check_oldest_kernel() { 619python check_oldest_kernel() {
@@ -636,6 +635,9 @@ kernel_do_configure() {
636 # $ scripts/setlocalversion . => + 635 # $ scripts/setlocalversion . => +
637 # $ make kernelversion => 2.6.37 636 # $ make kernelversion => 2.6.37
638 # $ make kernelrelease => 2.6.37+ 637 # $ make kernelrelease => 2.6.37+
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
639 if [ ! -e ${B}/.scmversion -a ! -e ${S}/.scmversion ]; then 641 if [ ! -e ${B}/.scmversion -a ! -e ${S}/.scmversion ]; then
640 echo ${KERNEL_LOCALVERSION} > ${B}/.scmversion 642 echo ${KERNEL_LOCALVERSION} > ${B}/.scmversion
641 echo ${KERNEL_LOCALVERSION} > ${S}/.scmversion 643 echo ${KERNEL_LOCALVERSION} > ${S}/.scmversion