Page 1 of 1

Compiling your own Linux kernel Configure, compile, and install your very own Linux kernel! Rate Topic: -----

#1 no2pencil   User is online

  • Professor Snuggly Pants
  • member icon

Reputation: 6642
  • View blog
  • Posts: 30,932
  • Joined: 10-May 07

Post icon  Posted 11 July 2007 - 09:21 PM

Compiling your own kernel
(Configure, compile, and install your very own Linux kernel!)

Knowing your hardware:
Prior to doing this, youll need to gather as much information about your computer as you can. The processor, motherboard, audio card, network interface card, modem, or any other devices that will need specific modules loaded into the kernel.

Downloading the kernel source:
After a visit to, youll be able to download the kernel from either ftp or http. A good place to download this file to is /home/*userid*/downloads or /downloads. A copy of it should also be placed in /usr/src. That is where we will be working from.

Unpacking the kernel:

Everything that we will be doing here will require that you have root privileges.
cd /usr/src
mv linux linux-2.4.6 (or whatever your current version is)
gunzip linux-
tar xvf linux-
ln s linux- linux
cd linux

Assuring a back-out:
You want to leave your existing kernel in-tact, just in case you've made a mistake or your new kernel won't boot. We will do this by backing up a few files & directories shown below.

mv arch/i386/boot/bzImage /boot/vmlinuz
mv /boot/
mv /boot /boot_2.4

Pick your poison, making your menu:
Xwindows :
make xconfig

Terminal :
make menuconfig
* this is the one that I use.
Yes/no/module :
make config
* this takes forever!

Inside of the menu is where we will select of the modules to install for your devices.

What exactly is a kernel module?
Modules are pieces of code that can be loaded and unloaded into the kernel upon demand. They extend the functionality of the kernel without the need to reboot the system. An example of one type of module is the device driver, which allows the kernel to access hardware connected to the system. The alternative to building a module, is compiling the code into the kernel, and add new functionality directly into the kernel image. Besides having larger kernels, this has the disadvantage of requiring us to rebuild and reboot the kernel every time we want new functionality. Obviously, this is one of the advantages over using MS Windows.

Compiling your kernel:
Now that we have selected which modules to install into our new kernel, we will now compile the kernel.
make dep
make clean (for older kernels)
make bzImage
make modules
make modules_install

Everyone needs a boot loader.
The two main boot loaders that youll find are lilo & grub. Lilo, stands for Line In Line Out. Unlike lilo, grub is a graphical boot loader. Both lilo & grub allow you to choose an Operating System to boot from a menu. This allows you to install Linux & MS Windows onto the same machine.

Reboot & enjoy:
Your new kernel should now be installed! & if all went well, issuing the reboot command should boot up your new kernel.

Is This A Good Question/Topic? 0
  • +

Replies To: Compiling your own Linux kernel

#2 k.sangeeth   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 62
  • Joined: 27-July 07

Posted 02 August 2007 - 09:49 PM

great one
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1