next up previous contents
Next: Trees Up: The kernel, patches, trees Previous: Patches   Contents


Ketchup

The ketchup tool allows us to download any version of the kernel source code quickly and easily as well as to transform given kernel tree into another one. It does this quite intelligently, checking the current version and downloading only the required patches.

The users of Debian testing/unstable can simply install the ketchup package with the help of their favorite tool, eg.

# apt-get install ketchup
Still, for the users of Debian stable or another distribution in which the ketchup tool is not available the easiest way of installing it is to do:
$ mkdir ~/bin
unless the subdirectory bin is already present in the user's home directory, and
$ cd ~/bin
$ wget http://www.selenic.com/ketchup/ketchup-0.9.8.tar.bz2
$ tar xjvf ketchup-0.9.8.tar.bz2
It is also necessary to install the python package.

You should remember that ketchup is able to check the signatures of the downloaded patches. For this reason it is recommended to visit the web page at http://www.kernel.org/signature.html and save the current key in a text file (we have never managed to make $ gpg --keyserver wwwkeys.pgp.net --recv-keys 0x517D0F0E work on our systems). Next, you can do

$ gpg --import the_file_containing_the_kernel.org_key
and you are ready to check how the whole thing works. Namely, you can do
$ mkdir ~/tree
$ cd ~/tree
$ ketchup -m
and you should get an error message similar to the following one:
Traceback (most recent call last):
  File "/usr/bin/ketchup", line 695, in ?
    lprint(get_ver("Makefile"))
   File "/usr/bin/ketchup", line 160, in get_ver
     m = open(makefile)
 IOError: [Errno 2] No such file or directory: 'Makefile'
This only means that there is no Linux kernel tree in the current directory. You can order ketchup to download the latest ''stable'' version of the kernel by using the command ''ketchup 2.6-tip'':
$ ketchup 2.6-tip
None -> 2.6.16.1
Unpacking linux-2.6.15.tar.bz2
Applying patch-2.6.16.bz2
Downloading patch-2.6.16.1.bz2
--21:11:47--  http://www.kernel.org/pub/linux/kernel/v2.6/patch-2.6.16.1.bz2
           => `/home/michal/.ketchup/patch-2.6.16.1.bz2.partial'
Resolving www.kernel.org... 204.152.191.5, 204.152.191.37
Connecting to www.kernel.org|204.152.191.5|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5,284 (5.2K) [application/x-bzip2]

100%[====================================>] 5,284          6.19K/s

21:11:49 (6.18 KB/s) - `/home/michal/.ketchup/patch-2.6.16.1.bz2.partial'
saved [5284/5284]

Downloading patch-2.6.16.1.bz2.sign
--21:11:49--  http://www.kernel.org/pub/linux/kernel/v2.6/
		patch-2.6.16.1.bz2.sign
           => `/home/michal/.ketchup/patch-2.6.16.1.bz2.sign.partial'
Resolving www.kernel.org... 204.152.191.37, 204.152.191.5
Connecting to www.kernel.org|204.152.191.37|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 250 [application/pgp-signature]
 
100%[====================================>] 250           --.--K/s

21:11:49 (18.34 MB/s) - `/home/michal/.ketchup/
patch-2.6.16.1.bz2.sign.partial' saved [250/250]

Verifying signature...
gpg: Signature made wto 28 mar 2006 09:37:31 CEST using DSA key ID 517D0F0E
gpg: Good signature from "Linux Kernel Archives Verification Key
 <ftpadmin@kernel.org>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: C75D C40A 11D7 AF88 9981  ED5B C86B A06A 517D 0F0E
Applying patch-2.6.16.1.bz2
Now you can check if you really have the latest stable tree:
$ ketchup -m
2.6.16.1
As you can see, ketchup automatically downloads the necessary patches. It can also take patches from the ~/.ketchup subdirectory of the user's home directory, so it is a good idea to put the patches that you already have in there.

Making a transition to another kernel tree is absolutely not a problem for ketchup. For this purpose you can simply use the command ''ketchup kernel_version'', eg.

$ ketchup 2.6.16-rc4-mm1
2.6.16.1 -> 2.6.16-rc4-mm1
Applying patch-2.6.16.1.bz2 -R
Applying patch-2.6.16.bz2 -R
Applying patch-2.6.16-rc4.bz2
Applying 2.6.16-rc4-mm1.bz2
Similarly, if you want to get the latest kernel version from the -rt branch, you can do
$ ketchup 2.6-rt
and the tool will automatically apply or revert the patches for you:
2.6.16-rc4-mm1 -> 2.6.16-rt12
Applying 2.6.16-rc4-mm1.bz2 -R
Applying patch-2.6.16-rc4.bz2 -R
Applying patch-2.6.16.bz2
Applying patch-2.6.16-rt12

It is also possible to teach ketchup to use patches included in the latest -mm tree (described below), which can be done in the following way:

$ wget -c `ketchup -u 2.6-mm | sed "s/.bz2/-broken-out.tar.bz2/"`

As follows from the above examples, ketchup can recognize several development branches of the Linux kernel source code. In particular, it can handle the following trees:

Now, you may be wondering why we have shown you all of the commands used for applying and reverting patches. The reason is really simple: if you find and report a bug, you will probably get a fix in the form of a patch and you should be able to correctly apply it.


next up previous contents
Next: Trees Up: The kernel, patches, trees Previous: Patches   Contents
MichaƂ Piotrowski 2007-06-21