The first thing we need to do is to download the source from kernel.org. The 2.6 tree is found here.
http://www.kernel.org/pub/linux/kernel/v2.6/
Scroll down to the desired version to be compiled and select "copy link location". Then open a terminal and become root and change to your build environment. We'll use /usr/src as the default.
su -
cd /usr/src
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.29.tar.bz2
now we need to unpack the tar ball.
tar -jxf linux-2.6.29.tar.bz2
Next we're going to remove the current symlink to the linux directory and link to the new directory.
rm linux
ln -s linux-2.6.29 linux
Now we'll move into the build directory.
cd linux
To get this far means that you have a working kernel. So we're going to utilize the current kernel config to build our new kernel.
zcat /proc/config.gz > .config
make oldconfig
New additions to the kernel will be displayed and you can choose which ones you want to keep and in what form. It will ask you to keep them in module form (m), or you can select y for it to be built in to the kernel, or n for it to be left out. Simply hitting enter will do the default action, which the dialog will tell you what that is.
Next we can alter anything we want in the kernel itself.
make menuconfig
There are a couple of things I always change here. One is the processor support. Scroll to processor type and features, and then processor family. For my celeron M on this laptop I pick the pentium M option. For my core 2 duo system, I choose the core 2/ newer xeon option.
We then exit from the processor type and features menu back to the main menu.
Next we scroll down to Device Drivers and select it. Then we select usb support. Finally we modularize "USB Mass Storage Support" by pressing "m" while it is highlighted.
We click exit to exit out of our submenus all the way back to the main menu. Hitting exit one more time, will ask if you want to save the kernel configuration, to which we reply yes.
Now we want to build the kernel so we type
make all
This can take a while, depending on your processor, so grab a cup of coffee, read the paper and come back in a little while.
Once that completes, we'll grab a nice script by Dagmar to install the kernel in /boot.
wget http://dagmar.droplinegnome.org/experimental/installkernel
install -m 755 installkernel /sbin/
Then we execute the following to be able to use the new kernel
make modules_install
make install
These commands will install the new modules and copy the config, system.map, and kernel to the proper locations in /boot.
now we'll change to the /boot directory to modify a few things.
cd /boot
It's time to remove the current symlinks to config, System.map, and vmlinuz.
rm config
rm System.map
rm vmlinuz
and then link them to the new kernel.
ln -s config-2.6.29-smp config
ln -s System.map-2.6.29-smp System.map
ln -s vmlinuz-2.6.29-smp vmlinuz
At this point it's a good idea to create an initrd. For ext3 we use the following command. Note that sda3 is my root partition. be sure to alter yours accordingly.
mkinitrd -c -k 2.6.29-smp -m mbcache:jbd:ext3 -f ext3 -r /dev/sda3
For reiser it would be
mkinitrd -c -k 2.6.29-smp -m reiserfs
next, we'll edit lilo to use the initrd.gz. we add the following line above "root = /dev/sda3"
initrd = /boot/initrd.gz
so it will look something like this.
image = /boot/vmlinuz
initrd = /boot/initrd.gz
root = /dev/sda3
label = Linux
read-only
Now we need to run lilo to update it.
/sbin/lilo
That's it. upon rebooting you should now be utilizing your shiny new 2.6.29 kernel. If you somehow messed something up, and you end up with a kernel panic, you can use your slackware 12.2 cd to boot your system in a pinch.
Good luck and happy slacking!
I borrowed heavily from this excellent guide on the dropline wiki.
http://wiki.droplinegnome.org/index.php?title=Building_a_new_2.6.x_kernel_with_Slackware_12.0