public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Config option to disable info from decompression of the kernel
@ 2008-06-18 18:04 Ben Collins
  2008-07-03 12:36 ` Ingo Molnar
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Collins @ 2008-06-18 18:04 UTC (permalink / raw)
  To: kernel list

I submitted a similar patch some time ago, but rightfully it didn't get
accepted, as it just disabled all output from the decompress stage
(without a boot time option to enable it).

This patch just disables the information output from this stage, but not
the error output.

Signed-off-by: Ben Collins <ben.collins@canonical.com>

diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug
index 1836337..94c818f 100644
--- a/arch/x86/Kconfig.debug
+++ b/arch/x86/Kconfig.debug
@@ -20,6 +20,14 @@ config NONPROMISC_DEVMEM
 
 	  If in doubt, say Y.
 
+config NO_BZ_CHATTER
+	bool "Disable decompress info messages"
+	default n
+	help
+	  Disables just the informational output from the decompression stage
+	  (e.g. bzImage) of the boot. You will still see errors. Do this if you
+	  want to cleanup the bootup process.
+
 config EARLY_PRINTK
 	bool "Early printk" if EMBEDDED
 	default y
diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
index 90456ce..67cf205 100644
--- a/arch/x86/boot/compressed/misc.c
+++ b/arch/x86/boot/compressed/misc.c
@@ -206,7 +206,8 @@ static void free(void *where);
 static void *memset(void *s, int c, unsigned n);
 static void *memcpy(void *dest, const void *src, unsigned n);
 
-static void putstr(const char *);
+static void __putstr(int, const char *);
+#define putstr(__x)  __putstr(0, __x)
 
 #ifdef CONFIG_X86_64
 #define memptr long
@@ -270,11 +271,16 @@ static void scroll(void)
 		vidmem[i] = ' ';
 }
 
-static void putstr(const char *s)
+static void __putstr(int error, const char *s)
 {
 	int x, y, pos;
 	char c;
 
+#ifdef CONFIG_NO_BZ_CHATTER
+	if (!error)
+		return;
+#endif
+
 #ifdef CONFIG_X86_32
 	if (RM_SCREEN_INFO.orig_video_mode == 0 && lines == 0 && cols == 0)
 		return;
@@ -366,9 +372,9 @@ static void flush_window(void)
 
 static void error(char *x)
 {
-	putstr("\n\n");
-	putstr(x);
-	putstr("\n\n -- System halted");
+	__putstr(1, "\n\n");
+	__putstr(1, x);
+	__putstr(1, "\n\n -- System halted");
 
 	while (1)
 		asm("hlt");



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Config option to disable info from decompression of the kernel
  2008-06-18 18:04 [PATCH] Config option to disable info from decompression of the kernel Ben Collins
@ 2008-07-03 12:36 ` Ingo Molnar
  2008-07-03 14:46   ` Ben Collins
  0 siblings, 1 reply; 3+ messages in thread
From: Ingo Molnar @ 2008-07-03 12:36 UTC (permalink / raw)
  To: Ben Collins; +Cc: kernel list, H. Peter Anvin, Thomas Gleixner


* Ben Collins <ben.collins@canonical.com> wrote:

> I submitted a similar patch some time ago, but rightfully it didn't 
> get accepted, as it just disabled all output from the decompress stage 
> (without a boot time option to enable it).
> 
> This patch just disables the information output from this stage, but 
> not the error output.

> +config NO_BZ_CHATTER
> +	bool "Disable decompress info messages"
> +	default n
> +	help
> +	  Disables just the informational output from the decompression stage
> +	  (e.g. bzImage) of the boot. You will still see errors. Do this if you
> +	  want to cleanup the bootup process.

applied to tip/x86/setup - thanks Ben.

Note that i've flipped around the name (i.e. got rid of the 'NO_'), and 
i renamed it to the bit more generic X86_VERBOSE_BOOTUP config variable. 
We might want to make other output dependent on that flag, not just the 
decompressor messages. Find the commit below. (please double-check it)

	Ingo

----------------------->
commit 6bcb13b35a2ea39be6c7cc0292b8ad1191b1a748
Author: Ben Collins <ben.collins@canonical.com>
Date:   Wed Jun 18 14:04:35 2008 -0400

    x86: config option to disable info from decompression of the kernel
    
    This patch allows the disabling of decompression messages during
    x86 bootup.
    
    Signed-off-by: Ben Collins <ben.collins@canonical.com>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug
index ac1e31b..14abaa5 100644
--- a/arch/x86/Kconfig.debug
+++ b/arch/x86/Kconfig.debug
@@ -16,6 +16,14 @@ config NONPROMISC_DEVMEM
 	  obviously disasterous, but specific access can be used by people
 	  debugging the kernel.
 
+config X86_VERBOSE_BOOTUP
+	bool "Enable verbose x86 bootup info messages"
+	default y
+	help
+	  Enables the informational output from the decompression stage
+	  (e.g. bzImage) of the boot. If you disable this you will still
+	  see errors. Disable this if you want silent bootup.
+
 config EARLY_PRINTK
 	bool "Early printk" if EMBEDDED
 	default y
diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
index d10e727..11629e9 100644
--- a/arch/x86/boot/compressed/misc.c
+++ b/arch/x86/boot/compressed/misc.c
@@ -202,7 +202,8 @@ static void free(void *where);
 static void *memset(void *s, int c, unsigned n);
 static void *memcpy(void *dest, const void *src, unsigned n);
 
-static void putstr(const char *);
+static void __putstr(int, const char *);
+#define putstr(__x)  __putstr(0, __x)
 
 #ifdef CONFIG_X86_64
 #define memptr long
@@ -266,11 +267,16 @@ static void scroll(void)
 		vidmem[i] = ' ';
 }
 
-static void putstr(const char *s)
+static void __putstr(int error, const char *s)
 {
 	int x, y, pos;
 	char c;
 
+#ifndef CONFIG_X86_VERBOSE_BOOTUP
+	if (!error)
+		return;
+#endif
+
 #ifdef CONFIG_X86_32
 	if (real_mode->screen_info.orig_video_mode == 0 &&
 	    lines == 0 && cols == 0)
@@ -363,9 +369,9 @@ static void flush_window(void)
 
 static void error(char *x)
 {
-	putstr("\n\n");
-	putstr(x);
-	putstr("\n\n -- System halted");
+	__putstr(1, "\n\n");
+	__putstr(1, x);
+	__putstr(1, "\n\n -- System halted");
 
 	while (1)
 		asm("hlt");

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Config option to disable info from decompression of the kernel
  2008-07-03 12:36 ` Ingo Molnar
