如何为Yocto打包已安装的文件?

huangapple go评论59阅读模式
英文:

How do I package installed files for Yocto?

问题

我正在尝试为 Yocto 创建一个简单的 Hello World 配方,但失败了。我只是试图在根文件系统上创建一个目录并将一个文件复制到那里。我的配方布局如下:

meta-hw
meta-hw/conf
meta-hw/conf/layer.conf
meta-hw/recipes-main
meta-hw/recipes-main/hello-world
meta-hw/recipes-main/hello-world/hello-world.bb
meta-hw/recipes-main/hello-world/files
meta-hw/recipes-main/hello-world/files/hello-world.txt

这是我的 layer.conf:

BBPATH .= ":${LAYERDIR}"
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
            ${LAYERDIR}/recipes-*/*/*.bbappend"

BBFILE_PATTERN_yoctobsp = "^${LAYERDIR}/"
BBFILE_PRIORITY_yoctobsp = "5"
LAYERVERSION_yoctobsp = "4"

这是我的 hello-world.bb:

DESCRIPTION = "Hello world recipe"
LICENSE = "CLOSED"

SRC_URI = "file://hello-world.txt"

do_install() {
        install -d ${D}/hw
        cp ${WORKDIR}/hello-world.txt ${D}/hw/
}

FILES_${PN} += "/hw"
FILES_${PN} += "/hw/hello-world.txt"

这是我从 bitbake hello-world 得到的输出,告诉我我没有打包 /hw 和 /hw/hello-world.txt 文件,尽管我认为 FILES_${PN} 行正在做这件事。

ERROR: hello-world-1.0-r0 do_package: QA Issue: hello-world: Files/directories were installed but not shipped in any package:
  /hw
  /hw/hello-world.txt
Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
hello-world: 2 installed and not shipped files. [installed-vs-shipped]
ERROR: hello-world-1.0-r0 do_package: Fatal QA errors were found, failing task.
ERROR: Logfile of failure stored in: /data/toradex/build/tmp/work/cortexa53-tdx-linux/hello-world/1.0-r0/temp/log.do_package.130751
ERROR: Task (/home/user/meta-hw/recipes-main/hello-world/hello-world.bb:do_package) failed with exit code '1'

我不确定接下来应该尝试什么,因为我找到的每个示例基本上都是这样的。

英文:

I'm trying to create a simple Hello World recipe for yocto and failing. I'm just trying to create a directory on the root files system and copy a file there. My recipe layout looks like this:

meta-hw
meta-hw/conf
meta-hw/conf/layer.conf
meta-hw/recipes-main
meta-hw/recipes-main/hello-world
meta-hw/recipes-main/hello-world/hello-world.bb
meta-hw/recipes-main/hello-world/files
meta-hw/recipes-main/hello-world/files/hello-world.txt

This is my layer.conf:

BBPATH .= ":${LAYERDIR}"
BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \
            ${LAYERDIR}/recipes-*/*/*.bbappend"

BBFILE_PATTERN_yoctobsp = "^${LAYERDIR}/"
BBFILE_PRIORITY_yoctobsp = "5"
LAYERVERSION_yoctobsp = "4"

This is my hello-world.bb:

DESCRIPTION = "Hello world recipe"
LICENSE = "CLOSED"

SRC_URI = "file://hello-world.txt"

do_install() {
        install -d ${D}/hw
        cp ${WORKDIR}/hello-world.txt ${D}/hw/
}

FILES_${PN} += "/hw"
FILES_${PN} += "/hw/hello-world.txt"

And this is the output I get from bitbake hello-world, telling me I haven't packaged the /hw and /hw/hello-world.txt files, though I thought that's what the FILES_${PN} lines were doing.

ERROR: hello-world-1.0-r0 do_package: QA Issue: hello-world: Files/directories were installed but not shipped in any package:
  /hw
  /hw/hello-world.txt
Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
hello-world: 2 installed and not shipped files. [installed-vs-shipped]
ERROR: hello-world-1.0-r0 do_package: Fatal QA errors were found, failing task.
ERROR: Logfile of failure stored in: /data/toradex/build/tmp/work/cortexa53-tdx-linux/hello-world/1.0-r0/temp/log.do_package.130751
ERROR: Task (/home/user/meta-hw/recipes-main/hello-world/hello-world.bb:do_package) failed with exit code '1'

I'm not sure what to try next as every example I've found looks basically like this.

答案1

得分: 0

@skandigraun是正确的。我正在使用kirkstone,所以它需要是FILES:${PN} +=

英文:

@skandigraun was right. I'm using kirkstone so it needs to be FILES:${PN} +=

huangapple
  • 本文由 发表于 2023年6月30日 04:40:17
  • 转载请务必保留本文链接:https://go.coder-hub.com/76584479.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定