<div dir="ltr"><div>uboot-env-tools: Check for config prior to append</div><div><br></div><div>In the rare event a pre-populated fw_env.config exists in the rootfs prior to firstboot, calling fw_setenv after the system has initialised will annihilate the devices environment due to two identical lines in fw_env.config.</div><div><br></div><div>Check for existence prior to blind appendage. </div><div><br></div>--- a/uboot-envtools.sh<br>+++ b/uboot-envtools.sh<br>@@ -31,6 +31,6 @@ ubootenv_add_app_config() {<br>       config_get envsize "$1" envsize<br>    config_get secsize "$1" secsize<br>    config_get numsec "$1" numsec<br>-      echo "$dev $offset $envsize $secsize $numsec" >>/etc/fw_env.config<br>+   grep -q "$dev $offset $envsize $secsize $numsec" /etc/fw_env.config || echo "$dev $offset $envsize $secsize $numsec" >>/etc/fw_env.config<br> }<br><div><br></div><div>Signed-off-by: Imran Khan <gururug at <a href="http://gmail.com">gmail.com</a>></div></div>