Install: omitting directory ERROR

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

Did you like my answer?

:+1: :-1:


The issue you’re facing is due to the install command not handling directories recursively, which is why directories like __pycache__, pocketsphinx-data, and recognizers are being omitted. You’ve already tried using cp -r, but it seems that didn’t resolve the issue. Here are some steps you can take to address this:

  1. Use cp -r Correctly:
    Ensure that when you use cp -r, you are specifying the correct source and destination paths. The command should look something like this:

    cp -r ${S}/speech_recognition/* ${D}${PYTHON_SITEPACKAGES_DIR}/speech_recognition/
    

    Make sure that the destination directory ${D}${PYTHON_SITEPACKAGES_DIR}/speech_recognition/ exists before running the cp command.

  2. Verify Directory Creation:
    Before copying, ensure that the destination directory is created. You can add this line before the cp command:

    install -d ${D}${PYTHON_SITEPACKAGES_DIR}/speech_recognition
    
  3. Check for Errors:
    If cp -r is not copying the files as expected, check for any errors in the logs that might indicate why the files are not being copied. Ensure that the source directory ${S}/speech_recognition/ contains the expected files and directories.

  4. Debugging:
    If the issue persists, you might want to manually inspect the contents of ${S}/speech_recognition/ to ensure all necessary files and directories are present before the copy operation.

  5. Alternative Approach:
    If cp -r still doesn’t work, consider using a different approach to copy the directories, such as using rsync if available, which can handle recursive copying and provide more detailed output for debugging:

    rsync -av ${S}/speech_recognition/ ${D}${PYTHON_SITEPACKAGES_DIR}/speech_recognition/
    

By ensuring the correct use of cp -r or trying rsync, you should be able to include all necessary directories and files in your Yocto image.

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

Failed in "do_image_bootfs" when building "tdx-reference-multimedia-image".