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

Jeffrey Hutzelman jhutz@cmu.edu
Thu, 17 Jun 2004 13:25:52 -0400


On Thursday, June 17, 2004 10:38:07 -0400 Matthew Miller 
<mattdm@mattdm.org> wrote:

> On Thu, Jun 17, 2004 at 10:08:43AM -0400, Christopher Allen Wing wrote:
>> > 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.
>
> Actually, not in 2.6 / Fedora Core 2. The new kernel build system requires
> headers that match the specific kernel exactly, and so the new kernel
> packages include them. You don't even need the kernel-sourcecode package
> to build an external module anymore.
>
>> On Red Hat systems up to Fedora Core 1 (I'm not sure about FC2), you need
>> to look at:
> [snip]
>
> Yeah, all of that is gone with 2.6, which is all I'm interested in right
> now. Thank you very much for the clear explanation, though.

Right.  Which means you don't need --enable-redhat-buildsys, which is for 
use when building the official RPM's for pre-FC2 systems, where you want to 
build all the modules without rebooting N times in the middle of building 
the RPMs.

Unless you are the spec file trying to build RPM's for pre-FC2 redhat 
systems, you should not use --enable-redhat-buildsys.  It's a private hook 
for a strange situation.


If you are building one module against 2.6, as normal users do, then you 
can configure --with-linux-kernel-headers=/lib/modules/<version>/build and 
everything will be happy.  You'll get two modules ("SP" and "MP") but 
they'll be the same and they will match your kernel.

If you want to build a variety of modules, as you might if you're building 
an RPM set, then I recommend a different approach:

- configure and build with --disable-kernel-module, which will get you all
  the user-mode binaries and no modules
- also 'make only_libafs_tree'.  This will produce a directory called
  libafs_tree, which is a self-contained configurable package which can
  be used to build just a kernel module.  Package this up and ship it
  so it is easy for users to build their own module for a custom kernel.
- For each kernel you want to support, run configure and make in the
  libafs_tree, --with-linux-kernel-headers=/lib/modules/<version>/build
  then copy out the module.

  You can even do multiple builds in the same LIBAFS_TREE, as long as
  you remove config.cache between builds and set LINUX_MODULE_NAME to
  a different string for each build (this controls part of the name of
  the subdirectory in which the build will be done).  Using this trick
  it is safe to use the whole source tree and just 'make only_libafs'
  for each module, but configure will be quicker in the libafs_tree.

-- Jeffrey T. Hutzelman (N3NHS) <jhutz+@cmu.edu>
   Sr. Research Systems Programmer
   School of Computer Science - Research Computing Facility
   Carnegie Mellon University - Pittsburgh, PA