[OpenAFS-devel] what's "enable-redhat-buildsys" all about?

Christopher Allen Wing wingc@engin.umich.edu
Thu, 17 Jun 2004 10:08:43 -0400 (EDT)


On Wed, 16 Jun 2004, Matthew Miller wrote:

> On Wed, Jun 16, 2004 at 05:23:33PM -0400, Christopher Allen Wing wrote:
> > The way that the configure script is generally meant to be used is to
> > compile OpenAFS, including a kernel module appropriate for the "current"
> > kernel running on your machine. By default it assumes that the kernel
> > headers in e.g. /usr/src/linux correspond to this one particular kernel.
>
> This won't work anymore anyway -- the headers must be from
> /lib/modules/[version]/build/.

This is just a symlink to:

	/usr/src/linux-some.particular.version

And that's what I meant by '/usr/src/linux', sorry for being unclear.


> > Red Hat's kernel headers are packaged in such a way that by specifying
> > various options as #defines, you can generate kernel modules corresponding
> > to all the different kernels that Red Hat ships. (e.g. SMP, non-SMP,
> > "enterprise", etc.)
>
> Which is now vastly simplified -- just cycle through various [version]s in
> the above. There's gonna be some weirdness with smp, since the OpenAFS build
> process apparently generates both uniprocessor and multiprocessor modules no
> matter what. But that should be easy to work around.

On Red Hat systems up to Fedora Core 1 (I'm not sure about FC2), you need
to look at:

	/boot/kernel.h

which is generated by:

	/sbin/mkkerneldoth

which gets run by:

	/etc/rc.d/rc.sysinit



If you grep through Red Hat's kernel headers in /usr/src/linux-X.Y.Z,
you'll notice that /boot/kernel.h gets #included. This determines which
variety (i386, i686, athlon, SMP, uniprocessor, etc.) of the particular
kernel you are building for.


What the OpenAFS RPM does, along with --enable-redhat-buildsys, is to
override these #defines in /boot/kernel.h with its own set of defines, so
that it can generate modules corresponding to all of these possibilities.

That's all.



If you do a plain build of OpenAFS on a Red Hat system, using Red Hat
packaged kernel headers, you will end up building a module that
corresponds to the particular kernel you are running at the moment, as
defined by /boot/kernel.h.


-Chris Wing
wingc@engin.umich.edu