Use Environment Variables in petalinux-config Option - 2021.2 English

PetaLinux Tools Documentation: Reference Guide

Document ID
UG1144
Release Date
2021-10-27
Version
2021.2 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.
export BB_ENV_EXTRAWHITE="$BB_ENV_EXTRAWHITE USER"
Note: In the above example, the host machine exports the user environment variable by default.
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.