diff options
author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2023-07-21 22:31:09 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-07-25 15:27:33 +0100 |
commit | 88ae1b73c09c4a1b2563f61fcddd15b5ae9fedca (patch) | |
tree | 3f26bc71b71a363bb5a81e73f61d1186f51cbf75 /meta/classes-recipe/kernel.bbclass | |
parent | 71252e03e732163a90a59e28aae06ebf4e427e6c (diff) | |
download | poky-88ae1b73c09c4a1b2563f61fcddd15b5ae9fedca.tar.gz |
kernel: make LOCALVERSION consistent between recipes
The initial fix for localversion setting in 6.3+ broke older
recipes and also broke recipes setting localversion in a kernel
recipe, as make-mod-scripts (and other locations) can trigger
a regeneration of files and don't have access to the variable.
Moving the setting of this variable to the global namespace
doesn't make sense, so we follow the example of the kernel-abiversion
and save a kernel-localversion to the build artifacts.
Recipes that may regenerate scripts/dynamic files, must
depend on the do_shared_workedir of the kernel and use the helper
function to read the file storing the localversion.
(From OE-Core rev: b378eec156998eea55ba61e59103cb34fab0d07c)
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-recipe/kernel.bbclass')
-rw-r--r-- | meta/classes-recipe/kernel.bbclass | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/meta/classes-recipe/kernel.bbclass b/meta/classes-recipe/kernel.bbclass index 2e9563186e..247ef4a48a 100644 --- a/meta/classes-recipe/kernel.bbclass +++ b/meta/classes-recipe/kernel.bbclass | |||
@@ -551,6 +551,7 @@ do_shared_workdir () { | |||
551 | # | 551 | # |
552 | 552 | ||
553 | echo "${KERNEL_VERSION}" > $kerneldir/${KERNEL_PACKAGE_NAME}-abiversion | 553 | echo "${KERNEL_VERSION}" > $kerneldir/${KERNEL_PACKAGE_NAME}-abiversion |
554 | echo "${KERNEL_LOCALVERSION}" > $kerneldir/${KERNEL_PACKAGE_NAME}-localversion | ||
554 | 555 | ||
555 | # Copy files required for module builds | 556 | # Copy files required for module builds |
556 | cp System.map $kerneldir/System.map-${KERNEL_VERSION} | 557 | cp System.map $kerneldir/System.map-${KERNEL_VERSION} |
@@ -640,6 +641,19 @@ python check_oldest_kernel() { | |||
640 | check_oldest_kernel[vardepsexclude] += "OLDEST_KERNEL KERNEL_VERSION" | 641 | check_oldest_kernel[vardepsexclude] += "OLDEST_KERNEL KERNEL_VERSION" |
641 | do_configure[prefuncs] += "check_oldest_kernel" | 642 | do_configure[prefuncs] += "check_oldest_kernel" |
642 | 643 | ||
644 | KERNEL_LOCALVERSION ??= "" | ||
645 | |||
646 | # 6.3+ requires the variable LOCALVERSION to be set to not get a "+" in | ||
647 | # the local version. Having it empty means nothing will be added, and any | ||
648 | # value will be appended to the local kernel version. This replaces the | ||
649 | # use of .scmversion file for setting a localversion without using | ||
650 | # the CONFIG_LOCALVERSION option. | ||
651 | # | ||
652 | # Note: This class saves the value of localversion to a file | ||
653 | # so other recipes like make-mod-scripts can restore it via the | ||
654 | # helper function get_kernellocalversion_file | ||
655 | export LOCALVERSION="${KERNEL_LOCALVERSION}" | ||
656 | |||
643 | kernel_do_configure() { | 657 | kernel_do_configure() { |
644 | # fixes extra + in /lib/modules/2.6.37+ | 658 | # fixes extra + in /lib/modules/2.6.37+ |
645 | # $ scripts/setlocalversion . => + | 659 | # $ scripts/setlocalversion . => + |