[U-Boot] [PATCH 0/2] Deprecate Linux bootargs munging with CONFIG_SILENT_CONSOLE.

As discussed previously on the U-Boot mailing list (see comments on "Fix fixup_silent_linux() buffer overrun" patchset), relying on "bootm" to mangle the Linux bootargs is not a suggested way to go. We now officially deprecate it and provide a way to avoid it (but still get the other CONFIG_SILENT_CONSOLE behavior).
Doug Anderson (2): config: Add CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE bootm: Move silencing of linux console to deprecated config option.
README | 5 ++--- common/cmd_bootm.c | 10 +++++----- doc/README.silent | 13 ++++++++++--- include/configs/KUP4K.h | 3 +++ include/configs/KUP4X.h | 3 +++ include/configs/QS823.h | 1 + include/configs/QS850.h | 1 + include/configs/QS860T.h | 1 + include/configs/TQM5200.h | 3 +++ include/configs/a4m072.h | 3 +++ include/configs/bfin_adi_common.h | 3 +++ include/configs/cm5200.h | 3 +++ include/configs/cpu9260.h | 3 +++ include/configs/cpuat91.h | 3 +++ include/configs/mcc200.h | 3 +++ include/configs/mimc200.h | 3 +++ include/configs/omap3_evm_quick_mmc.h | 3 +++ include/configs/omap3_evm_quick_nand.h | 3 +++ include/configs/pdm360ng.h | 3 +++ include/configs/sc3.h | 3 +++ 20 files changed, 62 insertions(+), 11 deletions(-)

I have set this config option based on the existing usage of CONFIG_SILENT_CONSOLE. This is to support a future change deprecating the silencing of the linux console in bootm by having bootm modify the linux command-line arguments.
Signed-off-by: Doug Anderson dianders@chromium.org --- include/configs/KUP4K.h | 3 +++ include/configs/KUP4X.h | 3 +++ include/configs/QS823.h | 1 + include/configs/QS850.h | 1 + include/configs/QS860T.h | 1 + include/configs/TQM5200.h | 3 +++ include/configs/a4m072.h | 3 +++ include/configs/bfin_adi_common.h | 3 +++ include/configs/cm5200.h | 3 +++ include/configs/cpu9260.h | 3 +++ include/configs/cpuat91.h | 3 +++ include/configs/mcc200.h | 3 +++ include/configs/mimc200.h | 3 +++ include/configs/omap3_evm_quick_mmc.h | 3 +++ include/configs/omap3_evm_quick_nand.h | 3 +++ include/configs/pdm360ng.h | 3 +++ include/configs/sc3.h | 3 +++ 17 files changed, 45 insertions(+), 0 deletions(-)
diff --git a/include/configs/KUP4K.h b/include/configs/KUP4K.h index c0035e6..7f55748 100644 --- a/include/configs/KUP4K.h +++ b/include/configs/KUP4K.h @@ -502,6 +502,9 @@ #define CONFIG_SYS_DEVICE_NULLDEV 1 /* enble null device */ #define CONFIG_VERSION_VARIABLE 1
+/* Added based on usage of CONFIG_SILENT_CONSOLE; please remove when possible */ +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE 1 + /* pass open firmware flat tree */ #define CONFIG_OF_LIBFDT 1 #define CONFIG_OF_BOARD_SETUP 1 diff --git a/include/configs/KUP4X.h b/include/configs/KUP4X.h index 5084ccc..07233fa 100644 --- a/include/configs/KUP4X.h +++ b/include/configs/KUP4X.h @@ -452,6 +452,9 @@ #define CONFIG_AUTOBOOT_STOP_STR "." /* easy to stop for now */ #define CONFIG_SILENT_CONSOLE 1
+/* Added based on usage of CONFIG_SILENT_CONSOLE; please remove when possible */ +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE 1 + #define CONFIG_USB_STORAGE 1 #define CONFIG_USB_SL811HS 1
diff --git a/include/configs/QS823.h b/include/configs/QS823.h index 36efbf2..84aea2a 100644 --- a/include/configs/QS823.h +++ b/include/configs/QS823.h @@ -37,6 +37,7 @@ /* various debug settings */ #undef CONFIG_SYS_DEVICE_NULLDEV /* null device */ #undef CONFIG_SILENT_CONSOLE /* silent console */ +#undef CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE #undef CONFIG_SYS_CONSOLE_INFO_QUIET /* silent console ? */ #undef DEBUG_FLASH /* debug flash code */ #undef FLASH_DEBUG /* debug fash code */ diff --git a/include/configs/QS850.h b/include/configs/QS850.h index 5c6ed07..15e6adb 100644 --- a/include/configs/QS850.h +++ b/include/configs/QS850.h @@ -37,6 +37,7 @@ /* various debug settings */ #undef CONFIG_SYS_DEVICE_NULLDEV /* null device */ #undef CONFIG_SILENT_CONSOLE /* silent console */ +#undef CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE #undef CONFIG_SYS_CONSOLE_INFO_QUIET /* silent console ? */ #undef DEBUG_FLASH /* debug flash code */ #undef FLASH_DEBUG /* debug fash code */ diff --git a/include/configs/QS860T.h b/include/configs/QS860T.h index b0bee82..99ac280 100644 --- a/include/configs/QS860T.h +++ b/include/configs/QS860T.h @@ -37,6 +37,7 @@ /* various debug settings */ #undef CONFIG_SYS_DEVICE_NULLDEV /* null device */ #undef CONFIG_SILENT_CONSOLE /* silent console */ +#undef CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE #undef CONFIG_SYS_CONSOLE_INFO_QUIET /* silent console ? */ #undef DEBUG_FLASH /* debug flash code */ #undef FLASH_DEBUG /* debug fash code */ diff --git a/include/configs/TQM5200.h b/include/configs/TQM5200.h index 6ea3faa..9415f29 100644 --- a/include/configs/TQM5200.h +++ b/include/configs/TQM5200.h @@ -71,6 +71,9 @@ #define CONFIG_SILENT_CONSOLE 1 /* enable silent startup */ #define CONFIG_BOARD_EARLY_INIT_F 1 /* used to detect S1 switch position */ #define CONFIG_USB_BIN_FIXUP 1 /* for a buggy USB device */ + +/* Added based on usage of CONFIG_SILENT_CONSOLE; please remove when possible */ +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE 1 #if 0 #define FO300_SILENT_CONSOLE_WHEN_S1_CLOSED 1 /* silent console on PSC1 when S1 */ /* switch is closed */ diff --git a/include/configs/a4m072.h b/include/configs/a4m072.h index 1c13904..bbd34d4 100644 --- a/include/configs/a4m072.h +++ b/include/configs/a4m072.h @@ -55,6 +55,9 @@ #define CONFIG_SILENT_CONSOLE #define CONFIG_SYS_DEVICE_NULLDEV 1 /* include nulldev device */
+/* Added based on usage of CONFIG_SILENT_CONSOLE; please remove when possible */ +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE 1 + /* * PCI Mapping: * 0x40000000 - 0x4fffffff - PCI Memory diff --git a/include/configs/bfin_adi_common.h b/include/configs/bfin_adi_common.h index 3fbf5c6..fc874b2 100644 --- a/include/configs/bfin_adi_common.h +++ b/include/configs/bfin_adi_common.h @@ -108,6 +108,9 @@ #define CONFIG_LOADS_ECHO 1 #define CONFIG_JTAG_CONSOLE #define CONFIG_SILENT_CONSOLE + +/* Added based on usage of CONFIG_SILENT_CONSOLE; please remove when possible */ +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE 1 #ifndef CONFIG_BAUDRATE # define CONFIG_BAUDRATE 57600 #endif diff --git a/include/configs/cm5200.h b/include/configs/cm5200.h index 0abe090..0596795 100644 --- a/include/configs/cm5200.h +++ b/include/configs/cm5200.h @@ -63,6 +63,9 @@ #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 } #define CONFIG_SILENT_CONSOLE 1 /* needed to silence i2c_init() */
+/* Added based on usage of CONFIG_SILENT_CONSOLE; please remove when possible */ +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE 1 + /* * Ethernet configuration */ diff --git a/include/configs/cpu9260.h b/include/configs/cpu9260.h index 8674a35..116b915 100644 --- a/include/configs/cpu9260.h +++ b/include/configs/cpu9260.h @@ -504,6 +504,9 @@ #define CONFIG_SILENT_CONSOLE #define CONFIG_NETCONSOLE
+/* Added based on usage of CONFIG_SILENT_CONSOLE; please remove when possible */ +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE 1 + /* * Size of malloc() pool */ diff --git a/include/configs/cpuat91.h b/include/configs/cpuat91.h index 1b43c54..5b2e770 100644 --- a/include/configs/cpuat91.h +++ b/include/configs/cpuat91.h @@ -224,6 +224,9 @@ #define CONFIG_DEVICE_NULLDEV #define CONFIG_SILENT_CONSOLE
+/* Added based on usage of CONFIG_SILENT_CONSOLE; please remove when possible */ +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE 1 + #define CONFIG_AUTOBOOT_KEYED #define CONFIG_AUTOBOOT_PROMPT \ "Press SPACE to abort autoboot\n" diff --git a/include/configs/mcc200.h b/include/configs/mcc200.h index b56b273..1c08358 100644 --- a/include/configs/mcc200.h +++ b/include/configs/mcc200.h @@ -425,4 +425,7 @@ #define CONFIG_AUTOBOOT_STOP_STR "432" #define CONFIG_SILENT_CONSOLE 1
+/* Added based on usage of CONFIG_SILENT_CONSOLE; please remove when possible */ +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE 1 + #endif /* __CONFIG_H */ diff --git a/include/configs/mimc200.h b/include/configs/mimc200.h index d8d8256..83f0635 100644 --- a/include/configs/mimc200.h +++ b/include/configs/mimc200.h @@ -87,6 +87,9 @@ #define CONFIG_DISABLE_CONSOLE /* disable console */ #define CONFIG_SYS_DEVICE_NULLDEV /* include nulldev device */
+/* Added based on usage of CONFIG_SILENT_CONSOLE; please remove when possible */ +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE 1 + #define CONFIG_LCD 1
/* diff --git a/include/configs/omap3_evm_quick_mmc.h b/include/configs/omap3_evm_quick_mmc.h index 912da7d..8202333 100644 --- a/include/configs/omap3_evm_quick_mmc.h +++ b/include/configs/omap3_evm_quick_mmc.h @@ -45,6 +45,9 @@ #define CONFIG_SILENT_CONSOLE #define CONFIG_ENV_IS_NOWHERE
+/* Added based on usage of CONFIG_SILENT_CONSOLE; please remove when possible */ +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE 1 + /* ---------------------------------------------------------------------------- * Supported hardware * ---------------------------------------------------------------------------- diff --git a/include/configs/omap3_evm_quick_nand.h b/include/configs/omap3_evm_quick_nand.h index 2f879c0..39096db 100644 --- a/include/configs/omap3_evm_quick_nand.h +++ b/include/configs/omap3_evm_quick_nand.h @@ -44,6 +44,9 @@ #define CONFIG_SILENT_CONSOLE #define CONFIG_ENV_IS_NOWHERE
+/* Added based on usage of CONFIG_SILENT_CONSOLE; please remove when possible */ +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE 1 + /* ----------------------------------------------------------------------------- * Include common board configuration * ----------------------------------------------------------------------------- diff --git a/include/configs/pdm360ng.h b/include/configs/pdm360ng.h index f0154e0..e704937 100644 --- a/include/configs/pdm360ng.h +++ b/include/configs/pdm360ng.h @@ -55,6 +55,9 @@ #define CONFIG_SYS_DEVICE_NULLDEV #define CONFIG_SILENT_CONSOLE
+/* Added based on usage of CONFIG_SILENT_CONSOLE; please remove when possible */ +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE 1 + /* Video */ #define CONFIG_VIDEO
diff --git a/include/configs/sc3.h b/include/configs/sc3.h index 2d6e51d..7857382 100644 --- a/include/configs/sc3.h +++ b/include/configs/sc3.h @@ -130,6 +130,9 @@ #define CONFIG_SILENT_CONSOLE 1 /* enable silent startup */ #define CONFIG_SYS_DEVICE_NULLDEV 1 /* include nulldev device */
+/* Added based on usage of CONFIG_SILENT_CONSOLE; please remove when possible */ +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE 1 + #if 1 /* feel free to disable for development */ #define CONFIG_AUTOBOOT_KEYED /* Enable password protection */ #define CONFIG_AUTOBOOT_PROMPT \

Dear Doug Anderson,
In message 1326223018-12441-2-git-send-email-dianders@chromium.org you wrote:
I have set this config option based on the existing usage of CONFIG_SILENT_CONSOLE. This is to support a future change deprecating the silencing of the linux console in bootm by having bootm modify the linux command-line arguments.
...
+/* Added based on usage of CONFIG_SILENT_CONSOLE; please remove when possible */ +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE 1
This selects a feature only, so please define without value. Please fix globally.
Best regards,
Wolfgang Denk

Dear Doug Anderson,
In message 1326223018-12441-2-git-send-email-dianders@chromium.org you wrote:
I have set this config option based on the existing usage of CONFIG_SILENT_CONSOLE. This is to support a future change deprecating the silencing of the linux console in bootm by having bootm modify the linux command-line arguments.
...
--- a/include/configs/KUP4K.h +++ b/include/configs/KUP4K.h @@ -502,6 +502,9 @@ #define CONFIG_SYS_DEVICE_NULLDEV 1 /* enble null device */ #define CONFIG_VERSION_VARIABLE 1
+/* Added based on usage of CONFIG_SILENT_CONSOLE; please remove when possible */ +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE 1
And can you please place this new #define not somewhere in the middle of the file, but instead very close (immendiately preceeding or following lines) to the CONFIG_SILENT_CONSOLE definition.
Hm...actually - why do we need both now? This is ugly and makes little sense to me.
Best regards,
Wolfgang Denk

Dear Wolfgang,
On Tue, Jan 10, 2012 at 11:46 AM, Wolfgang Denk wd@denx.de wrote:
Hm...actually - why do we need both now? This is ugly and makes little sense to me.
Having both CONFIG_SILENT_CONSOLE and CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE separate allows us to continue to use CONFIG_SILENT_CONSOLE and then undefine the CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE setting from boards one by one as people either decide that they don't need it or come up with other options.
Being able to undefine CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE allows you to avoid the 256-byte buffer overrun while still using the rest of the CONFIG_SILENT_CONSOLE feature.
At the moment, I haven't sent up any patches that have CONFIG_SILENT_CONSOLE defined but _not_ CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE, since the config file I'm currently working with hadn't made it all the way upstream yet.
I will resubmit the series with your other suggestions. Thanks!

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(-)
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.

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

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

