summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--commands/loadenv.c2
-rw-r--r--commands/saveenv.c2
-rw-r--r--common/environment.c2
-rw-r--r--common/startup.c7
-rw-r--r--include/environment.h3
5 files changed, 11 insertions, 5 deletions
diff --git a/commands/loadenv.c b/commands/loadenv.c
index c33c34fcee..5568aced88 100644
--- a/commands/loadenv.c
+++ b/commands/loadenv.c
@@ -36,7 +36,7 @@ static int do_loadenv(struct command *cmdtp, int argc, char *argv[])
else
dirname = argv[2];
if (argc < 2)
- filename = "/dev/env0";
+ filename = default_environment_path;
else
filename = argv[1];
printf("loading environment from %s\n", filename);
diff --git a/commands/saveenv.c b/commands/saveenv.c
index 2f969fe7b9..11a9fee54f 100644
--- a/commands/saveenv.c
+++ b/commands/saveenv.c
@@ -41,7 +41,7 @@ static int do_saveenv(struct command *cmdtp, int argc, char *argv[])
else
dirname = argv[2];
if (argc < 2)
- filename = "/dev/env0";
+ filename = default_environment_path;
else
filename = argv[1];
diff --git a/common/environment.c b/common/environment.c
index e5f24ec201..0fdbd03e00 100644
--- a/common/environment.c
+++ b/common/environment.c
@@ -44,6 +44,8 @@
#define EXPORT_SYMBOL(x)
#endif
+char *default_environment_path = "/dev/env0";
+
int file_size_action(const char *filename, struct stat *statbuf,
void *userdata, int depth)
{
diff --git a/common/startup.c b/common/startup.c
index 38087093b0..00bc9a0038 100644
--- a/common/startup.c
+++ b/common/startup.c
@@ -144,10 +144,11 @@ void start_barebox (void)
display_meminfo();
#ifdef CONFIG_ENV_HANDLING
- if (envfs_load("/dev/env0", "/env")) {
+ if (envfs_load(default_environment_path, "/env")) {
#ifdef CONFIG_DEFAULT_ENVIRONMENT
- printf("no valid environment found on /dev/env0. "
- "Using default environment\n");
+ printf("no valid environment found on %s. "
+ "Using default environment\n",
+ default_environment_path);
envfs_load("/dev/defaultenv", "/env");
#endif
}
diff --git a/include/environment.h b/include/environment.h
index 1f22fcb812..da032e21d6 100644
--- a/include/environment.h
+++ b/include/environment.h
@@ -62,6 +62,9 @@ static inline int setenv(const char *var, const char *val)
int env_pop_context(void);
int env_push_context(void);
+/* defaults to /dev/env0 */
+extern char *default_environment_path;
+
int envfs_load(char *filename, char *dirname);
int envfs_save(char *filename, char *dirname);