o4385630
o4385630

Reputation: 43

How to add a missing library (or executable or other file) to Yocto/bitbake

For an application I am running, there is a run time error as it cannot find libwayland-client.so.0 shared object. How do I know which package provides it and where do I add it. I tried as shown below but it gave me a Nothing PROVIDES error.

CORE_IMAGE_EXTRA_INSTALL += "libwayland-client"

Upvotes: 0

Views: 2362

Answers (1)

Uwe Geuder
Uwe Geuder

Reputation: 2317

You don't typically work with single files when building Yocto images

In reverse order

  1. You install packages to the image
  2. You build packages by using a recipe
  3. You find (or as a last resort write) recipes as part of layers.

Generally when something is missing you take the following steps:

  1. Check the layerindex https://layers.openembedded.org/layerindex/branch/master/recipes/?q=wayland It tells you that there is a recipe called wayland in layer openembedded-core
  2. Add the layer in question. openembedded-core is already contained in Yocto's poky (directly under the name meta, just to confuse the newcomer...), so nothing to add in this example
  3. Create the environment listing of the recipe in question, bitbake -e wayland >wayland.env
  4. Check what packages the recipe in question creates grep ^PACKAGES= wayland.env. In this case it is easy because there is really only one package wayland (-debug, -dev etc. are special purpose that would not contain the library)
  5. Add a package to the image by its package name. How to do that exactly depends on the image type you create. The variable name given in the question works for some images, but not all. Search for IMAGE_INSTALL in the manual https://www.yoctoproject.org/docs/2.6.1/mega-manual/mega-manual.html for other options.

Once you have built the recipe in question you can also check what files are contained in a package (In this case recipe name and package name are identical, but that is not always the case. Some recipes build more than one package suitable for installation, so obviously they need to use different names)

$ oe-pkgdata-util list-pkg-files wayland
wayland:
        /usr/lib/libwayland-client.so.0
        /usr/lib/libwayland-client.so.0.3.0
        /usr/lib/libwayland-cursor.so.0
        /usr/lib/libwayland-cursor.so.0.0.0
        /usr/lib/libwayland-server.so.0
        /usr/lib/libwayland-server.so.0.1.0

Upvotes: 3

Related Questions