On Tuesday 10 January 2012 14:16:56 Doug Anderson wrote:
As discussed previously on the U-Boot mailing list (see comments on "Fix fixup_silent_linux() buffer overrun" patchset), relying on "bootm" to mangle the Linux bootargs is not a suggested way to go. We now officially deprecate it and provide a way to avoid it (but still get the other CONFIG_SILENT_CONSOLE behavior).
personally i found the current behavior useful, but the code to implement it is crappy. oh well. -mike

On Tue, Jan 10, 2012 at 12:18 PM, Mike Frysinger vapier@gentoo.org wrote:
personally i found the current behavior useful, but the code to implement it is crappy. oh well.
Agreed. However, in the previous thread Wolfgang was of the view that the behavior of silencing linux is best achieved with scripts. I'm OK with that approach which is why I've submitted the current patch.
I believe that you can do a script something like this (where normal_bootargs is the old bootargs without the console= part, console_args is the non-silent console settings, and old_bootcmd is the old bootcmd):
setenv generate_bootargs 'if test -n "$silent"; then \ setenv bootargs $normal_bootargs console=; \ else \ setenv bootargs $normal_bootargs $console_args; fi' setenv bootcmd 'run generate_bootargs; run old_bootcmd'
Hopefully this works for you. I'll add it to the documentation, too.
-Doug

On Tuesday 10 January 2012 16:04:27 Doug Anderson wrote:
I believe that you can do a script something like this (where normal_bootargs is the old bootargs without the console= part, console_args is the non-silent console settings, and old_bootcmd is the old bootcmd):
it's not exactly the same behavior, but should be sufficient for everyone's needs
Hopefully this works for you. I'll add it to the documentation, too.
that'd be good -mike

Dear Doug Anderson,
In message CAD=FV=Wr9JNLOP_0=KUgV-aO1Qf6ZXf4xXOX3azyh3-Ns3v0Ng@mail.gmail.com you wrote:
personally i found the current behavior useful, but the code to implement it is crappy. oh well.
Agreed. However, in the previous thread Wolfgang was of the view that the behavior of silencing linux is best achieved with scripts. I'm OK with that approach which is why I've submitted the current patch.
I believe that you can do a script something like this (where normal_bootargs is the old bootargs without the console= part, console_args is the non-silent console settings, and old_bootcmd is the old bootcmd):
setenv generate_bootargs 'if test -n "$silent"; then \ setenv bootargs $normal_bootargs console=; \ else \ setenv bootargs $normal_bootargs $console_args; fi' setenv bootcmd 'run generate_bootargs; run old_bootcmd'
Hopefully this works for you. I'll add it to the documentation, too.
In which way would this approach avoid the problem (potential overflow of cmdline max size) that you are trying to fix with your patch?
If the existing code overflows the environment, this macro will doe the same.
So you actually do not fix any problem, but you remove existing functionality that has been used in a number of projects, so you actually break a number of boards.
Hm... why should we apply this patch, then?
Best regards,
Wolfgang Denk

