[U-Boot-Users] [PATCH] expand macros in bootargs env var for bootm command

Murray.Jensen at csiro.au Murray.Jensen at csiro.au
Thu Jun 30 16:37:28 CEST 2005


On Thu, 30 Jun 2005 15:43:53 +0200, Wolfgang Denk writes:
>You can expand all macros when building the bootargs variable like it
>is shown in all the examples in the DULG; is there any  problem  with
>that?

Quoting from the DULG:

"We can use U-Boot environment variables to store all necessary configuration
parameters:

=> setenv ipaddr 10.0.0.99
=> setenv serverip 10.0.0.2
=> setenv netmask 255.0.0.0
=> setenv hostname tqm
=> setenv rootpath /opt/eldk/ppc_8xx
=> saveenv

Then you can use these variables to build the boot arguments to be passed to
the Linux kernel:

=> setenv bootargs root=/dev/nfs rw nfsroot=\$(serverip):\$(rootpath) ip=\$(ipaddr):\$(serverip):\$(gatewayip):\$(netmask):\$(hostname)::off

Note how backslashes are used to delay the substitution of the referenced
environment variables. This way, the current values of these variables get
inserted when the "bootargs" variable itself is used, i. e. when the kernel
gets booted. This allows us to simply redefine any of the variables (say, the
value of "ipaddr" if it has to be changed), and the changes will
automatically propagate to the Linux kernel."

But I found that this (or at least, an almost identical situation) simply
didn't work. Macros in the bootargs variable weren't expanded when the kernel
was booted. Maybe I've missed something?

>See section "Submitting Patches" in the README.
>
>There is no excuse for not reding the README.

Except that I read the README file many years ago before this section
was in there. Obviously, I need to re-read it. Cheers!
								Murray...
--
Murray Jensen, CSIRO Manufacturing & Infra. Tech.      Phone: +61 3 9662 7763
Locked Bag No. 9, Preston, Vic, 3072, Australia.         Fax: +61 3 9662 7853
Internet: Murray.Jensen at csiro.au

To the extent permitted by law, CSIRO does not represent, warrant and/or
guarantee that the integrity of this communication has been maintained or
that the communication is free of errors, virus, interception or interference.

The information contained in this e-mail may be confidential or privileged.
Any unauthorised use or disclosure is prohibited. If you have received this
e-mail in error, please delete it immediately and notify Murray Jensen on
+61 3 9662 7763. Thank you.




More information about the U-Boot mailing list