In case you weren't aware, you can explicitly set default values:
W ??= "x"
A ?= "aval"
 
https://docs.yoctoproject.org/bitbake/2.0/bitbake-user-manual/bitbake-user-manual-metadata.html#setting-a-default-value
 
--
 
Variables can be queried as to how they are set:
$ bitbake-getvar --recipe rpi-u-boot-scr MY_VARIABLE
 
--
 
Also note:
The scripts are executed by /bin/sh, which may not be a bash shell but might be something such as dash.
https://docs.yoctoproject.org/bitbake/2.0/bitbake-user-manual/bitbake-user-manual-metadata.html#shell-functions