I'm adding an external driver module to an android Gingerbread kernel (works similar to Linux). I've done it before and it worked but I have a problem this time. I follow the recipe found in O'Reilly "Linux Device Drivers 3rd edition" which is:
in the local Makefile, you add those statements:
obj-m := GobiNet.o GobiNet-objs := GobiUSBNet.o QMIDevice.o QMI.o
In human language it means build me a GobiNet.ko from GobiUSBNet.c + QMIDevice.c + QMI.c.
This is for the case where the makefile is called when building the whole kernel. I'm cross-compiling on a Ubuntu x86-64bit for an ARM-EABI system (Cortex-A8).
Somehow, the build system understands what I want since it says during compile time:
/home/sylvain/Projects/android_gingerbread_realv210_ver_1_0/kernel CHK include/linux/version.h CHK include/generated/utsrelease.h make[1]: `include/generated/mach-types.h' is up to date. CALL scripts/checksyscalls.sh CHK include/generated/compile.h LD drivers/cell/OptionGobiNet/built-in.o CC [M] drivers/cell/OptionGobiNet/GobiUSBNet.o CC [M] drivers/cell/OptionGobiNet/QMIDevice.o CC [M] drivers/cell/OptionGobiNet/QMI.o LD [M] drivers/cell/OptionGobiNet/GobiNet.o Kernel: arch/arm/boot/Image is ready SHIPPED arch/arm/boot/compressed/lib1funcs.S AS arch/arm/boot/compressed/lib1funcs.o LD arch/arm/boot/compressed/vmlinux OBJCOPY arch/arm/boot/zImage Kernel: arch/arm/boot/zImage is ready Building modules, stage 2. MODPOST 5 modules ERROR: "usbnet_suspend" [drivers/cell/OptionGobiNet/GobiNet.ko] undefined! ERROR: "usbnet_resume" [drivers/cell/OptionGobiNet/GobiNet.ko] undefined! ERROR: "usbnet_disconnect" [drivers/cell/OptionGobiNet/GobiNet.ko] undefined! ERROR: "usbnet_probe" [drivers/cell/OptionGobiNet/GobiNet.ko] undefined! make[1]: *** [__modpost] Error 1 make: *** [modules] Error 2
It also generates the typical "GobiNet.mod.c" and "GobiNet.o" that is generated when you want the driver as a module but it doesn't complete with the "GobiNet.ko" I would expect. I ran a "find -name *.ko" in the home directory and "GobiNet.ko" is nowhere to but found.
I also looked on the WEB and in the kernel/documentation/kbuild/*.txt. There is about 3 ways to do it. I chose the one described above because all the environment variables are set within the top build script and I don't compile native but I cross compile. Anyway, the other ".ko" in the kernel tree are generated so the build script should be good to generate the ".ko" modules.
Any idea what makes this process start but not finish with the ".ko" file?