Dear Wolfgang Denk,
On Tue, Jan 10, 2012 at 2:16 PM, Wolfgang Denk wd@denx.de wrote:
In which way would this approach avoid the problem (potential overflow of cmdline max size) that you are trying to fix with your patch?
The overflow will be avoided on any boards that don't define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE. As of the third version of this patch (will be sent shortly), the Blackfin board will be fixed so that the overflow can't happen on that board.
So you actually do not fix any problem, but you remove existing functionality that has been used in a number of projects, so you actually break a number of boards.
With the third version of this patch the Blackfin board is one example of a board that is fixed. On all other boards, no functionality is lost and no bugs are fixed.
Previously I had submitted a patch to fix the overflow itself, which you NAKed (saying that fixup_silent_linux() was deprecated and shouldn't get any bugfixes). I am happy to dig that up and re-post it if you'd prefer. Either option is fine with me.
My problem is that I have a board that would like to use CONFIG_SILENT_CONSOLE (to silence the U-Boot console) and have a Linux command line that is >256 characters. I either need the overflow fixed (my previous patch) or some way to avoid it (this patch).
Thanks much!
-Doug

Dear Doug Anderson,
In message CAD=FV=VX-BEpx2idRA1T1sBt2H6n9vYayTb1HYtNjjTnA_zziA@mail.gmail.com you wrote:
Dear Wolfgang Denk,
On Tue, Jan 10, 2012 at 2:16 PM, Wolfgang Denk wd@denx.de wrote:
In which way would this approach avoid the problem (potential overflow of cmdline max size) that you are trying to fix with your patch?
The overflow will be avoided on any boards that don't define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE. As of the third version of this patch (will be sent shortly), the Blackfin board will be fixed so that the overflow can't happen on that board.
You misunderstand.
I agree that the code should be fixed to not write out of the bouds of the array. But simply increasing the buffer size here in U-Boot only means that you will have an overflow or at least a truncation on many Linux systems.
So you actually do not fix any problem, but you remove existing functionality that has been used in a number of projects, so you actually break a number of boards.
With the third version of this patch the Blackfin board is one example of a board that is fixed. On all other boards, no functionality is lost and no bugs are fixed.
If we don't change functionality and don;t fix any bugs then we can simply omit this change?
Previously I had submitted a patch to fix the overflow itself, which you NAKed (saying that fixup_silent_linux() was deprecated and shouldn't get any bugfixes). I am happy to dig that up and re-post it if you'd prefer. Either option is fine with me.
I agree with Mike that the existing code is anything but perfect, but removing useful functionality without providing something that is at least as good makes no sense to me.
With your patches we get more and uglier code and win nothing.
My problem is that I have a board that would like to use CONFIG_SILENT_CONSOLE (to silence the U-Boot console) and have a Linux command line that is >256 characters. I either need the overflow fixed (my previous patch) or some way to avoid it (this patch).
Use a shorter command line? ;-)
See my previous message - the command line size is hardwired to 256 bytes for a number of architectures. You break these.
Best regards,
Wolfgang Denk

As discussed previously on the U-Boot mailing list (see comments on "Fix fixup_silent_linux() buffer overrun" patchset), relying on "bootm" to mangle the Linux bootargs is not a suggested way to go. We now officially deprecate it and provide a way to avoid it (but still get the other CONFIG_SILENT_CONSOLE behavior).
Changes in v2: - Define without a value, since this selects a feature only. - Moved define of CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE to always be right next to the define of CONFIG_SILENT_CONSOLE - Better description of CONFIG_SILENT_CONSOLE in README - Example of how to use a script to silence Linux console in a non- deprecated way in doc/README.silent
Doug Anderson (2): config: Add CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE bootm: Move silencing of linux console to deprecated config option.
README | 10 ++++++---- common/cmd_bootm.c | 10 +++++----- doc/README.silent | 27 +++++++++++++++++++++++---- include/configs/KUP4K.h | 1 + include/configs/KUP4X.h | 1 + include/configs/QS823.h | 1 + include/configs/QS850.h | 1 + include/configs/QS860T.h | 1 + include/configs/TQM5200.h | 1 + include/configs/a4m072.h | 1 + include/configs/bfin_adi_common.h | 1 + include/configs/cm5200.h | 1 + include/configs/cpu9260.h | 1 + include/configs/cpuat91.h | 1 + include/configs/mcc200.h | 1 + include/configs/mimc200.h | 1 + include/configs/omap3_evm_quick_mmc.h | 1 + include/configs/omap3_evm_quick_nand.h | 1 + include/configs/pdm360ng.h | 1 + include/configs/sc3.h | 1 + 20 files changed, 51 insertions(+), 13 deletions(-)

As discussed previously on the U-Boot mailing list (see comments on "Fix fixup_silent_linux() buffer overrun" patchset), relying on "bootm" to mangle the Linux bootargs is not a suggested way to go. We now officially deprecate it and provide a way to avoid it (but still get the other CONFIG_SILENT_CONSOLE behavior).
Changes in v2: - Define without a value, since this selects a feature only. - Moved define of CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE to always be right next to the define of CONFIG_SILENT_CONSOLE - Better description of CONFIG_SILENT_CONSOLE in README - Example of how to use a script to silence Linux console in a non- deprecated way in doc/README.silent
Changes in v3: - Use __deprecated #define instead of direct gcc attribute - Minor wording updates in doc/README.silent - Added part 3 of the patch to turn off the deprecated config option for Blackfin, where it was confirmed that it's not needed.
Doug Anderson (3): config: Add CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE bootm: Move silencing of linux console to deprecated config option. config: Remove Blackfin CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE
README | 10 ++++++---- common/cmd_bootm.c | 10 +++++----- doc/README.silent | 27 +++++++++++++++++++++++---- include/configs/KUP4K.h | 1 + include/configs/KUP4X.h | 1 + include/configs/QS823.h | 1 + include/configs/QS850.h | 1 + include/configs/QS860T.h | 1 + include/configs/TQM5200.h | 1 + include/configs/a4m072.h | 1 + include/configs/cm5200.h | 1 + include/configs/cpu9260.h | 1 + include/configs/cpuat91.h | 1 + include/configs/mcc200.h | 1 + include/configs/mimc200.h | 1 + include/configs/omap3_evm_quick_mmc.h | 1 + include/configs/omap3_evm_quick_nand.h | 1 + include/configs/pdm360ng.h | 1 + include/configs/sc3.h | 1 + 19 files changed, 50 insertions(+), 13 deletions(-)

I have set this config option based on the existing usage of CONFIG_SILENT_CONSOLE. This is to support a future change deprecating the silencing of the linux console in bootm by having bootm modify the linux command-line arguments.
Signed-off-by: Doug Anderson dianders@chromium.org --- Changes in v2: - Define without a value, since this selects a feature only. - Moved define of CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE to always be right next to the define of CONFIG_SILENT_CONSOLE
include/configs/KUP4K.h | 1 + include/configs/KUP4X.h | 1 + include/configs/QS823.h | 1 + include/configs/QS850.h | 1 + include/configs/QS860T.h | 1 + include/configs/TQM5200.h | 1 + include/configs/a4m072.h | 1 + include/configs/bfin_adi_common.h | 1 + include/configs/cm5200.h | 1 + include/configs/cpu9260.h | 1 + include/configs/cpuat91.h | 1 + include/configs/mcc200.h | 1 + include/configs/mimc200.h | 1 + include/configs/omap3_evm_quick_mmc.h | 1 + include/configs/omap3_evm_quick_nand.h | 1 + include/configs/pdm360ng.h | 1 + include/configs/sc3.h | 1 + 17 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/include/configs/KUP4K.h b/include/configs/KUP4K.h index c0035e6..3cbe199 100644 --- a/include/configs/KUP4K.h +++ b/include/configs/KUP4K.h @@ -499,6 +499,7 @@ #define CONFIG_AUTOBOOT_KEYED /* use key strings to stop autoboot */ #define CONFIG_AUTOBOOT_STOP_STR "." #define CONFIG_SILENT_CONSOLE 1 +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE #define CONFIG_SYS_DEVICE_NULLDEV 1 /* enble null device */ #define CONFIG_VERSION_VARIABLE 1
diff --git a/include/configs/KUP4X.h b/include/configs/KUP4X.h index 5084ccc..c092a90 100644 --- a/include/configs/KUP4X.h +++ b/include/configs/KUP4X.h @@ -451,6 +451,7 @@
#define CONFIG_AUTOBOOT_STOP_STR "." /* easy to stop for now */ #define CONFIG_SILENT_CONSOLE 1 +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE
#define CONFIG_USB_STORAGE 1 #define CONFIG_USB_SL811HS 1 diff --git a/include/configs/QS823.h b/include/configs/QS823.h index 36efbf2..84aea2a 100644 --- a/include/configs/QS823.h +++ b/include/configs/QS823.h @@ -37,6 +37,7 @@ /* various debug settings */ #undef CONFIG_SYS_DEVICE_NULLDEV /* null device */ #undef CONFIG_SILENT_CONSOLE /* silent console */ +#undef CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE #undef CONFIG_SYS_CONSOLE_INFO_QUIET /* silent console ? */ #undef DEBUG_FLASH /* debug flash code */ #undef FLASH_DEBUG /* debug fash code */ diff --git a/include/configs/QS850.h b/include/configs/QS850.h index 5c6ed07..15e6adb 100644 --- a/include/configs/QS850.h +++ b/include/configs/QS850.h @@ -37,6 +37,7 @@ /* various debug settings */ #undef CONFIG_SYS_DEVICE_NULLDEV /* null device */ #undef CONFIG_SILENT_CONSOLE /* silent console */ +#undef CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE #undef CONFIG_SYS_CONSOLE_INFO_QUIET /* silent console ? */ #undef DEBUG_FLASH /* debug flash code */ #undef FLASH_DEBUG /* debug fash code */ diff --git a/include/configs/QS860T.h b/include/configs/QS860T.h index b0bee82..99ac280 100644 --- a/include/configs/QS860T.h +++ b/include/configs/QS860T.h @@ -37,6 +37,7 @@ /* various debug settings */ #undef CONFIG_SYS_DEVICE_NULLDEV /* null device */ #undef CONFIG_SILENT_CONSOLE /* silent console */ +#undef CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE #undef CONFIG_SYS_CONSOLE_INFO_QUIET /* silent console ? */ #undef DEBUG_FLASH /* debug flash code */ #undef FLASH_DEBUG /* debug fash code */ diff --git a/include/configs/TQM5200.h b/include/configs/TQM5200.h index 6ea3faa..c9860fa 100644 --- a/include/configs/TQM5200.h +++ b/include/configs/TQM5200.h @@ -69,6 +69,7 @@ #ifdef CONFIG_FO300 #define CONFIG_SYS_DEVICE_NULLDEV 1 /* enable null device */ #define CONFIG_SILENT_CONSOLE 1 /* enable silent startup */ +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE #define CONFIG_BOARD_EARLY_INIT_F 1 /* used to detect S1 switch position */ #define CONFIG_USB_BIN_FIXUP 1 /* for a buggy USB device */ #if 0 diff --git a/include/configs/a4m072.h b/include/configs/a4m072.h index 1c13904..ebb1a32 100644 --- a/include/configs/a4m072.h +++ b/include/configs/a4m072.h @@ -53,6 +53,7 @@ #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 } /* define to enable silent console */ #define CONFIG_SILENT_CONSOLE +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE #define CONFIG_SYS_DEVICE_NULLDEV 1 /* include nulldev device */
/* diff --git a/include/configs/bfin_adi_common.h b/include/configs/bfin_adi_common.h index 3fbf5c6..4729e7b 100644 --- a/include/configs/bfin_adi_common.h +++ b/include/configs/bfin_adi_common.h @@ -108,6 +108,7 @@ #define CONFIG_LOADS_ECHO 1 #define CONFIG_JTAG_CONSOLE #define CONFIG_SILENT_CONSOLE +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE #ifndef CONFIG_BAUDRATE # define CONFIG_BAUDRATE 57600 #endif diff --git a/include/configs/cm5200.h b/include/configs/cm5200.h index 0abe090..7837037 100644 --- a/include/configs/cm5200.h +++ b/include/configs/cm5200.h @@ -62,6 +62,7 @@ #define CONFIG_BAUDRATE 57600 /* ... at 57600 bps */ #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 } #define CONFIG_SILENT_CONSOLE 1 /* needed to silence i2c_init() */ +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE
/* * Ethernet configuration diff --git a/include/configs/cpu9260.h b/include/configs/cpu9260.h index 8674a35..e24be56 100644 --- a/include/configs/cpu9260.h +++ b/include/configs/cpu9260.h @@ -502,6 +502,7 @@ #define CONFIG_SYS_LONGHELP #define CONFIG_CMDLINE_EDITING #define CONFIG_SILENT_CONSOLE +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE #define CONFIG_NETCONSOLE
/* diff --git a/include/configs/cpuat91.h b/include/configs/cpuat91.h index 1b43c54..71996e6 100644 --- a/include/configs/cpuat91.h +++ b/include/configs/cpuat91.h @@ -223,6 +223,7 @@
#define CONFIG_DEVICE_NULLDEV #define CONFIG_SILENT_CONSOLE +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE
#define CONFIG_AUTOBOOT_KEYED #define CONFIG_AUTOBOOT_PROMPT \ diff --git a/include/configs/mcc200.h b/include/configs/mcc200.h index b56b273..a67925c 100644 --- a/include/configs/mcc200.h +++ b/include/configs/mcc200.h @@ -424,5 +424,6 @@ #define CONFIG_AUTOBOOT_KEYED /* use key strings to stop autoboot */ #define CONFIG_AUTOBOOT_STOP_STR "432" #define CONFIG_SILENT_CONSOLE 1 +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE
#endif /* __CONFIG_H */ diff --git a/include/configs/mimc200.h b/include/configs/mimc200.h index d8d8256..6cd53d7 100644 --- a/include/configs/mimc200.h +++ b/include/configs/mimc200.h @@ -84,6 +84,7 @@ "fsload boot/uImage; bootm"
#define CONFIG_SILENT_CONSOLE /* enable silent startup */ +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE #define CONFIG_DISABLE_CONSOLE /* disable console */ #define CONFIG_SYS_DEVICE_NULLDEV /* include nulldev device */
diff --git a/include/configs/omap3_evm_quick_mmc.h b/include/configs/omap3_evm_quick_mmc.h index 912da7d..19f2836 100644 --- a/include/configs/omap3_evm_quick_mmc.h +++ b/include/configs/omap3_evm_quick_mmc.h @@ -43,6 +43,7 @@ * ---------------------------------------------------------------------------- */ #define CONFIG_SILENT_CONSOLE +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE #define CONFIG_ENV_IS_NOWHERE
/* ---------------------------------------------------------------------------- diff --git a/include/configs/omap3_evm_quick_nand.h b/include/configs/omap3_evm_quick_nand.h index 2f879c0..65214e9 100644 --- a/include/configs/omap3_evm_quick_nand.h +++ b/include/configs/omap3_evm_quick_nand.h @@ -42,6 +42,7 @@ * ---------------------------------------------------------------------------- */ #define CONFIG_SILENT_CONSOLE +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE #define CONFIG_ENV_IS_NOWHERE
/* ----------------------------------------------------------------------------- diff --git a/include/configs/pdm360ng.h b/include/configs/pdm360ng.h index f0154e0..c09505b 100644 --- a/include/configs/pdm360ng.h +++ b/include/configs/pdm360ng.h @@ -54,6 +54,7 @@ /* Used for silent command in environment */ #define CONFIG_SYS_DEVICE_NULLDEV #define CONFIG_SILENT_CONSOLE +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE
/* Video */ #define CONFIG_VIDEO diff --git a/include/configs/sc3.h b/include/configs/sc3.h index 2d6e51d..2627c74 100644 --- a/include/configs/sc3.h +++ b/include/configs/sc3.h @@ -128,6 +128,7 @@ #undef CONFIG_BOOTCOMMAND
#define CONFIG_SILENT_CONSOLE 1 /* enable silent startup */ +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE #define CONFIG_SYS_DEVICE_NULLDEV 1 /* include nulldev device */
#if 1 /* feel free to disable for development */

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 --- Changes in v2: - Better description of CONFIG_SILENT_CONSOLE in README - Example of how to use a script to silence Linux console in a non- deprecated way in doc/README.silent
Changes in v3: - Use __deprecated #define instead of direct gcc attribute - Minor wording updates in doc/README.silent
README | 10 ++++++---- common/cmd_bootm.c | 10 +++++----- doc/README.silent | 27 +++++++++++++++++++++++---- 3 files changed, 34 insertions(+), 13 deletions(-)
diff --git a/README b/README index 7916777..5ba8482 100644 --- a/README +++ b/README @@ -605,10 +605,12 @@ The following options need to be configured: default i/o. Serial console can be forced with 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. + When CONFIG_SILENT_CONSOLE is defined, all U-Boot console + messages can be silenced with the "silent" environment + variable. Linux console messages will not be silenced + based on the "silent" environment variable unless + CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE is defined. + 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..775a7dc 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) __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..32739ed 100644 --- a/doc/README.silent +++ b/doc/README.silent @@ -1,5 +1,5 @@ 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 +on the U-Boot 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 @@ -15,6 +15,25 @@ 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 caveat that using +the option opens you up to a buffer overrun if your linux bootargs +are >256 bytes. + +If you were relying on the old behavior of CONFIG_SILENT_CONSOLE to +also silence the Linux console, a script like this might help you (where +normal_bootargs is the old bootargs without the console= part, +console_args is the non-silent console settings, and old_bootcmd is +the old bootcmd): + + setenv generate_bootargs 'if test -n "$silent"; then \ + setenv bootargs $normal_bootargs console=; \ + else \ + setenv bootargs $normal_bootargs $console_args; + fi' + setenv bootcmd 'run generate_bootargs; run old_bootcmd'

