Friday, July 18, 2008

Ubuntu 8.04 Kernel Compilation

1) To prepare the necessary tooling, kernel-package libncurese-dev
>sudo apt-get install kernel-package libncurses5-dev

2) To download kernel source from kernel.org.
>cd /usr/src
>sudo wget http://ww.kernel.org/pub/linux/lernel/v2.6/linux-2.6.24.7.tar.bz2

3) To de-compress the kernel sources.
>sudo tar jxvf linux-2.6.24.7.tar.bz2

4) To create a soft link to the kernel source.
>sudo ln -s linux-2.6.24.7 linux

5) To copy the kernel configuration.
> cd linux
>sudo cp /boot/config-'uname -r' .config

6) To config the kernel.
>sudo make menuconfig

7) To clean up the old stuffs first.
> sudo make distclean

8) Exciting now, start to build the kernel source.
> sudo make-kpkg --initrd kernel_image kernel_headers

9) To install the kernel.
>sudo dpkg -i linux-image-2.6.24.7_2.6.24.7-10.00.Custom_i386.deb linux-headers-2.6.24.7_2.6.24.7-10.00.Custom_i386.deb

10) Aftter installation, user can check /boot/grub/menu.lst to ensure the kernel was added to the menu.

11) Reboot. ^_^

No comments: