Ravi A
Ravi A

Reputation: 531

Library built but not part of rootfs

I have built images using yocto(core-image-minimal). I need "libtinfo" library to run my application, but it is not part of rootfs.

I could see the library was built and available under "cortexa7hf-neon-poky-linux-gnueabi" folder, but it is not available in rootfs. I have added using IMAGE_INSTALL_append.

My doubt here is, if the library is not required for rootfs(core-image-minimal) then it should not built.

Why the yocto built that library? similar behavior was observed with libudev library also.

Upvotes: 0

Views: 1248

Answers (1)

Parthiban
Parthiban

Reputation: 2330

Before answering your question, if you have an application which depends on "libtinfo" and your application is also build using yocto (say sample_app.bb), then you should use

DEPENDS += "libtinfo"
RDEPENDS_${PN} += "libtinfo"

This will instruct yocto to include the library in rootfs as your application needs it for runtime.

My doubt here is, if the library is not required for rootfs(core-image-minimal) then it should not built.

Assume you have source for a package which produces binary and also library i.e for example source for kmod produces libkmod and also modprobe, insmod, rmmod. In such cases recipes are written in such a way to produce two different package (based on configuration you can see *.rpm or *.ipk) files i.e kmod_*.ipk/rpm and libkmod2_*.ipk/rpm.

Based on your real requirement of application you can either use kmod or libkmod in RDEPENDS.

In your case, libtinfo is build inside ncurses package which may not be required in rootfs by any package.

Why the yocto built that library? similar behavior was observed with libudev library also.

By default the recipe for the source component ncurses or systemd includes the configuration (do_configure) for libtinfo and libudev respectively. But it is not included in rootfs, as none of the software needs it during runtime.

You can always check the dependency graph using

bitbake -g <recipe name>

as mentioned here.

Upvotes: 3

Related Questions