I tried doing the compile just using the default path that comes in the make file, being /usr/include/linux, but the version.h file in that directory complained, with the following message:
#error "You should not include /usr/include/{linux,asm}/ header"
#error "files directly for the compilation of kernel modules."
#error ""
#error "glibc now uses kernel header files from a well-defined"
#error "working kernel version (as recommended by Linus Torvalds)"
#error "These files are glibc internal and may not match the"
#error "currently running kernel. They should only be"
#error "included via other system header files - user space"
#error "programs should not directly include <linux/*.h> or"
#error "<asm/*.h> as well."
#error ""
#error "To build kernel modules please do the following:"
#error ""
#error " o Have the kernel sources installed"
#error ""
#error " o Make sure that the symbolic link"
#error " /lib/modules/`uname -r`/build exists and points to"
#error " the matching kernel source directory"
#error ""
#error " o Now copy /boot/vmlinuz.version.h to"
#error " /lib/modules/`uname -r`/build/include/linux/version.h"
#error ""
#error " o When compiling, make sure to use the following"
#error " compiler option to use the correct include files:"
#error ""
#error " -I/lib/modules/`uname -r`/build/include"
#error ""
#error " instead of"
#error ""
#error " -I/usr/include/linux"
#error ""
#error " Please adjust the Makefile accordingly."Of course, this is Mandrake 9.2, and they haven't put the kernel source on the CDs. I downloaded it in source RPM format (not using my machine, as it's the modem driver that I'm trying to install here). The package in question is kernel-2.4.22.10mdk-1-1mdk.src.rpm.
Now what? I tried using rpm -q to find out what was in the package, and it simply said kernel-2.4.22.10mdk-1-1mdk. Helpful.
In the process of clowning around in Nautilus to see whether I could extract some useful information there, I ended up running something called "Software installer" on the package. It did stuff. I don't know what. I assume it did some clever installation-type thing, but I don't know what, and I don't know where to find the result.
How can I find out where the kernel headers have been extracted to, if they have been extracted?
How can I extract the source from this source rpm package? It isn't at all clear from the rpm man-pages. Like all man pages, I can't see the wood for the trees. I don't need to recompile the whole kernel here, do I?
Where will I find the "matching kernel source directory" referred to in the version.h error message above?
Thanks in anticipation, Douglas.
