4

I need ldd utility in my final image of yocto. When I needed usbutils before, I went ahead and added the line in ../build/conf/local.conf file

CORE_IMAGE_EXTRA_INSTALL += "usbutils"

After searching around I came to see that ldd is part of the libc-bin package, atleast on my Ubuntu machine. But after reading this, I see that it is in eglibs recipe and not part of the standard package. Adding libc-bin similar to usbutils threw a Nothing RPROVIDES libc-bin error which is understandable.

What are the steps I take to get ldd onto my image if I need to add eglibs recipe. If not, is there another way I can do this.

Please bear with me, still a newbie with yocto and bitbake.

o4385630
  • 43
  • 1
  • 5
  • 3
    `CORE_IMAGE_EXTRA_INSTALL += "ldd"` should do it – Nayfe Feb 27 '19 at 09:07
  • @Nayfe You were right ! It worked, but I dont understand it. When I wanted the `lsusb` utility, I added the `usbutils` package which provided it but somehow for `ldd` I didnt have to add any. Shouldn't I add a package? What am I missing? – o4385630 Feb 27 '19 at 15:30
  • ldd comes from [glibc recipe](https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-core/glibc/glibc-package.inc#n27). Maybe usbutils has `RDEPENDS_${PN} += "ldd"` that will add ldd automatically to your image. – Nayfe Feb 27 '19 at 16:06
  • Is there a set way to do this? Like, in an other instance I needed `libwayland-client.so.0` so for an application I was trying to run. Now how would I know which package to add and where to add it? Sorry I am just coat-tailing on this question for another one. – o4385630 Feb 27 '19 at 21:09
  • For myself, search `libwayland-client.so.0` on http://rpmfind.net/ and find that provided by libwayland-client and srpm is wayland. Then search wayland recipe in yocto and located at `meta/recipes-graphics/wayland/wayland_1.16.0.bb`. And then `bitbake wayland` checks `libwayland-client.so.0` is packaged to `wayland` rather than wayland-dev. Then update the recipe of your application to add `RDEPENDS_${PN} += "wayland"`. – Kai Feb 28 '19 at 03:19
  • For me, it's a grep in my Yocto recipes folder, then a `bitbake ` and finally a `oe-pkgdata-util list-pkg-files -p `. – Nayfe Feb 28 '19 at 06:58

1 Answers1

1

How to add "ldd" to your image depends on the used C library.

In case of glibc: At least for the current "zeus" version the glibc recipes provide a separate ldd package, see: https://git.openembedded.org/openembedded-core/tree/meta/recipes-core/glibc/glibc-package.inc?h=zeus#n27

In case of musl: At least for the current "zeus" version the musl package itself provides ldd, see: https://git.openembedded.org/openembedded-core/tree/meta/recipes-core/musl/musl_git.bb?h=zeus#n91

Adding packages to your image can be done in various ways but I would recommend to use IMAGE_INSTALL_append. For more info in this topic please consult the YoctoProject manual: https://www.yoctoproject.org/docs/latest/mega-manual/mega-manual.html#usingpoky-extend-customimage.

g0hl1n
  • 1,367
  • 14
  • 28