[OpenAFS] Building libafs.ko on Debian without full kernel sources

Kevin openafs@gnosys.biz
Sun, 15 May 2005 18:31:58 -0400


Hi List-

I've checked the Debian list archives and didn't find anything on this.
Indeed, it's been years since afs was even discussed on either
debian-user or debian-powerpc according to a Gmane search of the subject
headers.

I've seen in this list a good bit of discussion on building libafs.ko on
Debian from the openafs module sources in the Debian package
openafs-modules-source, and this has been very helpful to me, but I see
nothing in particular on whether or not this can be done _without_ the
full kernel tree being present and configured.

I ask about this because I have a barebones installation of Debian Sarge
installed on an OldWorld Apple 604e with very limited memory (64MB) and
diskspace (788MB usable with 570MB taken up by the barebones Sarge
installation, thus only 178MB left on the local HDD) running Debian
kernel-image-2.6.8-powerpc.  I have the related headers and build
packages installed (kernel-headers-2.6.8 and
kernel-build-2.6.8-powerpc), but I don't have room on the local disk to
uncompress the full kernel sources (and even if I did, I suspect that
configuring the kernel would be a very lengthy operation on this box
that I'd prefer to avoid if at all possible).

I'm a newbie to Debian and am accustomed to building libafs.ko from a
fully configured kernel source tree that has been recently built and
installed, and with the same gcc version as that used to build the
kernel (I ran into one case where my libafs module was incompatible
because of a different gcc version used to build the module from the one
used to build the kernel), so I am thinking that this plan is unlikely
to succeed, but I saw some posts that seem to indicate that it might be
do-able so I thought I'd ask here.

In particular, I saw Chaskiel M Grundman write about the
module-assistant package on Debian and that, combined with comments that
I see associated with the kernel-headers and kernel-build packages in
aptitude package descriptions, leads me to believe that it might be
possible to build libafs.ko without having the full kernel sources
installed and configured.  Perhaps the .config file could be generated
from the running kernel?  Not sure.

In any case, I tried Chaskiel's recipe with module-assistant:

module-assistant update
module-assistant prepare
module-assistant auto-install openafs

but it fails with complaints like:

make[6]: Entering directory `/usr/src/kernel-build-2.6.8-powerpc'
make[6]: *** No rule to make target `modules'.  Stop.

In my /usr/src/kernel-build-2.6.8-powerpc directory, I have only the
following files:
arch  include  scripts

which I'm sure is why I'm getting this failure.

Is it the case that I absolutely must have the full kernel sources
installed to build libafs.ko?  If so, then I seem to be in a catch-22
situation where I'm trying to give this machine more diskspace with afs,
but cannot do so until I get more diskspace for installing the full
kernel sources and configuring them.

Any thoughts on solutions?  I'm thinking maybe mount an NFS volume for
the additional space requirements?  I don't have NFS set up on this
network because I have AFS, but I suppose I could do it if absolutely
necessary.

TIA for any suggestions.

-Kevin