Compiling Kernel – II
Get yourself a copy of the new kernel .you can
download it at
Here you will find out many packages
Get the latest kernel code for 2.6 kernel from
More keep on coming every fortnight.
If you do not want to download the new kernel
you can use the one you got with your installation.
Many distributions provide source packages
also along with their Distributions
You can compile it also, that also will
increase your performance.
Extract the kernel source file to /usr/src
Copy the tar archive to /usr/src/ and then
tar xvzf linux-2.6…tar.gz
tar xvjf linux-2.6…tar.bz2
**”Change Directory To /usr/src”**
**”check for symlink (ex. /usr/src/linux->/usr/src/linux-2.6.5)”**
ln -s /usr/src/linux-x.x.x /usr/src/linux
**”make a new link to the new kernel”**
**”type this to change to the directory”**
**”this removes the current .config and other files”**
**”basic config from terminal”**
**”for ncurses GUI in the terminal”**
**”for X-based GUI with modular explanations”**
Don’t forget to add module support and kernel support for future hardware.
Do not compile your hard drive and file system type as a module.
The configure program enables you to specify an enormous number of features. It
is advisable to skim through all the sections to get a feel for the different
things you can do. Most options are about specifying whether you want a feature
[*] compiled into the kernel image, [M] compiled as a module, or [ ] not
compiled at all. You can also turn off module support altogether from Loadable
module support –>. The kernel configuration is one LINUX program that
offers lots of help–select on any feature. The raw help file is
/usr/src/linux/Documentation/Configure.help and is worth reading.
When you’re done the config click exit and save current configuration. Your
file is now known as .config.
(vi, pico, emacs) Makefile
**”Want A Unique Kernel Name? Edit /usr/src/linux/Makefile and change
like I have this in my Makefile
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 11
EXTRAVERSION = gm132
So my kernel will be called as 2.6.11gm132
**”to clean your sources for they compile correctly”**
**”to make the kernel image (compile and creates compressed image of
(note the capital ‘I’ here)
**”compile your selected modules”**
**”to install newly compile modules (installs to /lib/modules/linux.x.x.x)”**
Now Its Time To Install Your New Kernel~!
copy the newly created kernel and system.map to /boot
cp /usr/src/linux/arch/i386/boot/bzImage /boot/vmlinuz-x.x.x
cp /usr/src/linux/System.map /boot/System.map-x.x.x
I keep the name of vmlinuz as
Make the new links:
ln -s /boot/vmlinuz-x.x.x /boot/vmlinuz
ln -s /boot/System.map-x.x.x /boot/System.map
Next remove existing initrd.img file:
rm -rf /boot/initrd.x.x.x.img
..And create the new one:
/sbin/mkinitrd /boot/initrd-x.x.x.img x.x.x
The last set of x.x.x is the equivalent to your new kernel version and it looks
to /lib/modules for that version.
Use The Steps That Pertain To You
If You Use Grub Then Edit grub.conf
If You Use lilo Then Edit lilo.conf
And Finally Edit Your /etc/grub.conf file
title New Kernel
kernel /vmlinuz-x.x.x ro root=LABEL=/
look at the previous parameters in the grub.conf file and note what
“root=” and use what is existing.
Exit and Save grub.conf
And Finally Edit Your /etc/lilo.conf file
image = /boot/vmlinuz-x.x.x
label = New Kernel
root = /dev/hdx
look at the previous parameters in the lilo.conf file and note what “root
=” and use what is existing.
Exit and Save lilo.conf
as requested there was wanting the instructions on how to apply patches to your
this step comes after untarring your kernel source.
When you download the patch place it in the folder that you untarred you new
patch -E -p1 < sound_patch
purely an example and you would type whatever the file name is in replace of
As of having alternative boot options, well this is no problem… The stuff
above that I tell you to add to your lilo or grub file above could just append
the file, and just add “.old” to the title of your original kernel
name for you will know the difference. And whether its grub or lilo adds
“read-only”, to the end of the original entries in the lilo.conf, or