1

我正在尝试将使用 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'以某种方式被弃用了。

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

4

1 回答 1

5

这不是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 用户手册

于 2019-07-11T10:49:44.743 回答