python - 在尝试使用 Bitbake 构建时,用 python 编写的 Yocto 食谱给了我一个错误
问题描述
这是我第一次遇到用 python 编写的配方文件,它给了我一个错误。错误是:
../meta-intel/recipes-rt/images/core-image-rt.bb: Error executing a python function in <code>:
这是来自元英特尔分支“[master] intel-vaapi-driver: 2.1.0 -> 2.2.0”的配方。
我的 poky 版本是“[morty] 文档:更新了 2.2.4 发布日期的手动修订表。
我的 BITBAKE 版本是:“BitBake Build Tool Core version 1.32.0”
core-image-rt.bb 的内容是:
require recipes-core/images/core-image-minimal.bb
# Skip processing of this recipe if linux-intel-rt is not explicitly specified as the
# PREFERRED_PROVIDER for virtual/kernel. This avoids errors when trying
# to build multiple virtual/kernel providers.
python () {
if d.getVar("PREFERRED_PROVIDER_virtual/kernel") != "linux-intel-rt":
raise bb.parse.SkipPackage("Set PREFERRED_PROVIDER_virtual/kernel to linux-intel-rt to enable it")
}
DESCRIPTION = "A small image just capable of allowing a device to boot plus a \
real-time test suite and tools appropriate for real-time use."
DEPENDS += "linux-intel-rt"
IMAGE_INSTALL += "rt-tests hwlatdetect"
LICENSE = "MIT"
如果您需要任何其他信息,请告诉我,我会尽力提供。
我通常可以在我的 ubuntu 机器上构建图像,但不相信曾经必须构建一个用 python 编写食谱的图像
解决方案
您正在使用g.getVar方法的不兼容 API。在morty release 作为最后一个使用第二个参数的旧方式,仍然需要提供布尔参数:
...
if d.getVar("PREFERRED_PROVIDER_virtual/kernel", True) != "linux-intel-rt":
...
请查看其中一个commit,它将在下一个版本中删除。
推荐阅读
- python - 在地图上聚类位置,其中每个聚类具有相同数量的点
- javascript - 正则表达式检测 Zalgo
- leaflet - 在传单 [r] 中绘制 sf 类型的对象
- bytecode - Dalvik 字节码和比较为 0 跳转
- reactjs - OpenID Connect 与 .Net Core 3 和 React
- logging - kubectl 为 pod 中的特定容器记录“未找到首选地址”
- java - 使用 Junit 5 和 spring boot 2 在 Mokito 2 中未找到测试
- javascript - 如何从 AJAX 向 Odoo 10 自定义模块控制器发出 POST/GET 请求?(被 CORS 政策阻止)
- c++ - C++中的类矩阵
- office-js - 已验证的 Excel 插件清单在本地 Excel 中有效,但在在线 Excel 中无效