Open Embedded Mosquitto recipe将mosquitto 安装为守护进程,但 Target 上没有 libmosquitto.so。
如何修改配方以安装库?
已经创建mosquitto_%.bbappend
并尝试do_install
使用类似的方法扩展该功能。
do_install_append() {
install -m 0755 ${FILES_libmosquitto1} ${D}${libdir}/
}
编辑:
再深入一点,发现 libmosquitto.so 在构建和映像目录中可用,就像 Layer shippes 一样。所以我在创建 rootfs 时一定会遗漏一些东西。
bitbake mosquitto -c configure
bitbake mosquitto -c compile
bitbake mosquitto -c install
WORKDIR=./build/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-gnueabi/mosquitto/1.6.12-r0
# lib is available in after do_compile
cd ${WORKDIR}/build/lib
tree
├── libmosquitto.so -> libmosquitto.so.1
├── libmosquitto.so.1 -> libmosquitto.so.1.6.12
└── libmosquitto.so.1.6.12
# lib is available after do_install, also headers and binary is available (in include, sbin respectively)
cd ${WORKDIR}/image/usr/lib
tree
├── libmosquitto.so -> libmosquitto.so.1
├── libmosquitto.so.1 -> libmosquitto.so.1.6.12
└── libmosquitto.so.1.6.12