[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(-) -- 1.7.3.1 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 0/2] Deprecate Linux bootargs munging with CONFIG_SILENT_CONSOLE.
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 signature.asc Description: This is a digitally signed message part. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 0/2] Deprecate Linux bootargs munging with CONFIG_SILENT_CONSOLE.
On Tue, Jan 10, 2012 at 12:18 PM, Mike Frysinger vap...@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 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 0/2] Deprecate Linux bootargs munging with CONFIG_SILENT_CONSOLE.
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 signature.asc Description: This is a digitally signed message part. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 0/2] Deprecate Linux bootargs munging with CONFIG_SILENT_CONSOLE.
Dear Doug Anderson, In message CAD=FV=Wr9JNLOP_0=kugv-ao1qf6zxf4xxox3azyh3-ns3v...@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 -- 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: w...@denx.de What about WRITING it first and rationalizing it afterwords? :-) - Larry Wall in 8...@jpl-devvax.jpl.nasa.gov ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 0/2] Deprecate Linux bootargs munging with CONFIG_SILENT_CONSOLE.
Dear Wolfgang Denk, On Tue, Jan 10, 2012 at 2:16 PM, Wolfgang Denk w...@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 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 0/2] Deprecate Linux bootargs munging with CONFIG_SILENT_CONSOLE.
Dear Doug Anderson, In message CAD=FV=vx-bepx2idra1t1sbt2h6n9vyaytb1hytnjjtna_z...@mail.gmail.com you wrote: Dear Wolfgang Denk, On Tue, Jan 10, 2012 at 2:16 PM, Wolfgang Denk w...@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 -- 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: w...@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 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot