Friday, November 9, 2007

Compiling a Custom Kernel for Ubuntu

  1. Install necessary packages:
    1. apt-get install kernel-package libncurses5-dev fakeroot wget bzip2
  1. Download the kernel sources from www.kernel.org
  2. Extract them
  3. ln -s linux-kernel-version linux
  4. change directory into "linux"
  5. Copy the current kernel's config:
    1. cp /boot/config-`uname -r` ./.config
  6. Start the GUI kernel configuration
    1. make menuconfig
  7. Save the config
  8. Start the compile
    1. make-kpkg clean
    2. fakeroot make-kpkg --initrd --append-to-version=-custom kernel_image kernel_headers
  9. After it's done compiling, which may take 30 minutes or much more you will have to .deb packages in the /usr/src directory, install them
    1. dpkg -i kernel-image-2.6.23-custom_10.00.Custom_i386.deb
    2. dpkg -i kernel-headers-2.6.23-custom_10.00.Custom_i386.deb
  10. verify that the entries are in grub
    1. vi /boot/grub/menu.lst
  11. reboot

No comments: