【问题标题】:Updating Yocto causes exception 'bb.data' has no attribute 'getVar'更新 Yocto 导致异常 'bb.data' 没有属性 'getVar'
【发布时间】:2019-07-14 17:14:24
【问题描述】:

我正在尝试将使用 Yocto 1.6 Fido 的项目升级到 Yocto 2.6 Thud。

我在构建期间收到以下异常。 meta-eca 层的问题

ERROR: ExpansionError during parsing /home/poky-thud/build- 
bbgw/../meta-eca/meta-iot/recipes-web/the-thing-system/steward_git.bb                                                                                         
| ETA:  0:01:02

Traceback (most recent call last):

bb.data_smart.ExpansionError: Failure expanding variable TTS_ARCH[:=], 
expression was ${@get_arch(bb, d)} which triggered exception AttributeError:

module 'bb.data' has no attribute 'getVar'

我猜 'getVar' 以某种方式被弃用了。

解决此问题的最佳方法是什么?

【问题讨论】:

    标签: linux yocto bitbake


    【解决方案1】:

    不推荐使用的不是getVar,而是使用/访问它的方式。您只需要 BitBake 的数据字典结构 (d) 即可访问其环境变量。您应该如下修改配方:

    def get_arch(d):
        val = (d.getVar("MACHINEOVERRIDES", True) or "")
        if val.find("genericx86") > 0:
            return "--arch=i686"
        elif val.find("x86") > 0:
            return "--arch=i686"
        elif val.find("arm") > 0:
            return "--arch=arm"
        else:
            return ""
    
    # Always compile 32-bit in npm because many modules that npm
    # compiles do not support 64 bit in x86.
    TTS_ARCH := "${@get_arch(d)}"
    

    更多信息请参考BitBake user manual

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-01-07
      • 2011-08-10
      • 1970-01-01
      • 2020-09-14
      • 1970-01-01
      • 1970-01-01
      • 2014-02-07
      • 2010-10-05
      相关资源
      最近更新 更多