As Mike Frysinger writes: We didn't enable silent=1 by default in any of the Blackfin boards Just made the functionality available to people if they wanted to test things out with it when prototyping on dev boards.
Signed-off-by: Doug Anderson dianders@chromium.org --- Changes in v3: - Added part 3 of the patch to turn off the deprecated config option for Blackfin, where it was confirmed that it's not needed.
include/configs/bfin_adi_common.h | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/include/configs/bfin_adi_common.h b/include/configs/bfin_adi_common.h index 4729e7b..3fbf5c6 100644 --- a/include/configs/bfin_adi_common.h +++ b/include/configs/bfin_adi_common.h @@ -108,7 +108,6 @@ #define CONFIG_LOADS_ECHO 1 #define CONFIG_JTAG_CONSOLE #define CONFIG_SILENT_CONSOLE -#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE #ifndef CONFIG_BAUDRATE # define CONFIG_BAUDRATE 57600 #endif

On Tuesday 10 January 2012 17:26:22 Doug Anderson wrote:
As Mike Frysinger writes: We didn't enable silent=1 by default in any of the Blackfin boards Just made the functionality available to people if they wanted to test things out with it when prototyping on dev boards.
--- a/include/configs/bfin_adi_common.h +++ b/include/configs/bfin_adi_common.h @@ -108,7 +108,6 @@ #define CONFIG_LOADS_ECHO 1 #define CONFIG_JTAG_CONSOLE #define CONFIG_SILENT_CONSOLE -#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE #ifndef CONFIG_BAUDRATE # define CONFIG_BAUDRATE 57600 #endif
not sure why you don't just squash it into 1/3 and never bother defining it ? -mike

