ketchup, or how to manage your kernel sources more efficiently

July 15, 2011

A couple of months ago I found out about ketchup (credits to Daniel Drake, and his blog).

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.

Feel free to give it a try, and report any bugs/issues.

About these ads

7 Responses to “ketchup, or how to manage your kernel sources more efficiently”

  1. me Says:

    “You can very easily upgrade to a newer kernel version, downgrade to older releases, and even switch between different patchsets”.

    sounds like this will do the job as well:
    ln -s /usr/bin/git /usr/bin/ketchup
    :-)

    • mark Says:

      You forgot mv /usr/bin/ketchup /usr/bin/git. I hope you’re not saying git pull is faster on your connection than downloading a patch.

  2. Szymon Says:

    yay, nice! is there n y manpage ? or how to use it?

    • psomas Says:

      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.

  3. psomas Says:

    Well, not exactly. :P

    Why would you clone the whole mainline repo, with all of the git history and tags etc, if you only want to build the kernel, and not patch it for example.

    And, another things is, that if you want to try out different patchsets, like -mmotm, -ck, -pf etc, I’m not sure the solution you proposed will be very helpful. :)

  4. coroa Says:

    Hey, thanks so much for bringing ketchup up-to-date. I’m still a faithful user.

    But my python 2.7.2 choked on t += ‘.0′ on line 659, ‘+=’ not being defined for types int and str (which makes sense).

    t = “%d.0″ % t

    does the trick for me.

    • psomas Says:

      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. :)


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 276 other followers

%d bloggers like this: