diff mbox

[U-Boot,4/5] README: The ver env var is not read-only

Message ID 893352169.2280403.1344620757141.JavaMail.root@advansee.com
State Changes Requested
Delegated to: Wolfgang Denk
Headers show

Commit Message

Benoît Thébaudeau Aug. 10, 2012, 5:45 p.m. UTC
Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Wolfgang Denk <wd@denx.de>
---
 {u-boot-4d3c95f.orig => u-boot-4d3c95f}/README |    1 -
 1 file changed, 1 deletion(-)

Comments

Mike Frysinger Aug. 11, 2012, 5:48 p.m. UTC | #1
On Friday 10 August 2012 13:45:57 Benoît Thébaudeau wrote:
> --- u-boot-4d3c95f.orig/README
> +++ u-boot-4d3c95f/README
>
>  		If this variable is defined, an environment variable
>  		named "ver" is created by U-Boot showing the U-Boot
>  		version as printed by the "version" command.
> -		This variable is readonly.

why don't we fix it to be read-only ?
-mike
Benoît Thébaudeau Aug. 11, 2012, 6:07 p.m. UTC | #2
On Saturday 11 August 2012 19:48:24 Mike Frysinger wrote:
> On Friday 10 August 2012 13:45:57 Benoît Thébaudeau wrote:
> > --- u-boot-4d3c95f.orig/README
> > +++ u-boot-4d3c95f/README
> >
> >  		If this variable is defined, an environment variable
> >  		named "ver" is created by U-Boot showing the U-Boot
> >  		version as printed by the "version" command.
> > -		This variable is readonly.
> 
> why don't we fix it to be read-only ?
> -mike

I had thought about that, but there is an issue. main_loop() sets this env var,
so if ver is made read-only and the env is stored somewhere (NVRAM, etc.), then
after an update of U-Boot with a newer version (stored env untouched), ver will
still indicate the older version. See commit 155cb01, which forgot to update the
README file, which my patch does.

Best regards,
Benoît
Wolfgang Denk Aug. 12, 2012, 11:49 a.m. UTC | #3
Dear Mike Frysinger,

In message <201208111348.25632.vapier@gentoo.org> you wrote:
>
> > -		This variable is readonly.
> 
> why don't we fix it to be read-only ?

Actually it is "auto-restoring".  Any value written to it will be lost
at the next reset, when the variable will be siigned it's original
value again.

Best regards,

Wolfgang Denk
Wolfgang Denk Aug. 12, 2012, 11:54 a.m. UTC | #4
Dear =?utf-8?Q?Beno=C3=AEt_Th=C3=A9baudeau?=,

In message <2098801045.2303154.1344708456703.JavaMail.root@advansee.com> you wrote:
>
> I had thought about that, but there is an issue. main_loop() sets this env var,
> so if ver is made read-only and the env is stored somewhere (NVRAM, etc.), then
> after an update of U-Boot with a newer version (stored env untouched), ver will
> still indicate the older version. See commit 155cb01, which forgot to update the

No.  main_loop() will always set this variable to the right value, no
matter what might be stored in the environment.  Only if you then
change i later you may (temporarily) see a different value.  But again
only until you reset the board.

The correct fix for this would be the introduction of variable types,
including flags like "read-only" (as for serial# or ethaddr) or
"volatile" (i. e. not included in saveenv, as for filesize etc.)

I have been thinking about this for a long time already, I just didn't
find time yet to implement it.

Best regards,

Wolfgang Denk
Benoît Thébaudeau Aug. 12, 2012, 1:58 p.m. UTC | #5
Dear Wolfgang Denk,

> > I had thought about that, but there is an issue. main_loop() sets
> > this env var,
> > so if ver is made read-only and the env is stored somewhere (NVRAM,
> > etc.), then
> > after an update of U-Boot with a newer version (stored env
> > untouched), ver will
> > still indicate the older version. See commit 155cb01, which forgot
> > to update the
> 
> No.  main_loop() will always set this variable to the right value, no
> matter what might be stored in the environment.  Only if you then
> change i later you may (temporarily) see a different value.  But
> again
> only until you reset the board.

Yes, I agree. The behavior that I described is what would occur _if_ commit
155cb01 were reverted in order to make ver truly read-only like Mike asked for.
The current behavior is not too bad for now.

> The correct fix for this would be the introduction of variable types,
> including flags like "read-only" (as for serial# or ethaddr) or
> "volatile" (i. e. not included in saveenv, as for filesize etc.)
> 
> I have been thinking about this for a long time already, I just
> didn't
> find time yet to implement it.

OK. Don't you think that the README file should be updated in some way in the
meantime to reflect this, since ver is neither read-only nor "normal"?

Best regards,
Benoît
Mike Frysinger Aug. 12, 2012, 2:49 p.m. UTC | #6
On Sunday 12 August 2012 09:58:24 Benoît Thébaudeau wrote:
> Dear Wolfgang Denk,
> > The correct fix for this would be the introduction of variable types,
> > including flags like "read-only" (as for serial# or ethaddr) or
> > "volatile" (i. e. not included in saveenv, as for filesize etc.)
> > 
> > I have been thinking about this for a long time already, I just
> > didn't
> > find time yet to implement it.
> 
> OK. Don't you think that the README file should be updated in some way in
> the meantime to reflect this, since ver is neither read-only nor "normal"?

sure, just mention any updates to it will be lost
-mike
diff mbox

Patch

diff --git u-boot-4d3c95f.orig/README u-boot-4d3c95f/README
index fb9d904..369ea9c 100644
--- u-boot-4d3c95f.orig/README
+++ u-boot-4d3c95f/README
@@ -907,7 +907,6 @@  The following options need to be configured:
 		If this variable is defined, an environment variable
 		named "ver" is created by U-Boot showing the U-Boot
 		version as printed by the "version" command.
-		This variable is readonly.
 
 - Real-Time Clock: