Luca Carlon
Luca Carlon

Reputation: 9986

How to remove unneeded files after those are installed by Yocto?

I'm trying to create a recipe for a custom library in Yocto. I'm currently getting this error:

ERROR: ... do_package: QA Issue: pot-plugin: Files/directories were installed but not shipped in any package:
  /usr/lib/qt5/plugins/mediaservice/a.so.1.0
  /usr/lib/qt5/plugins/mediaservice/a.so.1
Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.

I already set those in FILES_${PN} but in that case Yocto complains about those being so symlinks, and that do not belong to the package. The proper thing would actually be to remove those also from the sysroot itself. I'm therefore trying to define the do_install step but I cannot find how to remove those before the package is created. I did something like:

do_install {
   rm <some_path>/a.so.1.0
   rm <some_path>/a.so.1
}

but I cannot find the proper path to use. Someone who can explain if this is the proper way to solve the issue and, in case it is, what path I should use to delete those files after those are installed and before the package is being created? Thanks!

Upvotes: 7

Views: 17629

Answers (2)

Ross Burton
Ross Burton

Reputation: 4053

Note that this is actually a bug in your custom library: it shouldn't be installing versioned symlinks for a module.

If you're using libtool to build this then - IIRC - passing -module will stop it versioning.

Upvotes: 0

ensc
ensc

Reputation: 6984

$D contains the path to the installroot so you can write

do_install_append() {
    rm -f ${D}/usr/lib/qt5/plugins/mediaservice/a.so.1.0 ...
}

But you probably want to replace /usr/lib/qt5/plugins by a variable too. To do this, inspect existing variables with

bitbake <recipe> -e | less

Upvotes: 8

Related Questions