Os-release using DISTRO information instead of IMAGE

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 encountering is likely due to the order in which the variables are being set and used during the build process. The os-release file is being generated before your custom image variables like IMAGE_VERSION are set, which is why they are not appearing in the final os-release file.

Here are a few suggestions to address this issue:

  1. Ensure Variable Expansion: Make sure that the variables are being expanded correctly. You can try using := instead of = for immediate variable expansion in your os-release.bbappend file. This forces the variable to be expanded at the time of assignment.

    NAME:="${IMAGE_NAME}"
    VERSION:="${IMAGE_VERSION}"
    
  2. Check the Order of Execution: The os-release file might be getting generated before your image recipe is fully processed. You can try to ensure that your os-release.bbappend is processed after your image recipe by using dependencies or by adjusting the order of operations.

  3. Use BitBake Debugging: Use BitBake’s debugging tools to check the order of operations and see when the os-release file is being generated. You can use bitbake -e <recipe> to inspect the environment and see the values of variables at different stages.

  4. Custom Task: If the above methods do not work, consider creating a custom task in your image recipe that modifies the os-release file after it has been initially created. This task can be set to run after the do_rootfs task.

  5. Check for Conflicts: Ensure there are no other layers or recipes that might be overriding your settings for os-release.

By ensuring the correct order of operations and variable expansion, you should be able to get your custom variables into the os-release file.

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

Apalix IMX8QM/Ixora V1.2 random reset.