How to compile Kernel 2.6.36.2 in Ubuntu with the 200-line patch

Many of you seem to have had a problem installing the Kernel precompiled with the 200 line patch on your machines, this is to be expected, so it is always better to have a Kernel directly compiled in our machine than in a foreign machine, so that it correctly takes the architecture of our machine and the general configuration of the hardware.

For this reason, here I teach the most daring, how to compile their own Kernel (2.6.36.2) in Ubuntu (tested in Ubuntu 10.10) with the 200-line patch included in it. Remember that this process should be done at your own risk, it requires a large number of packages to download and a fairly long compilation time.

To begin, the first thing we must do is install the necessary dependencies for the kernel compilation by executing the following line in the terminal:

sudo apt-get install fakeroot build-essential crash kexec-tools makedumpfile kernel-wedge kernel-package

Now let's execute the following line in the terminal, which is necessary to compile the Kernel (from Intrepid)

sudo apt-get build-dep linux

We finish this first step with the installation of other packages necessary for the compilation

sudo apt-get install libncurses5 libncurses5-dev libelf-dev asciidoc binutils-dev

To continue with the kernel installation process, we must download the sources of the latest stable kernel (2.6.36.2) and the patch of Mike galbraith and locate them within our personal directory.
Let's create a directory for the kernel compilation, we go to it and download the kernel sources from kernel.org:

mkdir kernel-2.6.36.2 cd kernel-2.6.36.2 wget http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.36.2.tar.gz

Now we create a new text file and we will copy the code that we will find in Mike Galbraith's post or we can download it from MediaFire, save and close the file:

gedit ~ / autogroup.patch

Mike Galbraith's Official Post
Mike Galbraith Patch from MediaFire

Now we are going to unzip the Kernel that we just downloaded from kernel.org:

tar xzvf linux-2.6.36.2.tar.gz cd linux-2.6.36.2 patch -p1 <~ / autogroup.patch

At this point everything should go well and without errors, in case of having an error it is necessary to restart the process.
Next we will load the current Kernel configuration, this so that the new Kernel takes the configuration directly from our system and we will not have any problems when compiling it. Even so, if you have enough knowledge you can customize the kernel configuration to obtain a system more tailored to your needs, you can do it.

If you don't know what you are doing, it is better not to manually modify the kernel configuration.

We copy the configuration by executing the following command in the terminal and later we execute

lsmod

so that all the modules loaded in our system are executed and we make sure that all our hardware is recognized.

cp -vi / boot / config-`uname -r` .config make localmodconfig

At this point the compilation process will ask you several questions about the modules, continue accepting all the questions that are asked by pressing Enter until the setup process is complete.
We continue the kernel compilation by executing the following line in the terminal to open the kernel configuration menu:

cp / boot / config - $ (uname -r) .config && yes "" | make oldconfig make menuconfig

Now we can choose the patches that we want to enable in our Kernel, since we are interested in the 200-line patch.
To do this, we navigate through the kernel configuration menu that appears, until

General Setup

and we look for the line with name

Automatic process group scheduling

, we enable it by pressing the space bar on our keyboard, we position ourselves on the option

Exit

using the arrow keys on the keyboard and press the key Enter from our keyboard to exit the menu

General Setup

.

Linux Kernel Configuration - General Setup

Linux Kernel Configuration - Automatic Process Group Scheduling

Now we navigate to the menu

Kernel hacking

and we enter by pressing the key Enter, we look for the option

Compile the kernel with debug info

and we deselect it by pressing the space bar on our keyboard, again we go to the option

Exit

And we pressed Enter to exit the main menu.

Linux Kernel Configuration - Kernel hacking

Linux Kernel Configuration - No Compile the kernel with debug info

We have finished the kernel configuration, so we only have to go back to

Exit

in the main menu and press Enter to finish the kernel configuration. We accept when it asks us if we want to save the changes made to the kernel configuration by pressing Enter on the Yes option.

Now yes, we are going to compile the Kernel by executing the following line in the terminal:

fakeroot make-kpkg --initrd --append-to-version = -20101209 kernel-image kernel-headers

Please note that the build process may vary depending on your hardware

This will generate two .deb packages inside the kernel-2.6.36.2 directory, which we will use to install the new Kernel in our Ubuntu allowing them to be traceable by Synaptic and easily removable.

We come to the final part of this tutorial, where we are going to install and test the proper functioning of the new Kernel that we have just installed.

To install the two .deb packages that we have just generated we must execute the following command in the terminal:

cd .. sudo dpkg -i * .deb

If everything went well, we restarted our machine and in the list of Grub, we select the new Kernel (2.6.36.2) and press Enter to start the system.
Once we are back on the desktop, we will verify that the 200-line patch is correctly applied and working by executing the following line in a terminal:

cat /usr/src/linux-headers-2.6.36.2-20101219/.config | grep -i AUTOGROUP

And it has to return a line like this:

CONFIG_SCHED_AUTOGROUP = y

If so, we have our system running with it. Kernel 2.36.6.2 and "Automatic process group scheduling" activated.
Ubuntu 10.10 Maverick Meerkat with Kernel 2.6.36.2 and Automatic process group scheduling

We can already stress Ubuntu to the maximum ...

This manual comes to you thanks to the effort of FRANCOBEP.


10 comments, leave yours

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   horacio said

    Hi David

    my question is:

    I usually use the kernels of the ubuntu ppa (https://launchpad.net/~kernel-ppa/+archive/ppa)

    These no longer come with the 200-line patch included?

    Thank you

    1.    David Gómez said

      See, I'm still checking to see if the Ubuntu PPA kernel has the patch included, but this is easy to find out for yourself, just run the command cat /usr/src/[versión del último kernel]/.config | grep -i AUTOGROUP, where you would change the text inside the brackets for the version of the latest kernel on your machine.

      If you get a reply message like this CONFIG_SCHED_AUTOGROUP=y, then you have the patch installed.

      Note: to know the version of all the kernels installed on your computer, you just have to execute the command ls /usr/src/ In the terminal.

    2.    David Gómez said

      Horacio, the Ubuntu PPA Kernel currently has the V4 patch of Mike glabraith in the words of himself Tim gardner (Canonical developer).

      We're carrying V4 of Mike Galbraith's auto-cgroup patch since 2.6.37-6.16, but I expect that to change in favor of upstream tip as we move forward into the 2.6.38 merge window.

      sched: automated per session task groups V4

      rtg


      Tim gardner

  2.   kanito said

    Well, I already compiled it and it is installed,…. at least the system did not die now to work to see how it works

  3.   Irving said

    Excellent tutorial. I followed the steps to the letter and everything worked perfectly. I have my new kernel.

    Note: I only made one change that sounded logical to me and it was here:

    cp -vi / boot / config-`uname -r` .config
    make localmodconfig

    I did it like this:

    cp -vi / boot / config-`uname -r` .config
    lsmod
    make localmodconfig

  4.   kanito said

    now i realize i made a little mistake so i will reinstall it ... and add the irving modification : Mrgreen:

  5.   sergio said

    I stay at the beginning a:
    init: unread main process (362) terminated with status 5
    Well, it seems to work well, what could it be ??? '

  6.   brian said

    Well very good the manual, they also posted it on taringa, at this moment it is compiling the kernel I hope it has gone well I just change the type of processor in the menuconfig I hope you have chosen well by opting for Intel core / newer xeon since I have an intel core i3 processor, greetings and thanks for the input

  7.   thedemon007 said

    Hello, well, the command seems better to me

    cp / boot / config-`uname –kernel-release` ./.config

    since it uses the most recent kernel configuration installed

  8.   darkwolf22 said

    Hello, how are you? I only have a slight doubt… in the kernel file comes both the 32-bit and 64-bit versions? or to get the amd64 version do I need to download a different one?… By deduction, both versions should come in the same right?… very good explanation!

    Thank you!