[U-Boot] [PATCH v2] Allow providing default environment from file

Rasmus Villemoes rasmus.villemoes at prevas.dk
Tue Mar 20 14:47:05 UTC 2018


On 2018-03-20 15:20, Lukasz Majewski wrote:
> Hi Rasmus,
> 
>> Modifying the default environment via CONFIG_EXTRA_ENV_SETTINGS is
>> somewhat inflexible, partly because the cpp language does not allow
>> appending to an existing macro. This prevents reuse of "environment
>> fragments" for different boards, which in turn makes maintaining that
>> environment consistently tedious and error-prone.
> 
> It is also possible to build boot.scr image, which is afterwards read
> from e.g. vfat, from text file.
> 
> As a reference and example please look
> into ./boards/samsung/common/bootscripts/*.cmd
> 
>>
>> This implements a Kconfig option for allowing one to define the entire
>> default environment in an external file, which can then, for example,
>> be generated programmatically as part of a Yocto recipe, 
> 
> Is this yocto generation upstreamed? Or this is some kind of internal
> patch?

Neither, for now, we're just using the "entire environment in file
maintained elsewhere" model. But I can easily see us using the ability
to amend the environment with a simple "echo ... >> foo.env" in some
pre/postfunc, or having foo.env contain some __PLACEHOLDER__ which we
fix up with sed using values from .conf files before the U-boot build.
Stuff like tftp server ip address is nice to be able to override easily
to point at one's own laptop while doing development.

> 
> The patch looks ok.
> 
> Reviewed-by: Lukasz Majewski <lukma at denx.de>

Thanks.

Rasmus


More information about the U-Boot mailing list