Beagleboard Kernel Module Cross Compiling


I am trying to cross-compile a kernel module for a few days now.
This module is just a hello world module to get started.

The module should be cross-compiled for Beagleboard XM Rev C with an
ARM processor.

I installed the Angstrom toolchain by doing this:

git clone git://

After that i build the kernel and an image:

MACHINE=beagleboard ./ config beagleboard
MACHINE=beagleboard ./ update
MACHINE=beagleboard ./ bitbake virtual/kernel
MACHINE=beagleboard ./ bitbake systemd-gnome-image

Then i use just a small Makefile for the Kernel Module:

obj-m := mod1.o

And this build script:

export SYSROOTS=${HOME}/source/toolchain/setup-scripts/build/tmp-
export PATH=${PATH}:${SYSROOTS}/x86_64-linux/usr/bin/armv7a-angstrom-
export ARCH=arm
export CROSS_COMPILE=arm-angstrom-linux-gnueabi-
export KERNELDIR=${SYSROOTS}/beagleboard/kernel
make -C ${KERNELDIR} M=$(pwd) modules

The Problem now:

tom@***:~/source/modtest$ ./
make: Entering directory `/home/tom/source/toolchain/setup-scripts/
CC [M] /home/tom/source/modtest/mod1.o
/bin/sh: scripts/basic/fixdep: not found
make[1]: *** [/home/tom/source/modtest/mod1.o] Error 127
make: *** [_module_/home/tom/source/modtest] Error 2
make: Leaving directory `/home/tom/source/toolchain/setup-scripts/

I think fixdep is used to find out the dependencies for something,
what do i have to do, to get fixdep.c compiled (source and Makefile
are present in this folder). And which platform do i have to compile
it to: ARM or x86 ? I think x86... but how can i do that?

--> I am using a Ubuntu Server Edition to do all the cross compiling.

Any suggestions are welcome!

Just write a recipe for your module that does 'inherit module'

I’ve had success with a simpler file. I source:

export ARM_TOOLCHAIN_PATH=~/BeagleBoard/oe/build/tmp-angstrom_2010_x-eglibc/sysroots/x86_64-linux/usr/bin/armv7a-angstrom-linux-gnueabi
export ARCH=arm
export CROSS_COMPILE=arm-angstrom-linux-gnueabi-

And then just run:
$ make modules

Maybe your exporting the other variables is confusing things.



I’m trying to build the hello_world module with the tree created by OE for my BB-xM
I found the directories :
I want to use this kind of makefile :

obj-m += hello-1.o
make ARCH=arm CROSS_COMPILE= -C kernel_include_repository M=$(pwd)  modules

I understand the theory, but I’m lost for the practice.
Where do I put the makefile and the source file to run it after ?
do I use /home/mum/OE/setup-scripts/build/tmp-angstrom_v2012_05-eglibc/sysroots/beagleboard/usr/include for the kernel_include_repository ?

Do you have any link/tutorial to explain how to do this ?
Thank youi