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

Simon Glass sjg at chromium.org
Mon Oct 19 17:52:27 CEST 2020


Hi Michael,

On Mon, 19 Oct 2020 at 09:47, Michael Walle <michael at walle.cc> wrote:
>
> Am 2020-10-19 16:54, schrieb Wolfgang Denk:
> > Dear Simon,
> >
> > In message <20201019135602.3943835-12-sjg at chromium.org> you wrote:
> >> In some cases it is necessary to pass parameters to Linux so that it
> >> will
> >> boot correctly. For example, the rootdev parameter is often used to
> >> specify the root device. However the root device may change depending
> >> on
> >> whence U-Boot loads the kernel. At present it is necessary to build up
> >> the command line by adding device strings to it one by one.
> >>
> >> It is often more convenient to provide a template for bootargs, with
> >> U-Boot doing the substitution from other environment variables.
> >>
> >> Add a way to substitute strings in the bootargs variable. This allows
> >> things like "rootdev=%U" to be used in bootargs, with the %U
> >> substitution
> >> providing the UUID of the root device.
> >
> > Argh, no, please don't.
> >
> > You add something unconditionally to common code which very few
> > people need.  U-Boot size is growing all the time because of such
> > ... features.  This may be acceptable on the systems you have in
> > mind, but I consider this selfish.
> >
> > Why do we have to add yet another non-standard way of substituting
> > variables in a string?  Can we not use alreay existing methonds
> > instead?
> >
> > Why do you have to use "%U" in your template instead of for example
> > "${uuid}" ?
>
> I'd second that. Having variables evaluated inside the bootargs would
> be very valuable IMHO.
>
> 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.

Another thing to mention is that years ago I sent a series to help
with that last bit, i.e. make variables evaluate recursively. I'm
trying to remember what happened to it.

Regards,
Simon


More information about the U-Boot mailing list