Recompiling Linux Kernel

How to add a new kernel to linux OS and compile it and use it, the following points discusses that.
Step 1: Download a new kernel from (recent version is 2.6.33)
Step 2: you may get the file either as a .tar.bz2 file  or .tar.gz file
Step 3: untar the file in the /usr/src directory (for installing you need to be a root user)
if it is a bz2 file, then execute tar jxvf filename.tar.bz2 –C /usr/src
if it is a gz file, then execute tar zxvf filename.tar.gz –C /usr/src
Step 4: go to the folder /usr/src using the command cd /usr/src

Step 5: Execute the following 

    Execute any one of the following command

  • make config (for text mode)
  • make menuconfig
  • make xconfig (for X window)
  • make gconfig (this command is preferred)

Step 6: make  (will take atleast 30 minutes to complete, be patient)
Step 7: make modules
Step 8: make modules_install
Step 9: make install
Once done, reboot the system, your grub loader is updated with one more kernel.
(NB: in the previous flavors of linux, the following are the set of commands

  • make xconfig
  • make dep
  • make
  • make bzImage
  • make modules
  • make modules_install
  • make install    )

2 thoughts on “Recompiling Linux Kernel”

  1. Implementing a new system call in Kernel version 2.6.32 «

    […] the new system call Step 1: Recompile and install the new kernel so that our system call becomes available to the operating system. go to the kernel folder and give […]

Leave a Reply