简体   繁体   English

Yocto 图像未将文件添加到 rootfs

[英]Yocto image is not adding the files to rootfs

I want to create a new folder in "/etc", as following我想在“/etc”中创建一个新文件夹,如下

/etc
----/shared
-----------example.txt

I created a new recipe in a custom yocto layer.我在自定义 yocto 层中创建了一个新配方。 The recipe is under a folder meta-own\\recipes-own\\shared and the structure of recipes-own is:配方在文件夹meta-own\\recipes-own\\sharedrecipes-own的结构是:

.
├── files
│   ├── example.txt
└── shared_configuration_1.0.bb

and the recipe is:配方是:

DESCRIPTION = "Script for copying example configurations"
SUMMARY = "example configurations"
LICENSE = "CLOSED"

SRC_URI = "file://example.txt"

do_install_append() {
    install -dm644 ${D}${sysconfdir}/shared
    install -m 0755 ${WORKDIR}/example.txt ${D}${sysconfdir}/example.txt

FILES_${PN} = "\
    ${sysconfdir} \
"

When I add the recipe to my recipes-core/images/example-image.bb :当我将配方添加到我的recipes-core/images/example-image.bb

IMAGE_INSTALL_append = " \
    bash \
    util-linux \
    shared_configuration \
    "

it outputs me always:它总是输出我:

ERROR: Nothing RPROVIDES

But if I don't place it in the example-image, it is running through but the file is not copied.但是如果我不把它放在示例图像中,它会运行但文件不会被复制。

Try to rename shared_configuration to shared-configuration because after the underscore should be the version of the recipe.尝试将 shared_configuration 重命名为 shared-configuration 因为下划线后面应该是配方的版本。

[EDIT] [编辑]

.
├── files
│   ├── example.txt
└── shared-configuration_1.0.bb

IMAGE_INSTALL_append = " \
    bash \
    util-linux \
    shared-configuration \
    "

And the recipe:和食谱:

DESCRIPTION = "Script for copying example configurations"
SUMMARY = "example configurations"
LICENSE = "CLOSED"

SRC_URI = "file://example.txt"

do_install_append() {
    install -d 644 ${D}${sysconfdir}
    install -m 0755 ${WORKDIR}/example.txt ${D}${sysconfdir}

FILES_${PN} = "${sysconfdir}"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM