ketchup, or how to manage your kernel sources more efficiently

July 15, 2011

ketchup is an awesome utility/script, written by Matt Mackall in Python, which makes it very easy to manage kernel sources. You can very easily upgrade to a newer kernel version, downgrade to older releases, and even switch between different patchsets. The ketchup ebuild I found in Portage (and in every Linux distro I know about) was fetching the original and out-of-date version of ketchup. Steven Rostedt had pulled the original ketchup code (v0.9) into his git repo @ kernel.org. However, there were no commits/updates to ketchup for 1-2 years, I think.

So, I decided to cleanup some of the old trees that ketchup supported, but were no longer maintained, and add support for new trees (or some updated ‘versions’ of the old trees). I sent the patches to Steven Rostedt, and he proposed that I take over and maintain ketchup. :)

I cloned the ketchup git repo to Github, applied the patches I’d written, plus quite a lot of patches that the Debian ketchup package provided.

Now, with the Linux-3.0 release approaching, I tried to add (at least) partial support for the new 2 digit version numbers, but there are still some issues, which will hopefully get resolved once Linux-3.0 gets released, and the new versioning scheme gets standarized (for example the EXTRAVERSION Makefile variable will probably not get removed from 3.0, as it breaks some userspace utils, like uptime etc from procps utils, some depmod issues etc).

The new code for 3.x kernels is currently in the linux-3 branch, from which I took a snapshot and pushed it to Portage as dev-util/ketchup-1.1_beta. I will hopefully merge it back with master, after the first -stable release comes out (Linux-3.0.1), just to make sure that everything works.

Yeap, there’s a man page included in the repo, and probably in most of the ketchup distro packages, written by Baruch Even.

It’s basic usage is as simple as ketchup 3-rc in an empty directory for example, and it will fetch and untar the latest Linux-3.0 release candidate.

If you run the same command in a directory containing Linux-2.6.38.1, for example, ketchup will download and apply (or revert) any patches needed until you have the latest Linux-3.0-rc sources in the directory.

You can also try running ketchup -h for the available options you can pass to ketchup.

Yeap, I know, and I have patched it, but I also tried a few other things and pushed all of these changes to a new experimental branch. I’ll probably just push to linux-3 branch this fix, and a fix for the -rc kernels (which are broken because they changed the -rc links upstream).

Btw, if you look at the commit log, the fix was originally as you proposed, but I erased it accidentally, and then I did it this way, and instead of t += .0, I added t += ‘.0′. :/

Anyway, thanks for reporting, I’ll try to push the fix to linux-3 as soon as possible. :)