# A good kernel-building techniques

## Hexorg

Good daytime to you all!

A week ago my friend persuaded me to try to install gentoo, so I started learning from handbook, and some online sourses. Now I have running console on my virtualbox (being a student scholar, I can't live a day without working firefox or open office).

I compiled my kernel, based on gentoo-sources. and got most of my hardware working (decided not to tuch GUI, since video drivers and virtual box dont go too well together, but I shouldn't have any problems there. 

What my question is - is what are the good kernel-building techniques? I've build my kernel as a monolit, but I still have a module support (although lsmod shows 0). I do have a working internet, sound, all the harddrives and cd-roms, So for a while I was happy with this kernel, untill I stumbled upoon a post from linuxquestions.org by the member "Electro" - he said some "Gentoo kernel hints:

1) Disable any OSS and ALSA modules, but leave sound core as a module

2) Set PS/2 mouse as a module

3) Set ramdisk and initrd as built-in

4) Set EXT2 and EXT3 as built-in

5) Disable low-performance USB storage

6) Set loop devices as a module

7) Set PIIX as built-in

 :Cool:  Set your IDE chipset as built-in

9) Set additional controllers as modules

10) Set UDF and NTFS write support as disable

*) Set everything else as modules if you think that you are going to need it in the future"

so I wanted to see what everyones opinion is? The only hardware that I will have connected later can only be usb, because I only have a laptop. Are Mr. Electro's hints good for all computers, or there are better ones for desktops\laptops? And is monolit kernel faster then modulated?

----------

## d2_racing

You should ask pappy_mcfae about the kernel config optimization  :Razz: 

----------

## Ant P.

Those "hints" sound extremely outdated.

----------

## Veldrin

Let me give it a shot

1) Disable any OSS and ALSA modules, but leave sound core as a module 

You want to keep the module for you own soundcard, otherwise keeping soundcore is rather useless

2) Set PS/2 mouse as a module 

sound reasonable, If you are still using PS/2, or your PC still has a PS/2 plug (My notebook does not....)

3) Set ramdisk and initrd as built-in 

Ramdisk sounds fine, initrd are normally not needed

4) Set EXT2 and EXT3 as built-in 

Depends, on what FS you want to boot from, resp on what FS your / is on. In general I would compile all FS in, that are going to be used regularly

5) Disable low-performance USB storage 

Sounds fine

6) Set loop devices as a module 

Sounds fine

7) Set PIIX as built-in 

Depend on the Chipset, nowadays ahci is pretty often used

 Set your IDE chipset as built-in 

Yes, but use libata, and not the deprecated IDE set

9) Set additional controllers as modules 

If you really need them

10) Set UDF and NTFS write support as disable 

Agreed for UDF, and remove NTFS completly - ntfs-3g is a userspace tool, that provides NTFS writeaccess

*) Set everything else as modules if you think that you are going to need it in the future" 

no comment here

As Ant_P already mentioned, those Hints are a bit out of date....

This little debian page might also help.

cheers

V.

----------

## Hexorg

d2_racing, will do  :Smile: 

Ant_P and Veldrin, so you "vote" for more modules?

----------

## d2_racing

For my concern, all the hardware stuff are builtin inside the kernel except for the wifi driver.

For the rest, I use module when I can.

----------

