summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHongxu Jia <hongxu.jia@windriver.com>2025-07-02 10:44:08 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-07-03 10:40:17 +0100
commit37dd8810df2205ce12722f44293cf8991fc4704e (patch)
tree00e29a12f6522ac05ea509e2112554c859ec7779
parent1fb4a71811dadecbe0348530658623371071c0e3 (diff)
downloadpoky-37dd8810df2205ce12722f44293cf8991fc4704e.tar.gz
kernelsrc/perf: clean up package version while using kernel source
If recipe inherits bbclass kernelsrc to use kernel sources, the recipe should explicitly set ${KERNEL_VERSION} to ${PKGV} in task do_package, otherwise package version (${PV} is usually default 1.0) is not consistent with kernel source. For example, there are 5 recipes in meta-openembedded to inherit kernelsrc, but 4 recipes explicitly set PKGV. meta-openembedded$ grep -e "setVar(.*PKGV.*KERNEL_VERSION" -e kernelsrc -rn * meta-oe/recipes-kernel/intel-speed-select/intel-speed-select.bb:9:inherit kernelsrc meta-oe/recipes-kernel/bpftool/bpftool.bb:8:inherit bash-completion kernelsrc kernel-arch meta-oe/recipes-kernel/bpftool/bpftool.bb:44: d.setVar('PKGV', d.getVar("KERNEL_VERSION").split("-")[0]) meta-oe/recipes-kernel/cpupower/cpupower.bb:8:inherit kernelsrc kernel-arch bash-completion meta-oe/recipes-kernel/cpupower/cpupower.bb:32: d.setVar('PKGV', d.getVar("KERNEL_VERSION").split("-")[0]) meta-oe/recipes-kernel/turbostat/turbostat.bb:98: d.setVar('PKGV', d.getVar("KERNEL_VERSION").split("-")[0]) meta-oe/recipes-kernel/usbip-tools/usbip-tools.bb:25:inherit kernelsrc autotools-brokensep meta-oe/recipes-kernel/usbip-tools/usbip-tools.bb:68: d.setVar('PKGV', d.getVar("KERNEL_VERSION").split("-")[0]) meta-oe/recipes-kernel/spidev-test/spidev-test.bb:7:inherit bash-completion kernelsrc kernel-arch meta-oe/recipes-kernel/spidev-test/spidev-test.bb:26: d.setVar('PKGV', d.getVar("KERNEL_VERSION").split("-")[0]) This commit clean up the setting of PKGV, move it to kernelsrc.bbclass for common use, the recipe (such as intel-speed-select) that inherited kernelsrc will not be required to explicitly set ${PKGV} with ${KERNEL_VERSION} (From OE-Core rev: 77a93e8cf1da4231341c56f64f9d4d474f9f2bb7) Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes-recipe/kernelsrc.bbclass4
-rw-r--r--meta/recipes-kernel/perf/perf.bb4
2 files changed, 4 insertions, 4 deletions
diff --git a/meta/classes-recipe/kernelsrc.bbclass b/meta/classes-recipe/kernelsrc.bbclass
index ecb02dc9ed..9336184298 100644
--- a/meta/classes-recipe/kernelsrc.bbclass
+++ b/meta/classes-recipe/kernelsrc.bbclass
@@ -15,3 +15,7 @@ LOCAL_VERSION = "${@get_kernellocalversion_file("${STAGING_KERNEL_BUILDDIR}")}"
15 15
16inherit linux-kernel-base 16inherit linux-kernel-base
17 17
18# The final packages get the kernel version instead of the default 1.0
19python do_package:prepend() {
20 d.setVar('PKGV', d.getVar("KERNEL_VERSION").split("-")[0])
21}
diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb
index 157aca4d79..4f29bd5bbc 100644
--- a/meta/recipes-kernel/perf/perf.bb
+++ b/meta/recipes-kernel/perf/perf.bb
@@ -385,10 +385,6 @@ do_configure:prepend () {
385 done 385 done
386} 386}
387 387
388python do_package:prepend() {
389 d.setVar('PKGV', d.getVar("KERNEL_VERSION").split("-")[0])
390}
391
392PACKAGE_ARCH = "${MACHINE_ARCH}" 388PACKAGE_ARCH = "${MACHINE_ARCH}"
393 389
394PACKAGES =+ "${PN}-archive ${PN}-tests ${PN}-perl ${PN}-python" 390PACKAGES =+ "${PN}-archive ${PN}-tests ${PN}-perl ${PN}-python"