Enable systemd services using yocto

拥有回忆 提交于 2019-11-30 19:40:43
SYSTEMD_SERVICE_${PN} += "file://test_systemd.service"

This should be:

SYSTEMD_SERVICE_${PN} = "test_systemd.service"

Other notes (unrelated to the error):

  • Installing things into /home is probably not a great idea (you could use e.g. ${libexecdir} for scripts that other scripts need.
  • there's no reason for having a do_install_append() in a bb file: you can just put everything in do_install()
  • If your Yocto is recent, using ${systemd_system_unitdir} instead of /lib/systemd/system is a good idea (in older releases ${systemd_unitdir}/system/ works)

In order to resolve this packaging error, I used the following install step

do_install() {
   install -d ${D}${bindir}
   install -m 0755 ${WORKDIR}/test_systemd.sh ${D}${bindir}
   install -d ${D}${systemd_unitdir}/system
   install -m 0644 ${WORKDIR}/test_systemd.service ${D}${systemd_unitdir}/system
}
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!