# Truly silent boot [SOLVED]

## JKosta

I want to get rid of the following output when kernel is loading:

early console in decompress-kernel

Decompressing Linux . . . Parsing ELF . . .done

Booting the kernel

Anybody knows how?Last edited by JKosta on Thu Nov 14, 2013 12:36 am; edited 1 time in total

----------

## NeddySeagoon

JKosta,

Patch the kernel to remove those text ouputs.

Use gep to find the strings in the kernel source.

----------

## JKosta

NeddySeagoon,

Can you detail?

Thanks.

----------

## NeddySeagoon

JKosta,

I will do an example here ...

```
roy@NeddySeagoon_SSD ~ $ cd /usr/src/linux

roy@NeddySeagoon_SSD /usr/src/linux $ grep -R Decompressing
```

Searches the entire kernel for the word "Decompressing" with a capital D.

In my kernel, the output is

```
Documentation/xz.txt:    is used in single-call mode. Decompressing the kernel itself is an

arch/alpha/boot/bootpz.c:   srm_printk("Decompressing the kernel...\n"

Binary file arch/x86/boot/compressed/misc.o matches

arch/x86/boot/compressed/misc.c:   debug_putstr("\nDecompressing Linux... ");

Binary file arch/x86/boot/compressed/vmlinux matches

Binary file arch/x86/boot/vmlinux.bin matches

Binary file arch/x86/boot/bzImage matches

Binary file arch/x86_64/boot/bzImage matches

arch/m32r/boot/compressed/misc.c:   puts("\nDecompressing Linux... ");
```

We can ignore the binary files as they are not source code.

We also ignore Documentation/,  as that is human readable instructions.

This leaves three files ...

```
arch/alpha/boot/bootpz.c:   srm_printk("Decompressing the kernel...\n"

arch/x86/boot/compressed/misc.c:   debug_putstr("\nDecompressing Linux... ");

arch/m32r/boot/compressed/misc.c:   puts("\nDecompressing Linux... ");

```

The first one is for DEC Alpha based sysems, the second one is for Intel/AMD based systems.

I don't know what m32r is.

Open the file in nano

```
nano -w arch/x86/boot/compressed/misc.c
```

Notice the file starts with lots of comments that are started with /* and ended with */

Press Ctl-W in nano to search and enter 

```
Decompressing
```

to search

At the end of the file there is

```
        debug_putstr("\nDecompressing Linux... ");

        decompress(input_data, input_len, NULL, NULL, output, NULL, error);

        parse_elf(output);

        debug_putstr("done.\nBooting the kernel.\n");

        return;
```

Add the comment marks around  

```
 debug_putstr("\nDecompressing Linux... "); 
```

and 

```
debug_putstr("done.\nBooting the kernel.\n");

```

so it reads 

```
/*        debug_putstr("\nDecompressing Linux... ");  */

        decompress(input_data, input_len, NULL, NULL, output, NULL, error);

        parse_elf(output);

/*        debug_putstr("done.\nBooting the kernel.\n");  */

        return;
```

These lines of code are now comments and will not be compiled when you rebuild the kernel.

You could also just delete the lines but comments are easier to reverse.

You can also add a comment of your own for you to read later.

That is the method with a worked example.

----------

## JKosta

NeddySeagoon,

I've followed your example and it worked!

Thanks a lot!   :Very Happy: 

----------

## 666threesixes666

is there a way to automatically patch any kernel that comes past me so i can run a command instead of digging through files by hand?  how do i tell openrc shush too?

----------

## NeddySeagoon

666threesixes666,

Building on the above example, you can make a patch file and run patch < patchfile to apply your patch.

```
man patch 
```

tells how to use diff to make a patch.

If the package of interest supports epatch, you only need drop the patch into the right place in /etc/portage and portage will apply it for you.

For openrc, file a feature request for a silent USE flag.  Of course, patches welcome.

----------

## Lukas0907

Hi,

instead of patching the kernel you can also simply disable CONFIG_X86_VERBOSE_BOOTUP which does the same thing (Linux 3.13).

Cheers,

Lukas

----------

