我是 Yocto 的新手,我想在 /etc 中创建一个目录并将我的服务器证书复制到该目录中。我尝试在下面做,但它没有在 /etc 中创建任何目录,但是我没有收到任何编译错误:
DESCRIPTION = "OC sample service"
SUMMARY = "Install and start a systemd service and copy server certificates"
LICENSE = "MIT"
SRC_URI = "file://service.tar.gz"
inherit systemd
S = "${WORKDIR}/service"
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE_${PN} = "sample.service"
SYSTEMD_AUTO_ENABLE = "enable"
INSANE_SKIP_${PN} += "installed-vs-shipped"
do_configure() {
:
}
do_compile() {
:
}
do_install() {
install -d ${D}${systemd_unitdir}/system
install -m 0755 ${S}/sample.service ${D}${systemd_unitdir}/system
mkdir -p ${D}${etcdir}/oc_certs
install -m 0755 ${S}/certs/* ${D}${etcdir}/oc_certs
}
FILES_${PN} = "${systemd_unitdir}/system
Run Code Online (Sandbox Code Playgroud)
”
现在的问题是,sample.service 已成功放置到该位置,但未创建 /etc/oc_certs。
除了 LetoThe2nd 的答案:${etcdir}
变量通常为空。如果你想要一个变量/etc
,它是${sysconfdir}
。所以你的文件可能安装到根目录。
检查输出bitbake -e <your_recipe>
并尝试查找etcdir
以验证。
还删除INSANE_SKIP_${PN} += "installed-vs-shipped"
隐藏了您尝试查找的错误(您将看到安装在何处但未发货的内容)。
顺便说一句,LetoThe2nd 的答案也是需要的,因为您正在覆盖(而不是附加FILES_${PN}
,否则不需要它。${sysconfdir}
已经是FILES_${PN}
.
归档时间: |
|
查看次数: |
880 次 |
最近记录: |