yocto - 如何将可执行文件放入 yocto 构建下的指定目录(路径)
问题描述
SECTION = "devel"
LICENSE = "CLOSED"
EXTERNALSRC := "${THISDIR}/../../../sample-applications/sampleap/src"
inherit cmake externalsrc
inherit autotools gettext
do_compile() /*section to compile */
{
${CC} ${EXTERNALSRC}/sampleapp.c ${LDFLAGS} -o sample
}
/* To install executable in to specified D */
do_install()
{
install -d ${D} ${bindir}##
install -m 0755 sample ${D} ${bindir}
}
我是 Yocto 的新手。我写了简单的 .bb 文件。这里我的问题是如何更改我的目标目录 ${D}。我想将我的可执行文件放在不同的路径中。
解决方案
该D
变量表示目标 rootfs。您可以通过指定在bitbake.conf中定义的前缀之一或之后的相对路径来选择目标 rootfs 上的特定文件夹${D}
。例子:
...
install -d ${D}/home/root/mySamples
install -m 0755 sample ${D}/home/root/mySamples
...
如果您想将工件放置在目标 rootfs之外,那么您实际上是在滥用 Yocto 项目。无论如何,你可以在<BUILD_DIR>/tmp/work/<DISTRO-TARGET>/<RECIPE_NAME>/<RECIPE_VERSION>/image
目录下找到你的食谱的输出。
推荐阅读
- python - 使用带有张量板的keras时不断收到Nan值错误
- android - 将 Flutter 代码编译到 Android 模拟器时收到错误消息
- javascript - 如何始终在角度材料表中显示两种类型的行
- php - 来自 PHP 的大型 JSON 响应被浏览器截断
- three.js - 三.Object3D:如何禁用对象的光线投射,而不是材质?
- java - 在 Java 11 的编译选项中使用 --illegal-access=deny 时出现 Invalid flag 错误
- sql - Power BI 返回 count=1 而表有 431 行
- python - 有没有办法让 Colab 在单元格完成运行时发出音频通知
- ios - UIViewControllerAnimatedTransitioning 动画preferedContentSize
- r - optim() 根据规模陷入局部最小值