This document describes kernel compiling for versions 2.4.x and less. A brief note about 2.6+ kernels. 2.6+ kernels are more simple, since the individual steps for make dep, make clean, make bzImage, and make modules are all done by default when running 'make'. After configuring your kernel, 'make menuconfig' for example, type 'make help' to find out what your 2.6+ kernel will do when you run 'make'. On with the 2.4.x and less info. Please read paragraph at the end of this document before anything else! If your re-compiling ( you already have a linux-x.x.x in /usr/src, and a symlink of linux > linux-x.x.x), then: 'cd /usr/src/linux' or 'cd /usr/src/linux-x.x.x' (same thing if symlink is there). The linux symlink should always point to your current linux kernel tree. It's best to have a symlink of "linux" pointing to "linux-x.x.x". Whenever you get a a new kernel, you then remove "linux", which is the symlink, unpack the new kernel into /usr/src, mv the new "linux" directory to "linux-x.x.x" (where x.x.x is the new kernel), and link linux to the new kernel tree. 'ln -s linux-x.x.x linux'. You can delete the old linux-x.x.x kernel directory if you want or need, or keep it if you ever want to go back and recompile the old kernel. Whew! The following commands are put in quotes ('')to distinguish from regular text or comments. Do not type the quotes! 'make mrproper' 'make menuconfig' or 'make config' or 'make xconfig' for a graphical config (only in X), or 'make oldconfig' to rebuild the current kernel with the same settings. Whichever you choose is a matter of choice and preference. after going through and selecting what you want, select 'save'. You can also save a copy of your config somewhere for easier recompiling, which you would then select "Load an alterenate config ...". 'make dep' 'make clean' 'make bzImage' 'make modules' at this point you might want to back up the current modules installed. 'cd /lib/modules' 'tar zxvf modules-x.x.xxbackup.tar.gz 2.x.xx/' you should have a tarball there, just move it somewhere safe. you can then delete the /lib/modules/2.x.xx directory (NOT /lib/modules itself). Now go back to kernel tree. 'cd /usr/src/linux' 'make modules_install' 'cp System.map /boot/System.map-x.x.x' (where x.x.x = (new) kernel version) 'cp arch/i386/boot/bzImage /boot/vmlinuz-x.x.x' (same as above) 'cd /boot' make sure you have the symlinks "System.map" and "vmlinuz" pointing to your current System.map-x.x.x and vmlinuz-x.x.x. 'ls -ll' you want to see "System.map --> System.map-x.x.x" "vmlinuz --> vmlinuz-x.x.x" If not, then: 'rm System.map vmlinuz' and 'ln -s System.map-x.x.x System.map' 'ln -s vmlinuz-x.x.x vmlinuz' 'ls -ll' to check for proper symlinks. Now, which is most important, is to edit lilo.conf using your favorite text editor. It's best to keep your old kernel in case the new one will not boot. In lilo.conf, you will see an "image" section. Copy the whole image section and place it ABOVE the current one. For example, if you see: image=/boot/vmlinuz label=linux root=/dev/hdax append="" read-only then copy and paste it above so you see this: image=/boot/vmlinuz label=linux root=/dev/hdax append="" read-only image=/boot/vmlinuz label=linux root=/dev/hdax append="" read-only Now in the second section, point the image to the old kernel, AND rename the label to something like linux.old: image=/boot/vmlinuz label=linux root=/dev/hdax append="" read-only image=/boot/vmlinuz-x.x.x # where x.x.x is your old kernel label=linux.old root=/dev/hdax append="" read-only See how this works, fairly simple once you do it a couple of times. Lilo automatically boots the first image section. Now you MUST run lilo. 'lilo -v' And there should be no errors. If there is, re-open lilo.conf and make corrections. Thats it! When you reboot, linux should boot to your newly compiled kernel. If something goes wrong, and the new kernel will not boot, then reboot, and as soon as you see "LILO" appear, hit the key, which will give you a choice of all the images listed in lilo.conf. You could then type "linux.old" to boot to your old kernel. It's always safe to have at least one old kernel to boot, just in case. After a few brand new kernel compiles, you'll have some old System.map-x.x.x vmlinuz-x.x.x's in your /boot directory. You can safely delete the ones not listed in your lilo.conf. !!Very Important!! Disclaimer: Please read the LILO-howto and kernel docs and README. This is an unofficial kernel-compiling tip and is in no way connected to kernel.org or anything or anybody else. This document should be taken "as is", and there is no guarantee that any of this will work for you. This process DOES work for the writer, but do not send email if any problems or questions come up. The writer of this document will not take any responsibility for any use of this document. Although the writer has taken care to insure that all steps have been included, there is the possibility that something or some steps have been overlooked. This document in no way replaces any official doc or HOWTO.