Use Yocto Environment Variables in petalinux-config Option - 2023.2 English

PetaLinux Tools Documentation: Reference Guide (UG1144)

Document ID
UG1144
Release Date
2023-10-18
Version
2023.2 English
From this release, PetaLinux supports using all Yocto variables in petalinux-config, for example, TMPDIR. To use the shell variables, you need to export the shell variable to BB_ENV_PASSTHROUGH_ADDITIONS. You cannot use normal shell variables directly to align with Yocto like the previous versions.
export BB_ENV_PASSTHROUGH_ADDITIONS="$BB_ENV_PASSTHROUGH_ADDITIONS BB_USERNAME"
Note: In the previous example, the host machine exports the user environment variable by default.

export BB_USERNAME=$(whoami)
exportBB_ENV_PASSTHROUGH_ADDITIONS="$BB_ENV_PASSTHROUGH_ADDITIONS BB_USERNAME"
Note: In the previous example, BB_USERNAME is a new environment variable defined and exported to the BB_ENV_PASSTHROUGH_ADDITIONS Yocto variable. After it is exported to BB_ENV_PASSTHROUGH_ADDITIONS, you can use BB_USERNAME for the petalinux-config options