【问题标题】:Bitbake Autotools and SystemdBitbake Autotools 和 Systemd
【发布时间】:2017-10-03 16:35:18
【问题描述】:

我对 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.target

do_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

感谢您的帮助。

【问题讨论】:

    标签: autotools systemd yocto bitbake


    【解决方案1】:

    @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/
    }
    

    【讨论】:

    • 解决了!非常感谢
    猜你喜欢
    • 2020-01-20
    • 2021-08-01
    • 2019-10-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-17
    • 2016-06-21
    • 1970-01-01
    相关资源
    最近更新 更多