public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Peter Barada <peter.barada@logicpd.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] Very confusing variable=name behaviour
Date: Sat, 12 Dec 2015 21:11:44 +0000	[thread overview]
Message-ID: <566C8D91.1010705@logicpd.com> (raw)
In-Reply-To: <20151212205357.GA20569@amd>

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

      reply	other threads:[~2015-12-12 21:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-12 20:53 [U-Boot] Very confusing variable=name behaviour Pavel Machek
2015-12-12 21:11 ` Peter Barada [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=566C8D91.1010705@logicpd.com \
    --to=peter.barada@logicpd.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox