[U-Boot-Users] PATCH: save 'ver' env var on update

Wolfgang Denk wd at denx.de
Tue Aug 14 02:13:35 CEST 2007


In message <5CBE65F7D9232C47861CB09B0954861C66A986 at MAIL.infinitychannel.local> you wrote:
> 
> diff --git a/common/main.c b/common/main.c
> index 379695c..429d367 100644
> --- a/common/main.c
> +++ b/common/main.c
> @@ -326,10 +326,11 @@ void main_loop (void)
>  #endif  /* CONFIG_MODEM_SUPPORT */
> 
>  #ifdef CONFIG_VERSION_VARIABLE
> +       extern char version_string[];
> +       if (strcmp(getenv("ver"), version_string))
>         {
> -               extern char version_string[];
> -
>                 setenv ("ver", version_string);  /* set version variable
> */
> +               run_command("saveenv", 0);
>         }
>  #endif /* CONFIG_VERSION_VARIABLE */

As mentioned before, I reject this patch.

U-Boot is not supposed to do such things like writing  to  the  flash
"automagically".

If you need this function, please implement it as a script.

[And BTW: is there a special reason why you did not call do_saveenv()
directly?]

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
In an infinite universe all things are possible, including the possi-
bility that the universe does not exist.
                        - Terry Pratchett, _The Dark Side of the Sun_




More information about the U-Boot mailing list