Mike,
On Tue, Jan 10, 2012 at 3:27 PM, Mike Frysinger vapier@gentoo.org wrote:
not sure why you don't just squash it into 1/3 and never bother defining it ?
I was attempting to keep changes isolated as much as possible, but everyone seems to like to do this differently and I'm still getting a feel for what you guys prefer. It sounds like Wolfgang would actually prefer all three of these squashed into a single patch, which I'll do if there's a v4.
...I'm still awaiting Wolfgang's suggestion for which of the following he'd like me to submit instead of this series:
1. A stripped down version of the change to use malloc with the caveat that it's up to the user not to overrun any hardcoded limits in the kernel (I'm pretty sure that the kernel already has code to truncate--at least on most platforms).
2. A version of the change to add a platform-specific COMMAND_LINE_SIZE to u-boot (keeping in sync with the kernel) with a fix in u-boot to never buffer overrun (changing behavior to truncate).
3. Something else (?)
Thanks!
-Doug

On Tuesday 10 January 2012 18:38:07 Doug Anderson wrote:
- Something else (?)
getenv returns a writable buffer, so i wonder if things couldn't be avoided easily all around. after all, you're just deleting bytes here, not adding new ones. -mike

On Tue, Jan 10, 2012 at 3:44 PM, Mike Frysinger vapier@gentoo.org wrote:
On Tuesday 10 January 2012 18:38:07 Doug Anderson wrote: getenv returns a writable buffer, so i wonder if things couldn't be avoided easily all around. after all, you're just deleting bytes here, not adding new ones.
Actually, that's not quite true. The current code will add "console=" in the case that it finds no console argument.

On Tuesday 10 January 2012 18:48:12 Doug Anderson wrote:
On Tue, Jan 10, 2012 at 3:44 PM, Mike Frysinger vapier@gentoo.org wrote:
On Tuesday 10 January 2012 18:38:07 Doug Anderson wrote: getenv returns a writable buffer, so i wonder if things couldn't be avoided easily all around. after all, you're just deleting bytes here, not adding new ones.
Actually, that's not quite true. The current code will add "console=" in the case that it finds no console argument.
true ... we could still relegate the strdup/free to that step ... -mike

Dear Doug,
In message CAD=FV=Ui2Zww2bGT+QSjTg=K0v9BGGSAxShrTsXOQyPbA9XRSg@mail.gmail.com you wrote:
...I'm still awaiting Wolfgang's suggestion for which of the following he'd like me to submit instead of this series:
- A stripped down version of the change to use malloc with the caveat
that it's up to the user not to overrun any hardcoded limits in the kernel (I'm pretty sure that the kernel already has code to truncate--at least on most platforms).
- A version of the change to add a platform-specific
COMMAND_LINE_SIZE to u-boot (keeping in sync with the kernel) with a fix in u-boot to never buffer overrun (changing behavior to truncate).
I have to admit that I have no clear opinion here yet.
The existing code is from a time when all architectures had a pretty low limit on the command line size - IIRC even PPC had only 256 bytes by then, hard coded.
I think we have two options:
1) Try not to exceed any limits imposed by the Linux kernel. Advantage: we can catch situations where the user overflows the limits and print an error message (IIRC this needs to be added), so the user gets aware of the pronlem. Disadvantage: we need to add architecture specific definitions for the command line size, and keep these in sync with any related changes to the Linux kernel. We know in advance that this will not work really well.
2) We just make sure not to overwrite array bounds in U-Boot, and allow passing arbitrary sized buffers to the Linux kernel. Advantage: the code in U-Boot can be simple and clean Disadvantage: the resulting behaviour is not exactly user-friendly, as a silent truncation in the Linux kernel is probably hard to spot.
Hm...
I agree that the old code needs fixing. I think it would be nice if we could adapt U-Boot behaviour, but I fear that actually it cannot work at all, as we don't know which Linux kernel version the user will use, and what their limits might be.
So in the end 2) is probably the most sensible approach here.
Best regards,
Wolfgang Denk

Dear Wolfgang,
On Wed, Jan 11, 2012 at 12:11 AM, Wolfgang Denk wd@denx.de wrote:
I have to admit that I have no clear opinion here yet.
The existing code is from a time when all architectures had a pretty low limit on the command line size - IIRC even PPC had only 256 bytes by then, hard coded.
I think we have two options:
- Try not to exceed any limits imposed by the Linux kernel.
Advantage: we can catch situations where the user overflows the limits and print an error message (IIRC this needs to be added), so the user gets aware of the pronlem. Disadvantage: we need to add architecture specific definitions for the command line size, and keep these in sync with any related changes to the Linux kernel. We know in advance that this will not work really well.
- We just make sure not to overwrite array bounds in U-Boot, and
allow passing arbitrary sized buffers to the Linux kernel. Advantage: the code in U-Boot can be simple and clean Disadvantage: the resulting behaviour is not exactly user-friendly, as a silent truncation in the Linux kernel is probably hard to spot.
Hm...
I agree that the old code needs fixing. I think it would be nice if we could adapt U-Boot behaviour, but I fear that actually it cannot work at all, as we don't know which Linux kernel version the user will use, and what their limits might be.
So in the end 2) is probably the most sensible approach here.
Thank you for all of your time on this issue. I have just sent a patch implementing 2) with as little extra cruft as possible (I hope). Let me know if there is anything else you need here. Thanks!
-Doug

Dear Doug Anderson,
In message 1326231380-30128-1-git-send-email-dianders@chromium.org you wrote:
As discussed previously on the U-Boot mailing list (see comments on "Fix fixup_silent_linux() buffer overrun" patchset), relying on
Please provide a link.
"bootm" to mangle the Linux bootargs is not a suggested way to go.
So what is "a suggested way to go" to silence the Linux kenrel messages?
We now officially deprecate it and provide a way to avoid it (but still get the other CONFIG_SILENT_CONSOLE behavior).
You are removing functionality that is in active use by a number of boards, without providing any replacement, i. e. you are breaking a number of boards.
Do you think this is a good idea?
Best regards,
Wolfgang Denk

Dear Wolfgang Denk
On Tue, Jan 10, 2012 at 2:30 PM, Wolfgang Denk wd@denx.de wrote:
As discussed previously on the U-Boot mailing list (see comments on "Fix fixup_silent_linux() buffer overrun" patchset), relying on
Please provide a link.
Sure! This is the message I'm referring to: http://lists.denx.de/pipermail/u-boot/2011-October/106255.html. I know it was a long time ago--I got a bit sidetracked for a while. Specifically, I offered to provide a very simple version of fixup_silent_linux() that just fixed the buffer overrun and you said "Please consider it NAKed".
"bootm" to mangle the Linux bootargs is not a suggested way to go.
So what is "a suggested way to go" to silence the Linux kenrel messages?
Please see doc/README.silent in part 1 of this patchset for a sample script.
You are removing functionality that is in active use by a number of boards, without providing any replacement, i. e. you are breaking a number of boards.
Do you think this is a good idea?
This change doesn't remove any functionality but instead deprecates it and provides a path for boards to move forward to a non-deprecated solution. The non-deprecated solution is documented in doc/README.silent.

