问题描述
我基于 CMAKE 的存储库创建了 2 个可执行文件:thermostat_server
和 thermostat_client
。我尝试将包分成 2 个包,以便我可以创建 2 个 init 脚本。
我尝试了基于以下方面的不同方法: yocto-splitting-packages 和 yocto-create-init-script
其中一个尝试如下:
DESCRIPTION = "Thermostat"
LICENSE = "CLOSED"
LIC_FILES_CHKSUM = ""
inherit cmake pkgconfig update-rc.d
SRC_URI = "git://git@xxx/yyy/thermostat.git;protocol=ssh"
SRCREV = "v${PV}"
S = "${workdir}/git"
#create 2 new packages
PACKAGES =+ "{$PN}_server {$PN}_client"
FILES_{$PN}_client = "${bindir}/thermostat_client"
FILES_{$PN}_server = "${bindir}/thermostat_server"
#creat init scripts
INITSCRIPT_PACKAGES = "{$PN}_client {$PN}_server"
STARTUP_SCRIPT_server = "startup_server.sh"
INITSCRIPT_NAME_{$PN}_server = "thermostat-server"
INITSCRIPT_ParaMS_{$PN}_server = "start 41 2 3 4 5 ."
STARTUP_SCRIPT_client = "startup_client.sh"
INITSCRIPT_NAME_{$PN}_client = "thermostat-client"
INITSCRIPT_ParaMS_{$PN}_client = "start 42 2 3 4 5 ."
DEPENDS += "pkgconfig-native"
# Specify any options you want to pass to cmake using EXTRA_OECMAKE:
EXTRA_OECMAKE = ""
OECMAKE_GENERATOR="Unix Makefiles"
do_install_append() {
install -d ${D}${INIT_D_DIR}
install -m 0755 ${S}/${STARTUP_SCRIPT_server} ${D}${INIT_D_DIR}/${INITSCRIPT_NAME_{$PN}_server}
install -m 0755 ${S}/${STARTUP_SCRIPT_client} ${D}${INIT_D_DIR}/${INITSCRIPT_NAME_${PN}_client}
}
要么在 rcN.d 中只能找到一个启动项,要么我收到了当前示例中的错误消息:
... run.do_install.29203: Bad substitution
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)