Mark took the original "pristine" kernel sourcecode from kernel.org to build his kernel, but
I wanted to try something different and compile a kernel that was an exact duplicate of the
current stock Debian kernel that I was already running with the exception of adding the voluntary
preemption option and compiling it for my specific architecture (Pentium M) instead of the
default Pentium Pro.
For those of you who don't know, the voluntary preemption option in the kernel basically allows
for faster application context switching (more preemption points in the kernel) which gives me a
much more responsive feel under heavy load than the default "no preemption" scheme that the default
Debian kernel has.
One of the reasons that you might choose to use your distributions patched kernel source is that it will not change the way your system operates now (if you don't make major changes). If you use the pristine kernel source some things that your distro provider does may not work anymore.. boot splash screens, hardware detection, different versions of hardware drivers, etc.. or it may all work just fine. Either way, you're more likely to have less changes in the way your system operates by using your distro's patched kernel source.
To get started I installed the follwoing packages with the command
apt-get install linux-source-2.6.18 kernel-package debhelper dpkg-dev libncurses5-devThis gives me the tools I need to compile a Debian kernel package along with the Debian modified kernel source. The Debian kernel source comes just like the one from kernel.org so I need to unpack it and make a symlink to the default "linux" directory with the following commands
tar -jxvf linux-source-2.6.18.tar.bz2 ln -s linux-source-2.6.18 linuxNow I want to keep the same settings as my current kernel so I am going to copy the currently running kernel's config file to the kernel source directory with the following command
cp /boot/config-2.6.18-4-686 /usr/src/linuxYou may also want to edit the Makefile in the /usr/src/linux/ directory and make the "EXTRAVERSION" variable near the top of the file something like the date "20070711" if you plan on compiling multiple instances of the same kernel version. This keeps the module directorys for the kernels seperated to avoid confusion. Now I'm ready to configure my new kernel with this command
make menuconfigAfter running this command you're presented with a text-based user interface that allows you to select options for the new kernel. Before I start I choose to load an alternate configuration file and give it the path to the config-2.6.18-4-686 file that I copied over in the steps above. Now I just change my architecture type and select the voluntary preemption option and then exit. Next I prep the source directory and then start the kernel compile with the following commands
make-kpkg clean make-kpkg --initrd --append-to-version=-custom --revision=thinkpod.1.0 kernel_imageThsi process can take quite a while depending on the speed of your machine. My machine is pretty old and slow, so my kernel compile took 65 minutes.. your's should be much faster (~20 minutes). When the compile completes, you should have a new Debian kernel package in the /usr/src/ directory. All that is left to do is install it with the following command
dpkg -i linux-image-2.6.1820070711_thinkpod.1.0_i386.debNow when you reboot you should have a new default entry in your Grub bootloader for your new kernel. If it runs like you want, then you've succeeded, but if not, reboot and select yor old kernel and try your compile again (you've probably tried to get fancy with your option choosing during the kernel config process.. stop that unless you know what you're doing! read. read. read, then try it again).
![[logo]](logo.png)