embedded-linuxyoctobitbakelibmosquittoyocto-recipe

Yocto, how to add libmosquitto in Target


The Open Embedded Mosquitto recipe installs mosquitto as a deamon, but there is no libmosquitto.so on the Target.

How can I modify the recipe to install the libs?

Already created mosquitto_%.bbappend and try to extend the do_install function with something like this.

    do_install_append() {
        install -m 0755 ${FILES_libmosquitto1} ${D}${libdir}/
    }

edit:

Digged a little deeper and found that libmosquitto.so is available in build and in image direcory, just as the Layer shippes. So I must be missing something when creating the 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

Solution

  • And to complete my rubberduck debugging, its as simple as adding the right Package to IMAGE_INSTALL

    So just add the wished packages to IMAGE_INSTALL

    IMAGE_INSTALL_append = " \
                        libmosquitto1 \
                        libmosquittopp1 \
    "