[OpenAFS] Help with Debian Kernel Module for AFS

Faheem Mitha faheem@email.unc.edu
Thu, 21 Aug 2003 21:10:41 -0400 (EDT)


On Thu, 21 Aug 2003, Matt Weatherford wrote:

>
> Hello All,
>
> Im trying to get kernel modules built for my debian kernel-2.4.20-3-686
> and when I get everything set up correctly and build the kernel package
> via the commands:
>
>    make-kpkg configure
>    make-kpkg modules_image
>
> it compiles everything and generates a .deb package that
> installs when I do a dpkg -i openafs-modules-yadda.deb)
> into:
>
>    /lib/modules/2.4.20/fs/openafs.mp.o
>
> Additional notes: (are these things to worry about?)
>
>    - This is the wrong directory, so I have to copy it over to
>      /lib/modules/2.4.20-3-686/fs/openafs.mp.o)

You really should not be doing that. I'd recommend recompiling your own
kernel, using your current 2.4.20-3-686 config as a base. That is what I
do.

If you don't want to do this, then check which kernel headers you are
compiling against. Does it correspond to your kernel?

I think you want

kernel-headers-2.4.20-3-386 - Linux kernel headers 2.4.20 on 386

installed.

Then something like

fakeroot make-kpkg --append-to-version -3-686 modules_image

msy work. I've never actually done this myself though, so I am not sure.

>From README.modules

***************************************************************
6)  To build the actual module packages, execute:

make-kpkg modules_image

This will generate a <name>-modules-<kernel version>.deb file in the
parent directory. The revision you supplied while building the kernel
shall be used automatically.

If you are using an official Debian kernel-image with specific options
(kernel-image-x.y.z-foo), you should append this version for modules
compilation:

make-kpkg --append-to-version -foo modules_images
(e.g. of foo at this time are "386", "k6", "586tsc"...)

A revision number based on the date shall be used automatically. You
can however force the revision number using the --revision
flag (see 3.1).

***************************************************************

>    - depmod: *** Unresolved symbols in
> /lib/modules/2.4.20-3-686/fs/openafs.mp.o (this comes up after
> I copy the file to another directory)
>
>
> Then I go to install the openafs-client, and it wants to UNINSTALL
> the package I just installed.
>
> Ok, so now I've got the openafs-client and the openafs.mp.o files
> both on my system (the .o file didnt get removed by apt cause I
> copied it to another dir)
>
> I start up openafs-client and now it complains that I dont have
> "openafs.o"
>
> But I just built the module, and its called "openafs.mp.o"!
> Why this discrepency?
>
> Im not using a mulitprocessor machine... is there something possibly
> in my kernel config that causes this .mp version to be built?
> And I do need to eventually support multiprocessor machines,
> how can I get openafs-client to grab the right module in that
> case?

You need to switch off multi-processor support in the kernel config. It is
on by default. However, I would have thought that the mp version would
still work. I seem to remember it did for me.

> I assume I need the openafs module for running both an AFS client
> and a server - and that is the same module... ?

Yup.

> Im really stuck here. I've been thru all the docs. Can anyone
> enlighten me?
>
> Thanks,
>
> Matt
>
> BTW: If I copy openafs.mp.o to openafs.o, "/etc/init.d/openafs-client
> start" dumps a ton of unresolved symbols and says it cant start AFS.
>
> Trace:
>
>
> lucy:/usr/src# dpkg -i
> openafs-modules-2.4.20_1.2.3final2-6+10.00.Custom_i386.deb
> Selecting previously deselected package openafs-modules-2.4.20.
> (Reading database ... 42539 files and directories currently installed.)
> Unpacking openafs-modules-2.4.20 (from
> openafs-modules-2.4.20_1.2.3final2-6+10.00.Custom_i386.deb) ...
> Setting up openafs-modules-2.4.20 (1.2.3final2-6+10.00.Custom) ...
>
> lucy:/usr/src#
> lucy:/usr/src# depmod
> lucy:/usr/src#
> lucy:/usr/src#
> lucy:/usr/src# mkdir /lib/modules/2.4.20-3-686/fs
> lucy:/usr/src# cp /lib/modules/2.4.20/fs/openafs.mp.o
> /lib/modules/2.4.20-3-686/fs/openafs.mp.o
> lucy:/usr/src# depmod
> depmod: *** Unresolved symbols in /lib/modules/2.4.20-3-686/fs/openafs.mp.o
> lucy:/usr/src#
>
> lucy:/usr/src#
> lucy:/usr/src#
> lucy:/usr/src# apt-get install openafs-client
> Reading Package Lists... Done
> Building Dependency Tree... Done
> The following packages will be REMOVED:
>    openafs-modules-2.4.20
> The following NEW packages will be installed:
>    openafs-client
> 0 packages upgraded, 1 newly installed, 1 to remove and 201  not upgraded.
> Need to get 0B/1522kB of archives. After unpacking 2740kB will be used.
> Do you want to continue? [Y/n]
> Preconfiguring packages ...
> (Reading database ... 42543 files and directories currently installed.)
> Removing openafs-modules-2.4.20 ...
> Selecting previously deselected package openafs-client.
> (Reading database ... 42539 files and directories currently installed.)
> Unpacking openafs-client (from .../openafs-client_1.2.9-2_i386.deb) ...
> Setting up openafs-client (1.2.9-2) ...
> AFS module /lib/modules/2.4.20-3-686/fs/openafs.o does not exist. Not
> starting AFS.
> Please consider building kernel modules using instructions in
> /usr/share/doc/openafs-client/README.modules
>
> lucy:/usr/src#

I would recommend reading the kernel compile howto on
http://newbiedoc.sourceforge.net/ and also the files in
/usr/share/doc/kernel-package, particularly README.gz and README.modules.

I've done this sort of thing many times successfully. I'd be happy to walk
to through what I do if you want.

You could also post to debian-user@lists.debian.org. They are quite
helpful.

                                                       Faheem.