[PATCH] distro_bootcmd: Add support for loading user environment

Jon Hunter jonathanh at nvidia.com
Fri Jan 31 14:24:21 CET 2020


On 31/01/2020 12:42, Soeren Moch wrote:
> On 31.01.20 11:59, Jon Hunter wrote:
>> U-Boot supports loading a user environment from a file in the
>> file-system. Therefore to make it easier for users to override the
>> default environment, add support to the 'distro_bootcmd' to look for
>> and load a user environment in a file called 'uEnv.txt' in the same
>> locations where an extlinux.conf or boot script might be found.
> 
> We already have boot script support, which can easily be used to modify
> the environment. Do we really need to bloat the distro_boot machinery
> further with environment import, that is quite limited in contrast to
> boot scripts?

If you are booting with an extlinux.conf file, as we do by default, then
if this file is found, this is always booted from before you have the
opportunity to run the boot.scr script.

Furthermore if you did switch the order to boot from a boot.scr script
before the extlinux.conf, but you just wanted to do some simple
modifications of the environment before booting (ie. so the boot.scr
does not actually boot the system), then as the code is today you get a
'echo SCRIPT FAILED: continuing...' message.

Yes this could be changed, but just seems cleaner and simpler to add
support to make changes to the environment before the extlinux.conf is
loaded.

Yes this does add more to the environment, but it is hardly significant
bloat, but if that is a concern then we could always disable this by
default and allow users to enable it.

Jon

-- 
nvpublic


More information about the U-Boot mailing list