[Buildroot] In Buildroot, how to compile kernel modules

Frank Ihle frank.ihle at hs-offenburg.de
Wed Feb 26 07:31:40 UTC 2014


Right setting kernel dependencies makes sense, but I'm not so sure about the process: when I have the following makefile

obj-m += /<path-to-module>/measurement_gpio.o
KDIR := /<BR-path>/output/build/linux-2.6.39/
PWD := $(shell pwd)
default:
    $(MAKE) ARCH=arm CROSS_COMPILE=/<BR-path>/output/host/opt/ext-toolchain/bin/arm-none-linux-gnueabi- -C modules

where is then the generated .ko file and how can I make sure that in this build process the .ko file will be moved to a certain place ?

Kind Regards

Frank


>>> Arnout Vandecappelle <arnout at mind.be> 25.02.14 21.42 Uhr >>>
On 25/02/14 11:38, Frank Ihle wrote:
> Hi and thanks for your response. Before i start hacking this, is it
> really that complicated ? For me it doesn't seem a big deal ?

 Actually, a much better example for simple modules is
package/on2-8170-modules/on2-8170-modules.mk

 You need to set VERSION and SITE like for all packages.

 You need to set DEPENDENCIES to LINUX (and also in the Config.in you
need to depend on BR2_LINUX_KERNEL).

 And you need the following build/install commands:

define ON2_8170_MODULES_BUILD_CMDS
        $(MAKE) -C $(LINUX_DIR) $(LINUX_MAKE_FLAGS) M=$(@D)
endef

define ON2_8170_MODULES_INSTALL_TARGET_CMDS
        $(MAKE) -C $(LINUX_DIR) $(LINUX_MAKE_FLAGS) M=$(@D) \
        modules_install
endef



 Regards,
 Arnout

-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20140226/b0a79691/attachment-0002.html>


More information about the buildroot mailing list