Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!
Did you like my answer?
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:
-
Ensure Variable Expansion: Make sure that the variables are being expanded correctly. You can try using
:=
instead of=
for immediate variable expansion in youros-release.bbappend
file. This forces the variable to be expanded at the time of assignment.NAME:="${IMAGE_NAME}" VERSION:="${IMAGE_VERSION}"
-
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 youros-release.bbappend
is processed after your image recipe by using dependencies or by adjusting the order of operations. -
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 usebitbake -e <recipe>
to inspect the environment and see the values of variables at different stages. -
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 thedo_rootfs
task. -
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: