Deprecate Linux bootargs munging with CONFIG_SILENT_CONSOLE.
cover 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(-)
Signature · 1 line
1.7.3.1
PATCH 1/2 config: Add CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE
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.
--- 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(-)
include/configs/KUP4K.h +3 -0
@@ -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
include/configs/KUP4X.h +3 -0
@@ -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
include/configs/QS823.h +1 -0
@@ -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 */
include/configs/QS850.h +1 -0
@@ -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 */
include/configs/QS860T.h +1 -0
@@ -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 */
include/configs/TQM5200.h +3 -0
@@ -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 */
include/configs/a4m072.h +3 -0
@@ -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
include/configs/bfin_adi_common.h +3 -0
@@ -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
include/configs/cm5200.h +3 -0
@@ -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 */
include/configs/cpu9260.h +3 -0
@@ -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 */
include/configs/cpuat91.h +3 -0
@@ -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"
include/configs/mcc200.h +3 -0
@@ -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 */
include/configs/mimc200.h +3 -0
@@ -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/*
include/configs/omap3_evm_quick_mmc.h +3 -0
@@ -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 * ----------------------------------------------------------------------------
include/configs/omap3_evm_quick_nand.h +3 -0
@@ -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 * -----------------------------------------------------------------------------
include/configs/pdm360ng.h +3 -0
@@ -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
include/configs/sc3.h +3 -0
@@ -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 \
Signature · 1 line
1.7.3.1
PATCH 1/2 config: Add CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE
Dear Doug Anderson,
Quoted 4 lines · In message <[email protected]> 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.
...
Review
Quoted 2 lines
(quoted diff) +2
-0+/* 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
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de All I ask is a chance to prove that money can't make me happy.
PATCH 1/2 config: Add CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE
In reply to Doug AndersonDear Doug Anderson,
Quoted 4 lines · In message <[email protected]> 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.
...
include/configs/KUP4K.h line 506
Quoted 8 lines
include/configs/KUP4K.h +2
-0@@ -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
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de "Where humor is concerned there are no standards -- no one can say what is good or bad, although you can be sure that everyone will. - John Kenneth Galbraith
PATCH 1/2 config: Add CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE
Dear Wolfgang,
Quoted 2 lines · Wolfgang Denk
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!
PATCH 2/2 bootm: Move silencing of linux console to deprecated config option.
In reply to Doug AndersonIf 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.
--- README | 5 ++--- common/cmd_bootm.c | 10 +++++----- doc/README.silent | 13 ++++++++++--- 3 files changed, 17 insertions(+), 11 deletions(-)
README +2 -3
@@ -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
common/cmd_bootm.c +5 -5
@@ -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 */ /*******************************************************************/
doc/README.silent +10 -3
@@ -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.
Signature · 1 line
1.7.3.1
PATCH 2/2 bootm: Move silencing of linux console to deprecated config option.
Dear Doug Anderson,
Quoted 5 lines · In message <[email protected]> you wrote:
If you would like the old behavior of having bootm modify the bootargs to silence the linux console when
CONFIG_SILENT_CONSOLEis defined, you now need to define the configCONFIG_DEPRECATED_SILENT_LINUX_CONSOLE. A previous change already added this new config to all known users ofCONFIG_SILENT_CONSOLE.
...
README The following options need to be configured: · line 610
Quoted 6 lines
README +2
-3When 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
Signature · 8 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The connection between the language in which we think/program and the
problems and solutions we can imagine is very close. For this reason
restricting language features with the intent of eliminating pro-
grammer errors is at best dangerous.
- Bjarne Stroustrup in "The C++ Programming Language"PATCH 2/2 bootm: Move silencing of linux console to deprecated config option.
In reply to Doug AndersonREADME The following options need to be configured: · line 610
Quoted 11 lines · On Tuesday 10 January 2012 14:16:58 Doug Anderson wrote:
README +2
-3@@ -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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120110/f000bf7a/attachment.pgp>
cover Deprecate Linux bootargs munging with CONFIG_SILENT_CONSOLE.
In reply to Doug AndersonQuoted 5 lines · 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 otherCONFIG_SILENT_CONSOLEbehavior).
personally i found the current behavior useful, but the code to implement it is crappy. oh well.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120110/5eb31be1/attachment.pgp>
cover Deprecate Linux bootargs munging with CONFIG_SILENT_CONSOLE.
Quoted 2 lines · Mike Frysinger
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
cover Deprecate Linux bootargs munging with CONFIG_SILENT_CONSOLE.
Quoted 4 lines · On Tuesday 10 January 2012 16:04:27 Doug Anderson wrote:
I believe that you can do a script something like this (where
normal_bootargsis the old bootargs without the console= part,console_argsis the non-silent console settings, andold_bootcmdis the old bootcmd):
it's not exactly the same behavior, but should be sufficient for everyone's needs
Quoted 1 line
Hopefully this works for you. I'll add it to the documentation, too.
that'd be good
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120110/ad6bd6b4/attachment.pgp>
cover Deprecate Linux bootargs munging with CONFIG_SILENT_CONSOLE.
In reply to Doug AndersonDear Doug Anderson,
Quoted 13 lines · In message <CAD=FV=Wr9JNLOP_0=KUgV-aO1Qf6ZXf4xXOX3azyh3-Ns3v0Ng@mail.gmail.com>…
Quoted 3 lines
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_bootargsis the old bootargs without the console= part,console_argsis the non-silent console settings, andold_bootcmdis the old bootcmd):
Quoted 8 lines
setenv generate_bootargs 'if test -n "$silent"; then \ setenv bootargs $normal_bootargs console=; \ else \ setenv bootargs $normal_bootargs $console_args;fi'
setenv bootcmd 'rungenerate_bootargs; runold_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
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
What about WRITING it first and rationalizing it afterwords? :-)
- Larry Wall in <[email protected]>cover Deprecate Linux bootargs munging with CONFIG_SILENT_CONSOLE.
Dear Wolfgang Denk,
Quoted 2 lines · Wolfgang Denk
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.
Quoted 3 lines
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
cover Deprecate Linux bootargs munging with CONFIG_SILENT_CONSOLE.
Dear Doug Anderson,
Quoted 10 lines · In message <CAD=FV=VX-BEpx2idRA1T1sBt2H6n9vYayTb1HYtNjjTnA_zziA@mail.gmail.com>…
Dear Wolfgang Denk,
Quoted 2 lines · Wolfgang Denk
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.
Quoted 7 lines
Quoted 3 lines
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?
Quoted 4 lines
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.
Quoted 4 lines
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
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Even if you aren't in doubt, consider the mental welfare of the per- son who has to maintain the code after you, and who will probably put parens in the wrong place. - Larry Wall in the perl man page
v2 cover Deprecate Linux bootargs munging with CONFIG_SILENT_CONSOLE.
In reply to Doug AndersonAs 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(-)
Signature · 1 line
1.7.3.1
v3 cover 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).
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(-)
Signature · 1 line
1.7.3.1
PATCH v3 1/3 config: Add CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE
In reply to Doug AndersonI 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.
---
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(-)
include/configs/KUP4K.h +1 -0
@@ -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
include/configs/KUP4X.h +1 -0
@@ -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
include/configs/QS823.h +1 -0
@@ -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 */
include/configs/QS850.h +1 -0
@@ -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 */
include/configs/QS860T.h +1 -0
@@ -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 */
include/configs/TQM5200.h +1 -0
@@ -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
include/configs/a4m072.h +1 -0
@@ -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 */ /*
include/configs/bfin_adi_common.h +1 -0
@@ -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
include/configs/cm5200.h +1 -0
@@ -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
include/configs/cpu9260.h +1 -0
@@ -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 /*
include/configs/cpuat91.h +1 -0
@@ -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 \
include/configs/mcc200.h +1 -0
@@ -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 */
include/configs/mimc200.h +1 -0
@@ -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 */
include/configs/omap3_evm_quick_mmc.h +1 -0
@@ -43,6 +43,7 @@* ---------------------------------------------------------------------------- */ #define CONFIG_SILENT_CONSOLE +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE #define CONFIG_ENV_IS_NOWHERE /* ----------------------------------------------------------------------------
include/configs/omap3_evm_quick_nand.h +1 -0
@@ -42,6 +42,7 @@* ---------------------------------------------------------------------------- */ #define CONFIG_SILENT_CONSOLE +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE #define CONFIG_ENV_IS_NOWHERE /* -----------------------------------------------------------------------------
include/configs/pdm360ng.h +1 -0
@@ -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
include/configs/sc3.h +1 -0
@@ -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 */
Signature · 1 line
1.7.3.1
PATCH v3 2/3 bootm: Move silencing of linux console to deprecated config option.
In reply to Doug AndersonIf 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.
---
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(-)
README +6 -4
@@ -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
common/cmd_bootm.c +5 -5
@@ -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 */ /*******************************************************************/
doc/README.silent +23 -4
@@ -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'
Signature · 1 line
1.7.3.1
PATCH v3 3/3 config: Remove Blackfin CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE
In reply to Doug AndersonAs 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.
---
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(-)
include/configs/bfin_adi_common.h +0 -1
@@ -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
Signature · 1 line
1.7.3.1
PATCH v3 3/3 config: Remove Blackfin CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE
Quoted 8 lines · 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.
include/configs/bfin_adi_common.h line 113
Quoted 7 lines
include/configs/bfin_adi_common.h +0
-1@@ -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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120110/e1fbbdd1/attachment.pgp>
PATCH v3 3/3 config: Remove Blackfin CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE
Mike,
Quoted 1 line · Mike Frysinger
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
PATCH v3 3/3 config: Remove Blackfin CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE
Quoted 1 line · On Tuesday 10 January 2012 18:38:07 Doug Anderson wrote:
3. 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120110/38ba669a/attachment.pgp>
PATCH v3 3/3 config: Remove Blackfin CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE
Quoted 4 lines · Mike Frysinger
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.
PATCH v3 3/3 config: Remove Blackfin CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE
Quoted 8 lines · On Tuesday 10 January 2012 18:48:12 Doug Anderson wrote:
Quoted 4 lines · Mike Frysinger
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120110/1b03ff79/attachment.pgp>
PATCH v3 3/3 config: Remove Blackfin CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE
In reply to Doug AndersonDear Doug,
Quoted 4 lines · In message <CAD=FV=Ui2Zww2bGT+QSjTg=K0v9BGGSAxShrTsXOQyPbA9XRSg@mail.gmail.com>…
...I'm still awaiting Wolfgang's suggestion for which of the following he'd like me to submit instead of this series:
Quoted 8 lines
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_SIZEto 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
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de THIS IS A 100% MATTER PRODUCT: In the Unlikely Event That This Merchandise Should Contact Antimatter in Any Form, a Catastrophic Explosion Will Result.
PATCH v3 3/3 config: Remove Blackfin CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE
Dear Wolfgang,
Quoted 24 lines · Wolfgang Denk
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.
Quoted 8 lines
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
v2 cover Deprecate Linux bootargs munging with CONFIG_SILENT_CONSOLE.
In reply to Doug AndersonDear Doug Anderson,
Quoted 3 lines · In message <[email protected]> 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.
Quoted 1 line
"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?
Quoted 2 lines
We now officially deprecate it and provide a way to avoid it (but still get the other
CONFIG_SILENT_CONSOLEbehavior).
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
Signature · 4 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Any technology distinguishable from magic is insufficiently advanced.
v2 cover Deprecate Linux bootargs munging with CONFIG_SILENT_CONSOLE.
Dear Wolfgang Denk
Quoted 4 lines · Wolfgang Denk
Quoted 2 lines
As discussed previously on the U-Boot mailing list (see comments on "Fix
fixup_silent_linux()buffer overrun" patchset), relying onPlease 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".
Quoted 4 lines
Quoted 1 line
"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.
Quoted 5 lines
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.
v2 cover Deprecate Linux bootargs munging with CONFIG_SILENT_CONSOLE.
Dear Doug Anderson,
Quoted 5 lines · In message <CAD=FV=W+GErKZ2LCeUoYrsWgVFg2QX9EsH3rjJvj7KQ6tjdbVA@mail.gmail.com>…
Quoted 2 lines
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).
Quoted 4 lines
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.
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
"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.
Quoted 4 lines
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
Signature · 7 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The shortest unit of time in the multiverse is the News York Second,
defined as the period of time between the traffic lights turning
green and the cab behind you honking.
- Terry Pratchett, _Lords and Ladies_v2 cover Deprecate Linux bootargs munging with CONFIG_SILENT_CONSOLE.
Dear Wolfgang Denk,
Quoted 2 lines · Wolfgang Denk
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.
Quoted 2 lines
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.
Quoted 2 lines
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. :(
PATCH v2 1/2 config: Add CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE
In reply to Doug AndersonI 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.
---
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(-)
include/configs/KUP4K.h +1 -0
@@ -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
include/configs/KUP4X.h +1 -0
@@ -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
include/configs/QS823.h +1 -0
@@ -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 */
include/configs/QS850.h +1 -0
@@ -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 */
include/configs/QS860T.h +1 -0
@@ -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 */
include/configs/TQM5200.h +1 -0
@@ -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
include/configs/a4m072.h +1 -0
@@ -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 */ /*
include/configs/bfin_adi_common.h +1 -0
@@ -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
include/configs/cm5200.h +1 -0
@@ -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
include/configs/cpu9260.h +1 -0
@@ -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 /*
include/configs/cpuat91.h +1 -0
@@ -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 \
include/configs/mcc200.h +1 -0
@@ -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 */
include/configs/mimc200.h +1 -0
@@ -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 */
include/configs/omap3_evm_quick_mmc.h +1 -0
@@ -43,6 +43,7 @@* ---------------------------------------------------------------------------- */ #define CONFIG_SILENT_CONSOLE +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE #define CONFIG_ENV_IS_NOWHERE /* ----------------------------------------------------------------------------
include/configs/omap3_evm_quick_nand.h +1 -0
@@ -42,6 +42,7 @@* ---------------------------------------------------------------------------- */ #define CONFIG_SILENT_CONSOLE +#define CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE #define CONFIG_ENV_IS_NOWHERE /* -----------------------------------------------------------------------------
include/configs/pdm360ng.h +1 -0
@@ -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
include/configs/sc3.h +1 -0
@@ -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 */
Signature · 1 line
1.7.3.1
PATCH v2 1/2 config: Add CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE
Quoted 1 line · 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120110/f69cf4b8/attachment.pgp>
PATCH v2 1/2 config: Add CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE
In reply to Doug AndersonDear Doug Anderson,
Quoted 4 lines · In message <[email protected]> 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
Signature · 8 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Making files is easy under the UNIX operating system. Therefore, users tend to create numerous files using large amounts of file space. It has been said that the only standard thing about all UNIX systems is the message-of-the-day telling users to clean up their files. -- System V.2 administrator's guide
PATCH v2 2/2 bootm: Move silencing of linux console to deprecated config option.
In reply to Doug AndersonIf 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.
---
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(-)
README +6 -4
@@ -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
common/cmd_bootm.c +5 -5
@@ -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 */ /*******************************************************************/
doc/README.silent +23 -4
@@ -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'
Signature · 1 line
1.7.3.1
PATCH v2 2/2 bootm: Move silencing of linux console to deprecated config option.
common/cmd_bootm.c extern flash_info_t flash_info[]; /* info for FLASH chips */ · line 87
Quoted 4 lines · On Tuesday 10 January 2012 16:36:20 Doug Anderson wrote:
common/cmd_bootm.c +1
-0+static void fixup_silent_linux (void ) __attribute__ ((deprecated));
__deprecated (from linux/compiler.h)
doc/README.silent The following actions are taken if "silent" is set at boot time: · line 24
Quoted 4 lines
doc/README.silent +1
-0+CONFIG_DEPRECATED_SILENT_LINUX_CONSOLE with the warning that using
s/warning/caveat/
doc/README.silent The following actions are taken if "silent" is set at boot time: · line 26
Quoted 2 lines
doc/README.silent +2
-0+the option opens you up to a buffer overrun if your linux bootargs +can be >256 bytes.
s/can be/are/
Quoted 1 line
+also silence the Linux console, a script like this may help you (where
the pedant in me says: s/may/might/
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120110/79b611b6/attachment.pgp>
PATCH v2 2/2 bootm: Move silencing of linux console to deprecated config option.
In reply to Doug AndersonDear Doug Anderson,
Quoted 5 lines · In message <[email protected]> you wrote:
If you would like the old behavior of having bootm modify the bootargs to silence the linux console when
CONFIG_SILENT_CONSOLEis defined, you now need to define the configCONFIG_DEPRECATED_SILENT_LINUX_CONSOLE. A previous change already added this new config to all known users ofCONFIG_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
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Just because your doctor has a name for your condition doesn't mean he knows what it is.