|
Introduction
|
|
I have a VERY rough guide ready, and I mean rough. Basically, what I do before preparing one of my official guides is I go through the whole process and write notes down in txt form. Then I go through again on different distros and see if it works the same. Once that's done I format it into a full guide with little caveats you might run into. Right now, this rough guide only covers Fedora Core 3 directly, but it will work if you know how to move around your system a bit.
DISCLAIMER: If you have any doubts about compiling a kernel, don't do it. You can end up with a non-functioning system if the instructions aren't followed 100%. I'll have a full guide up after a while which will point out little things that can go wrong. Again, if you have doubts, wait.
|
Steps
|
|
Vadakill's Compiling the kernel on Fedora Core 3:
http://www.vadakill.com
Let's get started. Log in as root to your server.
# cd /usr/src
Change to the src directory
Go to www.kernel.org and locate the kernel you want. I chose the following kernel:
# wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.10.tar.gz
untar the file into directory structure
# tar zxvf linux-2.6.10.tar.gz
Change into the kernel source root
# cd linux-2.6.10
Clean up old settings and preps it for new configuration
# make clean
# make mrproper
Change the EXTRAVERSION in the Makefile so it won't overwrite your standard kernel:
# vi Makefile
Change the line
EXTRAVERSION =
to:
EXTRAVERSION = -Hz_100
or
EXTRAVERSION = -Hz_200
Now we will actually change the Hz setting in the kernel source depending on
what you want to get for performance. If you change the Hz setting to 100 it
will interrupt the kernel every 10ms (server limited to 50fps) or 200 (server
limited to 100 fps):
# vi include/asm-i386/param.h
Change the line that looks like this:
# define HZ 1000 /* Internal kernel timer frequency */
to this:
# define HZ 100 /* Kernel interrupt every 10ms - Internal kernel timer frequency */
or this:
# define HZ 200 /* Kernel interrupt every 5ms - Internal kernel timer frequency */
Hit ESC twice, then hit SHIFT+ZZ to save and close the file.
Copy your existing kernel .config file to your new kernel src directory so
you don't have to start from scratch or if you want to leave your current
kernel settings alone and just add some new modules:
# cp /lib/modules/2.6.9-1.667/build/.config .config
for a single processor system, or if you have a P4 HT processor:
# cp /lib/modules/2.6.9-1.667smp/build/.config .config
# make oldconfig
This will prompt you to enable any NEW features that have been included
between your old kernel and the new kernel, most of the time just hitting
enter and accepting the defaults is fine unless there is something new and
cool you want to try.
# make menuconfig
Makes the graphical kernel configuration menu show up if you want to add or
change anything else.
# make bzImage
This will take a while, look for the final line "BUILD
arch/ix86/boot/bzImage" when done.
# make modules
This will compile the options you chose in menuconfig as loadable modules
for the kernel.
# make modules_install
Install all driver modules and loadable modules to thier proper places
# make
Sanity check to ensure everything is built properly
# make install
Install the kernel, create proper lilo.conf or grub.conf records and build
an initrd.img file.
Now reboot the system. At start up, it will not usually choose the newly
built kernel as default. You will have to select it and see if it runs
without a kernel panic.
If all is well, you should then edit the
/boot/lilo.conf or /boot/grub/grub.conf file and set the new kernel as
default.
#vi /boot/grub/grub.conf
Change "default=1" to "default=0" and save changes. Try rebooting again without
intervention to make sure it selects the correct kernel.
|