@ 2008-07-03 14:46   ` Ben Collins
  0 siblings, 0 replies; 3+ messages in thread
From: Ben Collins @ 2008-07-03 14:46 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: kernel list, H. Peter Anvin, Thomas Gleixner

On Thu, 2008-07-03 at 14:36 +0200, Ingo Molnar wrote:
> * Ben Collins <ben.collins@canonical.com> wrote:
> 
> > I submitted a similar patch some time ago, but rightfully it didn't 
> > get accepted, as it just disabled all output from the decompress stage 
> > (without a boot time option to enable it).
> > 
> > This patch just disables the information output from this stage, but 
> > not the error output.
> 
> > +config NO_BZ_CHATTER
> > +	bool "Disable decompress info messages"
> > +	default n
> > +	help
> > +	  Disables just the informational output from the decompression stage
> > +	  (e.g. bzImage) of the boot. You will still see errors. Do this if you
> > +	  want to cleanup the bootup process.
> 
> applied to tip/x86/setup - thanks Ben.
> 
> Note that i've flipped around the name (i.e. got rid of the 'NO_'), and 
> i renamed it to the bit more generic X86_VERBOSE_BOOTUP config variable. 
> We might want to make other output dependent on that flag, not just the 
> decompressor messages. Find the commit below. (please double-check it)

Looks good, thanks.

> 	Ingo
> 
> ----------------------->
> commit 6bcb13b35a2ea39be6c7cc0292b8ad1191b1a748
> Author: Ben Collins <ben.collins@canonical.com>
> Date:   Wed Jun 18 14:04:35 2008 -0400
> 
>     x86: config option to disable info from decompression of the kernel
>     
>     This patch allows the disabling of decompression messages during
>     x86 bootup.
>     
>     Signed-off-by: Ben Collins <ben.collins@canonical.com>
>     Signed-off-by: Ingo Molnar <mingo@elte.hu>
> 
> diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug
> index ac1e31b..14abaa5 100644
> --- a/arch/x86/Kconfig.debug
> +++ b/arch/x86/Kconfig.debug
> @@ -16,6 +16,14 @@ config NONPROMISC_DEVMEM
>  	  obviously disasterous, but specific access can be used by people
>  	  debugging the kernel.
>  
> +config X86_VERBOSE_BOOTUP
> +	bool "Enable verbose x86 bootup info messages"
> +	default y
> +	help
> +	  Enables the informational output from the decompression stage
> +	  (e.g. bzImage) of the boot. If you disable this you will still
> +	  see errors. Disable this if you want silent bootup.
> +
>  config EARLY_PRINTK
>  	bool "Early printk" if EMBEDDED
>  	default y
> diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
> index d10e727..11629e9 100644
> --- a/arch/x86/boot/compressed/misc.c
> +++ b/arch/x86/boot/compressed/misc.c
> @@ -202,7 +202,8 @@ static void free(void *where);
>  static void *memset(void *s, int c, unsigned n);
>  static void *memcpy(void *dest, const void *src, unsigned n);
>  
> -static void putstr(const char *);
> +static void __putstr(int, const char *);
> +#define putstr(__x)  __putstr(0, __x)
>  
>  #ifdef CONFIG_X86_64
>  #define memptr long
> @@ -266,11 +267,16 @@ static void scroll(void)
>  		vidmem[i] = ' ';
>  }
>  
> -static void putstr(const char *s)
> +static void __putstr(int error, const char *s)
>  {
>  	int x, y, pos;
>  	char c;
>  
> +#ifndef CONFIG_X86_VERBOSE_BOOTUP
> +	if (!error)
> +		return;
> +#endif
> +
>  #ifdef CONFIG_X86_32
>  	if (real_mode->screen_info.orig_video_mode == 0 &&
>  	    lines == 0 && cols == 0)
> @@ -363,9 +369,9 @@ static void flush_window(void)
>  
>  static void error(char *x)
>  {
> -	putstr("\n\n");
> -	putstr(x);
> -	putstr("\n\n -- System halted");
> +	__putstr(1, "\n\n");
> +	__putstr(1, x);
> +	__putstr(1, "\n\n -- System halted");
>  
>  	while (1)
>  		asm("hlt");


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-07-03 14:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-18 18:04 [PATCH] Config option to disable info from decompression of the kernel Ben Collins
2008-07-03 12:36 ` Ingo Molnar
2008-07-03 14:46   ` Ben Collins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox