Skip to content

Sorry I'm late. Work was murder.

I've spent a few hours recently looking at building RPM packages of GNU/Linux kernels, which has been a frustrating process.

There are many many online guides which give the impression that this is actually a pretty complex process. For example How To Compile A Kernel - The CentOS Way guide. (Did I mention how bad most of the howtoforge guides are recently?)

So, after fiddling around for an afternoon and getting lost I decided to abandon the process.

Here is a tested process for building a binary RPM kernel package:

cd linux-2.6.24.7/
make rpm

Yes this works just fine upon a Centos 5.x machine - I'm used to using make-kpkg to make a Debian kernel package, but it seems that if you just visit kernel.org and download the latest version you can build a RPM without any extra effort thanks to native support. Cool.

Now I need to work out how to create, host, and update a YUM repository. That looks fiddly and annoying too. XML. Eww. Any guides are most welcome - ultimately I need to package and host a "recent" kernel for Centos 4.x, Centos 5.x and Fedora Core 6-9 - each for i386 + amd64.

ObQuote: Spiderman

Comments On This Entry

  1. [gravitar] Ben Hutchings
    I recently went through this at work so we can test our in-tree driver in the form distributions are likely to use it. I found that the RPM's postinst script (or whatever the RPM equivalent is) does not generate an initrd. And the necessary commands differ between distributions, which may be why this isn't done.
  2. [author] Steve Kemp

    In our case this isn't required - either the kernels are installed purely to satisfy dependencies, or our imaging system takes care of creating the initial ramdisk as part of the installation.

    Definitely worth knowing though, and something I hadn't spotted myself.

  3. [gravitar] Claire Connelly
    Actually, setting up a YUM repo is pretty trivial. There are scripts (notably createrepo) that do all the heavy lifting for you -- all you have to do is set up a directory structure, then run createrepo with the right arguments.