Monday, June 8, 2009

Build your own Ubuntu Kernel. The Fast guide.

What follows is a quick guide of how to make your custom ubuntu kernel.

First you need to install all the required packages:
sudo apt-get install ncurses-dev kernel-package linux-source build-essential
Next go into /usr/src and extract the kernel source:
cd /usr/src
sudo bzip2 -dc linux-source-2.6.28.tar.bz2 |tar xf -
cd /usr/src/linux-2.6.28
NOTE: You the to change the above lines to match your kernel source file name and extracted kernel source directory name.
Get the existing kernel config used by ubuntu.
sudo cp /boot/config-2.6.15-26-386 .config
Then run the kernel configuration utility.
sudo make menuconfig
Select the Load an Alternate Configuration File and point to .config Exit the utility and save your configuration. You are almost finished. Type the below commands and just sit back and relax while your kernel is building.
sudo make-kpkg clean
sudo make-kpkg --initrd --append-to-version=custom1 kernel_image kernel_headers
When the process completed you will find 2 .deb files in your /usr/src that you can install using the dpkg -i command.
cd /usr/src/
sudo dpkg -i *.deb
You are finished. If you want you can use the update-grub command to make your grub bootloader to update its list with kernel(and make it default selection).
sudo update-grub

No comments:

Post a Comment