Reputation: 4919
I'm having issues loading kernel modules on Android, the kernel has been crosscompiled from a 64bit linux box. Kernel boots fine, it just wont load any modules (even bcm4329.ko for wifi)
The kernel and modules are flashed onto the device (HTC Desire) using CWM "install from zip" feature in recovery.
root@android:/data # uname -a Linux localhost 2.6.38.8-dtbaker2-ics+ #3 PREEMPT Sun May 5 18:50:10 EST 2013 armv7l GNU/Linux
trying to load module manually:
root@android:/system/lib/modules/dtbaker2-ics # ls -l -rw-rw-rw- root root 287308 2013-05-05 08:50 bcm4329.ko root@android:/system/lib/modules/dtbaker2-ics # depmod -a root@android:/system/lib/modules/dtbaker2-ics # modprobe bcm4329 modprobe: 'dtbaker2-ics/bcm4329.ko': unknown symbol in module or invalid parameter root@android:/system/lib/modules/dtbaker2-ics # insmod bcm4329.ko insmod: init_module 'bcm4329.ko' failed (No such file or directory) root@android:/system/lib/modules/dtbaker2-ics # modinfo bcm4329.ko filename: bcm4329.ko license: GPL v2 alias: sdio:c*v02D0d4319* alias: sdio:c*v02D0d4329* alias: sdio:c*v02D0d0493* alias: sdio:c*v02D0d0492* alias: sdio:c*v02D0d0000* depends: vermagic: 2.6.38.8-dtbaker2-ics+ preempt mod_unload ARMv7 parm: dhd_oob_gpio_num:DHD oob gpio number parm: clockoverride:SDIO card clock override
dmesg output after modprobe or insmod:
[ 1525.047424] bcm4329: Unknown symbol _GLOBAL_OFFSET_TABLE_ (err 0)
The /proc/config.gz output from my custom built kernel is identical to the output from a fresh install of this ICS ROM (bar the date).
A couple of forum posts mentioned SLAB/SLUB and module loading issues, so I even tried to rebuild the initial SLAB kernel (dtbaker-ics) with the SLUB option (dtbaker2-ics) and the identical problem exists.
Could this be a 64bit cross compilation issue? Is it weird that the kernel works fine but modules are not loaded?
Upvotes: 3
Views: 7251
Reputation: 4919
Ah! "Unknown symbol _GLOBAL_OFFSET_TABLE_" error: https://groups.google.com/forum/?fromgroups=#!topic/android-kernel/dzEIOVuxtEo
I remembered early on I swapped to using prebuilt toolchain arm-linux-androideabi-4.4.3 instead of arm-eabi-4.4.0 because arm-eabi-4.4.0 did not work for me on 64bit ubuntu ( shrug )
As per the above google groups post, modified my kernel Makefile from this:
MODFLAGS = -DMODULE -march=armv7-a -mfpu=vfpv3 -ftree-vectorize
to this:
MODFLAGS = -DMODULE -march=armv7-a -mfpu=vfpv3 -ftree-vectorize -fno-pic
Then re-built the kernel modules:
make clean make modules
and copied my new module back over to android, away she goes!
Upvotes: 4