diff mbox series

[6/6] turbostat: make turbostat's version align with kernel version

Message ID 20250414082717.2827252-6-changqing.li@windriver.com
State Under Review
Headers show
Series [1/6] version-check.conf: add CHECK_VERSION_PV for pn-netperf | expand

Commit Message

Changqing Li April 14, 2025, 8:27 a.m. UTC
From: Changqing Li <changqing.li@windriver.com>

* Current PV 3.4 is the kernel version when the recipe is newly added,
set PKGV to KERNEL_VERSION to make it always align with kernel version
* turbostat has its runtime version, set CHECK_VERSION_PV to this version to mute
the version mismatch warning
[snip of turbostat.c]
void print_version()
{
    fprintf(outf, "turbostat version 2024.07.26 - Len Brown <lenb@kernel.org>\n");
}
[snip]

Signed-off-by: Changqing Li <changqing.li@windriver.com>
---
 meta-oe/conf/version-check.conf                            | 1 +
 .../turbostat/{turbostat_3.4.bb => turbostat.bb}           | 7 +++++++
 2 files changed, 8 insertions(+)
 rename meta-oe/recipes-kernel/turbostat/{turbostat_3.4.bb => turbostat.bb} (94%)
diff mbox series

Patch

diff --git a/meta-oe/conf/version-check.conf b/meta-oe/conf/version-check.conf
index ecc8802565..7193ece705 100644
--- a/meta-oe/conf/version-check.conf
+++ b/meta-oe/conf/version-check.conf
@@ -22,3 +22,4 @@  CHECK_VERSION_PV:pn-luajit = "${PV}.%"
 CHECK_VERSION_PV:pn-sg3-utils = "%"
 CHECK_VERSION_PV:pn-netperf = "2.7.%"
 CHECK_VERSION_PV:pn-bridge-utils = "1.7%"
+CHECK_VERSION_PV:pn-turbostat = "2024.07.26"
diff --git a/meta-oe/recipes-kernel/turbostat/turbostat_3.4.bb b/meta-oe/recipes-kernel/turbostat/turbostat.bb
similarity index 94%
rename from meta-oe/recipes-kernel/turbostat/turbostat_3.4.bb
rename to meta-oe/recipes-kernel/turbostat/turbostat.bb
index cfe3bb9682..8ac15164d4 100644
--- a/meta-oe/recipes-kernel/turbostat/turbostat_3.4.bb
+++ b/meta-oe/recipes-kernel/turbostat/turbostat.bb
@@ -16,6 +16,9 @@  LIC_FILES_CHKSUM = "file://${UNPACKDIR}/COPYING;md5=bbea815ee2795b2f4230826c0c6b
 COMPATIBLE_HOST = '(x86_64.*|i.86.*)-linux'
 COMPATIBLE_HOST:libc-musl = "null"
 
+KERNEL_VERSION = "${@get_kernelversion_file("${STAGING_KERNEL_BUILDDIR}")}"
+inherit linux-kernel-base
+
 SRC_URI += "\
             file://COPYING \
             "
@@ -91,3 +94,7 @@  do_compile() {
 do_install() {
 	oe_runmake DESTDIR="${D}" install
 }
+
+python do_package:prepend() {
+    d.setVar('PKGV', d.getVar("KERNEL_VERSION").split("-")[0])
+}