[Buildroot] Cross-Compiling out-of-tree driver

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Fri Apr 5 12:07:52 UTC 2013


Hello Andreas,

(Would be nice if your e-mail had been wrapped to ~80 characters).

On Fri, 5 Apr 2013 13:40:59 +0200 (CEST), universeII at gmx.de wrote:

> I'm trying to use buildroot to create a Linux system for our custom
> VME PowerPC board.
>
> I succeeded in modifying the kernel to run on our special hardware
> but I'm stuck in compiling a driver out-of-tree.
>
> In-kernel compilation is no problem but for development and
> debugging of drivers it is much simpler to be able to compile drivers
> quickly out-of-tree and insert/remove them manually.
>
> I started to compile a dummy driver out-of-tree on my linux PC
> which works fine. Now I'm trying to use the linux kernel inside
> buildroot tree (setting KDIR appropriately) and use the cross-compile
> tool from buildroot. I searched the buildroot documentation but only
> found instructions how to compile own applications/libraries. Also
> TODOs from the internet on cross-compiling drivers did not help.
>
> Maybe I just oversee some simple things
>
> Can anybody give me a hint, how to cross-compile a linux driver
> out-of-tree using buildroot?

Yes. See the mail I posted a long time ago, which provided an example
of a kernel module and the associated .mk file:

  http://lists.busybox.net/pipermail/buildroot/2011-August/044807.html

Note however that the .mk file will need a few modifications,
especially the last line should just be:

$(eval $(generic-package))

I hope this helps. If not, don't hesitate to come back with
any question you may have.

Best regards,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com



More information about the buildroot mailing list