[PATCH v5 4/5] env: Allow environment files to use the C preprocessor

Wolfgang Denk wd at denx.de
Mon Oct 4 14:12:32 CEST 2021

Dear Simon Glass,

In message <20211001183842.v5.4.Ie78bfbfca0d01d9cba501e127f446ec48e1f7afe at changeid> you wrote:
> In many cases environment variables need access to the U-Boot CONFIG
> variables to select different options. Enable this so that the environment
> scripts can be as useful as the ones currently in the board config files.
> Also support += to allow variables to be appended to. This is needed when
> using the preprocessor.
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
> (no changes since v4)
> Changes in v4:
> - Add documentation in rST format instead of README
> - Move use of += to this patch
> - Explain that environment variables may not end in +

Sorry, I disagree here.  There was intentionally only very little
restrictions on what a environment variable name should look like -
the only exceptions were the '=' and the NUL characters.

Adding artificial restrictions now just to enable your custom
notation for appending seems not acceptable to me.  You might want
to chose a different notation or implement a proper parser instead.


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
Never call a man a fool.  Borrow from him.

More information about the U-Boot mailing list