CONFIG_DEFAULT_ENV_FILE Question

Rasmus Villemoes rasmus.villemoes at prevas.dk
Fri Sep 30 08:16:30 CEST 2022


On 28/09/2022 22.14, Jonathan DeNoon wrote:
> Hello, I want to define my own default environment, so I have enabled CONFIG_USE_DEFAULT_ENV_FILE. The next step appears to be setting the path to the default environment file via CONFIG_DEFAULT_ENV_FILE. My questions are as follows:
> 
>   *   Am I expected to provide an absolute path to the file, or is it a relative path with respect to the cloned U-Boot repo?

It can either be an absolute path or a path relative to your _build_
directory (which need not be the source directory, in case you build
with 'make O=...').

>   *   Is there a specific directory that you advise to store a default environment file in?

Well, it doesn't really matter. If you plan to maintain the file in the
U-Boot repository itself (i.e. in some private branch with stuff that is
not intended for upstream), I suggest you create a vendor-specific
directory somewhere - that way you reduce the risk of any conflicts when
rebasing to a newer upstream release.

We maintain the default environment file as part of our yocto/bitbake
repositories (that also allows us to generate parts of it using bitbake
variables), and then put a copy of it into the build directory as part
of do_configure, with the CONFIG path then just set to the basename.

>   *   Are there any example default environment files and corresponding default environment file paths that I could reference?

Well, what I do for bringup of a new board is to start without
CONFIG_DEFAULT_ENV_FILE and see whatever env gets generated (it somewhat
depends on whether you're starting from an existing eval board or trying
to do something from scratch), then extract that environment and strip
away all the gunk that won't be needed for this particular
board/project. You can use scripts/get_default_envs.sh.

Rasmus


More information about the U-Boot mailing list