Click to See Complete Forum and Search --> : can't find modversions.h


A. Buza
11-24-2001, 02:54 AM
I thought this would be an easy thing to answer, but I can't seem to find any information on it.

I'm trying to install the NVidia drivers, but when I make them, it can't find modversions.h. I've checked and it isn't installed on my system. I downloaded the kernel source (2.2.17) and it doesn't seem to be there either. Where can I find this phantom file? I read something about it being needed for kernels that support loadable modules, and I do indeed have a kernel that supports that, but I can't seem to find any other information.

DMR
11-24-2001, 03:35 AM
Are you absolutely sure that it doesn't exist on your system? I believe you do need to install the kernel sources to get it, but it should be somewhere once you've done that. On my Mandrake 8 system(kernel 2.4.3-20), here's the result of a find for modversions.h:[root@penguinbox ~]# find / -name modversions.h
/usr/include/linux/modversions.h
/usr/src/linux-2.4.3/include/linux/modversions.h It is possible that

A) the file really doesn't exist on your system. Have you done a kernel recompile, or is this the stock kernel?

B) the makefile or compilation command is looking in the wrong location for the file. If the find command I used above finds the file on your system, this is probably the case. I haven't compiled those drivers before; what commands are you using to do so?

[ 24 November 2001: Message edited by: DMR ]

A. Buza
11-24-2001, 06:59 PM
Originally posted by DMR:
It is possible that

A) the file really doesn't exist on your system. Have you done a kernel recompile, or is this the stock kernel?


[ 24 November 2001: Message edited by: DMR ][/QB]

I searched the entire filesystem for modversions.h (like you did above) and it isn't there. I'm using a stock kernel from Debian 2.2.

Any ideas?

DMR
11-24-2001, 08:34 PM
I got the following piece of advice from a driver development mailing list; you might give it a shot. I've seen "make dep" suggested in other places as well, but I can't vouche for it myself.
If you see something like:

gcc [....] /usr/src/linux/include/linux/modversions.h:
No such file or directory after typing "make", you have no modversions.h or you have it at the wrong place.

First, make sure, your kernel source tree starts at /usr/src/linux. If not, make a link from your kernel source to /usr/src/linux:
$ ln -s /path/to/your/kernel /usr/src/linux

Now, create the modversions.h by running
$ cd /usr/src/linux
$ make dep

this should make you a modversions.h in /usr/src/linux/include/

If this did not work, an ugly hack is to create an empty file there:
$ mkdir -p /usr/src/linux/include/linux
$ touch /usr/src/linux/include/linux/modversions.hThe directories on your system may differ slightly, and I've heard that the "ugly hack" he suggests doesn't always work.

Just FYI, there are probably more of these sorts of problems to come. The implementation of modversions.h has apparently "underwhelmed" developers for some time now, and it is not supposed to be used in the 2.5 kernel at all. I could see this causing problems with sources and makefiles which still reference modversion.h.

Anyway- hope this helps.

[ 24 November 2001: Message edited by: DMR ]