[U-Boot-Users] uboot script parameters.

Hi:
Couple questions regarding u-boot scripts:
1) Is it possible to create proprietary u-boot script which takes parameters (like bash for instance):
setenv getkernel tftp 2000000 $1/uImage
where I used $1 for 1st parameter like in bash (u-boot may have different notation).
Then later I can run my script with arbitrary parameter:
run getkernel /images
2) Looks like u-boot doesn't support nested substitution of script parameters. For instance:
=> setenv sw_ver 1.0.10
=> setenv image_path rel/$(sw_ver)
=> printenv image_path
image_path=rel/$(sw_ver)
=>
Am I doing something wrong?
Thanks,
Leonid.

In message FAB00A8DC59FAB42B13C2B3B0F6877010EFD30C9@ehost011-3.exch011.intermedia.net you wrote:
Couple questions regarding u-boot scripts:
- Is it possible to create proprietary u-boot script which takes
parameters (like bash for instance):
No.
setenv getkernel tftp 2000000 $1/uImage
Note that this is a definition of an envrionment variable, not a script. A script is a different thing.
- Looks like u-boot doesn't support nested substitution of script
parameters. For instance:
It does, but only within the context of the "run" command.
=> setenv sw_ver 1.0.10 => setenv image_path rel/$(sw_ver)
Why are you escaping the / here?
Also note that you should ${sw_ver}. The old syntax $(...) has been deprecated and will cease to exist soon.
=> printenv image_path image_path=rel/$(sw_ver) =>
Try:
=> sete foo echo ${image_path} => run foo rel/1.0.10
Am I doing something wrong?
Yes, you make a MAJOR mistake:
------_=_NextPart_001_01C6AB7A.77AD4D53 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
You MUST NOT post HTML here!!!!
Best regards,
Wolfgang Denk

Thanks a lot for answers and sorry for my HTMLness - I'll use Plain Text from now.
I understand that my getkernel is environment variable, but this is the only way to create proprietary script for u-boot, right?
Also if I'll add parameters' support, does it make sense for u-boot community?
Leonid.
-----Original Message----- From: wd@denx.de [mailto:wd@denx.de] Sent: Wednesday, July 19, 2006 3:47 PM To: Leonid Cc: u-boot-users@lists.sourceforge.net Subject: Re: [U-Boot-Users] uboot script parameters.
In message <FAB00A8DC59FAB42B13C2B3B0F6877010EFD30C9@ehost011-3.exch011.intermedia. net> you wrote:
Couple questions regarding u-boot scripts:
- Is it possible to create proprietary u-boot script which takes
parameters (like bash for instance):
No.
setenv getkernel tftp 2000000 $1/uImage
Note that this is a definition of an envrionment variable, not a script. A script is a different thing.
- Looks like u-boot doesn't support nested substitution of script
parameters. For instance:
It does, but only within the context of the "run" command.
=> setenv sw_ver 1.0.10 => setenv image_path rel/$(sw_ver)
Why are you escaping the / here?
Also note that you should ${sw_ver}. The old syntax $(...) has been deprecated and will cease to exist soon.
=> printenv image_path image_path=rel/$(sw_ver) =>
Try:
=> sete foo echo ${image_path} => run foo rel/1.0.10
Am I doing something wrong?
Yes, you make a MAJOR mistake:
------_=_NextPart_001_01C6AB7A.77AD4D53 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
You MUST NOT post HTML here!!!!
Best regards,
Wolfgang Denk

In message FAB00A8DC59FAB42B13C2B3B0F6877010EFD3201@ehost011-3.exch011.intermedia.net you wrote:
Thanks a lot for answers and sorry for my HTMLness - I'll use Plain Text from now.
OK. So while we are at it: will you please also stop to top/post / full quote? Please read the netiquette (ideally *before* posting). See for example http://www.netmeister.org/news/learn2quote.html
I understand that my getkernel is environment variable, but this is the only way to create proprietary script for u-boot, right?
Please, what exactly do you mean by "proprietary" here? I guess you want to express something different...
And no, environment variables are one thing, and scripts are something different. Think of a shell script - it is something different to a shell variable, even though a shell variable (like a U-Boot environment variable) can be used to store commands or even command sequences.
In U-Boot, a script is an image of type "script" (surprise, surprise!) which gets executed using the "autoscr" command.
And if you had read the manual, or just searched it for "script", you wouldn't have wasted our time.
Also if I'll add parameters' support, does it make sense for u-boot community?
Yes, this would be a very useful extension, as it would probably include a number or other useful things as well. But I guess you probably underestimate the required effort.
Best regards,
Wolfgang Denk
participants (2)
-
Leonid
-
Wolfgang Denk