Dear Doug Anderson,
In message CAD=FV=W+GErKZ2LCeUoYrsWgVFg2QX9EsH3rjJvj7KQ6tjdbVA@mail.gmail.com you wrote:
Please provide a link.
Sure! This is the message I'm referring to: http://lists.denx.de/pipermail/u-boot/2011-October/106255.html. I
You should do so in the commit mesage (but judging from my current state of mind you can save the efforts for a v4).
know it was a long time ago--I got a bit sidetracked for a while. Specifically, I offered to provide a very simple version of fixup_silent_linux() that just fixed the buffer overrun and you said "Please consider it NAKed".
I just replied to one of your earlier patches that did not fix the overflow, but just shifted it to happen later, in Linux.
"bootm" to mangle the Linux bootargs is not a suggested way to go.
So what is "a suggested way to go" to silence the Linux kenrel messages?
Please see doc/README.silent in part 1 of this patchset for a sample script.
But this does the very same, just in a different way (requiring more code). And it does not prevent the overflow at all.
This change doesn't remove any functionality but instead deprecates it and provides a path for boards to move forward to a non-deprecated solution. The non-deprecated solution is documented in doc/README.silent.
Your suggestion does not solve anything.
Best regards,
Wolfgang Denk

Dear Wolfgang Denk,
On Tue, Jan 10, 2012 at 2:48 PM, Wolfgang Denk wd@denx.de wrote:
You should do so in the commit mesage (but judging from my current state of mind you can save the efforts for a v4).
Got it. If we end up with a v4, I'll add it.
I just replied to one of your earlier patches that did not fix the overflow, but just shifted it to happen later, in Linux.
I just responded to that one. ...but to reiterate here: I'm happy to add a CONFIG option to u-boot to allow setting the command line length (so I can use the 1024 bytes I have available to me in ARM) and also to avoid the buffer overrun.
If this is the approach you'd like me to go, I'm happy to do it.
But this does the very same, just in a different way (requiring more code). And it does not prevent the overflow at all.
Sorry, I must have misunderstood your earlier suggestions back in October. My apologies there. :(

I have set this config option based on the existing usage of CONFIG_SILENT_CONSOLE. This is to support a future change deprecating the silencing of the linux console in bootm by having bootm modify the linux command-line arguments.
Signed-off-by: Doug Anderson dianders@chromium.org --- Changes in v2: - Define without a value, since this selects a feature only. - Moved define of CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE to always be right next to the define of CONFIG_SILENT_CONSOLE
include/configs/KUP4K.h | 1 + include/configs/KUP4X.h | 1 + include/configs/QS823.h | 1 + include/configs/QS850.h | 1 + include/configs/QS860T.h | 1 + include/configs/TQM5200.h | 1 + include/configs/a4m072.h | 1 + include/configs/bfin_adi_common.h | 1 + include/configs/cm5200.h | 1 + include/configs/cpu9260.h | 1 + include/configs/cpuat91.h | 1 + include/configs/mcc200.h | 1 + include/configs/mimc200.h | 1 + include/configs/omap3_evm_quick_mmc.h | 1 + include/configs/omap3_evm_quick_nand.h | 1 + include/configs/pdm360ng.h | 1 + include/configs/sc3.h | 1 + 17 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/include/configs/KUP4K.h b/include/configs/KUP4K.h index c0035e6..3cbe199 100644 --- a/include/configs/KUP4K.h +++ b/include/configs/KUP4K.h @@ -499,6 +499,7 @@ #define CONFIG_AUTOBOOT_KEYED /* use key strings to stop autoboot */ #define CONFIG_AUTOBOOT_STOP_STR "." #define CONFIG_SILENT_CONSOLE 1 +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE #define CONFIG_SYS_DEVICE_NULLDEV 1 /* enble null device */ #define CONFIG_VERSION_VARIABLE 1
diff --git a/include/configs/KUP4X.h b/include/configs/KUP4X.h index 5084ccc..c092a90 100644 --- a/include/configs/KUP4X.h +++ b/include/configs/KUP4X.h @@ -451,6 +451,7 @@
#define CONFIG_AUTOBOOT_STOP_STR "." /* easy to stop for now */ #define CONFIG_SILENT_CONSOLE 1 +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE
#define CONFIG_USB_STORAGE 1 #define CONFIG_USB_SL811HS 1 diff --git a/include/configs/QS823.h b/include/configs/QS823.h index 36efbf2..84aea2a 100644 --- a/include/configs/QS823.h +++ b/include/configs/QS823.h @@ -37,6 +37,7 @@ /* various debug settings */ #undef CONFIG_SYS_DEVICE_NULLDEV /* null device */ #undef CONFIG_SILENT_CONSOLE /* silent console */ +#undef CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE #undef CONFIG_SYS_CONSOLE_INFO_QUIET /* silent console ? */ #undef DEBUG_FLASH /* debug flash code */ #undef FLASH_DEBUG /* debug fash code */ diff --git a/include/configs/QS850.h b/include/configs/QS850.h index 5c6ed07..15e6adb 100644 --- a/include/configs/QS850.h +++ b/include/configs/QS850.h @@ -37,6 +37,7 @@ /* various debug settings */ #undef CONFIG_SYS_DEVICE_NULLDEV /* null device */ #undef CONFIG_SILENT_CONSOLE /* silent console */ +#undef CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE #undef CONFIG_SYS_CONSOLE_INFO_QUIET /* silent console ? */ #undef DEBUG_FLASH /* debug flash code */ #undef FLASH_DEBUG /* debug fash code */ diff --git a/include/configs/QS860T.h b/include/configs/QS860T.h index b0bee82..99ac280 100644 --- a/include/configs/QS860T.h +++ b/include/configs/QS860T.h @@ -37,6 +37,7 @@ /* various debug settings */ #undef CONFIG_SYS_DEVICE_NULLDEV /* null device */ #undef CONFIG_SILENT_CONSOLE /* silent console */ +#undef CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE #undef CONFIG_SYS_CONSOLE_INFO_QUIET /* silent console ? */ #undef DEBUG_FLASH /* debug flash code */ #undef FLASH_DEBUG /* debug fash code */ diff --git a/include/configs/TQM5200.h b/include/configs/TQM5200.h index 6ea3faa..c9860fa 100644 --- a/include/configs/TQM5200.h +++ b/include/configs/TQM5200.h @@ -69,6 +69,7 @@ #ifdef CONFIG_FO300 #define CONFIG_SYS_DEVICE_NULLDEV 1 /* enable null device */ #define CONFIG_SILENT_CONSOLE 1 /* enable silent startup */ +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE #define CONFIG_BOARD_EARLY_INIT_F 1 /* used to detect S1 switch position */ #define CONFIG_USB_BIN_FIXUP 1 /* for a buggy USB device */ #if 0 diff --git a/include/configs/a4m072.h b/include/configs/a4m072.h index 1c13904..ebb1a32 100644 --- a/include/configs/a4m072.h +++ b/include/configs/a4m072.h @@ -53,6 +53,7 @@ #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 } /* define to enable silent console */ #define CONFIG_SILENT_CONSOLE +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE #define CONFIG_SYS_DEVICE_NULLDEV 1 /* include nulldev device */
/* diff --git a/include/configs/bfin_adi_common.h b/include/configs/bfin_adi_common.h index 3fbf5c6..4729e7b 100644 --- a/include/configs/bfin_adi_common.h +++ b/include/configs/bfin_adi_common.h @@ -108,6 +108,7 @@ #define CONFIG_LOADS_ECHO 1 #define CONFIG_JTAG_CONSOLE #define CONFIG_SILENT_CONSOLE +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE #ifndef CONFIG_BAUDRATE # define CONFIG_BAUDRATE 57600 #endif diff --git a/include/configs/cm5200.h b/include/configs/cm5200.h index 0abe090..7837037 100644 --- a/include/configs/cm5200.h +++ b/include/configs/cm5200.h @@ -62,6 +62,7 @@ #define CONFIG_BAUDRATE 57600 /* ... at 57600 bps */ #define CONFIG_SYS_BAUDRATE_TABLE { 9600, 19200, 38400, 57600, 115200, 230400 } #define CONFIG_SILENT_CONSOLE 1 /* needed to silence i2c_init() */ +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE
/* * Ethernet configuration diff --git a/include/configs/cpu9260.h b/include/configs/cpu9260.h index 8674a35..e24be56 100644 --- a/include/configs/cpu9260.h +++ b/include/configs/cpu9260.h @@ -502,6 +502,7 @@ #define CONFIG_SYS_LONGHELP #define CONFIG_CMDLINE_EDITING #define CONFIG_SILENT_CONSOLE +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE #define CONFIG_NETCONSOLE
/* diff --git a/include/configs/cpuat91.h b/include/configs/cpuat91.h index 1b43c54..71996e6 100644 --- a/include/configs/cpuat91.h +++ b/include/configs/cpuat91.h @@ -223,6 +223,7 @@
#define CONFIG_DEVICE_NULLDEV #define CONFIG_SILENT_CONSOLE +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE
#define CONFIG_AUTOBOOT_KEYED #define CONFIG_AUTOBOOT_PROMPT \ diff --git a/include/configs/mcc200.h b/include/configs/mcc200.h index b56b273..a67925c 100644 --- a/include/configs/mcc200.h +++ b/include/configs/mcc200.h @@ -424,5 +424,6 @@ #define CONFIG_AUTOBOOT_KEYED /* use key strings to stop autoboot */ #define CONFIG_AUTOBOOT_STOP_STR "432" #define CONFIG_SILENT_CONSOLE 1 +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE
#endif /* __CONFIG_H */ diff --git a/include/configs/mimc200.h b/include/configs/mimc200.h index d8d8256..6cd53d7 100644 --- a/include/configs/mimc200.h +++ b/include/configs/mimc200.h @@ -84,6 +84,7 @@ "fsload boot/uImage; bootm"
#define CONFIG_SILENT_CONSOLE /* enable silent startup */ +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE #define CONFIG_DISABLE_CONSOLE /* disable console */ #define CONFIG_SYS_DEVICE_NULLDEV /* include nulldev device */
diff --git a/include/configs/omap3_evm_quick_mmc.h b/include/configs/omap3_evm_quick_mmc.h index 912da7d..19f2836 100644 --- a/include/configs/omap3_evm_quick_mmc.h +++ b/include/configs/omap3_evm_quick_mmc.h @@ -43,6 +43,7 @@ * ---------------------------------------------------------------------------- */ #define CONFIG_SILENT_CONSOLE +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE #define CONFIG_ENV_IS_NOWHERE
/* ---------------------------------------------------------------------------- diff --git a/include/configs/omap3_evm_quick_nand.h b/include/configs/omap3_evm_quick_nand.h index 2f879c0..65214e9 100644 --- a/include/configs/omap3_evm_quick_nand.h +++ b/include/configs/omap3_evm_quick_nand.h @@ -42,6 +42,7 @@ * ---------------------------------------------------------------------------- */ #define CONFIG_SILENT_CONSOLE +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE #define CONFIG_ENV_IS_NOWHERE
/* ----------------------------------------------------------------------------- diff --git a/include/configs/pdm360ng.h b/include/configs/pdm360ng.h index f0154e0..c09505b 100644 --- a/include/configs/pdm360ng.h +++ b/include/configs/pdm360ng.h @@ -54,6 +54,7 @@ /* Used for silent command in environment */ #define CONFIG_SYS_DEVICE_NULLDEV #define CONFIG_SILENT_CONSOLE +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE
/* Video */ #define CONFIG_VIDEO diff --git a/include/configs/sc3.h b/include/configs/sc3.h index 2d6e51d..2627c74 100644 --- a/include/configs/sc3.h +++ b/include/configs/sc3.h @@ -128,6 +128,7 @@ #undef CONFIG_BOOTCOMMAND
#define CONFIG_SILENT_CONSOLE 1 /* enable silent startup */ +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE #define CONFIG_SYS_DEVICE_NULLDEV 1 /* include nulldev device */
#if 1 /* feel free to disable for development */

On Tuesday 10 January 2012 16:36:19 Doug Anderson wrote:
include/configs/bfin_adi_common.h | 1 +
don't bother. we didn't enable silent=1 by default in any of the Blackfin boards. just made the functionality available to people if they wanted to test things out with it when prototyping on dev boards. -mike

Dear Doug Anderson,
In message 1326231380-30128-2-git-send-email-dianders@chromium.org you wrote:
I have set this config option based on the existing usage of CONFIG_SILENT_CONSOLE. This is to support a future change deprecating the silencing of the linux console in bootm by having bootm modify the linux command-line arguments.
I think I'm not going to accept this other patch, so this one will follow it's fate. If I should reconsider, both patches should be squashed.
Best regards,
Wolfgang Denk

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 --- Changes in v2: - Better description of CONFIG_SILENT_CONSOLE in README - Example of how to use a script to silence Linux console in a non- deprecated way in doc/README.silent
README | 10 ++++++---- common/cmd_bootm.c | 10 +++++----- doc/README.silent | 27 +++++++++++++++++++++++---- 3 files changed, 34 insertions(+), 13 deletions(-)
diff --git a/README b/README index 7916777..5ba8482 100644 --- a/README +++ b/README @@ -605,10 +605,12 @@ The following options need to be configured: default i/o. Serial console can be forced with 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. + When CONFIG_SILENT_CONSOLE is defined, all U-Boot console + messages can be silenced with the "silent" environment + variable. Linux console messages will not be silenced + based on the "silent" environment variable unless + CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE is defined. + 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..a4b8a97 100644 --- a/doc/README.silent +++ b/doc/README.silent @@ -1,5 +1,5 @@ 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 +on the U-Boot 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 @@ -15,6 +15,25 @@ 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. + +If you were relying on the old behavior of CONFIG_SILENT_CONSOLE to +also silence the Linux console, a script like this may help you (where +normal_bootargs is the old bootargs without the console= part, +console_args is the non-silent console settings, and old_bootcmd is +the old bootcmd): + + setenv generate_bootargs 'if test -n "$silent"; then \ + setenv bootargs $normal_bootargs console=; \ + else \ + setenv bootargs $normal_bootargs $console_args; + fi' + setenv bootcmd 'run generate_bootargs; run old_bootcmd'

On Tuesday 10 January 2012 16:36:20 Doug Anderson wrote:
--- a/common/cmd_bootm.c +++ b/common/cmd_bootm.c
+static void fixup_silent_linux(void) __attribute__ ((deprecated));
__deprecated (from linux/compiler.h)
--- a/doc/README.silent +++ b/doc/README.silent
+CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE with the warning that using
s/warning/caveat/
+the option opens you up to a buffer overrun if your linux bootargs +can be >256 bytes.
s/can be/are/
+also silence the Linux console, a script like this may help you (where
the pedant in me says: s/may/might/ -mike

Dear Doug Anderson,
In message 1326231380-30128-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.
This is ugly and does no good.
You know that this feature is used by many boards, and unless you can provide a clean solution for these, you cannot declare the existing one as deprecated.
Best regards,
Wolfgang Denk
participants (3)
-
Doug Anderson
-
Mike Frysinger
-
Wolfgang Denk