How to update your custom Ubuntu 10.10 kernel

In two previous articles, How to compile a Ubuntu 10.10 (Maverick) kernel and How to compile a Ubuntu 10.10 (Maverick) kernel with sched: automated per tty task groups kernel patch, I described how to create your own custom kernel for Ubuntu 10.10. This article will explain how to update that kernel when a new release of the kernel has come out.

I’ll be doing a follow up on the original article, How to compile a Ubuntu 10.10 kernel. If you followed the article How to compile a Ubuntu 10.10 kernel with sched: automated per tty task groups kernel patch you need to replace core2 with tty through out the this article.

Just to refresh your memory, we have our kernel source in the following directory /d1/development/kernel/maverick/source and we have two branches, master and core2.

Upgrading the source

It’s time to get the new kernel source.
We’re going to update our master branch and use the master branch to update our own core2 branch.

Go to the kernel source directory and check which branch you are on

cd /d1/development/kernel/maverick/source
git branch

The output will look something like this

* core2

The asterisk in front of core2 indicates that is the active active branch.
We need to switch to the master branch.

git checkout master

If you have a problem switching to the master branch and you are stuck in the core2 branch use the following commands

git reset --hard
git clean -xdf
git checkout master

To update the master branch with the latest kernel source we need to pull the sources from the remote git repository

git pull

To check the latest version

git tag -l | sort -V

The output will look something like this


In this case the latest version we can use is Ubuntu-2.6.35-23.40. The versions after that can be disregarded as they are of no use for us.

Updating our version

The point of the article is to update our version of the kernel, including the the changes we have made, therefor we need to switch to our branch.

git checkout core2

In order to update the Ubuntu 10.10 kernel source and keep our changes we need to rebase our tree against the version we want.

git rebase Ubuntu-2.6.35-23.40

The output will look similar to this:

First, rewinding head to replay your work on top of it...
Applying: Core2 modifications

Getting ready for compilation

Sometimes new options are introduced with new kernels and it’s better to update the config files before compilation,

fakeroot debian/rules clean
debian/rules updateconfigs

We’ll backup our version:

cp debian.master/config/i386/config.flavour.core2 ../. 

Now we need to clean up the git tree.

git reset --hard
git clean -xdf

Copy our version back

cp ../config.flavour.core2 debian.master/config/i386/

As we have created our own flavor and added the files to the abi directory we need to move these. First we need to determine the old and new directories in the abi directory.

ls debian.master/abi

The output will look something like this

2.6.35-23.36  2.6.35-23.39  perm-blacklist

We need to copy our files over and remove the old files

cp debian.master/abi/2.6.35-23.36/i386/* debian.master/abi/2.6.35-23.39/i386/
git rm debian.master/abi/2.6.35-23.36 -r

We’ll commit this version to our branch

git add .
git commit -a --amend


It’s finally time for compiling.

fakeroot debian/rules clean

All the packages will be created in the directory /d1/development/kernel/maverick
Create independent packages:

skipabi=true skipmodule=true fakeroot debian/rules binary-indep

Create the tools package:

skipabi=true skipmodule=true fakeroot debian/rules binary-perarch

Create the flavour depended files:

skipabi=true skipmodule=true fakeroot debian/rules binary-core2


After the compilation is finished we’ll have the above packages in the parent directory.

To install the files

cd ..
sudo dpkg -i  linux-headers-2.6.35-23-core2_2.6.35-23.40_i386.deb linux-headers-2.6.35-23_2.6.35-23.40_all.deb linux-image-2.6.35-23-core2_2.6.35-23.40_i386.deb

Check your bootloader if the newly installed Ubuntu 10.10 kernel is the default one, for grub check the file /boot/grub/menu.lst or if you run grub2 check /boot/grub/grub.cfg

Reboot and enjoy your newly installed Ubuntu 10.10 kernel.

This article is filed under the categories Ubuntu » Compile a kernel and has the following tags associated with it: , , .

For more of the same articles see the page Compile a kernel for Ubuntu overview
  • Thanks again, Peter. Walked through the steps and it worked perfectly.

  • Murat

    thanksa so much it is very helpfull