[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 2.2.x module to 2.2.4
On Fri, 4 May 2001, Eduardo Ferro wrote:
> Hi
>
> I am testing a driver made for a 2.2.x with a 2.4.x kernel, i must to
> adapt this driver for this release but when i try to control I get:
>
> [eferro@localhost acl7130]$ make clean; make
> rm -f *.o *~ test-salidas test-entradas test-ioctl *.pre.c
> rm -f /dev/acl7130*
> gcc -O -Wall -DCONFIG_KERNELD -DMODULE -D__KERNEL__ -DLINUX -c acl7130.c -o acl7130gen.o
> In file included from acl7130.c:66:
> /usr/include/linux/modversions.h:1:2: #error Modules should never use kernel-headers system headers,
> /usr/include/linux/modversions.h:2:2: #error but headers from an appropriate kernel-source
> make: *** [acl7130gen.o] Error 1
>
> I think that this error is generated by:
>
> #if CONFIG_MODVERSIONS==1
> #define MODVERSIONS
> #include <linux/modversions.h>
> #endif
>
> but i don`t know how to change it...
> I need that the driver compile for 2.2 and for 2.4 so i need some
> examples of the ifdefs necesarys to do this...
>
> Anyhelp would be apreciated
There are a few things wrong with this
1) not sure it matters, but use -O2 not -O
2) "-DCONFIG_KERNELD" is wrong - this doesn't even exist in 2.4, and you shouldn't be
setting config like this
3) you should never include modversions.h directly
4) You are picking up the wrong headers, you need to add something like -I/usr/src/linux/include
Ideally you should have some glue with autoconf or similar to pick up
the correct stuff automatically. Maybe someone on the list has a suggestion for an
external module that gets this stuff 100%, but you can look at what my module oprofile
does : http://oprofile.sourceforge.net/
It's only 2.4 though, and I'm not sure it gets the MODVERSIONS stuff right anyway. Hopefully
someone will know of a module that does this stuff better.
john
p.s. Mark McCoughlin (sp?) wrote a guide to module symbols and versioning, linked from kernelnewbies.org
which you might find useful
--
"Brodie, he's a reasonable man, but he's *insane* !"
- Kramer
-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/
IRC Channel: irc.openprojects.net / #kernelnewbies
Web Page: http://www.kernelnewbies.org/