[OpenAFS-devel] Linux Kernel Module build question

Derek Atkins warlord@MIT.EDU
12 Jul 2001 12:55:08 -0400


Elliot Lee <sopwith@redhat.com> writes:

> I gather here that your requirement here is being able to build against
> kernel versions other than the currently running one? There has to be a
> better way to do this than editing system files during the build, or am I
> mistaken...

Yes, that is my requirement.  And no, currently due to bugs in
linux/rhconfig.h, there is not (IMHO) a better way of doing it.  Take
a look at http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=38460
for the full explanation.  The jist is that there is no way to
override the architecture of the currently-running kernel
(386/586/686/athlon) because you only check #ifdef, not #if defined()
&& != 0 like you do for SMP.

> There must be a gap in the universe regarding the definition of this
> term... :)

Wouldn't be the first time ;)

> > Or you have to be very careful to only build the openafs-kernel
> > modules for the other platforms.
> 
> Not at all.
> 
> If you look at the RH kernel RPM package, it does the right thing for each
> possible --target that you can specify. e.g. it skips the kernel-source
> package if you use --target=i686, but builds it if you use
> --target={i386,alpha,ia64,otherbasearchs...}.

This is exactly what I meant.  If you're building for the base
platform you need to build everything, and if you're building for a
'sub-platform' you need to be careful to ONLY build certain
sub-packages (e.g. just the kernel modules).

> > Me, I'd just rather have one package that contained ALL the modules
> > and just be intelligent about which one get's loaded.  Much easier for
> > the user, IMHO.  They don't have to figure out which module-package to
> > install.
> 
> Where is this intelligence supposed to be located?

Where it is currently, in the afs initscript.  It already attempts to
choose the 'correct' module, but it only bases it on 'uname -r'.
Obviously this doesn't help in the case of i386 v. i586 v. i686
v. athlon.  But I've got code to fix this, and choose the module based
upon the contents of /proc/ksyms.

> -- Elliot
> Your freedom to change my source code does not translate into my
> responsibility to foist your changes upon users at large.

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord@MIT.EDU                        PGP key available