Ubuntu and kernel compiles

February 14, 2006

There are tons of FAQs online intended to assist in the building a kernel image for Linux operating systems. The problem seems to be that every distribution and FAQ suggests something a little bit different and mileage may vary depending on your distribution and type of hardware being used. The kernel compile always seemed to be a pain for me to keep straight, although I’ve done it a million times by this point, I always seemed to forget to do it in a manner which allowed me to manage it through the apt system on Debian boxes.

The attached link is to the Ubuntu forums detailing all things necessary to get a working Kernel compile in Debian based distros specifically the Ubuntu breezy badger release and 2.6.x kernel releases.

Kernel Compile Ubuntu Forums

The thing of most interest in this FAQ is the patches recommended for the Ubuntu Systems and the process of applying them

NOTE: HOWTO compile from a vanilla kernel from kernel.org

If you want to compile from a vanilla kernel from kernel.org something need to be changed in my guide:

Skip Point 2
You have to download it from www.kernel.org (try the latest stable kernel source)

When you get to Point 3 of the guide and you get to the following lines you have to modify them in this way:

cd /home/your_username_folder/directory_where_you_put_the_downloaded_kernel (instead of cd /usr/src) (e.g. “cd /home/alberto/download” in my case)
sudo tar –bzip2 -xvf linux-source-2.6.12.tar.bz2 /usr/src (use the name of the file you downloaded)
sudo ln -s /usr/src/linux-source-2.6.12 /usr/src/linux (use the name of the file you downloaded)
cd /usr/src/linux

OPTIONAL PATCH (if you don’t need it you can continue with the instructions of Point 3)

At this point if you want to patch your vanilla kernel you have to:

1)Download the patch (I recommend you Kolivas’ patches: go to http://ck.kolivas.org/patches/2.6/ and choose the folder with the name which matches your kernel version (e.g. if you are going to compile “kernel 2.6.14″ get to http://ck.kolivas.org/patches/2.6/2.6.14/). You will see other folders with different versions of the patch: I suggest you to select the latest version (2.6.14-ck3 in this case). Then you have to choose the file “patch-2.6.14-ck3.bz2″ if you have a desktop computer (or laptop) or “patch-2.6.14-cks3.bz2″ if you have a server.

NOTE about KOLIVAS patch: if you want to use Kolivas patches you have to download the 1st stable version of a series of kernels and apply the latest patch to it. I’d better explain it with an example: if you are interested in 2.6.14.x series you have to download the source of 2.6.14 (NOT of 2.6.14.4 or 2.6.14.3, etc.) and to apply the latest Kolivas patch (as it will include the patches which make the difference between e.g. version 2.6.14 and 2.6.14.4)

2)cd /usr/src/linux

3)sudo bzcat /home/your_user_name/folder_in_which_you_downloaded_the_file/patch-2.6.14-ck3.bz2 | patch -p1
(put the name of the file you have downloaded instead of the word I have put in red)

And in Point 4 (this is the 1st thing to do at the beginning of point 4):

Get to “File Systems”.

Select your filesystem (ext3, reiserfs, etc.) with the cursor.( ext3 is the filesystem used by Ubuntu by default, so if you chose automatic partitioning when you installed Ubuntu Hoary then “ext3″ is definitely your filesystem)

Then press the spacebar on the desired filesystem (a “*” will appear beside it). (Make sure there’s a “*” beside it instead of a “M”. In this way the support for you filesystem will be built directly in the kernel instead of being built as a module and you will not get a “kernel panic”)

For example:
select “ext3 journalling filesystem support” and press the spacebar (a “*” will appear beside it).

Press the right arrow and select exit.

Then you can go on with the instructions of Point 4.

If you want to compile a kernel 2.6.13 or higher you have to skip Point 6.

Ubuntu Forums

Entry Filed under: Ubuntu. .

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackback this post  |  Subscribe to the comments via RSS Feed


Calendar

February 2006
M T W T F S S
    May »
 12345
6789101112
13141516171819
20212223242526
2728  

Most Recent Posts