读取 MACHINEOVERRIDES 变量的最终值

Read the final value of the MACHINEOVERRIDES variable

在将我的 SoM 层从 pyro 分支移植到 dunfell 分支的过程中,我遇到了一些与我的食谱中的 COMPATIBLE_MACHINE 列表相关的问题( BitBake 说没有与我的机器兼容的配方)。

为了进一步调查这个问题,我尝试使用 bitbake -e 命令读取 MACHINEOVERRIDES 变量的实际值。但是,我不认为这个列表是完整的,因为观察 bitbake -e 输出我可以看到还有其他变量扩展用于形成一般 OVERRIDES 变量的值。

这是我的构建环境中 bitbake -e | grep OVERRIDES 命令 运行 的输出:

# $DISTROOVERRIDES [3 operations]
DISTROOVERRIDES="fslc"
# $FILESOVERRIDES [2 operations]
#     "${TRANSLATED_TARGET_ARCH}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}"
#     [doc] "A subset of OVERRIDES used by the OpenEmbedded build system for creating FILESPATH."
#   "${TRANSLATED_TARGET_ARCH}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}"
FILESOVERRIDES="arm:isiot:armv7ve:use-mainline-bsp:isiot-geamx6ul:fslc"
# $MACHINEOVERRIDES [14 operations]
#     "PRISTINE_MACHINEOVERRIDES"
MACHINEOVERRIDES="isiot:armv7ve:use-mainline-bsp:isiot-geamx6ul"
# $MACHINEOVERRIDES_EXTENDER_FILTER_OUT
MACHINEOVERRIDES_EXTENDER_FILTER_OUT="     imx         mx6     mx6q     mx6dl     mx6sx     mx6sl     mx6sll     mx6ul     mx6ull         mx7     mx7d     mx7ulp         mx8     mx8qm     mx8mm     mx8mn     mx8mq     mx8qxp "
# $MACHINEOVERRIDES_EXTENDER_FILTER_OUT_use-mainline-bsp
MACHINEOVERRIDES_EXTENDER_FILTER_OUT_use-mainline-bsp="     imx         mx6     mx6q     mx6dl     mx6sx     mx6sl     mx6sll     mx6ul     mx6ull         mx7     mx7d     mx7ulp         mx8     mx8qm     mx8mm     mx8mn     mx8mq     mx8qxp "
# $MACHINEOVERRIDES_EXTENDER_mx25
MACHINEOVERRIDES_EXTENDER_mx25="use-mainline-bsp"
# $MACHINEOVERRIDES_EXTENDER_mx6dl
MACHINEOVERRIDES_EXTENDER_mx6dl="imxfbdev:imxpxp:imxipu:imxvpu:imxgpu:imxgpu2d:imxgpu3d:imxepdc"
# $MACHINEOVERRIDES_EXTENDER_mx6q
MACHINEOVERRIDES_EXTENDER_mx6q="imxfbdev:imxipu:imxvpu:imxgpu:imxgpu2d:imxgpu3d"
# $MACHINEOVERRIDES_EXTENDER_mx6sl
MACHINEOVERRIDES_EXTENDER_mx6sl="imxfbdev:imxpxp:imxgpu:imxgpu2d:imxepdc"
# $MACHINEOVERRIDES_EXTENDER_mx6sll
MACHINEOVERRIDES_EXTENDER_mx6sll="imxfbdev:imxpxp:imxepdc"
# $MACHINEOVERRIDES_EXTENDER_mx6sx
MACHINEOVERRIDES_EXTENDER_mx6sx="imxfbdev:imxpxp:imxgpu:imxgpu2d:imxgpu3d"
# $MACHINEOVERRIDES_EXTENDER_mx6ul
MACHINEOVERRIDES_EXTENDER_mx6ul="imxfbdev:imxpxp"
# $MACHINEOVERRIDES_EXTENDER_mx6ull
MACHINEOVERRIDES_EXTENDER_mx6ull="imxfbdev:imxpxp:imxepdc"
# $MACHINEOVERRIDES_EXTENDER_mx7d
MACHINEOVERRIDES_EXTENDER_mx7d="imxfbdev:imxpxp:imxepdc"
# $MACHINEOVERRIDES_EXTENDER_mx7ulp
MACHINEOVERRIDES_EXTENDER_mx7ulp="imxfbdev:imxpxp:imxgpu:imxgpu2d:imxgpu3d"
# $MACHINEOVERRIDES_EXTENDER_mx8mm
MACHINEOVERRIDES_EXTENDER_mx8mm="imxdrm:imxvpu:imxgpu:imxgpu2d:imxgpu3d"
# $MACHINEOVERRIDES_EXTENDER_mx8mn
MACHINEOVERRIDES_EXTENDER_mx8mn="imxdrm:imxgpu:imxgpu3d"
# $MACHINEOVERRIDES_EXTENDER_mx8mq
MACHINEOVERRIDES_EXTENDER_mx8mq="imxdrm:imxvpu:imxgpu:imxgpu3d"
# $MACHINEOVERRIDES_EXTENDER_mx8qm
MACHINEOVERRIDES_EXTENDER_mx8qm="imxdrm:imxdpu:imxgpu:imxgpu2d:imxgpu3d"
# $MACHINEOVERRIDES_EXTENDER_mx8qxp
MACHINEOVERRIDES_EXTENDER_mx8qxp="imxdrm:imxdpu:imxgpu:imxgpu2d:imxgpu3d"
# $OVERRIDES [2 operations]
#     "${TARGET_OS}:${TRANSLATED_TARGET_ARCH}:pn-${PN}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}:${CLASSOVERRIDE}${LIBCOVERRIDE}:forcevariable"
#     [doc] "BitBake uses OVERRIDES to control what variables are overridden after BitBake parses recipes and configuration files."
#   "${TARGET_OS}:${TRANSLATED_TARGET_ARCH}:pn-${PN}:${MACHINEOVERRIDES}:${DISTROOVERRIDES}:${CLASSOVERRIDE}${LIBCOVERRIDE}:forcevariable"
OVERRIDES="linux-gnueabi:arm:pn-defaultpkgname:isiot:armv7ve:use-mainline-bsp:isiot-geamx6ul:fslc:class-target:libc-glibc:forcevariable"
# $PRISTINE_MACHINEOVERRIDES [13 operations]
#   rename from MACHINEOVERRIDES machine-overrides-extender.bbclass:49 [machine_overrides_extender_handler]
PRISTINE_MACHINEOVERRIDES="mx6:mx6ul:isiot:armv7ve:imx:use-mainline-bsp:isiot-geamx6ul"
# $SRC_URI_OVERRIDES_PACKAGE_ARCH
    overrides = d.getVar('OVERRIDES').split(':')
        msg = 'Recipe %s has PN of "%s" which is in OVERRIDES, this can result in unexpected behaviour.' % (d.getVar("FILE"), pn)
        compat_machines = (d.getVar('MACHINEOVERRIDES') or "").split(":")
    # unless the package sets SRC_URI_OVERRIDES_PACKAGE_ARCH=0
    override = d.getVar('SRC_URI_OVERRIDES_PACKAGE_ARCH')
    overrides = (":" + (d.getVar("FILESOVERRIDES") or "")).split(":")
        overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + multilib
        localdata.setVar("OVERRIDES", overrides)
    overrides = d.getVar("OVERRIDES").split(":")
    machine_overrides = (d.getVar('PRISTINE_MACHINEOVERRIDES') or '').split(':')
        machine_overrides_filter_out += (d.getVar('MACHINEOVERRIDES_EXTENDER_FILTER_OUT_%s' % override) or '').split()
        extender = d.getVar('MACHINEOVERRIDES_EXTENDER_%s' % override)
    # so we can reprocess OVERRIDES if/as/when needed.
    d.renameVar("MACHINEOVERRIDES", "PRISTINE_MACHINEOVERRIDES")
    d.setVar("MACHINEOVERRIDES", "${@machine_overrides_extender(d)}")
    localdata.setVar('OVERRIDES', pkg)
        localdata.setVar('OVERRIDES', localdata.getVar('OVERRIDES') + ':' + pkg)
        overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
        localdata.setVar("OVERRIDES", overrides)
        localdata.setVar('OVERRIDES', d.getVar("OVERRIDES", False) + ":" + pkg)

