[U-Boot] Question about U-Boot env variable substitution

2012-05-01 Thread David Aldrich
Hi

I would be grateful for some help with environment variable substitution in 
U-Boot please.

I have:

= printenv
[snip]
bootargs=console=ttyS0,115200 root=/dev/nfs rw 
ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:off 
nfsroot=${serverip}:${rootpath} 
[snip]
bootcmd=run flashboot_nohv_mount_nfs
[snip]
flashboot_nohv_mount_nfs=setenv bdev /dev/ram; run bootargs; bootm $kern_flash 
$rfs_flash $fdt_flash
[snip]

ipaddr etc. are also defined.

When I leave the system to autoboot I see:

[0.00] Kernel command line: console=ttyS0,115200 root=/dev/nfs rw 
ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:off 
nfsroot=${serverip}:${rootpath}

So environment variable substitution is not happening.

What am I doing wrong please?

Best regards

David
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Question about U-Boot env variable substitution

2012-05-01 Thread David Aldrich
I have fixed this now.

Best regards

David

 -Original Message-
 From: u-boot-boun...@lists.denx.de [mailto:u-boot-
 boun...@lists.denx.de] On Behalf Of David Aldrich
 Sent: 01 May 2012 13:29
 To: u-boot@lists.denx.de
 Subject: [U-Boot] Question about U-Boot env variable substitution
 
 Hi
 
 I would be grateful for some help with environment variable substitution in
 U-Boot please.
 
 I have:
 
 = printenv
 [snip]
 bootargs=console=ttyS0,115200 root=/dev/nfs rw
 ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:of
 f nfsroot=${serverip}:${rootpath} [snip] bootcmd=run
 flashboot_nohv_mount_nfs [snip] flashboot_nohv_mount_nfs=setenv
 bdev /dev/ram; run bootargs; bootm $kern_flash $rfs_flash $fdt_flash [snip]
 
 ipaddr etc. are also defined.
 
 When I leave the system to autoboot I see:
 
 [0.00] Kernel command line: console=ttyS0,115200 root=/dev/nfs rw
 ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:of
 f nfsroot=${serverip}:${rootpath}
 
 So environment variable substitution is not happening.
 
 What am I doing wrong please?
 
 Best regards
 
 David
 ___
 U-Boot mailing list
 U-Boot@lists.denx.de
 http://lists.denx.de/mailman/listinfo/u-boot
 
 
  Click
 https://www.mailcontrol.com/sr/uUXZRz9yae3TndxI!oX7UqMEQvnfkQd8ps
 QMlLDSuzukDtsZfzt9rhAxPsYhMyihXvjKACHTr5IsQNbByDSe6A==  to report
 this email as spam.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] Question about U-Boot env variable substitution

2012-05-01 Thread Wolfgang Denk
Dear David Aldrich,

In message 41302a7145ac054fa7a96cfd03835a0a114...@ex10mbx02.eu.nec.com you 
wrote:
 
 I would be grateful for some help with environment variable substitution in 
 U-Boot please.

Make sure to read the manual, and the FAQ section, especially
http://www.denx.de/wiki/view/DULG/CommandLineParsing

 I have:
 
 = printenv
 [snip]
 bootargs=console=ttyS0,115200 root=/dev/nfs rw 
 ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:off 
 nfsroot=${serverip}:${rootpath} 
...
 When I leave the system to autoboot I see:
 
 [0.00] Kernel command line: console=ttyS0,115200 root=/dev/nfs rw 
 ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}:${netdev}:off 
 nfsroot=${serverip}:${rootpath}
 
 So environment variable substitution is not happening.

Why (and where) should it happen?  The bootm command will just pass
the content of the bootargs variable as command line to the Linux
kernel - it will not modify it in any way.

If you want variable substitution to take place, you must invoce the
shell - one way or another.  The recommended and usually most
efficient way is to (iteratively) build the kernel command line (i. e.
the bootargs variable) dynamically; in this process you also get the
variables substituted as you want it.

See the examples in the manual, or many of the built-in default
environment settings, for example in include/configs/amcc-common.h


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: w...@denx.de
Why is an average signature file longer than an average Perl script??
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot