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

* 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

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
This commit is contained in:
Martin Jansa 2024-08-21 20:03:06 +02:00 committed by Bruce Ashfield
parent 238020e420
commit c02af94731

View File

@ -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 ""