有没有办法在这些操作发生后获取 MACHINEOVERRIDESOVERRIDES 变量的值?

    # so we can reprocess OVERRIDES if/as/when needed.
    d.renameVar("MACHINEOVERRIDES", "PRISTINE_MACHINEOVERRIDES")
    d.setVar("MACHINEOVERRIDES", "${@machine_overrides_extender(d)}")
    localdata.setVar('OVERRIDES', pkg)
        localdata.setVar('OVERRIDES', localdata.getVar('OVERRIDES') + ':' + pkg)
        overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
        localdata.setVar("OVERRIDES", overrides)
        localdata.setVar('OVERRIDES', d.getVar("OVERRIDES", False) + ":" + pkg)

谢谢。

bitbake -e 已经显示了操作后的变量。

MACHINEOVERRIDES="isiot:armv7ve:use-mainline-bsp:isiot-geamx6ul"OVERRIDES="linux-gnueabi:arm:pn-defaultpkgname:isiot:armv7ve:use-mainline-bsp:isiot-geamx6ul:fslc:class-target:libc-glibc:forcevariable"

bitbake -e 首先向您显示有多少操作作用于一个变量,例如# $MACHINEOVERRIDES [14 operations] 以及它们来自哪里以及之后的扩展值。

您可以使用 bitbake -e | less 浏览输出而不是 grep。

您可以简单地使用:

bitbake -e <package_name> | grep ^MACHINEOVERRIDES=

bitbake -e <package_name> | grep ^OVERRIDES=