8 Dec 2007 dwmw2   » (Master)

(Oops. Updated to use anoncvs as I originally intended. Not everyone has an account)

Why is it that the easy way of obtaining and building a Fedora kernel isn't documented anywhere? It looks something like this:

$ cvs -d :pserver:anonymous@cvs.fedora.redhat.com:/cvs/pkgs co kernel/F-8
$ cd kernel
$ cvs -d :pserver:anonymous@cvs.fedora.redhat.com:/cvs/pkgs co common
$ cd F-8
$ cat > GNUmakefile <<EOF
ppc: DIST_DEFINES += --without smp
ppc64: DIST_DEFINES += --without kdump
i686: DIST_DEFINES += --without pae --without xen
include Makefile
EOF
$ make $(uname -m)

There are HOWTOs out there, but they seem to recommend that you download the SRPM and extract it, instead of working directly from the original. And presumably if you ever want to update it you need to download a whole new SRPM and do it all over again, instead of just 'cvs update; make $ARCH'. I cannot fathom why anyone would ever want to work directly with SRPMS like that, for any package. Even when I'm just building local hacks I wouldn't do it that way; I'd always take a copy of the Makefile from CVS and keep everything together in its own directory rather than scattered around ~/rpmbuild mixed together with potentially conflicting files from other packages.

The bit with the GNUmakefile is optional, but useful -- you can disable the builds you aren't interested in to save time, and more to the point if the last package built is the one you're interested in, you have the fully compiled source tree left behind (in kernel-$VERSION/linux-$VERSION.$ARCH) when it's done. This makes it easier for you to hack on it and debug it. After installing the built RPM on the target machine, you can individually rebuild and replace files -- both modules and the kernel image.

For the development ('rawhide') version, you'd use 'kernel/devel' in the first cvs checkout instead of 'kernel/F-8'. You can obviously have both at the same time, or even just checkout 'kernel', which should get you the common/ directory too. And a bunch of other 'branches' of the kernel.

Latest blog entries     Older blog entries

New Advogato Features

FOAF updates: Trust rankings are now exported, making the data available to other users and websites. An external FOAF URI has been added, allowing users to link to an additional FOAF file.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!