yocto - 文件未从 Yocto 中的图像配方复制到 WORKDIR 中
问题描述
我正在尝试将一个简单的文件安装到目标 rootfs 的 /etc 目录中。我正在建设core-image-sato
。“raxy_test”文件(在下面的配方中)甚至没有被复制到 WORKDIR 中。
我做错什么了吗?
我可以对普通食谱做同样的事情,但不能对图像食谱做同样的事情。
普通配方和图像配方有什么区别?
DESCRIPTION = "Image with Sato, a mobile environment and visual style for \
mobile devices. The image supports X11 with a Sato theme, Pimlico \
applications, and contains terminal, editor, and file manager."
IMAGE_FEATURES += "splash package-management x11-base x11-sato ssh-server-dropbear hwcodecs"
LICENSE = "MIT"
inherit core-image
TOOLCHAIN_HOST_TASK_append = " nativesdk-intltool nativesdk-glib-2.0"
TOOLCHAIN_HOST_TASK_remove_task-populate-sdk-ext = " nativesdk-intltool nativesdk-glib-2.0"
LICENSE="CLOSED"
LIC_FILES_CHKSUM=""
SRC_URI = "\
file://raxy_test \
"
do_install() {
install -d ${D}${sysconfdir}
install -m 0755 raxy_test ${D}${sysconfdir}
}
我希望“raxy_test”文件出现在 WORKDIR 以及目标的 /etc 目录中。
任何帮助将不胜感激,谢谢...!!!
解决方案
多件事:
- 您使用图像配方 (
core-image-sato
) 在图像中添加文件。您应该为此修改使用单独的配方; install
不正确(未使用WORKDIR ) ;- 您不填充包(FILES_${PN}不存在)。
myrecipe.bb
对于单独的配方,请在 recipes-* 子目录中创建一个文件(例如或任何您想要的文件)(您需要将其放置在与其他配方相同的文件夹级别!)。我没有测试它,但我认为这可以作为一个基础:
DESCRIPTION = "My recipe"
LICENSE="CLOSED"
PR = "r0"
PV = "0.1"
SRC_URI = " file://raxy_test "
# Create package specific skeleton
do_install() {
install -d ${D}${sysconfdir}
install -m 0755 ${WORKDIR}/raxy_test ${D}${sysconfdir}/raxy_test
}
# Populate packages
FILES_${PN} = "${sysconfdir}"
您会注意到一些事情发生了变化:
install
必须包含 ${WORKDIR} 路径:
install -m 0755 ${WORKDIR}/raxy_test ${D}${sysconfdir}
我们需要填充包:
FILES_${PN} = "${sysconfdir}"
这会将文件添加${sysconfdir}
到包${PN}
中(默认情况下是配方名称)。
推荐阅读
- c# - 如果我在文本框 Asp.net MVC 上输入 carno,结果不显示
- python - AttributeError:“QDialog”对象没有属性“QFileDialog”
- laravel - Laravel VueJs:`router-view` 不渲染组件
- asp.net-core - 在 ASP.net core 2.2 cshtml 中加载多个视图组件
- python - Eli5 explain_weights 不会为每个使用 sklearn 随机森林分类器的类返回 feature_importance
- java - ArrayList::new 中不需要的内存不足错误 - 为什么?
- java - 如何创建通过 websocket 接收流数据的服务器?
- guzzle - Guzzle:避免自动重试
- kotlin - 抽象类是否应该在 Kotlin 中实现
- python - 为什么 pip 说这是一个无效的论点?