如何编写yocto/bitbake食谱将目录复制到目标根文件系统 [英] How do I write a yocto/bitbake recipe to copy a directory to the target root file system

查看:819
本文介绍了如何编写yocto/bitbake食谱将目录复制到目标根文件系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个二进制"(即不被编译)文件的目录,只希望将它们安装到我的目标根文件系统上.

I have a directory of 'binary' (i.e. not to be compiled) files and just want them to be installed onto my target root file system.

我看了几篇文章,但似乎没有一篇适合我.

I have looked at several articles, none of which seem to work for me.

此食谱所需的功能是:

myRecipe/myFiles/-> myRootFs/dir/至/安装

myRecipe/myFiles/ --> myRootFs/dir/to/install

我当前的尝试是:

SRC_URI += "file://myDir"

do_install() {
         install -d ${D}/path/to/dir/on/fs
         install -m ${WORKDIR}/myDir ${D}/path/to/dir/on/fs
}

总体而言,我不能抱怨Yocto文档,这真的很好!只是找不到这样的例子!

I can't complain about the Yocto documentation overall, it's really good! Just can't find an example of something like this!

推荐答案

您只需要将这些文件复制到目标rootfs中即可.如果它们没有安装在标准位置,请不要忘记包装它们.

You just have to copy these files into your target rootfs. Do not forget to pakage them if they are not installed in standard locations.

SRC_URI += "file://myDir"

do_install() {
    install -d ${D}/path/to/dir/on/fs
    cp -r ${WORKDIR}/myDir ${D}/path/to/dir/on/fs
}
FILES_${PN} += "/path/to/dir/on/fs"

这篇关于如何编写yocto/bitbake食谱将目录复制到目标根文件系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