[PATCH 11/11] bootm: Support string substitution in bootargs

Wolfgang Denk wd at denx.de
Tue Oct 20 15:26:40 CEST 2020


Dear Simon,

In message <CAPnjgZ2rAQZN_bdQ5C-9cB4u8F8PrhZkBWYx0zWxj_yEBrV2qw at mail.gmail.com> you wrote:
>
> > At the moment we have some cumbersome constructs like
> >    set_bootargs="setenv bootargs bla ${var}"
>
> Yes it is a real pain. The substitution happens on first parse two, so
> you have to put these commands in separate variables if you are
> building things up.

Come on, is it really that big a problem?

You define all your needed settings (foo, bar, baz, and maybe uuid),
and then you run a single command

	setenv bootargs "${foo} ${bar} %{baz} ${uuid}"

?

Yes, it takes one additional step, but it's simple and does not need
extra code.

[And if someone bothered to update hush to a recent version, and
while doing so revisited the adaptions needed for U-Boot, we could
also do much better.  IIRC, things like command substitution were
omitted then because of the code size it would have required; given
today's resources this might be an optional feature for many.]

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
...when fits of creativity run strong, more than  one  programmer  or
writer  has  been  known to abandon the desktop for the more spacious
floor.                                             - Fred Brooks, Jr.


More information about the U-Boot mailing list