Commit 3b6b9293 authored by Kristian Høgsberg's avatar Kristian Høgsberg Committed by H. Peter Anvin

x86: Honor 'quiet' command line option in real mode boot decompressor.

This patch lets the early real mode code look for the 'quiet' option
on the kernel command line and pass a loadflag to the decompressor.
When this flag is set, we suppress the "Decompressing Linux... Parsing
ELF... done." messages.
Signed-off-by: default avatarKristian Høgsberg <krh@redhat.com>
Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
parent 23968f71
...@@ -189,6 +189,7 @@ static void gzip_release(void **); ...@@ -189,6 +189,7 @@ static void gzip_release(void **);
* This is set up by the setup-routine at boot-time * This is set up by the setup-routine at boot-time
*/ */
static struct boot_params *real_mode; /* Pointer to real-mode data */ static struct boot_params *real_mode; /* Pointer to real-mode data */
static int quiet;
extern unsigned char input_data[]; extern unsigned char input_data[];
extern int input_len; extern int input_len;
...@@ -391,7 +392,8 @@ static void parse_elf(void *output) ...@@ -391,7 +392,8 @@ static void parse_elf(void *output)
return; return;
} }
putstr("Parsing ELF... "); if (!quiet)
putstr("Parsing ELF... ");
phdrs = malloc(sizeof(*phdrs) * ehdr.e_phnum); phdrs = malloc(sizeof(*phdrs) * ehdr.e_phnum);
if (!phdrs) if (!phdrs)
...@@ -426,6 +428,9 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap, ...@@ -426,6 +428,9 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap,
{ {
real_mode = rmode; real_mode = rmode;
if (real_mode->hdr.loadflags & QUIET_FLAG)
quiet = 1;
if (real_mode->screen_info.orig_video_mode == 7) { if (real_mode->screen_info.orig_video_mode == 7) {
vidmem = (char *) 0xb0000; vidmem = (char *) 0xb0000;
vidport = 0x3b4; vidport = 0x3b4;
...@@ -461,9 +466,11 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap, ...@@ -461,9 +466,11 @@ asmlinkage void decompress_kernel(void *rmode, memptr heap,
#endif #endif
makecrc(); makecrc();
putstr("\nDecompressing Linux... "); if (!quiet)
putstr("\nDecompressing Linux... ");
gunzip(); gunzip();
parse_elf(output); parse_elf(output);
putstr("done.\nBooting the kernel.\n"); if (!quiet)
putstr("done.\nBooting the kernel.\n");
return; return;
} }
...@@ -165,6 +165,10 @@ void main(void) ...@@ -165,6 +165,10 @@ void main(void)
/* Set the video mode */ /* Set the video mode */
set_video(); set_video();
/* Parse command line for 'quiet' and pass it to decompressor. */
if (cmdline_find_option_bool("quiet"))
boot_params.hdr.loadflags |= QUIET_FLAG;
/* Do the last things and invoke protected mode */ /* Do the last things and invoke protected mode */
go_to_protected_mode(); go_to_protected_mode();
} }
...@@ -40,6 +40,7 @@ struct setup_header { ...@@ -40,6 +40,7 @@ struct setup_header {
__u8 type_of_loader; __u8 type_of_loader;
__u8 loadflags; __u8 loadflags;
#define LOADED_HIGH (1<<0) #define LOADED_HIGH (1<<0)
#define QUIET_FLAG (1<<5)
#define KEEP_SEGMENTS (1<<6) #define KEEP_SEGMENTS (1<<6)
#define CAN_USE_HEAP (1<<7) #define CAN_USE_HEAP (1<<7)
__u16 setup_move_size; __u16 setup_move_size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment