使用Yocto图像输出作为另一个Yocto图像上的文件。

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

Use yocto image output as file on another yocto image

问题

我有一个 Yocto 配方,用于构建树莓派镜像。我们称之为 主镜像。它的输出是 main-image.wic.bz2 文件。我想要构建另一个树莓派镜像,用于从 USB 闪存进行恢复。我们称之为 恢复镜像。我知道如何从 USB 闪存启动此镜像,但现在我需要以某种方式将 main-image.wic.bz2 文件获取到恢复镜像中。我在 Yocto 中仍然很新手,所以我想知道,实现这一目标的最佳方法是什么。感谢您的建议。

英文:

I have yocto recipe, which builds raspberry pi image. Lets call it main image. It's output is main-image.wic.bz2 file. I would like to build another RPi image, used for recovery from USB flash. Lets call it recovery image. I know, how to achieve boot of this image from USB flash, but now I need to somehow get main-image.wic.bz2 as file in recovery image. I'm still pretty new in yocto, so I would like to know, what is best way to achieve this.
Thanks for your advice.

答案1

得分: 1

以下是已翻译的内容:

我找到了它。其实相当简单,有一个名为${DEPLOY_DIR_IMAGE}的变量,指向build/tmp/deploy/images/raspberrypi4。所以这就是我的解决方案。

SUMMARY = "恢复数据包"
DESCRIPTION = ""
HOMEPAGE = ""
LICENSE = "封闭"

EXTRA_IMAGEDEPENDS = "main-image"

do_install() {
install -d ${D}/usr/static
install ${DEPLOY_DIR_IMAGE}/main-image-raspberrypi4.wic.bz2 ${D}/usr/static
}

FILES:${PN} += "/usr/static"

英文:

Well, I have found it. It's actually pretty easy, there is ${DEPLOY_DIR_IMAGE} variable, which points to build/tmp/deploy/images/raspberrypi4. So there is my solution.

SUMMARY = "Recovery data package"
DESCRIPTION = ""
HOMEPAGE = ""
LICENSE = "CLOSED"

EXTRA_IMAGEDEPENDS = "main-image"

do_install() {
    install -d ${D}/usr/static
    install ${DEPLOY_DIR_IMAGE}/main-image-raspberrypi4.wic.bz2 ${D}/usr/static
}

FILES:${PN} += "/usr/static"

huangapple
  • 本文由 发表于 2023年5月22日 21:45:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/76306843.html
匿名

发表评论

匿名网友

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

确定