summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRasmus Villemoes <rasmus.villemoes@prevas.dk>2018-03-20 11:38:45 +0100
committerTom Rini <trini@konsulko.com>2018-04-06 20:45:28 -0400
commitf3d8f7dd73ac5dde258eb786d4a01869395b56d7 (patch)
treeac0438620f8ac9bacd7a390ec03f05f6ad50dd01 /include
parent11dfd1a331e915b17f3dd25c4ca98382d400719e (diff)
downloadu-boot-f3d8f7dd73ac5dde258eb786d4a01869395b56d7.tar.gz
Allow providing default environment from file
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. 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, or simply be kept in version control separately from the U-boot repository. Tested-by: Sean Nyekjaer <sean.nyekjaer@prevas.dk> Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Reviewed-by: Lukasz Majewski <lukma@denx.de>
Diffstat (limited to 'include')
-rw-r--r--include/env_default.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/env_default.h b/include/env_default.h
index dd741315ba..ba1c3c0d74 100644
--- a/include/env_default.h
+++ b/include/env_default.h
@@ -22,6 +22,7 @@ static char default_environment[] = {
#else
const uchar default_environment[] = {
#endif
+#ifndef CONFIG_USE_DEFAULT_ENV_FILE
#ifdef CONFIG_ENV_CALLBACK_LIST_DEFAULT
ENV_CALLBACK_VAR "=" CONFIG_ENV_CALLBACK_LIST_DEFAULT "\0"
#endif
@@ -108,6 +109,9 @@ const uchar default_environment[] = {
CONFIG_EXTRA_ENV_SETTINGS
#endif
"\0"
+#else /* CONFIG_USE_DEFAULT_ENV_FILE */
+#include "generated/defaultenv_autogenerated.h"
+#endif
#ifdef DEFAULT_ENV_INSTANCE_EMBEDDED
}
#endif