Ok, the kernel compile (assuming you already tried to follow the various threads and guides and they didn't help...):
Grab the latest **stable** kernel:
(2.4.21 is the latest stable click the "F" next to that)
Save it to a directory you have write privileges to (we are gonna move it after it's done).
Once it's done (assuming you saved it to /home/kernels) we will need to become root:
ROOT PASS (enter root's pass there)
mv /home/kernels/linux-2.4.21.tar.bz2 /usr/src
Then we will change to /usr/src:
And untar the kernel:
tar xvjf linux-2.4.21.tar.bz2
If you have a fast computer, good, just sit back for a minute or 2. If you've got a Slow CPU and no RAM, go grab yourself a java, a cup of Chai Tea, have a round of golf, come back and have dinner, take a nap, and then come back to see it finish up (not really, but it could take a good 15 minutes depending on how slow, I just dropped down to a Pentium 1 laptop, it took me around 15 minutes on that thing! On my 900mhz Athy, ~1 minute
After it's extracted you'll be returned to a prompt, so now enter the newly created directory:
And (we should still be root):
The make xconfig requires you to be in an X session that root owns (meaning you will have to have started X as root or given root permissions using xhost or something similar). You can use other things like:
However for first time kernel compilers this can look overwhelming (more so than xconfig does) but it's your choice. Whatever you have to do to get to the kernel compiling options screen, that's where you will want to be.
Now comes the part that really not many people can help you with, you have to find what hardware you have, and what is necessary for it's support and your day to day operations within linux.
Sounds scary doesn't it? Don't worry, nothing is set in stone, and EVERYONE has to do trial runs with their kernels to fine tune em. Go through and read the help files next to the options in each category. Notice the ones that apply to your hardware and needs, and use it. My personal rule of thumb for compiling in versus module (Y or M) is:
If I use it everyday, and it's a required option to get my system running, it's compiled in. If it's something I occasionally use, it's a module.
So go through, do your best, and when you are done, click exit. It will ask if you wanna save your current config, say yes. Then you will be returned to a prompt and it should suggest you run 'make dep' now; so we will:
After this finishes (go get some more chai tea and coffee)
We will clean it up, save ourselves some room, and make things tidy:
I wish I could clean my house this easily
After that finishes we need to create the modules you decided you wanted:
We want to not overwrite the current setup, and we are gonna assume you are already using a 2.4.21 kernel (just for reference sake, not that it fits your situation, but you could use the info some day
), so let's move the current directory containing the modules outta the way:
mv /lib/modules/linux-2.4.21 /lib/modules/linux-2.4.21.old
And now that we have finished the make modules command, we will install them:
It is now creating the necessary directories in /lib/modules/linux-2.4.21 (good thing we backed up the original working directory first eh
) and copying the modules that were compiled into them directories, creating files that know where each module is for quick reference for module calls and other things we aren't too concerned about at this point in our linux days
Now we need to make the kernel. I prefer smaller size files for faster kernel loads (I'm a speed freak, what can I say
) so we will use bzip compression on the kernel with:
Sit back, grab yourself some water to help cleanse your system of all that coffee and chai tea you've been drinking all day, watch an episode of the Simpson's, and come back, hopefully there are no errors (with any of the steps) however if this is your first compile, it's likely there is. Usually due to dependencies. You should look at the error, see what's missing, open back up the kernel configuration tool you used (xconfig or menuconfig) and add that into your kernel too. Start back over, through each step, do this again and again until you finally get to the end and you have a complete kernel. To know when you have one, you should see a message saying something like:
kernel image is too big for standalone floppy. OR you will see the size of the bzImage and no errors. Either way, the kernel is done, and you can now copy it over to the necessary directory for booting it.
From the command prompt type:
cp arch/i386/boot/bzImage /boot/vmlinuz-newkernel
Where -newkernel is WHATEVER you want it to be, I tend to be simple and use pretty much 'newkernel'
Then copy over the system map:
cp System.map /boot/System.map-newkernel
(remember, don't leave your kernel source tree, stay in the directory where you have been running make xconfig and everything)
And now, your distro utilized mkinitrd to get things setup, so (I've never had to use mkinitrd, so YMMV and I apologize if you have to go outside this thread (run a search) for this part of the compile):
mkinitrd /boot/initrd.linux-2.4.21 linux-2.4.21
And finally, let's make the symlink:
ln -sf /usr/src/linux-2.4.21 /usr/src/linux
This is necessary for certain applications that need to know what kernel version you are running.
As for adding it to your boot loader, consult your distro's documentation, or do a search on Grub (assuming you went with the default) on the site. I use LILO so really can't help ya there. But beware, do not overwrite your current, working kernel. You will want make another entry along side the existing one, then if the new one doesn't boot or whatever, you have somewhere to fall back to.
Good Luck, and HTH