[OpenAFS-devel] Generating a Linux 2.6-style .ko

Jeffrey Hutzelman jhutz@cmu.edu
Thu, 27 May 2004 18:58:28 -0400


On Thursday, May 27, 2004 13:49:14 -0400 "chas williams (contractor)" 
<chas@cmf.nrl.navy.mil> wrote:

> In message <Pine.LNX.4.60.0405271323320.22258@napoleon>,Asheesh Laroia
> writes:
>> Kernel source: 2.6.6 from Debian (kernel-source-2.6.6)
>
> 2.6.6 has changed a few things.  try applying this to the afs sources
> and see if you can load the .o into your kernel (normally this bit of
> code is generated by a script in the kernel build tree.  if this changes
> much it might be necessary to call that script).
>
> .ko is just a name.

.ko is indeed just a name, but there are also differences in what must be 
in the file.  While you can indeed load a file whose name ends in ".o", you 
cannot load an old-style module into a 2.6 kernel.  The build process has 
to change somewhat.


The patch you included, combined with some hackery already in the build 
tree, does indeed address part of the problem -- but not all of it.  For 
example, additional steps must be taken to generate a __versions section 
containing symbol version mappings.

The best way to do this is to use the kbuild infrastructure, which also 
gets us out of the business of guessing what compiler options are needed. 
I have a patch which does this, which I'll send in later today.


-- Jeff