[PATCH 0/3] add "call" command

Simon Glass sjg at chromium.org
Fri Sep 25 16:40:50 CEST 2020


Hi,

On Fri, 25 Sep 2020 at 06:59, Wolfgang Denk <wd at denx.de> wrote:
>
> Dear Rasmus,
>
> In message <20200925111942.4629-1-rasmus.villemoes at prevas.dk> you wrote:
> > This adds a way to call a "function" defined in the environment with
> > arguments. I.e., whereas
> >
> >   run foo
> >
> > requires one to set the (shell or environment) variables referenced
> > from foo beforehand, with this one can instead do
> >
> >   call foo arg1 arg2 arg3
> >
> > and use $1... up to $9 in the definition of foo. $# is set so foo can
> > make decisions based on that, and ${3:-default} works as expected.
>
> This is definitely a useful idea.
>
> But...
>
> ...the current version of hush in U-Boot is old, has a number of
> known bugs and shortcomings, and I really recommend not to adding
> any new features to it, because that would makie an update to a more
> recent version even less likely.

I would like to see this also. Is the busybox version the latest?
There might even be some tests although I can't see any.

One concern is that it seems to be 3x the line count. Hopefully that
doesn't result in 3x the code size. It also seems to have developed an
even more severe case of #ifdef disease.

>
> So the first step before such extensions should be to update hush.
> In that process (which might be more of a new port) one should
> consider the possibility of keeping a little more of the
> functionality - memory restrictins today are not so strict any more
> as they were when hush was originally added.  One feature that would
> definitely be useful is command substitution.
>
> All this needs a bit of a long term maintainable concept.  Quick
> hacking of the ancient code is not a good idea.
>

Regards,
Simon


More information about the U-Boot mailing list