* [PATCH 2/2 v2] Only print "Decompressing Linux" etc when 'debug' is passed.
@ 2008-05-25 3:47 Kristian Høgsberg
2008-05-25 4:54 ` Yinghai Lu
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Kristian Høgsberg @ 2008-05-25 3:47 UTC (permalink / raw)
To: linux-kernel; +Cc: Kristian Høgsberg
Signed-off-by: Kristian Høgsberg <krh@redhat.com>
---
Updated to use the standard 'debug' parameter instead of 'noisy'.
arch/x86/boot/compressed/misc.c | 30 +++++++++++++++++++++++++++---
1 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
index 0d03579..017df26 100644
--- a/arch/x86/boot/compressed/misc.c
+++ b/arch/x86/boot/compressed/misc.c
@@ -190,6 +190,7 @@ static void gzip_release(void **);
*/
static struct boot_params *real_mode; /* Pointer to real-mode data */
static struct screen_info *rm_screen_info; /* Pointer to real-mode data */
+static int debug;
extern unsigned char input_data[];
extern int input_len;
@@ -391,7 +392,8 @@ static void parse_elf(void *output)
return;
}
- putstr("Parsing ELF... ");
+ if (debug)
+ putstr("Parsing ELF... ");
phdrs = malloc(sizeof(*phdrs) * ehdr.e_phnum);
if (!phdrs)
@@ -419,11 +421,27 @@ static void parse_elf(void *output)
}
}
+static const char *strnstr(const char *string, int len, const char *s)
+{
+ int i, j;
+
+ for (i = 0; i < len; i++) {
+ for (j = 0; i + j < len && s[j]; j++)
+ if (string[i + j] != s[j])
+ break;
+ if (s[j] == '\0')
+ return string + i;
+ }
+
+ return NULL;
+}
asmlinkage void decompress_kernel(void *rmode, memptr heap,
unsigned char *input_data,
unsigned long input_len,
unsigned char *output)
{
+ char *cmdline;
+
real_mode = rmode;
if (rm_screen_info->orig_video_mode == 7) {
@@ -437,6 +455,10 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap,
lines = rm_screen_info->orig_video_lines;
cols = rm_screen_info->orig_video_cols;
+ cmdline = (char *) real_mode->hdr.cmd_line_ptr;
+ if (strnstr(cmdline, real_mode->hdr.cmdline_size, "debug"))
+ debug = 1;
+
window = output; /* Output buffer (Normally at 1M) */
free_mem_ptr = heap; /* Heap */
free_mem_end_ptr = heap + BOOT_HEAP_SIZE;
@@ -461,9 +483,11 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap,
#endif
makecrc();
- putstr("\nDecompressing Linux... ");
+ if (debug)
+ putstr("\nDecompressing Linux... ");
gunzip();
parse_elf(output);
- putstr("done.\nBooting the kernel.\n");
+ if (debug)
+ putstr("done.\nBooting the kernel.\n");
return;
}
--
1.5.5.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2 v2] Only print "Decompressing Linux" etc when 'debug' is passed.
2008-05-25 3:47 [PATCH 2/2 v2] Only print "Decompressing Linux" etc when 'debug' is passed Kristian Høgsberg
@ 2008-05-25 4:54 ` Yinghai Lu
2008-05-25 7:31 ` Pekka Enberg
2008-05-26 9:22 ` Mikael Pettersson
2 siblings, 0 replies; 7+ messages in thread
From: Yinghai Lu @ 2008-05-25 4:54 UTC (permalink / raw)
To: Kristian Høgsberg; +Cc: linux-kernel
On Sat, May 24, 2008 at 8:47 PM, Kristian Høgsberg <krh@redhat.com> wrote:
> Signed-off-by: Kristian Høgsberg <krh@redhat.com>
> ---
>
> Updated to use the standard 'debug' parameter instead of 'noisy'.
>
> arch/x86/boot/compressed/misc.c | 30 +++++++++++++++++++++++++++---
> 1 files changed, 27 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c
> index 0d03579..017df26 100644
> --- a/arch/x86/boot/compressed/misc.c
> +++ b/arch/x86/boot/compressed/misc.c
> @@ -190,6 +190,7 @@ static void gzip_release(void **);
> */
> static struct boot_params *real_mode; /* Pointer to real-mode data */
> static struct screen_info *rm_screen_info; /* Pointer to real-mode data */
> +static int debug;
>
> extern unsigned char input_data[];
> extern int input_len;
> @@ -391,7 +392,8 @@ static void parse_elf(void *output)
> return;
> }
>
> - putstr("Parsing ELF... ");
> + if (debug)
> + putstr("Parsing ELF... ");
>
> phdrs = malloc(sizeof(*phdrs) * ehdr.e_phnum);
> if (!phdrs)
> @@ -419,11 +421,27 @@ static void parse_elf(void *output)
> }
> }
>
> +static const char *strnstr(const char *string, int len, const char *s)
> +{
> + int i, j;
> +
> + for (i = 0; i < len; i++) {
> + for (j = 0; i + j < len && s[j]; j++)
> + if (string[i + j] != s[j])
> + break;
> + if (s[j] == '\0')
> + return string + i;
> + }
> +
> + return NULL;
> +}
> asmlinkage void decompress_kernel(void *rmode, memptr heap,
> unsigned char *input_data,
> unsigned long input_len,
> unsigned char *output)
> {
> + char *cmdline;
> +
> real_mode = rmode;
>
> if (rm_screen_info->orig_video_mode == 7) {
> @@ -437,6 +455,10 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap,
> lines = rm_screen_info->orig_video_lines;
> cols = rm_screen_info->orig_video_cols;
>
> + cmdline = (char *) real_mode->hdr.cmd_line_ptr;
> + if (strnstr(cmdline, real_mode->hdr.cmdline_size, "debug"))
> + debug = 1;
> +
> window = output; /* Output buffer (Normally at 1M) */
> free_mem_ptr = heap; /* Heap */
> free_mem_end_ptr = heap + BOOT_HEAP_SIZE;
> @@ -461,9 +483,11 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap,
> #endif
>
> makecrc();
> - putstr("\nDecompressing Linux... ");
> + if (debug)
> + putstr("\nDecompressing Linux... ");
> gunzip();
> parse_elf(output);
> - putstr("done.\nBooting the kernel.\n");
> + if (debug)
> + putstr("done.\nBooting the kernel.\n");
> return;
> }
> --
does that printout hurt anything?
YH
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2 v2] Only print "Decompressing Linux" etc when 'debug' is passed.
2008-05-25 3:47 [PATCH 2/2 v2] Only print "Decompressing Linux" etc when 'debug' is passed Kristian Høgsberg
2008-05-25 4:54 ` Yinghai Lu
@ 2008-05-25 7:31 ` Pekka Enberg
2008-05-26 9:22 ` Mikael Pettersson
2 siblings, 0 replies; 7+ messages in thread
From: Pekka Enberg @ 2008-05-25 7:31 UTC (permalink / raw)
To: Kristian Høgsberg; +Cc: linux-kernel
On Sun, May 25, 2008 at 6:47 AM, Kristian Høgsberg <krh@redhat.com> wrote:
> @@ -461,9 +483,11 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap,
> #endif
>
> makecrc();
> - putstr("\nDecompressing Linux... ");
> + if (debug)
> + putstr("\nDecompressing Linux... ");
> gunzip();
> parse_elf(output);
> - putstr("done.\nBooting the kernel.\n");
> + if (debug)
> + putstr("done.\nBooting the kernel.\n");
> return;
> }
Please add a proper changelog explaining why we want to do this.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2 v2] Only print "Decompressing Linux" etc when 'debug' is passed.
2008-05-25 3:47 [PATCH 2/2 v2] Only print "Decompressing Linux" etc when 'debug' is passed Kristian Høgsberg
2008-05-25 4:54 ` Yinghai Lu
2008-05-25 7:31 ` Pekka Enberg
@ 2008-05-26 9:22 ` Mikael Pettersson
2008-05-26 14:09 ` Jan Engelhardt
2 siblings, 1 reply; 7+ messages in thread
From: Mikael Pettersson @ 2008-05-26 9:22 UTC (permalink / raw)
To: Kristian Høgsberg; +Cc: linux-kernel
=?utf-8?q?Kristian=20H=C3=B8gsberg?= writes:
> Signed-off-by: Kristian Høgsberg <krh@redhat.com>
> ---
>
> Updated to use the standard 'debug' parameter instead of 'noisy'.
>
> arch/x86/boot/compressed/misc.c | 30 +++++++++++++++++++++++++++---
> 1 files changed, 27 insertions(+), 3 deletions(-)
NAK
You still haven't explained why suppressing these
messages is necessary.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2 v2] Only print "Decompressing Linux" etc when 'debug' is passed.
2008-05-26 9:22 ` Mikael Pettersson
@ 2008-05-26 14:09 ` Jan Engelhardt
2008-05-26 15:09 ` Johannes Weiner
0 siblings, 1 reply; 7+ messages in thread
From: Jan Engelhardt @ 2008-05-26 14:09 UTC (permalink / raw)
To: Mikael Pettersson; +Cc: Kristian Høgsberg, linux-kernel
On Monday 2008-05-26 11:22, Mikael Pettersson wrote:
>=?utf-8?q?Kristian=20H=C3=B8gsberg?= writes:
> > Signed-off-by: Kristian Høgsberg <krh@redhat.com>
> > ---
> >
> > Updated to use the standard 'debug' parameter instead of 'noisy'.
> >
> > arch/x86/boot/compressed/misc.c | 30 +++++++++++++++++++++++++++---
> > 1 files changed, 27 insertions(+), 3 deletions(-)
>
>NAK
>
>You still haven't explained why suppressing these
>messages is necessary.
In fact, quite the opposite, http://tinyurl.com/68notu , is worthwhile.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2 v2] Only print "Decompressing Linux" etc when 'debug' is passed.
2008-05-26 14:09 ` Jan Engelhardt
@ 2008-05-26 15:09 ` Johannes Weiner
2008-05-26 16:16 ` Jan Engelhardt
0 siblings, 1 reply; 7+ messages in thread
From: Johannes Weiner @ 2008-05-26 15:09 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: Mikael Pettersson, Kristian Høgsberg, linux-kernel
Hi,
Jan Engelhardt <jengelh@medozas.de> writes:
> On Monday 2008-05-26 11:22, Mikael Pettersson wrote:
>>=?utf-8?q?Kristian=20H=C3=B8gsberg?= writes:
>> > Signed-off-by: Kristian Høgsberg <krh@redhat.com>
>> > ---
>> >
>> > Updated to use the standard 'debug' parameter instead of 'noisy'.
>> >
>> > arch/x86/boot/compressed/misc.c | 30 +++++++++++++++++++++++++++---
>> > 1 files changed, 27 insertions(+), 3 deletions(-)
>>
>>NAK
>>
>>You still haven't explained why suppressing these
>>messages is necessary.
>
> In fact, quite the opposite, http://tinyurl.com/68notu , is
> worthwhile.
I want dots! My bootloader already prints dots!
Decompressing Linux...................done.
Booting the kernel.
Hannes
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2 v2] Only print "Decompressing Linux" etc when 'debug' is passed.
2008-05-26 15:09 ` Johannes Weiner
@ 2008-05-26 16:16 ` Jan Engelhardt
0 siblings, 0 replies; 7+ messages in thread
From: Jan Engelhardt @ 2008-05-26 16:16 UTC (permalink / raw)
To: Johannes Weiner; +Cc: Mikael Pettersson, Kristian Høgsberg, linux-kernel
On Monday 2008-05-26 17:09, Johannes Weiner wrote:
>>
>> In fact, quite the opposite, http://tinyurl.com/68notu , is
>> worthwhile.
>
>I want dots! My bootloader already prints dots!
>
>Decompressing Linux...................done.
>Booting the kernel.
I have deliberately chosen stars instead of dots because the rest of
the kernel already uses dots here and there without actually
implementing a progress "bar" ("Foobaring your CPU...",wait,"done\n") to
stand out a bit, but I do not actually mind what is printed, whether
it is stars, dots or ▒s.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-05-26 16:17 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-25 3:47 [PATCH 2/2 v2] Only print "Decompressing Linux" etc when 'debug' is passed Kristian Høgsberg
2008-05-25 4:54 ` Yinghai Lu
2008-05-25 7:31 ` Pekka Enberg
2008-05-26 9:22 ` Mikael Pettersson
2008-05-26 14:09 ` Jan Engelhardt
2008-05-26 15:09 ` Johannes Weiner
2008-05-26 16:16 ` Jan Engelhardt
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.