9
0
Fork 0

defaultenv: Reorder overlay append order

The defaultenv_add_base() functions adds the enviroment coming from
CONFIG_DEFAULT_ENVIRONMENT_PATH. But this is not only for
traditional enviroments, but also for external enviroments in e.g. build
systems. The external enviroment should override the enviroment set
in the board file and not the other way around. Made sure that
external enviroment is always added last.

Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Teresa Gámez 2014-09-10 16:46:08 +02:00 committed by Sascha Hauer
parent 0662205894
commit 22acbddd89
1 changed files with 14 additions and 2 deletions

View File

@ -50,10 +50,20 @@ static void defaultenv_add_base(void)
defaultenv_append_directory(defaultenv_2_dfu);
if (IS_ENABLED(CONFIG_DEFAULT_ENVIRONMENT_GENERIC))
defaultenv_append_directory(defaultenv_1);
}
static void defaultenv_add_external(void)
{
static int external_added;
if (external_added)
return;
external_added = 1;
/*
* The traditional environment given with CONFIG_DEFAULT_ENVIRONMENT_PATH.
* Once all users are converted to bbenv-y this can go.
* The traditional or external environment given with
* CONFIG_DEFAULT_ENVIRONMENT_PATH.
*/
defaultenv_append((void *)default_environment,
default_environment_size, "defaultenv");
@ -141,6 +151,8 @@ int defaultenv_load(const char *dir, unsigned flags)
defaultenv_add_base();
defaultenv_add_external();
list_for_each_entry(df, &defaultenv_list, list) {
ret = defaultenv_load_one(df, dir, flags);
if (ret)