[ENBD] depmod: *** Unresolved symbols in kernel 2.4.20

Peter T. Breuer enbd@lists.community.tummy.com
Sat, 4 Jan 2003 21:01:17 +0100 (MET)


"JonaZ A7V wrote:"
(of 2.4.20)
> > > OK, your kernel DOES have MODVERSIONS set.
> >
> > > > gcc -DMODVERSIONS -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1
> > > > -D_GNU_SOURCE=1 -D_XOPEN_SOURCE=1 -D_FILE_OFFSET_BITS=64 -Wall
> > > > -I/usr/src/linux/linux/modversions.h -O2 -I/tmp
> > > > -I/install-stuff/nbd-2.4.31/linux/include -I/usr/src/linux/include
> > > > -DDEBUG=0 -o enbd-server.o -c 
> >/install-stuff/nbd-2.4.31/nbd/enbd-server.c


I've now installed 2.4.20 and compiled enbd-2.4.31 (at least, the
others should not be any different) against it with no problem.
Runs too. I didn't try MODVERSIONS yet. I'll check in a little while.


Incidentally, does anyone have RAID5 working under 2.4.20? My raid5
won't resync:

 Personalities : [linear] [raid0] [raid1] [raid5] 
read_ahead 1024 sectors
md0 : active raid5 md/0[3] scsi/host0/bus0/target1/lun0/part1[1] [dev 08:01][0]
      17928320 blocks level 5, 4k chunk, algorithm 0 [3/2] [UU_]
      [>....................]  recovery =  0.0% (0/8964160)
finish=681276.1min speed=0K/sec
unused devices: <none>
 
Or maybe it's just thoroughly confused. That printout is pretty bogus.

Anyway, the plain enbd module compile  line is:


  gcc -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -D_GNU_SOURCE=1
-D_XOPEN_SOURCE=1 -D_FILE_OFFSET_BITS=64 -Wall -O2 -D__SMP__
-DCONFIG_X86_LOCAL_APIC -D__KERNEL__ -DMODULE -DDEBUG=0 -DCONFIG_ENBD=m
-I/var/home/oboe/ptb/lang/c/nbd/nbd-2.4.31/linux/include
-I/usr/local/src/linux-2.4.20/include  -DKBUILD_BASENAME=enbd  -c -o enbd.o
/var/home/oboe/ptb/lang/c/nbd/nbd-2.4.31/linux/drivers/block/enbd.c

So I modify it as follows to get modversions (I think)

   gcc -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -D_GNU_SOURCE=1
-D_XOPEN_SOURCE=1 -D_FILE_OFFSET_BITS=64 -Wall -O2 -D__SMP__
-DCONFIG_X86_LOCAL_APIC -D__KERNEL__ -DMODVERSIONS -include
/usr/local/src/linux-2.4.20/include/linux/modversions.h -DMODULE
-DDEBUG=0 -DCONFIG_ENBD=m
-I/var/home/oboe/ptb/lang/c/nbd/nbd-2.4.31/linux/include
-I/usr/local/src/linux-2.4.20/include  -DKBUILD_BASENAME=enbd  -c -o /tmp/enbd.o

but indeed .. running nm on the result shows none of the modversions
special codes in the symbol names. Hmm. That's really quite annoying.
It's all the kernel makefile does:

  ifdef CONFIG_MODULES
  ifdef CONFIG_MODVERSIONS
  MODFLAGS += -DMODVERSIONS -include $(HPATH)/linux/modversions.h

ahhh .. but I think one needs to update include/linux/modversions.h
first. It looks like one can't do it in isolation... nope, not even 
compiling the kernel with modversions and  then trying the above
compile line does the trick. Let me see what the kernel does ...
I don't think it does anything different:

  gcc -D__KERNEL__ -I/usr/local/src/linux-2.4.20/include -Wall
-Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common
-fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=i686
-DMODULE -DMODVERSIONS -include
/usr/local/src/linux-2.4.20/include/linux/modversions.h -D_LINUX
-I/usr/local/src/linux-2.4.20/drivers/acpi/include
-I/usr/local/src/linux-2.4.20/drivers/acpi/ospm/include -nostdinc
-iwithprefix include -DKBUILD_BASENAME=bn_osl  -c -o bn_osl.o bn_osl.c

Well, I've copied the kernel make as well as I am able, and still no joy.
Here's the compile line I tried:

   gcc -D__KERNEL__ -I /usr/local/src/linux-2.4.20/include -Wall -O2
-D__SMP__ -DMODULE -DMODVERSIONS -include
/usr/local/src/linux-2.4.20/include/linux/modversions.h -D_LINUX
-DCONFIG_ENBD=m
-I/var/home/oboe/ptb/lang/c/nbd/nbd-2.4.31/linux/include -nostdinc
-iwithprefix include -DKBUILD_BASENAME=enbd -c -o /tmp/enbd.o
/var/home/oboe/ptb/lang/c/nbd/nbd-2.4.31/linux/drivers/block/enbd.c

Ummm ... none of the kernel compiled modules show up as having
MODVERSIONS-type symbols either!

Maybe it's stopped working and nobody noticed? Or stopped being needed?


Peter






Peter