[PATCH v10 3/9] env: Allow U-Boot scripts to be placed in a .env file

Simon Glass sjg at chromium.org
Sat Nov 13 15:19:58 CET 2021

Hi Daniel,

On Fri, 12 Nov 2021 at 11:13, Daniel Golle <daniel at makrotopia.org> wrote:
> On Thu, Oct 21, 2021 at 09:08:46PM -0600, Simon Glass wrote:
> > At present U-Boot environment variables, and thus scripts, are defined
> > by CONFIG_EXTRA_ENV_SETTINGS. It is painful to add large amounts of text
> > to this file and dealing with quoting and newlines is harder than it
> > should be. It would be better if we could just type the script into a
> > text file and have it included by U-Boot.
> >
> > Add a feature that brings in a .env file associated with the board
> > config, if present. To use it, create a file in a board/<vendor>
> > directory, typically called <board>.env and controlled by the
> >
> > The environment variables should be of the form "var=value". Values can
> > extend to multiple lines. See the README under 'Environment Variables:'
> > for more information and an example.
> >
> > 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.
> > This uses the C preprocessor, means that comments can be included in the
> > environment using /* ... */
> >
> > Also support += to allow variables to be appended to. This is needed when
> > using the preprocessor.
> I hope to see this change moving forward!
> It would be of great value for use in OpenWrt, as right now a per board
> default environment is often included using CONFIG_ENV_SOURCE_FILE and
> I was about to convert everything to C precompiler #defines to be more
> flexible...
> The suggested .env files made possible by this commit would provide an
> ideal solution.

OK, well let 's see what happens. It is ready to apply, I think. I am
sure some additional tweaks will be needed as we migrate things.



More information about the U-Boot-Custodians mailing list