All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] u-boot environment variable parsing
@ 2011-07-21  8:28 Hebbar, Gururaja
  2011-07-21 13:11 ` Wolfgang Denk
  0 siblings, 1 reply; 3+ messages in thread
From: Hebbar, Gururaja @ 2011-07-21  8:28 UTC (permalink / raw)
  To: u-boot

Hi, 

I need one clarification regarding Environment variable declaration & its usage.

#define CONFIG_EXTRA_ENV_SETTINGS \
	"brd_mem=62M\0" \
	"bootargs_defaults=setenv bootargs " \
		"console=${console} " \
		 "mem=${brd_mem}\0" \
	"mmc_args=run bootargs_defaults;" \
		"setenv bootargs $(bootargs) " \
		"root=${mmc_root} " \
		"rootfstype=${mmc_root_fs_type} ip=${ip_method}\0" \
	"nand_args=run bootargs_defaults;" \
		"setenv bootargs ${bootargs} " \
		"root=${nand_root} noinitrd " \
		"rootfstype=${nand_root_fs_type} ip=${ip_method}\0" \

The question here is mmc_args re-uses variable bootargs as $(bootargs) & nand_args re-uses it as ${bootargs}. Note the difference in curly & flower brackets. "run mmc_args" fails for me however nand_args runs properly.

My question is 
1. Which is correct?
2. What is the difference between the two?

I have seen few boards using both methods.

Thanks in advance

Regards
Gururaja

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

* [U-Boot] u-boot environment variable parsing
  2011-07-21  8:28 [U-Boot] u-boot environment variable parsing Hebbar, Gururaja
@ 2011-07-21 13:11 ` Wolfgang Denk
  2011-07-22 10:49   ` Hebbar, Gururaja
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Denk @ 2011-07-21 13:11 UTC (permalink / raw)
  To: u-boot

Dear "Hebbar, Gururaja",

In message <C82BA3053CFD354AACBD25EFBD2A4EC603F0193C2D@dbde02.ent.ti.com> you wrote:
> 
> 
> The question here is mmc_args re-uses variable bootargs as
> $(bootargs) & nand_args re-uses it as ${bootargs}. Note the
> difference in curly & flower brackets. "run mmc_args" fails for me
> however nand_args runs properly.

Does this not answer your question sufficiently?

> My question is
> 1. Which is correct?

${...} is correct.

> 2. What is the difference between the two?

${...} is correct, and $(...) is not correct.

> I have seen few boards using both methods.

$(...) was used in very old versions of U-Boot, but this got changed
for the sake of compatibility with standard shell syntax.

Note that the simple cmmand line parser still accepts the obsolete
$(...) format; the hush shell doesn't.

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
A morsel of genuine history is a  thing  so  rare  as  to  be  always
valuable.                                          - Thomas Jefferson

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

* [U-Boot] u-boot environment variable parsing
  2011-07-21 13:11 ` Wolfgang Denk
@ 2011-07-22 10:49   ` Hebbar, Gururaja
  0 siblings, 0 replies; 3+ messages in thread
From: Hebbar, Gururaja @ 2011-07-22 10:49 UTC (permalink / raw)
  To: u-boot

Hi wd,

Thanks for the reply. Helped me a lot.

However see below 

On Thu, Jul 21, 2011 at 18:41:30, Wolfgang Denk wrote:
> Dear "Hebbar, Gururaja",
> 
> In message <C82BA3053CFD354AACBD25EFBD2A4EC603F0193C2D@dbde02.ent.ti.com> you wrote:
> > 
> > 
> > The question here is mmc_args re-uses variable bootargs as
> > $(bootargs) & nand_args re-uses it as ${bootargs}. Note the difference 
> > in curly & flower brackets. "run mmc_args" fails for me however 
> > nand_args runs properly.
> 
> Does this not answer your question sufficiently?

The point is mmc_args worked in one place & failed in other. After you reply, I found that the place where it worked was common shell environment & it was failing in Hush shell.

> 
> > My question is
> > 1. Which is correct?
> 
> ${...} is correct.
> 
> > 2. What is the difference between the two?
> 
> ${...} is correct, and $(...) is not correct.
> 
> > I have seen few boards using both methods.
> 
> $(...) was used in very old versions of U-Boot, but this got changed for the sake of compatibility with standard shell syntax.
> 
> Note that the simple cmmand line parser still accepts the obsolete
> $(...) format; the hush shell doesn't.
> 
> 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 A morsel of genuine history is a  thing  so  rare  as  to  be  always
> valuable.                                          - Thomas Jefferson
> 

Regards, 
Gururaja

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

end of thread, other threads:[~2011-07-22 10:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-21  8:28 [U-Boot] u-boot environment variable parsing Hebbar, Gururaja
2011-07-21 13:11 ` Wolfgang Denk
2011-07-22 10:49   ` Hebbar, Gururaja

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.