Wednesday, November 7, 2012

How to Compile Kernel ?

How to compile kernel ? Change the kernel is the one that not important for you if you have stable kernel with your hardware. Because upgrading a kernel may harm your hardware if you don't know how to configure the kernel configuration. You can see any update of available kernel from www.kernel.org. Every time Linus Torvalds release the kernel source code, you can download from there. The question is, how to compile the kernel and install to my computer ?
  1. First you must download the kernel source code from www.kernel.org
  2. After downloaded, extract with your favorite package manager, or you can do that from terminal and type this command tar -xjvf linux-x.y.z.tar.bz2 -C /usr/src
  3. The source code will be unpack to folder /usr/src
  4. Go to the directory by typing cd /usr/src
  5. Type make menuconfig to configure the kernel before you compile it. 
  6. BE CAREFUL ! There are plenty of configuration that if you didn't careful, the kernel may not work perfectly on your computer. If you don't know how to configure, just leave it default.
  7. To compile, type sudo make. It will took a long time to compile the kernel, about 50 - 60 minutes. 
  8. After finished, type sudo make modules_install install. The command will install the driver for your hardware and after it finished, the kernel will be updated into your system. 
  9. After that, reboot the computer, and the kernel should be in the GRUB list. If didn't, boot with old kernel, go to terminal and type update-grub (GRUB user) [OPTIONAL]
  10. Simple enough to do this, the bad things is that you must wait for a while to compile the kernel. If you have any question, please post here. 
Correct Me If I Wrong :)

No comments:

Post a Comment

Share