Quoting Dave Bresson ([EMAIL PROTECTED]): > On Fri, 18 Aug 2000, David Wright wrote: > > a) If you're compiling a kernel module, you need kernel headers. > > When people write /usr/src/linux, they really mean "the kernel headers > > for the running kernel". > > Okay, i *do* have the kernel headers in /usr/src, > (/usr/src/kernel-headers-2.2.17/include) however, i have > /usr/src/linux linked to the kernel source in > /usr/src/kernel-source-2.2.17. What's the difference between the > kernel-header > include/ and the kernel-source include/ ?
None, I hope, unless you've patched one of them, say. AIUI the kernel-headers packages only exist for people to compile kernel modules for use with stock kernels. These people won't have or need the kernel-source which is much bigger than kernel-headers. > And, also, before i untar'ed the entire kernel-source package into > /usr/src, the /usr/src/ directory only contained the kernel headers and i > tried compiling the 3c90x driver module using the those headers. I was > able to get a good compile, however, i still got the stupid version > problem when trying to do a 'insmod 3c90x'. The error it gives is > basically that the module was compiled for kernel 2.2.17 (the version > given in /usr/src/kernel-headers-2.2.17/include/linux/version.h) and that > it could not install the module since the running kernel was 2.2.17-ide. > I know i could force the insmod with the -f option, however, i would like > a better solution. I mean, the running kernel is *still* a 2.2.17 kernel > + the dma66 stuff, so shouldn't the version for it still be 2.2.17? After > all, i'm sure the stock 2.2.17 kernel and the 2.2.17-ide kernel came from > the same source. How do i solve this? Perhaps you have to fiddle the value in version.h. I haven't had to do this so I don't really know. It's built in the Makefile with the target include/linux/version.h: so it'd be easy to change it. > > b) The kernel-source tarball/debian package is installed into > > /usr/src as it's "owned" by Debian. However, Debian practice is > > to unpack it wheresoever you like. When you compile it, the > > Makefile's TOPDIR looks after all the path adjustments. > > That way you can have multiple versions around, and can build > > everything as an ordinary user with fakeroot. > > Ah, right, thanks for the info. So, when compiling programs, alot of them > need to know where to get the includes and they usually want to get them > at /usr/src/linux/include, am i to assume that i *should* be sym linking > /usr/src/linux to the kernel headers i have in > /usr/src/kernel-headers-2.2.17? That makes sense i guess. We're only talking kernels here, not general programs. The latter use /usr/include which is quite different, because it corresponds to the C libraries being used. When you compile kernels with the Makefiles, the includes should be found in ./include as shown in the following two lines almost at the start of ./Makefile: TOPDIR := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi) HPATH = $(TOPDIR)/include So there should be (a) no need for a link from /usr/src/linux to anywhere, and (b) no need to unpack the kernel sources in /usr/src, and (c) no need to be root to compile a kernel or kernel module (only to install it). Cheers, -- Email: [EMAIL PROTECTED] Tel: +44 1908 653 739 Fax: +44 1908 655 151 Snail: David Wright, Earth Science Dept., Milton Keynes, England, MK7 6AA Disclaimer: These addresses are only for reaching me, and do not signify official stationery. Views expressed here are either my own or plagiarised.