public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] Very confusing variable=name behaviour
@ 2015-12-12 20:53 Pavel Machek
  2015-12-12 21:11 ` Peter Barada
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Machek @ 2015-12-12 20:53 UTC (permalink / raw)
  To: u-boot

Hi!

I'm getting quite crazy behaviour of variables in recent u-boot:

VERSION = 2016
PATCHLEVEL = 01
SUBLEVEL =
EXTRAVERSION = -rc1


Bytes transferred = 104656 (198d0 hex)
=> bootm_boot_mode=nonsec
=> echo $bootm_boot_mode
nonsec
=> prinetenv bootm_boot_mode
Unknown command 'prinetenv' - try 'help'
=> printenv bootm_boot_mode
## Error: "bootm_boot_mode" not defined
=> echo $bootm_boot_mode
nonsec
=>

What is going on there? C-level  "getenv" fails on such variable, too.

bootm_boot_mode = '<NULL>'

Explicit setenv behaves as expected:

=> setenv bootm_boot_mode nonsec
=> echo $bootm_boot_mode
nonsec
=> printenv bootm_boot_mode
bootm_boot_mode=nonsec
=>

Best regards,

     	      	 			       	       		 Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [U-Boot] Very confusing variable=name behaviour
  2015-12-12 20:53 [U-Boot] Very confusing variable=name behaviour Pavel Machek
@ 2015-12-12 21:11 ` Peter Barada
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Barada @ 2015-12-12 21:11 UTC (permalink / raw)
  To: u-boot

In u-boot there are two types of variables, local and persistent variables.

Persistent variables are assigned via "setenv", can be saved (the whole 
environment) via "saveenv", restored (to default values) via "env 
default -f".

Hush variables are assigned via "=" and can aren't saved.

Both are accessed via "$variable" or "${variable}"

What you are seeing is normal.


On 12/12/2015 03:53 PM, Pavel Machek wrote:
> Hi!
>
> I'm getting quite crazy behaviour of variables in recent u-boot:
>
> VERSION = 2016
> PATCHLEVEL = 01
> SUBLEVEL =
> EXTRAVERSION = -rc1
>
>
> Bytes transferred = 104656 (198d0 hex)
> => bootm_boot_mode=nonsec
> => echo $bootm_boot_mode
> nonsec
> => prinetenv bootm_boot_mode
> Unknown command 'prinetenv' - try 'help'
> => printenv bootm_boot_mode
> ## Error: "bootm_boot_mode" not defined
> => echo $bootm_boot_mode
> nonsec
> =>
>
> What is going on there? C-level  "getenv" fails on such variable, too.
>
> bootm_boot_mode = '<NULL>'
>
> Explicit setenv behaves as expected:
>
> => setenv bootm_boot_mode nonsec
> => echo $bootm_boot_mode
> nonsec
> => printenv bootm_boot_mode
> bootm_boot_mode=nonsec
> =>
>
> Best regards,
>
>       	      	 			       	       		 Pavel

-- 
Peter Barada
peter.barada at logicpd.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-12-12 21:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-12 20:53 [U-Boot] Very confusing variable=name behaviour Pavel Machek
2015-12-12 21:11 ` Peter Barada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox