Ubuntu 12.04 LTS Kernel Compile Guide

http://linuxtweaking.blogspot.com/2012/08/ubuntu-1204-lts-kernel-compile-guide.html

 

Important Note: 

https://wiki.ubuntu.com/PrecisePangolin/ReleaseNotes/UbuntuDesktop#PrecisePangolin.2BAC8-ReleaseNotes.2BAC8-CommonInfrastructure.Ubuntu_Kernel_3.5.0-23.35

Whether it’s for educational purposes, tweaking or curiosity, compiling a Kernel in Ubuntu 12.04 LTS is generally a straight forward exercise. However, it can be a little more complex depending on what sources are used, for example GIT or a vanilla kernel from kernel.org.

This guide goes for the easiest method and demonstrates how to compile the Ubuntu 12.04 LTS Kernel using apt-get sources.

It is not intended to be a comprehensive guide to kernel compiling, just something to get you started and as a quick reference for Ubuntu 12.04 LTS users.

Before you attempt using this guide please make sure your Ubuntu installation is fully up to date. Use the ‘Update Manager’ program and if you need to reboot after the update please do.

The Kernel Compile Guide

Install required packages

sudo apt-get install libncurses5-dev kernel-package

Create a source directory

mkdir ~/src

cd ~/src

Download the kernel source into your source directory

apt-get source linux-image-$(uname -r)

Configure your Kernel 

cd linux-3.2.0

make menuconfig

Speed up the build

export CONCURRENCY_LEVEL=2

General rule is CONCURRENCY_LEVEL = number of processor cores + 1

Compile the Kernel

time fakeroot make-kpkg –initrd –append-to-version=-tweak kernel-image kernel-headers

You can change -tweak to anything you wish

Install your compiled Kernel

cd ~/src

sudo dpkg -i linux-image-3.2.24-tweak_3.2.24-tweak-10.00.Custom_amd64.deb

sudo dpkg -i linux-headers-3.2.24-tweak_3.2.24-tweak-10.00.Custom_amd64.deb

Reboot

Ubuntu should boot with your new Kernel by default, if not you may have to edit Grub or enable the Grub menu to be displayed during boot.

Enjoy tweaking!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s