[PATCH] env: Allow string CONFIG options in the text environment

Simon Glass sjg at chromium.org
Fri Nov 4 20:08:03 CET 2022


Hi Holger,

On Fri, 4 Nov 2022 at 08:20, Holger Brunck
<holger.brunck at hitachienergy.com> wrote:
>
> Hi Simon,
> I got no time to try it yet but I have a general comment.
>
> >
> > Sometimes it is useful to include a CONFIG option that contains a string.
> > This is hard to do in general, since in many cases it is useful to have the quotes
> > around the string so that, for example:
> >
>
> wouldn't it be cleaner to always convert a Kconfig option which is defined as a string
> to a string without the double quotes? If someone needs them he could explicitly
> add them with
>
> bootcmd=run "CONFIG_BOARD_CMD"
>
> Because  in my case I have some options I use them to build together the
> kernel command line I pass to the kernel.  Ok I could store them before in an
> own variable and them use them with ${variable} in the command line. But
> I think it would be cleaner to always convert a string defined in Kconfig in a
> string without the quotes. What do you think?

Yes I would prefer that to. I'm not sure how to implement it though.
Any thoughts?

>
> >    bootcmd=run CONFIG_BOARD_CMD
> >
> > becomes
> >
> >    bootcmd=run "boot_board"
> >
>
> just out of curiosity as we are also using similar things in our environment, the
> double quotes in this case are not needed or?

It isn't needed...actually that is a bad example.

>
> > But for the special case where there is a single quoted, it seems reasonable to
> > suppress the quotes, so that:
> >
> >    board=CONFIG_SYS_BOARD
> >
> > becomes
> >
> >    board=sandbox
> >
> > Update the script, documentation and tests accordingly.
> >
> > Signed-off-by: Simon Glass <sjg at chromium.org>
> > ---
>
> [..]

Regards,
Simon


More information about the U-Boot mailing list