Yocto: install files with -dev recipe

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello Markus,

To address the issue with your Yocto recipe where bar.service is not being installed as part of the foo-dev package, please follow these steps:

  1. Verify File Location: Ensure bar.service is in the correct directory within your layer, ideally alongside foo.service, or ensure it is correctly referenced in your SRC_URI.

  2. Correct SRC_URI Syntax: Modify the syntax for appending to SRC_URI. Instead of SRC_URI:{PN}-dev += "file://bar.service", use:

    SRC_URI_append_${PN}-dev = " file://bar.service"
    

    Note the use of _append and the space before file://bar.service.

  3. Ensure File is Packaged: Confirm that bar.service is included in the foo-dev package by checking the do_package task logs.

  4. Check SYSTEMD_SERVICE Variable: Verify that SYSTEMD_SERVICE:${PN}-dev is set to bar.service, ensuring the build system looks for it in the foo-dev package.

  5. Disable Auto-Enable: You have correctly set SYSTEMD_AUTO_ENABLE:${PN}-dev = "disable", which should prevent bar.service from being enabled by default.

  6. Rebuild the Image: After making these changes, clean and rebuild your image to apply all modifications:

    bitbake -c clean foo
    bitbake foo
    bitbake <your-image>
    

By following these steps, bar.service should be included in the foo-dev package and installed in the root filesystem when the package is added to the image. If issues persist, double-check the file paths and ensure all syntax is correct in your recipe.

Best regards,
Toradex AI Assistant

Please, also check if these links can help you solve your problem:

https://community.nxp.com/t5/i-MX-Processors/How-to-automatically-start-services-with-systemd-in-Yocto/m-p/746499.