Compiling a Custom Kernel
I have officially morphed into a level 60 geek. I know I had to compile Linux kernels in college, but this is the first time I have done it for my own enjoyment.
The linux kernel has the potential to include a lot of support for hardware without the need for “drivers” or kernel modules. There are a lot of things that are compiled in by default that the average user may not use anymore. There is a lot of support for hardware that is included to make Linux run on a vast range of systems. So if you compile your own kernel and leave out all that stuff that you don’t use or need you could get a quicker kernel. Also, you can force modules to be compiled into the kernel that you know you always use. Having them precompiled in the kernel can make for a faster boot time.
I used the instructions in the Master Kernel Thread at the Ubuntu forums. I’m not going to reiterate those instructions here because they are constantly updating them. The post is over 6 months old, but the instructions were updated just 4 days ago.
I was able to upgrade my kernel from 2.6.20.16 to 2.6.21.5. I don’t know what the benefit of this newer kernel is really, but it’s newer. I optimized the kernel for my Athlon64 processor and removed support for other processors that this build will never run on. I also ran through these kernel performance tweaks from Own3d in another Ubuntu forums thread.
Following Own3d’s instructions I removed a whole crapload of stuff that I dont use like PPP, SLIP, touchscreen support, ISDN subsystem, video capture support, extra languages, Amateur radio, IrDA, and Bluetooth support. Removing all these things might not be for you, but I don’t use them.
For most modules you have 3 options, to not compile it, to compile it, or to compile it as a module. I didnt think to look the things that were being complied as modules to see if they could be hard-compiled right into the kernel. So it looks like I might be compiling it once more.
Depending on the speed of your computer it can take more than an hour to compile the kernel. On mine it was between 30 minutes and an hour.
One last thing, if you have an Nvidia video card you will have to reinstall the driver after you boot into your new kernel. When you boot you will end up with a black screen. Switch to tty2 by hitting CTRL+ALT+F2 and run the Nvidia installer from there. Also, you will want to read this thread on a bug that exists with the Nvidia driver at the 2.6.21 kernel. Basically when you compile your kernel you want to turn off Paravirtualization Support. If you don’t turn it off you will have problems compiling the Nvidia driver on the new kernel.

![[REC]](/img/movie-covers/movie-1.png)






