Use Environment Variables in petalinux-config Option - 2021.1 English

PetaLinux Tools Documentation Reference Guide (UG1144)

Document ID
UG1144
Release Date
2021-06-16
Version
2021.1 English
From this release, PetaLinux supports using all Yocto variables in petalinux-config, for example, TOPDIR. To use the shell variables, you need to export the shell variable to BB_ENV_EXTRAWHITE. You cannot use normal shell variables directly to align with Yocto like the previous versions.
Note: In the above example, the HOST machine exports the USER environment variable by default.
export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE USER"
export MYENV="myenv"
export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE MYENV"
Note: In the above example, MYENV is a new environment variable defined and exported to the BB_ENV_EXTRAWHITE Yocto variable. After it is exported to BB_ENV_EXTRAWHITE, you can use MYENV for the petalinux-config options.