机器特定构建中的通配符
Wildcards in machine specific builds
假设我有那些机器:
- machine1a
- 机器 1b
- 机器 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"
不,不能以这种方式使用通配符。
您可以用多种不同的方式处理它。一种方法是为您的设备系列添加通用机器覆盖。
一个简单的方法是将以下内容添加到 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}' != '']}"
如果您已经在使用 SoC,其 BSP 已使用 SOC_FAMILY
,您可以改为将以下行添加到 machine1a.conf
和 machine1b.conf
MACHINEOVERRIDES =. "machine1-common:"
假设我有那些机器:
- machine1a
- 机器 1b
- 机器 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"
不,不能以这种方式使用通配符。
您可以用多种不同的方式处理它。一种方法是为您的设备系列添加通用机器覆盖。
一个简单的方法是将以下内容添加到 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}' != '']}"
如果您已经在使用 SoC,其 BSP 已使用 SOC_FAMILY
,您可以改为将以下行添加到 machine1a.conf
和 machine1b.conf
MACHINEOVERRIDES =. "machine1-common:"