未在映像中安装Hello World Bitbake食谱 [英] Hello World Bitbake Recipe Not Installed In Image

查看:72
本文介绍了未在映像中安装Hello World Bitbake食谱的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 OpenEmbedded用户手册和Dora版本的Yocto Project工具.bitbake构建工作正常,但是未在映像中安装可执行文件.基本上,我用两个配方创建了自己的meta层.一种是Autotools版本的"Hello World",它将自身构建并安装到映像中.第二个是"Hello World"的Makefile版本.这就是我遇到的麻烦.

I am working with the "Hello World" example from the OpenEmbedded User Manual and the Dora release of the Yocto Project tools. The bitbake build works fine, but the executable is not getting installed in the image. Basically I created my own meta layer with two receipes. One is an Autotools version of "Hello World" that builds and installs itself into the image. The second is a Makefile version of "Hello World". That's what I'm having trouble with.

来源与您期望的一样:

#include <stdio.h>

int main(int argc, char** argv)
{
    printf("Hello world 2!\n");
    return 0;
}


还有一个README.txt文件:


There is also a README.txt file:

Readme file for Hello World 2.


食谱如下:


The recipe is as follows:

DESCRIPTION = "Hello World 2 Program"
PR = "r0"
LICENSE = "CLOSED"
RM_WORK_EXCLUDE += "hello2"

SRC_URI = "file://hello2.c \
           file://README.txt"

do_compile() {
    ${CC} ${CFLAGS} ${LDFLAGS} ${WORKDIR}/hello2.c -o hello2
}

do_install() {
    install -m 0755 -d ${D}${bindir} ${D}${docdir}/hello2
    install -m 0644 ${S}/hello2 ${D}${bindir}
    install -m 0644 ${WORKDIR}/README.txt ${D}${docdir}/hello2
}


当我查看工作目录时,我看到可执行文件已经生成,并且生成了打包文件.日志文件中没有任何内容指示(对我来说,是新手)为什么未进行安装.食谱有什么问题吗?或者我可以检查一下以解决问题吗?


When I look at the work directory, I see the executable has built and the resulting package files. There is nothing in the log files that indicates (to me, a novice) why the install didn't happen. Is there something wrong with the recipe or is there something I can check to figure this out?

推荐答案

看来您已经成功构建了hello world演示,并且正如您指出的那样,您在WORKDIR中找到了文件.但这就是包装食谱的全部内容.它生成一个包.您需要告诉您的图像配方在最终图像中包括新包装.您可以使用以下方法作弊"并将这些说明放入您的local.conf文件中:

Well it seems like you successfully built the hello world demo, and as you indicate you found the files in WORKDIR. But that's all a package recipe does. It builds a package. You need to tell your image recipe to include your new package in the final image. You can "cheat" and put those instructions into your local.conf file, using something like:

IMAGE_INSTALL_append + =你好"

IMAGE_INSTALL_append += " hello"

但是请注意,仅当您使用基于image.bbclass的标准图像配方时,此技术才有效.

However beware that this technique only works if you are using a standard image recipe based on image.bbclass.

更好的是,在自己创建的自定义层中修改要使用的图像配方,然后将包添加到图像.bbappend中.

Better yet, modify the image recipe you are using in a custom layer of your own creation, and add the package in an image .bbappend.

例如,如果您使用的是core-image-base,请创建您自己的自定义层,并在该层中创建core-image-base.bbappend,然后在该bbappend中,为新创建的"hello"添加依赖项包裹.

For example, if you are using core-image-base, create your own custom layer and create a core-image-base.bbappend in that layer, and inside that bbappend, add the dependency for your newly created "hello" package.

元数据中有很多示例.查看core-image-base.bb和image.bbclass以获得一些有关如何创建图像的线索.请查看任何packagegroup-core * .bb,以获取有关如何将"hello"世界指定为运行时依赖项的示例,以便将该软件包安装在映像中.

There are many examples in the metadata. Take a look at core-image-base.bb and image.bbclass to get some clues how images are created. Take a look at any packagegroup-core*.bb for examples of how to specify your "hello" world as a runtime dependency so that the package gets installed in your image.

还请注意,Yocto项目的邮件列表上有很多友好的人,很乐意回答您的问题.freenode.net上还有#yocto和#oe.请访问yoctoproject.org了解详细信息.

Note also that the Yocto Project has a mailing list with lots of friendly folks on it, and would be happy to answer your questions. There is also #yocto and #oe on freenode.net. Check out yoctoproject.org for specifics.

希望这会有所帮助.

这篇关于未在映像中安装Hello World Bitbake食谱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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