* [U-Boot] 'filesize' env var - making U-Boot command more scriptable?
@ 2017-10-12 16:47 Tim Harvey
2017-10-15 11:50 ` Wolfgang Denk
0 siblings, 1 reply; 2+ messages in thread
From: Tim Harvey @ 2017-10-12 16:47 UTC (permalink / raw)
To: u-boot
Greetings,
Various U-Boot commands that deal with files/blobs end up setting the
'filesize' env variable to be used for subsequent commands which is
very handy. I haven't found this documented anywhere but a scan of the
code looks like this is done by
ximg/unzip/load/ini/lzmadec/reiser/cramfs/pxe/cbfs/jffs2/zfs/nvedit/zip/bootm_os/dfu_mmc/fs/ubifs/net.
I've seen other commands that allow a usage that will allow specifying
a var name to put a result in.
I've noticed commands such as 'ubi' and 'nand' would benefit from
setting filesize when dealing with volume names and partition names.
I've also noticed how some commands (ie nand) are good about reporting
sizes in hex but others (ie ubi) report them in decimal only making it
difficult for someone to even cut-and-paste sizes to following
commands.
Has there been a desire or proposal to make this more standard or come
up with something different?
Regards,
Tim
^ permalink raw reply [flat|nested] 2+ messages in thread
* [U-Boot] 'filesize' env var - making U-Boot command more scriptable?
2017-10-12 16:47 [U-Boot] 'filesize' env var - making U-Boot command more scriptable? Tim Harvey
@ 2017-10-15 11:50 ` Wolfgang Denk
0 siblings, 0 replies; 2+ messages in thread
From: Wolfgang Denk @ 2017-10-15 11:50 UTC (permalink / raw)
To: u-boot
Dear Tim,
In message <CAJ+vNU1c86fd3yj+qnZE5SnPLmzHaUWF68oT+gwHKYmNag84Hg@mail.gmail.com> you wrote:
>
> Various U-Boot commands that deal with files/blobs end up setting the
> 'filesize' env variable to be used for subsequent commands which is
> very handy. I haven't found this documented anywhere but a scan of the
> code looks like this is done by
Documentation is certainly not perfect, but at least filesize gets
mentioned in the U-Boot environment variables section of the manual;
see the very end of [1] (plus a few othe rplaces).
[1] http://www.denx.de/wiki/view/DULG/UBootEnvVariables
> I've seen other commands that allow a usage that will allow specifying
> a var name to put a result in.
>
> I've noticed commands such as 'ubi' and 'nand' would benefit from
> setting filesize when dealing with volume names and partition names.
> I've also noticed how some commands (ie nand) are good about reporting
> sizes in hex but others (ie ubi) report them in decimal only making it
> difficult for someone to even cut-and-paste sizes to following
> commands.
>
> Has there been a desire or proposal to make this more standard or come
> up with something different?
If you really think about it, all of this is just a worarounf for
the lack of command substitution (aka backquotes / backticks) in the
available command interpreters in U-Boot.
The currently most used one is based on an ancient version of hush
from the BusyBox project. It has a large number of severe
restrictions and a fair number of known other issues.
IMO if somebody is willing to spend efforts in this area it would be
best to replace hust by a more recent version of a shell, adding
command substitution.
[If you go a step further you might even think about introducing a
concept of "files" and adding pipes. But then we would be mioving
more and more into the direction of an OS ;-) ]
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
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
All this doesn't alter anything, you know. The world is still full of
stupid people. They don't use their brains. They don't seem to want
to think straight. - Terry Pratchett, _Soul Music_
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-10-15 11:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-12 16:47 [U-Boot] 'filesize' env var - making U-Boot command more scriptable? Tim Harvey
2017-10-15 11:50 ` Wolfgang Denk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox