如何使用 Yocto 正确添加文件到目标 rootfs?

问题描述 投票:0回答:1

我正在尝试将单个文件(index.html 文件)添加到目标设备上的 rootfs。为此,我创建了名为“网页”的单独配方。我的recipes-httpd 文件夹中有另一个名为“apache2”的菜谱。如下:

.
└── recipes-httpd/
    ├── apache2/
    │   ├── apache2_%.bbappend
    │   └── apache2/
    │       └── (some configuration files)
    └── webpage/
        ├── webpage_%.bb
        └── webpage/
            └── index.html

webpage_%.bb文件的内容是:

SUMMARY = "Webpage files recipe"
DESCRIPTION = "Recipe to put webpage files into target device rootfs"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI = "file://index.html"

do_install() {
 install -d ${D}/usr/share/apache2/default-site/htdocs
 install -m 0755 ${WORKDIR}/index.html ${D}/usr/share/apache2/default-site/htdocs/index.html
}

FILES:${PN} += "/usr/share/apache2/default-site/htdocs/index.html"

但是当我运行 bitbake 时,出现以下错误:

ERROR: webpage-%-r0 do_package: Fatal errors occurred in subprocesses:
Command '['/home/mateuszm/Projects/yocto/build-mp1/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/webpage/%-r0/recipe-sysroot-native/usr/lib/rpm/rpmdeps', '--alldeps', '--define', '__font_provides %{nil}', '/home/mateuszm/Projects/yocto/build-mp1/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/webpage/%-r0/packages-split/webpage/usr/share/apache2/default-site/htdocs/index.html']' returned non-zero exit status 1.
Subprocess output:error: No file attributes configured

ERROR: Logfile of failure stored in: /home/mateuszm/Projects/yocto/build-mp1/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/webpage/%-r0/temp/log.do_package.25703
ERROR: Task (/home/mateuszm/Projects/yocto/meta-custom/recipes-httpd/webpage/webpage_%.bb:do_package) failed with exit code '1'

尝试了很多方法,但仍然无法使其发挥作用。 我将不胜感激任何帮助

我尝试将文件放入与 apache2 无关的目录中,只是为了看看这是否是问题所在。但错误还是一样。

linux yocto bitbake
1个回答
0
投票

webpage
食谱一个版本,而不是
%

%
bbappend
文件一起使用,以匹配原始
bb
文件的所有版本。

设置正确的版本,例如:

webpage_0.1.bb

© www.soinside.com 2019 - 2024. All rights reserved.