From patchwork Tue Jan 10 21:36:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 135311 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 13864B6FD1 for ; Wed, 11 Jan 2012 09:03:17 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4137E286D9; Tue, 10 Jan 2012 23:03:15 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VCu7KwFyYUHv; Tue, 10 Jan 2012 23:03:14 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 66E3F286D0; Tue, 10 Jan 2012 23:03:11 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B7755286D0 for ; Tue, 10 Jan 2012 23:03:06 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 28lUg2pYFvPd for ; Tue, 10 Jan 2012 23:03:05 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-gy0-f202.google.com (mail-gy0-f202.google.com [209.85.160.202]) by theia.denx.de (Postfix) with ESMTPS id 533BE286CD for ; Tue, 10 Jan 2012 23:03:03 +0100 (CET) Received: by ghrr15 with SMTP id r15so8737ghr.3 for ; Tue, 10 Jan 2012 14:03:02 -0800 (PST) Received: by 10.101.176.29 with SMTP id d29mr8989667anp.2.1326231403815; Tue, 10 Jan 2012 13:36:43 -0800 (PST) Received: by 10.101.176.29 with SMTP id d29mr8989642anp.2.1326231403648; Tue, 10 Jan 2012 13:36:43 -0800 (PST) Received: from wpzn3.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id j11si53412656ane.2.2012.01.10.13.36.43 (version=TLSv1/SSLv3 cipher=AES128-SHA); Tue, 10 Jan 2012 13:36:43 -0800 (PST) Received: from peppermint.mtv.corp.google.com (peppermint.mtv.corp.google.com [172.22.73.61]) by wpzn3.hot.corp.google.com (Postfix) with ESMTP id 77BE810004D; Tue, 10 Jan 2012 13:36:43 -0800 (PST) Received: by peppermint.mtv.corp.google.com (Postfix, from userid 121310) id 3D6A419AA30; Tue, 10 Jan 2012 13:36:43 -0800 (PST) From: Doug Anderson To: U-Boot Mailing List Date: Tue, 10 Jan 2012 13:36:20 -0800 Message-Id: <1326231380-30128-3-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 1.7.3.1 In-Reply-To: <1326223018-12441-1-git-send-email-dianders@chromium.org> References: <1326223018-12441-1-git-send-email-dianders@chromium.org> Cc: U-Boot Mailing List Subject: [U-Boot] [PATCH v2 2/2] bootm: Move silencing of linux console to deprecated config option. X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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 --- 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'