# Detailed Guide to Kernel Configuration - Exists?

## Danuvius

I am hoping someone can recommend me some good kernel configuration guides.  I mean something like the menuconfig comments, but more detailed, and all in a single document.

My goal is to build myself a kernel that has everything I need, and nothing I do not.

Some of this is simple and rather obvious, like removing drivers for sound cards I don't have, and filesystems I'll never use.  Unfortunately, probably over half of the kernel configuration options are "greek to me"... quite often even after the menuconfig explanations.

I want to remove support from my kernel for the myriad hardware settings that my machine doesn't support and will never need.

My assumptions is that I'll have a (perhaps not overly noticably) faster kernel as a result.  Am I right?

And so I would appreciate suggestions as to how someone like me (whose understand of hardware is limited) could minimise the kernel.

Obviously I'm hoping to find a short-cut to having to research 100+ different settings on my own.

Thanks in advance!

----------

## adaptr

No, there will not be significant speed benefits from rolling your own kernel if the hardware you run it on remains the same.

The primary differences will be that everything is compiled in (no modules necessary) and it will be smaller (kernel and modules combined, a monolithic kernel will still be larger than a genkernel.)

The real differences come when you eliminate support for everything you have but don't need, like USB or other hardware.

AFAIK experience is still the best guide.. feel free to ask, though.

Most kernel aficionados will only need to know your mainboard to help you out.

----------

## Danuvius

 *adaptr wrote:*   

> The real differences come when you eliminate support for everything you have but don't need, like USB or other hardware.

 

And said difference would be a speed increase?  Or just likewise a smaller kernel.

I will reply tonight with my motherboard and other computer details in hope of some tips.

----------

## Sith_Happens

Well there is a speed difference if you don't use coldplugging or hotplugging, since it's not neccessary to probe your devices and configure support for them each time you boot.

----------

## Danuvius

My Box:

ASUS A7V600-X

AMD Athlon XP 2400

512 MB RAM

GeForce FX 5600 (with 128 MB)

I don't use USB and don't foresee using it in the near future... so I could probably disable that.

Any recommendations?

----------

## adaptr

Starting from the provided kernel config: set your processor type, disable all but the PCI bus, disable hotplugging (no USB), select only the filesystems you actually use (ext2/3, reiser, iso9660 if you want to use CDs), enable the mouse, select your IDE interface (from your mainboard manual) but DO NOT disable the generic IDE option, select SATA if you use that, and then also the relevant SCSI options, select via-agp and agpgart, make sure MTRR is enabled (or your geforce FX will b0rk), and play around with the sound options.. there is an excellent Gentoo ALSA guide to help with that - later.

Concise enough ?  :Wink: 

The main point to get is that it doesn't matter - you will routinely rebuild your kernel 3 times in a row if something doesn't work, it only takes like 5 minutes unless you have to rebuild everything (and there is rarely any reason to do that) and unless you mess around with the Black Magic options it will almost certainly boot.

Chill, and start enjoying the supreme feeling of control you get when you run your very own kernel.

----------

## Danuvius

Thanks!  :Wink: 

 *adaptr wrote:*   

> disable hotplugging (no USB)

 

Will this still allow me to use coldplug? (I don't really know how to "activate" ethernet card and other things without it)

 *adaptr wrote:*   

> also the relevant SCSI options

 

What does this usually relate to?  I have IDE based CD-ROM drive and DVD-RW drive... no SCSI based drives or devices that I know of.

----------

## adaptr

Coldplug is also used for USB, I'm not sure what you mean by Ethernet card; how is this hot- or cold-pluggable ?

Some SATA drivers use SCSI as their interface, others use IDE - you will have to check.

This is made extremely easy when you specify the proper parameters on booting from the LiveCD and then do an lsmod to see what was loaded.

----------

## Danuvius

 *adaptr wrote:*   

> Coldplug is also used for USB, I'm not sure what you mean by Ethernet card; how is this hot- or cold-pluggable ?
> 
> Some SATA drivers use SCSI as their interface, others use IDE - you will have to check.
> 
> This is made extremely easy when you specify the proper parameters on booting from the LiveCD and then do an lsmod to see what was loaded.

 

I miswrote.  My motherboard has integrated ethernet functionality.  That, however, does not work unless I have coldplug started during the boot process.  (presumably I could specifically load drives for it, instead of using coldplug.  but I don't know how)

Am I any clearer?  It is a terrible state of confusion when one does not know enough to even ask the question coherently. %)

----------

## rhill

 *adaptr wrote:*   

> No, there will not be significant speed benefits from rolling your own kernel if the hardware you run it on remains the same.
> 
> The primary differences will be that everything is compiled in (no modules necessary) and it will be smaller (kernel and modules combined, a monolithic kernel will still be larger than a genkernel.)
> 
> The real differences come when you eliminate support for everything you have but don't need, like USB or other hardware.

 

i don't agree with this.  removing all the extra junk that isn't needed but was previously built in creates a smaller kernel, which has a smaller memory footprint, which increases cache efficiency.  at least that's what i understand, but i could be wrong.  the debate on modular vs monolithic kernels is ongoing, so im not touching that one.

but back to the original question, i've always wished there were a detailed kernel guide out there.  i've thought about starting one many times, but in the end i'm just not knowing enough to make sense out of it myself, let alone for other ppl.  the second hardest part would then be keeping it up to date.  i think that hosting it on the wiki might solve both problems, if we could raise enough interest to sustain it.

i agree experience is the best teacher.  i can fly through a kernel config now, but still i have no idea what some of the options actually do in real world terms.

----------

## mseney

Yeah I could use a hand w/ the menuconfig part. I was able to successfully do it but later on in my stage 1 install I tried a lsmod for the check of it and there wasn't anything there? I'm guessing I compiled everything into the kernel and maybe should have made certain things modules. I really could use a hand w/ this first install run.

----------

## jshanab

We could eliminate the 3rd times a charm if we had some kind of dependency graph to see what depends on what. When I have problems compiling a kernel it is bvecause one option needs another and that is not documented anywhere that I know of.   I would love a guide for that. Right now I can't get USB to work, All guides assume you have a proc/bus/usb and mine is non-existant but the usb hardware is there, hotplug starts but everything reports no device.  All troubleshooting preocedures assume /proc/bus/usb too

----------

## adaptr

Well, if you use menuconfig then AFAIK mandatory dependencies are always handled correctly.

For instance, once you have selected USB mass storage support (USB sticks and the like) it then becomes impossible to deselect SCSI support, which it is dependent on.

Which is as it should be.

But I totally agree - a full dependency graph with explanations would be more than welcome  :Wink: 

----------

## jshanab

I have taken to printing out my .conif file and keeping it in my desk drawer, but I don't have the names of all the options memorized yet, I keep having to select help to see if an option is the one I want. I would like the varible names or the VARIABLE=VALUE on the right margin as an option.

I have been recompiling my kernel 3 or 4 times a day trying to get my USB scanner to work, it just won't recognize.  I am actually starting to think it might be a hardware problem. One of the real pains is that when I re-compile the kernel it triggers the nvidia module invalid and I end up re-running the same NVIDIA script to recompile the same module over and over.  Is there a way I can only trigger on kernel version change not every re-compile?

This machine is a 2.4.28-r8 kernel(trying to get some SCO software to install), my 2.6 kernel is at home.

----------

