
Dear Wolfgang,
From: Wolfgang Denk wd@denx.de Sent: mercredi 1 avril 2020 13:26
Dear Patrick Delaunay,
In message 20200331160456.26254-1-patrick.delaunay@st.com you wrote:
Imply CONFIG_VERSION_VARIABLE for stm32mp1 target and test U-Boot version ($env_ver) when the environment was saved for the last time and to display warning trace.
What is env_ver? Are you by chance reinventing the wheel?
The script env_check is ;
env exists env_ver || env set env_ver ${ver};
if env info -p -d -q; then env save; fi;
if test "$env_ver" != "$ver"; then echo "*** Warning: old environment ${env_ver}"; echo '* set default: env default -a; env save; reset'; echo '* update current: env set env_ver ${ver}; env save'; fi;
In the first line of the script: "env exists env_ver || env set env_ver ${ver}", so
$env_ver = $ver, before the first env_save during the first boot (second line of the script)
The U-Boot version is stored in the environment variable "ver"; there should be no need for something similar.
Also. where is $env_ver coming from? It does not exist in mainline, nor in any of the 3 patches that preceed this patch # 4/16 ?
env_ver is only defined and used in this script to detect that current U-Boot version ($ver) and the version of U-Boot for last env save ($env_var) are not aligned.
I introduce this warning after debug of many issue around this kind of error, but perhaps more a debug feature.
So if you found that it is a bad idea for upstream, I will drop this part and just to the new quiet option To simplify the test:
env_check = " if env info -p -d -q; then env save; fi;"
Best regards,
Wolfgang Denk
Regards Patrick