how to quickly upgrade a slackware 2.4 series kernel.



First, get the lastest stable 2.4.x source tarball, move it to /usr/src/ and un-tar/bzip it.

wget http://kernel.org/pub/linux/kernel/v2.4/linux-2.4.30.tar.bz2
mv linux-2.4.30.tar.bz2 /usr/src
cd /usr/src/
tar -xjf linux-2.4.30.tar.bz2
ln -s /usr/src/linux-2.4.30 linux

Next get the original config file that your kernel was compiled with. (or, if you custom compiled your kernel, then start with your customized config file, and use this next step to update it to the current kernel verion.)

wget ftp.slackware.com/pub/slackware/slackware-10.1/kernels/bare.i/config
mv config /usr/src/linux/.config
cd /usr/src/linux
make oldconfig

Now, you'll have the source configured exactly like the orignal stock kernel, optionally, you can edit this default kernel. This has a lot of advantages (such as speeding up your kernel, and the time it'll take to compile it!) also, it has some security aspects.. if you don't need a module xyz and later there is a vulnerability found in it, then you are vulnerable for a piece of code you didn't even need. For ease, you can skip this step altogether, but at the least i would recommend remove all the NIC modules you don't need, and choosing to compile in the NIC that you do use. Also, go through the rest of the kernel as see what you don't need.. such as, on my servers sound and usb has been completely removed. (the means my system is in-capable of using them, unless i recompiled the kernel to include them again). But like i said, this is optional, and just sticking with the defaults is okay.

make menuconfig

A very important step, once you're done configuring your kernel, is that you need to edit the Makefile and add an 'extraversion' to it.. i use my name, but you can use anything..

nano Makefile

extraversion = -alex
Next we just compile it.. one quick line that will take from 8 hours (486dx4-66) to 10 minutes (P4 2.8).

make dep clean bzImage modules modules_install

Now to install it:

cp System.map /boot/map
cp arch/i386/boot/bzImage /boot/bzImage
cp .config /boot/config
lilo /etc/lilo.conf

In the lilo config file, you need to add a boot entry for your new kernel, above the current kernel, the top entry will be the default.
image = /boot/bzImage root = /dev/hda2 label = Linux_New read-only image = /boot/vmlinuz root = /dev/hda2 label = Linux read-only # Linux bootable partition config ends
After that, just run lilo to update the boot records..

lilo

and finally (the only time i'll ever mention this in a 'how-to' by me about linux)

reboot

If all goes well, your new kernel will boot with no problems at all.. if something does happen or won't work right, during the boot, just select the other original kernel (thats why its important not to remove the current kernel entry, just to add our own new one) and try again.

Hope this helps.