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

Zach Sadecki Zach.Sadecki at ripcode.com
Tue Aug 14 00:07:51 CEST 2007


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 */



> -----Original Message-----
> From: u-boot-users-bounces at lists.sourceforge.net 
> [mailto:u-boot-users-bounces at lists.sourceforge.net] On Behalf 
> Of Zach Sadecki
> Sent: Monday, August 13, 2007 4:25 PM
> To: ulf at atmel.com
> Cc: u-boot-users at lists.sourceforge.net; wd at denx.de
> Subject: Re: [U-Boot-Users] Using 'ver' env var
> 
> Ulf, 
>   I was thinking this already..  I just thought that I was missing
> something which is why I asked the questions.  I'll send a patch to
> the group for review later.
> 
> Zach
> 
> > > If you don't explicitly 'saveenv' there is no 'ver' 
> variable to read
> > > from linux...
> > > And it can't be good for the flash to force u-boot to 
> save on every
> > > boot.
> > > 
> > > So if I update (from linux for example) 'ver' doesn't get 
> > updated unless
> > > u-boot is
> > > doing a saveenv on every boot...
> > 
> > Maybe saving the environment (with ver) should be forced if 
> > "ver" is not
> > the same as the U-Boot version.
> > 
> > Best Regards
> > Ulf Samuelsson
> > 
> > 
> > 
> > 
> > 
> 
> --------------------------------------------------------------
> -----------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and 
> a browser.
> Download your FREE copy of Splunk now >>  http://get.splunk.com/
> _______________________________________________
> U-Boot-Users mailing list
> U-Boot-Users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/u-boot-users
> 




More information about the U-Boot mailing list