[U-Boot] [PATCH 06/12] env: Make the "silent" env var take effect immediately
Joe Hershberger
joe.hershberger at ni.com
Fri Aug 17 22:49:40 CEST 2012
The silent variable now updates the global data flag anytime it is
changed as well as after the env relocation (in case its value is
different from the default env in such cases as NAND env)
Signed-off-by: Joe Hershberger <joe.hershberger at ni.com>
---
common/cmd_nvedit.c | 16 ++++++++++++++++
common/env_common.c | 8 ++++++++
doc/README.silent | 14 ++++++++++----
3 files changed, 34 insertions(+), 4 deletions(-)
diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index fd05e72..bd52fa4 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -303,9 +303,25 @@ int _do_env_set(int flag, int argc, char * const argv[])
/* Delete only ? */
if (argc < 3 || argv[2] == NULL) {
int rc = hdelete_r(name, &env_htab);
+
+#if defined(CONFIG_SILENT_CONSOLE) && \
+ defined(CONFIG_SILENT_CONSOLE_UPDATE_ON_SET)
+ if (strcmp(name, "silent") == 0) {
+ /* silent is deleted */
+ gd->flags &= ~GD_FLG_SILENT;
+ }
+#endif
return !rc;
}
+#if defined(CONFIG_SILENT_CONSOLE) && \
+ defined(CONFIG_SILENT_CONSOLE_UPDATE_ON_SET)
+ if (strcmp(name, "silent") == 0) {
+ /* silent is added */
+ gd->flags |= GD_FLG_SILENT;
+ }
+#endif
+
/*
* Insert / replace new value
*/
diff --git a/common/env_common.c b/common/env_common.c
index d9e990d..0c7e845 100644
--- a/common/env_common.c
+++ b/common/env_common.c
@@ -245,6 +245,14 @@ void env_relocate(void)
} else {
env_relocate_spec();
}
+
+#if defined(CONFIG_SILENT_CONSOLE) && \
+ defined(CONFIG_SILENT_CONSOLE_UPDATE_ON_RELOC)
+ if (getenv("silent") != NULL)
+ gd->flags |= GD_FLG_SILENT;
+ else
+ gd->flags &= ~GD_FLG_SILENT;
+#endif
}
#ifdef CONFIG_AUTO_COMPLETE
diff --git a/doc/README.silent b/doc/README.silent
index a26e3df..a04961f 100644
--- a/doc/README.silent
+++ b/doc/README.silent
@@ -1,9 +1,15 @@
The config option CONFIG_SILENT_CONSOLE can be used to quiet messages
on the console. If the option has been enabled, the output can be
-silenced by setting the environment variable "silent". The variable
-is latched into the global data at an early stage in the boot process
-so deleting it with "setenv" will not take effect until the system is
-restarted.
+silenced by setting the environment variable "silent".
+
+- CONFIG_SILENT_CONSOLE_UPDATE_ON_SET
+ When the "silent" variable is changed with env set, the change
+ will take effect immediately
+
+- CONFIG_SILENT_CONSOLE_UPDATE_ON_RELOC
+ Some environments are not available until relocation (e.g. NAND)
+ so this will make the value in the flash env take effect at
+ relocation.
The following actions are taken if "silent" is set at boot time:
--
1.7.11.5
More information about the U-Boot
mailing list