Yocto:在etcdir中创建一个新目录 [英] Yocto: Create a New Directory in etcdir

查看:637
本文介绍了Yocto:在etcdir中创建一个新目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Yocto的新手, 我想在/etc中创建一个目录,然后将服务器证书复制到该目录中.我尝试在下面做,但是它没有在/etc中创建任何目录,但是我没有得到任何编译错误:

I am new to Yocto, I want to create a directory in /etc and copy my server certificates into that directory. I tried doing below, But it it not creating any directory in /etc, however i am not getting any compilation error:

    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

"

现在的问题是,sample.service已成功放置到该位置,但未创建/etc/oc_certs.

Now the problem is, sample.service is successfully being placed to the location but /etc/oc_certs is not being created.

推荐答案

除了LetoThe2nd的答案:${etcdir}变量通常为空.如果要/etc的变量,则为${sysconfdir}.因此,您的文件可能已安装到根目录.

In addition to LetoThe2nd's answer: the ${etcdir} variable is usually empty. If you want a variable for /etc, it is ${sysconfdir}. So your files are probably installed to root directory.

检查bitbake -e <your_recipe>的输出并尝试找到etcdir进行验证.

Check output of bitbake -e <your_recipe> and try to find etcdir to verify.

也放下INSANE_SKIP_${PN} += "installed-vs-shipped"可以隐藏您要查找的错误(您将看到安装在什么地方但没有发货的错误).

Also drop INSANE_SKIP_${PN} += "installed-vs-shipped" which hides the error your are trying to find (you will see what is installed where but not shipped).

BTW LetoThe2nd的答案也是必需的,因为您正在覆盖(而不是附加FILES_${PN},否则将不需要.${sysconfdir}已经是FILES_${PN}的一部分.

BTW LetoThe2nd's answer is also needed, because you are overwriting (instead of appending FILES_${PN}, otherwise it wouldn't be needed. The ${sysconfdir} is already part of FILES_${PN}.

这篇关于Yocto:在etcdir中创建一个新目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