* [U-Boot-Users] [PATCH] expand macros in bootargs env var for bootm command
@ 2005-06-30 6:25 Murray.Jensen at csiro.au
2005-06-30 10:25 ` Wolfgang Denk
0 siblings, 1 reply; 6+ messages in thread
From: Murray.Jensen at csiro.au @ 2005-06-30 6:25 UTC (permalink / raw)
To: u-boot
This patch expands $(...) macros present in the bootargs environment variable
for the bootm command. Same code could be (and probably should be, for
consistencies sake) used in other boot commands. Required exposing the
"process_macros()" function in common/main.c. 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: EXPAND-M.PAT
Type: text/x-patch
Size: 1663 bytes
Desc: expand-macros-in-bootargs.patch
Url : http://lists.denx.de/pipermail/u-boot/attachments/20050630/3065cd24/attachment.bin
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot-Users] [PATCH] expand macros in bootargs env var for bootm command
2005-06-30 6:25 [U-Boot-Users] [PATCH] expand macros in bootargs env var for bootm command Murray.Jensen at csiro.au
@ 2005-06-30 10:25 ` Wolfgang Denk
2005-06-30 13:23 ` Murray.Jensen at csiro.au
0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Denk @ 2005-06-30 10:25 UTC (permalink / raw)
To: u-boot
In message <29194.1120112716@gerd> you wrote:
>
> This patch expands $(...) macros present in the bootargs environment variable
> for the bootm command. Same code could be (and probably should be, for
> consistencies sake) used in other boot commands. Required exposing the
> "process_macros()" function in common/main.c. Cheers!
Please explain in a little more detail which problem this patch is
supposed to fix or which extension it is supposed to implement?
Also, please stick with the rules for submitting patches.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The thing is, as you progress in the Craft, you'll learn there is
another rule... When you break rules, break 'em good and hard.
- Terry Pratchett, _Wyrd Sisters_
^ permalink raw reply [flat|nested] 6+ messages in thread* [U-Boot-Users] [PATCH] expand macros in bootargs env var for bootm command
2005-06-30 10:25 ` Wolfgang Denk
@ 2005-06-30 13:23 ` Murray.Jensen at csiro.au
2005-06-30 13:43 ` Wolfgang Denk
0 siblings, 1 reply; 6+ messages in thread
From: Murray.Jensen at csiro.au @ 2005-06-30 13:23 UTC (permalink / raw)
To: u-boot
On Thu, 30 Jun 2005 12:25:01 +0200, Wolfgang Denk writes:
>Please explain in a little more detail which problem this patch is
>supposed to fix or which extension it is supposed to implement?
I wanted to define the flash partition map in the kernel command line.
I want to do this with reference to other u-boot environment variables,
which contain the start addresses and sizes for each partition (just
numbers).
I found that if the "bootargs" environment variable contained macros, they
were not expanded before the command line was passed to the kernel. The patch
does this expansion.
>Also, please stick with the rules for submitting patches.
No worries - I will do that, except I don't know what they are. Where are
the rules defined? If you can give me a link I will study them before I
submit any more patches.
Note that a search of the mailing list archive using "patch submission
guidelines" as the keywords (which I did after reading your next email)
returned only one reference - your next email (i.e. I spent some time
hunting around for them, but couldn't find them). 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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot-Users] [PATCH] expand macros in bootargs env var for bootm command
2005-06-30 13:23 ` Murray.Jensen at csiro.au
@ 2005-06-30 13:43 ` Wolfgang Denk
2005-06-30 14:37 ` Murray.Jensen at csiro.au
0 siblings, 1 reply; 6+ messages in thread
From: Wolfgang Denk @ 2005-06-30 13:43 UTC (permalink / raw)
To: u-boot
In message <7938.1120137797@huldra> you wrote:
>
> I wanted to define the flash partition map in the kernel command line.
> I want to do this with reference to other u-boot environment variables,
> which contain the start addresses and sizes for each partition (just
> numbers).
We're working on something in this area, too (allowing U-Boot to
"edit" the partitions, especially on NAND devices, and to automa-
tically generate the required kernel arguments.
> I found that if the "bootargs" environment variable contained macros, they
This is intentional.
> were not expanded before the command line was passed to the kernel. The patch
> does this expansion.
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?
> No worries - I will do that, except I don't know what they are. Where are
> the rules defined? If you can give me a link I will study them before I
> submit any more patches.
See section "Submitting Patches" in the README.
There is no excuse for not reding the README.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
At the source of every error which is blamed on the computer you will
find at least two human errors, including the error of blaming it on
the computer.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot-Users] [PATCH] expand macros in bootargs env var for bootm command
2005-06-30 13:43 ` Wolfgang Denk
@ 2005-06-30 14:37 ` Murray.Jensen at csiro.au
2005-06-30 15:15 ` Wolfgang Denk
0 siblings, 1 reply; 6+ messages in thread
From: Murray.Jensen at csiro.au @ 2005-06-30 14:37 UTC (permalink / raw)
To: u-boot
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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [U-Boot-Users] [PATCH] expand macros in bootargs env var for bootm command
2005-06-30 14:37 ` Murray.Jensen at csiro.au
@ 2005-06-30 15:15 ` Wolfgang Denk
0 siblings, 0 replies; 6+ messages in thread
From: Wolfgang Denk @ 2005-06-30 15:15 UTC (permalink / raw)
To: u-boot
In message <9752.1120142248@huldra> you wrote:
>
> Quoting from the DULG:
...
> => setenv bootargs root=/dev/nfs rw nfsroot=\$(serverip):\$(rootpath) ip=\$(ipaddr):\$(serverip):\$(gatewayip):\$(netmask):\$(hostname)::off
...
And, did you try this out? It works fine for me.
> 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?
Maybe. I cannot tell without knowing what you "almost identical
situation" was exactly.
> Except that I read the README file many years ago before this section
> was in there. Obviously, I need to re-read it. Cheers!
You should re-read every time it changes, and ideally before each
posting :-)
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
1st Old Man: Gee, its windy today.
2nd Old Man: No it's not... it's Thursday.
3rd Old Man: Yeh, me too. Let's go for a beer.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-06-30 15:15 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-30 6:25 [U-Boot-Users] [PATCH] expand macros in bootargs env var for bootm command Murray.Jensen at csiro.au
2005-06-30 10:25 ` Wolfgang Denk
2005-06-30 13:23 ` Murray.Jensen at csiro.au
2005-06-30 13:43 ` Wolfgang Denk
2005-06-30 14:37 ` Murray.Jensen at csiro.au
2005-06-30 15:15 ` Wolfgang Denk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox