Hi,
Since the kernel is 2.6, I have trouble compiling and installing an external module. I could only compile the driver as root. 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. * run make oldconfig make prepare
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[1]: Entering directory `/opt/fc2t/usr/src/linux-2.6.3-1.118' HOSTCC scripts/modpost.o cc1 : Permission non accordée : ouverture du fichier de dépendances scripts/.modpost.o.d make[2]: *** [scripts/modpost.o] Erreur 1 make[1]: *** [scripts] Erreur 2 make[1]: Leaving directory `/opt/fc2t/usr/src/linux-2.6.3-1.118' make: *** [eagle-usb.ko] Erreur 2
If I can compile the driver, as root, I get: [root@localhost driver]# make make -C /usr/src/linux SUBDIRS=/home/pat/src/eagleusb/driver modules make[1]: Entering directory `/opt/fc2t/usr/src/linux-2.6.3-1.118' HOSTCC scripts/modpost.o HOSTLD scripts/modpost *** Warning: Overriding SUBDIRS on the command line can cause *** inconsistencies make[2]: « arch/i386/kernel/asm-offsets.s » est à jour. CC [M] /home/pat/src/eagleusb/driver/eu_main.o CC [M] /home/pat/src/eagleusb/driver/Boot.o CC [M] /home/pat/src/eagleusb/driver/eu_utils.o CC [M] /home/pat/src/eagleusb/driver/Pipes.o CC [M] /home/pat/src/eagleusb/driver/Me.o CC [M] /home/pat/src/eagleusb/driver/Sm.o CC [M] /home/pat/src/eagleusb/driver/eu_msg.o CC [M] /home/pat/src/eagleusb/driver/Dsp.o CC [M] /home/pat/src/eagleusb/driver/Mpoa.o CC [M] /home/pat/src/eagleusb/driver/Uni.o CC [M] /home/pat/src/eagleusb/driver/Sar.o CC [M] /home/pat/src/eagleusb/driver/Oam.o CC [M] /home/pat/src/eagleusb/driver/eu_eth.o LD [M] /home/pat/src/eagleusb/driver/eagle-usb.o Building modules, stage 2. MODPOST CC /home/pat/src/eagleusb/driver/eagle-usb.mod.o LD [M] /home/pat/src/eagleusb/driver/eagle-usb.ko make[1]: Leaving directory `/opt/fc2t/usr/src/linux-2.6.3-1.118'
Well, it works.
It is in line with what I have seen on some docs about the building of modules, but I am not very comfortable with that. First I don't like to build as root and second I don't know what to do for rpm building. What should I do to build modules as non root, and build rpms for the module ?
I searched for informations on that subject but I haven't found anything.
Pat
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 external 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.
- run make oldconfig make prepare
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[1]: Entering directory `/opt/fc2t/usr/src/linux-2.6.3-1.118' HOSTCC scripts/modpost.o cc1 : Permission non accordée : ouverture du fichier de dépendances scripts/.modpost.o.d make[2]: *** [scripts/modpost.o] Erreur 1 make[1]: *** [scripts] Erreur 2 make[1]: 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/' \ /lib/modules/2.6.3-1.118/build/scripts/Makefile \ /lib/modules/2.6.3-1.118/build/scripts/genksyms/Makefile
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/linux/autoconf.h \ /lib/modules/2.6.3-1.118/build/include/config/MARKER | head -1` \ /lib/modules/2.6.3-1.118/build/include/config/MARKER touch -r /lib/modules/2.6.3-1.118/build/arch/i386/kernel/asm-offsets.s \ /lib/modules/2.6.3-1.118/build/include/asm-i386/asm_offsets.h
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 building:
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 normal user.
gary
Ok, filed in bugzilla:
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=117645
gary
On Thu, Mar 04, 2004 at 08:10:57PM -0800, Gary Peck wrote:
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 external 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.
- run make oldconfig make prepare
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[1]: Entering directory `/opt/fc2t/usr/src/linux-2.6.3-1.118' HOSTCC scripts/modpost.o cc1 : Permission non accordée : ouverture du fichier de dépendances scripts/.modpost.o.d make[2]: *** [scripts/modpost.o] Erreur 1 make[1]: *** [scripts] Erreur 2 make[1]: 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/' \ /lib/modules/2.6.3-1.118/build/scripts/Makefile \ /lib/modules/2.6.3-1.118/build/scripts/genksyms/Makefile
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/linux/autoconf.h \ /lib/modules/2.6.3-1.118/build/include/config/MARKER | head -1` \ /lib/modules/2.6.3-1.118/build/include/config/MARKER touch -r /lib/modules/2.6.3-1.118/build/arch/i386/kernel/asm-offsets.s \ /lib/modules/2.6.3-1.118/build/include/asm-i386/asm_offsets.h
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 building:
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 normal user.
gary