Yocto ERROR: Function failed: SYSTEMD_SERVICE_package value myservice.service does not exist

Yocto ERROR: Function failed: SYSTEMD_SERVICE_package value myservice.service does not exist

在 bitbake 食谱中,我正在尝试安装一项服务。在我看来,Yocto 似乎没有接受它。以下是我的菜谱:


SRC_URI = "file://dispatcherd.service \
           file://llc-check.sh \
           file://dispatcherd \
    "

<snip>

do_install(){
    # Install startup script
        install -d ${D}${systemd_system_unitdir}
        install -m 0644 ${WORKDIR}/dispatcherd.service ${D}${systemd_system_unitdir}
}

INITSCRIPT_NAME = "dispatcherd"
#INITSCRIPT_PARAMS = "defaults 90 10"

SYSTEMD_SERVICE_${PN} = "dispatcherd.service"
SYSTEMD_AUTO_ENABLE_${PN} = "disable"

inherit update-rc.d systemd

INSANE_SKIP_${PN} = "ldflags"

FILES_${PN} = "${libdir}/*  \
               ${bindir}/*  \
               ${sysconfdir}/init.d/dispatcherd \
              "

尝试编译图像时我得到:

ERROR: Function failed: SYSTEMD_SERVICE_ecdsa value dispatcherd.service does not exist

当我进行文件搜索时,服务文件出现在这里:

devon@VM ~/app/build/tmp-glibc $ find . -name "dispatcherd*.service"
./work/cortexa9hf-vfp-neon-phytec-linux-gnueabi/ecdsa/1.0.0-r0/dispatcherd.service
./work/cortexa9hf-vfp-neon-phytec-linux-gnueabi/ecdsa/1.0.0-r0/package/dispatcherd.service
./work/cortexa9hf-vfp-neon-phytec-linux-gnueabi/ecdsa/1.0.0-r0/image/dispatcherd.service

我试过在谷歌上搜索解决方案,但到目前为止没有成功。关于可能有什么问题或为什么 Yocto 似乎找不到文件的任何提示?

看来我在我的环境中使用的是旧版本的 yocto,不得不使用

install -d ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/dispatcherd.service ${D}${systemd_unitdir}/system

中所建议

我发现的唯一原因是将我的仓库中的 systemd.bbclass 文件与 yocto 仓库中的最新文件进行比较。我的缺少搜索路径 systemd_system_unitdir 条目。