Unable to compile "compat-drivers" in Debian Wheezy
Hello,
I'm trying to compile "compat-drivers" in Debian Wheezy but it fails:
Kernel version:
root@stt300:~# dpkg -l | grep linux-image ii linux-image-3.2.0-4-686-pae 3.2.39-2 i386 Linux 3.2 for modern PCs ii linux-image-686-pae 3.2+46 i386 Linux for modern PCs (meta-package)
Build tools installed:
root@stt300:~# LANG=POSIX apt-get install build-essential linux-headers-`uname -r` Reading package lists... Done Building dependency tree Reading state information... Done build-essential is already the newest version. linux-headers-3.2.0-4-686-pae is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
But when running the build commands:
hpc03@stt300:~/Escritorio/compat-drivers-3.9-rc2-2-su$ ./scripts/driver-select brcmsmac
Processing new driver-select request...
Backing up makefile: Makefile.bk
Backup exists: Makefile.bk
Backup exists: Makefile.bk
Backup exists: Makefile.bk
Backup exists: Makefile.bk
Backing up makefile: drivers/net/wireless/Makefile.bk Backing up makefile: drivers/net/wireless/brcm80211/Makefile.bk
hpc03@stt300:~/Escritorio/compat-drivers-3.9-rc2-2-su$ LANG=POSIX make make -C /lib/modules/3.2.0-4-686-pae/build M=/home/hpc03/Escritorio/compat-drivers-3.9-rc2-2-su modules make[1]: Entering directory `/usr/src/linux-headers-3.2.0-4-686-pae' CC [M] /home/hpc03/Escritorio/compat-drivers-3.9-rc2-2-su/compat/main.o In file included from /home/hpc03/Escritorio/compat-drivers-3.9-rc2-2-su/include/linux/compat-2.6.h:67:0, from <command-line>:0:
/home/hpc03/Escritorio/compat-drivers-3.9-rc2-2-su/include/linux/compat-3.4.h:43:21: error: redefinition of 'kmalloc_array' /usr/src/linux-headers-3.2.0-4-common/include/linux/slab.h:243:21: note: previous definition of 'kmalloc_array' was here /home/hpc03/Escritorio/compat-drivers-3.9-rc2-2-su/include/linux/compat-3.4.h:104:20: error: redefinition of 'eth_hw_addr_random' /usr/src/linux-headers-3.2.0-4-common/include/linux/etherdevice.h:165:20: note: previous definition of 'eth_hw_addr_random' was here make[5]: *** [/home/hpc03/Escritorio/compat-drivers-3.9-rc2-2-su/compat/main.o] Error 1
make[4]: *** [/home/hpc03/Escritorio/compat-drivers-3.9-rc2-2-su/compat] Error 2
make[3]: *** [_module_/home/hpc03/Escritorio/compat-drivers-3.9-rc2-2-su] Error 2
make[2]: *** [sub-make] Error 2
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.2.0-4-686-pae'
make: *** [modules] Error 2
Note: I've tried with a bunch of different "compat-drivers" and "compat-wireless" packages but none succeeded.
Note 2: I also reported this to Debian BTS (bug #703205)
Greetings,
Signature · 1 line
Camaleón
Hi,
This is caused because Debian already defined those structures/functions/etc in their vendor kernel using 2 patches:
- features/all/ethernet-define-eth_hw_addr_random.patch
- features/all/drm/slab-introduce-kmalloc_array.patch
This kind of problems occur from time to time with other distributions too. I don't know if in the code level there is a dynamic way to detect whether those symbols are already defined or not but for now you can edit compat-3.4.h in the compat-drivers folder and comment out the lines defining kmalloc_array and eth_hw_addr_random.
2013/3/17 Ozan Çağlayan <[email protected]>:
Quoted 4 lines
This is caused because Debian already defined those structures/functions/etc in their vendor kernel using 2 patches:
-features/all/ethernet-define-eth_hw_addr_random.patch
-features/all/drm/slab-introduce-kmalloc_array.patch
I see, thanks for the explanation, really appreciated.
Quoted 5 lines
This kind of problems occur from time to time with other distributions too. I don't know if in the code level there is a dynamic way to detect whether those symbols are already defined or not but for now you can edit
compat-3.4.hin the compat-drivers folder and comment out the lines definingkmalloc_arrayandeth_hw_addr_random.
It works, thanks :-)
As I don't want to "make install" I first try to load the module using "insmod":
hpc03@stt300:~/Escritorio/compat-drivers-3.9-rc2-2-su$ su -c "insmod /home/hpc03/Escritorio/compat-drivers-3.9-rc2-2-su/drivers/net/ethernet/atheros/alx/alx.ko" Contraseña: Error: could not insert module /home/hpc03/Escritorio/compat-drivers-3.9-rc2-2-su/drivers/net/ethernet/atheros/alx/alx.ko: Unknown symbol in module
And dmesg shows:
[ 6042.342598] alx: Unknown symbol compat_dependency_symbol (err 0) [ 6042.342883] alx: Unknown symbol mdio_mii_ioctl (err 0)
Should I try with a different version of the compat-drivers instead? Or maybe is that I commented out too much from "compat-3.4.h"?
Thanks for any hint.
Signature · 1 line
Camaleón
insmod doesn't resolve module dependencies. You have to use modprobe or load dependencies of alx before insmod'ding alx by looking at the output of modinfo alx.
By the way make install should install the modules under a different subdirectory of /lib/modules/<your kernel>. So this wouldn't overwrite your already install stuff.
2013/3/17 Ozan Çağlayan <[email protected]>:
Quoted 3 lines
insmod doesn't resolve module dependencies. You have to use modprobe or load dependencies of alx before insmod'ding alx by looking at the output of modinfo alx.
Ah, okay.
Quoted 3 lines
By the way make install should install the modules under a different subdirectory of /lib/modules/<your kernel>. So this wouldn't overwrite your already install stuff.
Well, I finally run "make install", then "make unload" and finally "modprobe alx" but I get:
root@stt300:/home/hpc03/Escritorio/compat-drivers-3.9-rc2-2-su# modprobe alx ERROR: could not insert 'alx': Exec format error
While loading Debian's stock module seems to be fine:
root@stt300:/home/hpc03/Escritorio/compat-drivers-3.9-rc2-2-su# insmod /lib/modules/3.2.0-4-686-pae/kernel/drivers/net/ethernet/atheros/alx/alx.ko
root@stt300:/home/hpc03/Escritorio/compat-drivers-3.9-rc2-2-su# lsmod|grep alx alx 59294 0
Again, thanks for any hint :-)
Greetings,
Signature · 1 line
Camaleón
2013/3/17 Camaleón <[email protected]>:
Quoted 5 lines
Well, I finally run "make install", then "make unload" and finally "modprobe alx" but I get:
root@stt300:/home/hpc03/Escritorio/compat-drivers-3.9-rc2-2-su# modprobe alx ERROR: could not insert 'alx': Exec format error
Well, I'm afraid this is something on Debian's kernel side as I have the same symptoms:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=703142#56
Going back to Debian BTS to continue there.
Ozan, thanks for your kind support! :-)
Greetings,
Signature · 1 line
Camaleón