Patchwork [U-Boot,2/2] bootm: Move silencing of linux console to deprecated config option.

login
register
mail settings
Submitter Doug Anderson
Date Jan. 10, 2012, 7:16 p.m.
Message ID <1326223018-12441-3-git-send-email-dianders@chromium.org>
Download mbox | patch
Permalink /patch/135293/
State Superseded
Headers show

Comments

Doug Anderson - Jan. 10, 2012, 7:16 p.m.
If you would like the old behavior of having bootm modify the bootargs
to silence the linux console when CONFIG_SILENT_CONSOLE is defined,
you now need to define the config CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE.
A previous change already added this new config to all known users of
CONFIG_SILENT_CONSOLE.

Signed-off-by: Doug Anderson <dianders@chromium.org>
---
 README             |    5 ++---
 common/cmd_bootm.c |   10 +++++-----
 doc/README.silent  |   13 ++++++++++---
 3 files changed, 17 insertions(+), 11 deletions(-)
Wolfgang Denk - Jan. 10, 2012, 7:50 p.m.
Dear Doug Anderson,

In message <1326223018-12441-3-git-send-email-dianders@chromium.org> you wrote:
> If you would like the old behavior of having bootm modify the bootargs
> to silence the linux console when CONFIG_SILENT_CONSOLE is defined,
> you now need to define the config CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE.
> A previous change already added this new config to all known users of
> CONFIG_SILENT_CONSOLE.
...
>  		When CONFIG_SILENT_CONSOLE is defined, all console
> -		messages (by U-Boot and Linux!) can be silenced with
> -		the "silent" environment variable. See
> -		doc/README.silent for more information.
> +		messages can be silenced with the "silent" environment
> +		variable. See doc/README.silent for more information.

The "silent" environment variable changes only the U-Boot behaviour.

How do you silence Linux when you do not change the boot arguments?

Best regards,

Wolfgang Denk
Mike Frysinger - Jan. 10, 2012, 8:18 p.m.
On Tuesday 10 January 2012 14:16:58 Doug Anderson wrote:
> --- a/README
> +++ b/README
> @@ -606,9 +606,8 @@ The following options need to be configured:
>  		environment 'console=serial'.
> 
>  		When CONFIG_SILENT_CONSOLE is defined, all console
> -		messages (by U-Boot and Linux!) can be silenced with
> -		the "silent" environment variable. See
> -		doc/README.silent for more information.
> +		messages can be silenced with the "silent" environment
> +		variable. See doc/README.silent for more information.

this now becomes vague for anyone who is used to the old behavior/description.  
i'd have the new wording say "U-Boot messages" rather than "messages", and 
then add a tip that people have to manually add "console=" themselves to the 
kernel's bootargs in order for messages there to be silenced.
-mike

Patch

diff --git a/README b/README
index 7916777..9843dd1 100644
--- a/README
+++ b/README
@@ -606,9 +606,8 @@  The following options need to be configured:
 		environment 'console=serial'.
 
 		When CONFIG_SILENT_CONSOLE is defined, all console
-		messages (by U-Boot and Linux!) can be silenced with
-		the "silent" environment variable. See
-		doc/README.silent for more information.
+		messages can be silenced with the "silent" environment
+		variable. See doc/README.silent for more information.
 
 - Console Baudrate:
 		CONFIG_BAUDRATE - in bps
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index d5745b1..8d1899e 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -83,8 +83,8 @@  extern flash_info_t flash_info[]; /* info for FLASH chips */
 static int do_imls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
 #endif
 
-#ifdef CONFIG_SILENT_CONSOLE
-static void fixup_silent_linux(void);
+#ifdef CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE
+static void fixup_silent_linux(void) __attribute__ ((deprecated));
 #endif
 
 static image_header_t *image_get_kernel(ulong img_addr, int verify);
@@ -673,7 +673,7 @@  int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 	show_boot_progress(8);
 
-#ifdef CONFIG_SILENT_CONSOLE
+#ifdef CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE
 	if (images.os.os == IH_OS_LINUX)
 		fixup_silent_linux();
 #endif
@@ -1228,7 +1228,7 @@  U_BOOT_CMD(
 /*******************************************************************/
 /* helper routines */
 /*******************************************************************/
-#ifdef CONFIG_SILENT_CONSOLE
+#ifdef CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE
 static void fixup_silent_linux(void)
 {
 	char buf[256], *start, *end;
@@ -1259,7 +1259,7 @@  static void fixup_silent_linux(void)
 	setenv("bootargs", buf);
 	debug("after silent fix-up: %s\n", buf);
 }
-#endif /* CONFIG_SILENT_CONSOLE */
+#endif /* CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE */
 
 
 /*******************************************************************/
diff --git a/doc/README.silent b/doc/README.silent
index a26e3df..8b4f892 100644
--- a/doc/README.silent
+++ b/doc/README.silent
@@ -15,6 +15,13 @@  The following actions are taken if "silent" is set at boot time:
    suppressed automatically. Make sure to enable "nulldev" by
    #defining CONFIG_SYS_DEVICE_NULLDEV in your board config file.
 
- - When booting a linux kernel, the "bootargs" are fixed up so that
-   the argument "console=" will be in the command line, no matter how
-   it was set in "bootargs" before.
+
+The config option CONFIG_SILENT_CONSOLE previously also caused u-boot
+to silence the Linux console (also based on the "silent" environment
+variable) by modifying the "bootargs" so that the argument "console="
+would be in the command line no matter how it was set in "bootargs"
+before.  That behavior is now relegated to the config option
+CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE with the warning that using
+the option opens you up to a buffer overrun if your linux bootargs
+can be >256 bytes.  A non-deprecated solution is to use scripts to
+dynamically construct your "console=" argument.