Skip to contentSkip to conversation

linux-yocto_virtualization.inc: parse MAJOR.MINOR version from PV not PREFERRED_VERSION

PATCH New Martin Jansa 1 participant 1 message Aug 21, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-yocto_virtualization.inc: parse MAJOR.MINOR version from PV not PREFERRED_VERSION

From: Martin Jansa <[email protected]>

* it was introduced in:
https://git.yoctoproject.org/meta-virtualization/commit/?id=a940a0e873f9163d4585555b3f3d38e99400d237
but it doesn't work well when PREFERRED_VERSION is set to e.g. "6.6.%", you remove the '%' but not the trailing dot, causing:

ERROR: Nothing PROVIDES 'yocto-cfg-fragments-6.6.-native'. Close matches:

    yocto-cfg-fragments-6.10-native
    yocto-cfg-fragments-6.6
    yocto-cfg-fragments-6.6-native
---
 recipes-kernel/linux/linux-yocto_virtualization.inc | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
recipes-kernel/linux/linux-yocto_virtualization.inc +1 -6
index 88a1fa99..e729c3b2 100644
@@ -34,14 +34,9 @@ def distro_cond_feature(feature_fragment,distro_feature,d):
     return bb.utils.contains('DISTRO_FEATURES', distro_feature, ' ' + feat, ' ', d)
 
 def kernel_meta_ver_depends(d):
-    import re
-
-    t = d.getVar("PREFERRED_PROVIDER_virtual/kernel")
-    pv = d.getVar( "PREFERRED_VERSION_%s" % t )
-    pv = re.sub( '%', '', pv )
-
     yocto_enabled = bb.data.inherits_class('kernel-yocto', d)
     if yocto_enabled:
+        pv = oe.utils.trim_version(d.getVar('PV'), 2)
         return "yocto-cfg-fragments-%s-native:do_populate_sysroot" % pv
     else:
         return ""
Signature · 1 line
2.46.0