Skip to main content
2 of 4
added 1800 characters in body

Building kernel module

I have a 3rd party device driver which I am trying to cross-compile. When I build the driver everything goes smooth but I don't see any driver.ko file, however driver.o file is generated fine and I don't see any error during the build process. I have also tried with the option V=1 and I see following error

echo; echo " ERROR: Kernel configuration is invalid."; echo " include/generated/autoconf.h or include/config/auto.conf are missing."; echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; echo; 

But my kernel configuration is correct and I have tried a simple hello world module with this configuration, in that case I can build my module but still see this error message. Also I can see both the files include/generated/autoconf.h & include/config/auto.conf in the kernel sources. Still why I am unable to build my driver module.

Any thoughts.

Regards, Farrukh Arshad.

UPDATE # 1 I am cross-compiling the driver for ARM platform so /lib/modules will not be good in this environment. Secondly here is the output of the build.

LD [M] /home/farshad/Work/CSP/boards/imx6q/ar6k3/ar6003_3.1_RC_Linux_release_[posted_2011_8_19_olca3.1RC_553/imx6build/host/os/linux/ar6000.o Building modules, stage 2. MODPOST 0 modules make[2]: Leaving directory `/home/farshad/Work/CSP/projects/phase_1/farshad/cspbox/platform/imx6/mel5/fs/workspace/linux-2.6.38-imx6' 

As you can see above ar6000.o is built properly without any error, but why ar6000.ko is not being built otherwise it should report "MODPOST 1 modules". Since ar6000.ko is not being built at the end of the complete build process I also get the following error

cp: cannot stat `/home/farshad/Work/CSP/boards/imx6q/ar6k3/ar6003_3.1_RC_Linux_release_[posted_2011_8_19_olca3.1RC_553/imx6build/host/os/linux/ar6000.ko': No such file or directory 2404 make[1]: *** [install] Error 1 

Which is obvious. My problem is why I am not getting a ar6000.ko in the first place. Searching over google someone also faced this issue and mentioned that running make with sudo resolved it but it brought no luck for me!

I am wandering is there any problem in my kernel configuration (i.e the driver is looking for some configuration setting which I haven't enabled in my kernel, but in that case it should give compiler error looking for required #define), the other point can be that there is a problem with the driver build system, which I am trying to figure out. My cross-compile environment is good as I am seeing exactly the same issue while building the same driver for my (Ubuntu x86) machine !!

Any further thoughts.