机器特定构建中的通配符

时间:2016-03-15 13:16:54

标签: yocto bitbake

假设我有这些机器:

  • machine1a
  • machine1b
  • 机2

有没有办法一次响应所有机器1?

例如在* .bbappend文件中:

SRC_URI_machine1* += "file://file/for/machines/of/type/1"

而不是:

SRC_URI_machine1a += "file://file/for/machines/of/type/1"
SRC_URI_machine1b += "file://file/for/machines/of/type/1"

1 个答案:

答案 0 :(得分:2)

不,通配符不能以这种方式使用。

您可以通过多种不同方式处理它。一种方法是为您的设备系列添加一个通用的机器覆盖。

执行此操作的一种简单方法是将以下内容添加到machine1a和machine1b(或公共包含文件)的计算机配置中。

SOC_FAMILY = "machine1-common"
include conf/machine/include/soc-family.inc

通过这样做,你可以写

SRC_URI_machine1-common += "file://file/for/machines/of/type/1"

这适用于machine1a和machine1b。

soc-family.inc做的是

# Add SOC_FAMILY to machine overrides so we get access to e.g. 'omap3' and 'ti335x'
SOC_FAMILY ??= ""
MACHINEOVERRIDES =. "${@['', '${SOC_FAMILY}:']['${SOC_FAMILY}' != '']}"

如果您已经在使用其BSP已使用SOC_FAMILY的SoC,则可以将以下行添加到machine1a.confmachine1b.conf

MACHINEOVERRIDES =. "machine1-common:"