Search This Blog

Loading...

Popular Posts

Sunday, 6 February 2011

How to compile a kernel from kernel.org in Ubuntu 10.04 LTS

This quick how-to is based on http://linuxtweaking.blogspot.com/2010/05/how-to-compile-kernel-on-ubuntu-1004.html

Open a terminal and work through the following set of commands.

Install these packages

sudo apt-get install fakeroot kernel-wedge build-essential makedumpfile kernel-package libncurses5 libncurses5-dev

Run this

sudo apt-get build-dep --no-install-recommends linux-image-$(uname -r)

Create your source directory

mkdir ~/src
cd ~/src

Download and extract your kernel


You can browse for kernels at http://www.kernel.org/pub/linux/kernel/v2.6/ This guide is using kernel 2.6.37.

wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.37.tar.gz
tar xvf linux-2.6.37.tar.gz
cd linux-2.6.37

Configure your Kernel

make menuconfig

Build your Kernel

export CONCURRENCY_LEVEL=3
make-kpkg clean
time fakeroot make-kpkg --initrd kernel-image kernel-headers

General rule, concurrency level = number of processor cores + 1


Install your kernel

cd ~/src

dir        
sudo dpkg -i linux-image-2.6.37_2.6.37-10.00.Custom_amd64.deb
sudo dpkg -i linux-headers-2.6.37_2.6.37-10.00.Custom_amd64.deb

Create the initramfs image

sudo update-initramfs -c -k 2.6.37

Update your grub.cfg

sudo update-grub

Reboot your system


Enjoy your new kernel.

4 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Thanks, this really helped me, I've saved this page to my PC for future use.

    ReplyDelete
  3. Failed to create ./debian directory. This message in all cases

    ReplyDelete
  4. P, note the date this blog entry was created, Sunday, 6 February 2011

    A Ubuntu 10.04 installation with updates applied post 2011 may therefore be using an incompatible kernel config file.

    Substitute kernel 2.6.37 in the guide with something else, perhaps more recent.

    Unfortunately I do not have a 10.04 install atm but out of curiosity I may installing in a VM to test.

    Will post back the results.

    ReplyDelete

Note: only a member of this blog may post a comment.