我对yocto相当陌生,我正在努力学习从autotools和systemd继承下来的菜谱。
Systemd是在发行版上正确设置的,其他菜谱也是这样使用的,但它们并不是从autotools继承的。
下面是我的菜谱源代码:
DESCRIPTION = "Single Channel gateway"
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
DEPENDS = "wiringpi"
SRCREV = "c3cf15f6f3db46ec554de873326d253ee0508ea4"
SRC_URI = "git://github.com/ArnaudPec/single_chan_pkt_fwd.git;protocol=git;branch=master \
file://sgw.service"
S = "${WORKDIR}/git/"
inherit autotools systemd
PARALLEL_MAKE = ""
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE_${PN} = " sgw.service"
FILES_${PN} += " ${systemd_system_unitdir}/sgw.service"
do_install () {
install -d ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/sgw.service ${D}${systemd_system_unitdir}
}这是我的服务文件:
[Unit]
Description=Single Channel Gateway LoRaWAN service
After=multi-user.target
[Service]
Type=oneshot
ExecStart=/usr/bin/sgw
RemainAfterExit=yes
[Install]
WantedBy=multi-user.targetdo_package的输出失败:
ERROR: sgw-1.0-r0 do_package: SYSTEMD_SERVICE_sgw value sgw.service does not exist
ERROR: sgw-1.0-r0 do_package: Function failed: systemd_populate_packages谢谢你的帮助。
发布于 2017-05-11 14:20:11
@Fl0v0: Fido不支持${systemd_system_unitdir}。它是在Jethro中引入的。
@helix_:您覆盖autotools的默认安装函数。您应该使用do_install_append而不是do_install。此外,您应该删除之前的空格关闭嘉奖。
do_install_append () {
install -d ${D}${systemd_unitdir}/system/
install -m 0644 ${WORKDIR}/sgw.service/ ${D}${systemd_unitdir}/system/
}https://stackoverflow.com/questions/43800806
复制相似问题