On Thu, Mar 04, 2004 at 09:48:58PM +0100, Dumas Patrice wrote:
Since the kernel is 2.6, I have trouble compiling and installing an
module. I could only compile the driver as root.
Yeah, I've noticed the same problem. I keep meaning to bugzilla it, but
haven't gotten around to it yet. In the meantime, here's my notes on how
to compile modules as a normal user:
And before I compile it I had to do the following as root:
* edit the Makefile in /usr/src/kernel-2.6.... and remove 'custom' from the
EXTRAVERSION. Otherwise it isn't installed at the right place.
As of the 2.6 kernel, you don't need kernel-source installed to compile
kernel modules (which is what it looks like you're doing). The kernel
package now contains all necessary files.
If I try to compile as a user, I get
[pat@localhost driver]$ make
make -C /usr/src/linux SUBDIRS=/home/pat/src/eagleusb/driver modules
make: Entering directory `/opt/fc2t/usr/src/linux-2.6.3-1.118'
cc1 : Permission non accordée : ouverture du fichier de dépendances
make: *** [scripts/modpost.o] Erreur 1
make: *** [scripts] Erreur 2
make: Leaving directory `/opt/fc2t/usr/src/linux-2.6.3-1.118'
make: *** [eagle-usb.ko] Erreur 2
Even though you should only need the kernel package, the current Fedora
one is missing some files. Specifically, all the actual executables are
there, but some of the intermediate files are missing. This triggers
make to try and rebuild them. Do this as a workaround (assuming kernel
version 2.6.3-1.118) while logged in as root:
sed -ie 's/^always/#always/' \
Some timestamps are also messed up:
touch -r `ls -t /lib/modules/2.6.3-1.118/build/scripts/split-include \
/lib/modules/2.6.3-1.118/build/include/config/MARKER | head -1` \
touch -r /lib/modules/2.6.3-1.118/build/arch/i386/kernel/asm-offsets.s \
And last but not least, I had to do the following, though I'm not sure
if this is necessary for all external modules, or just the one I was
ln -s /dev/null /lib/modules/2.6.3-1.118/build/.__modpost.cmd
After the above commands, you should be able to build modules as a