LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   Beagleboard Kernel Module Cross Compiling (http://www.linuxquestions.org/questions/programming-9/beagleboard-kernel-module-cross-compiling-926335/)

dreamer2000 01-29-2012 01:12 PM

Beagleboard Kernel Module Cross Compiling
 
Hi!

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://git.angstrom-distribution.org/setup-scripts

After that i build the kernel and an image:

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

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

obj-m := mod1.o

And this build script:

#!/bin/bash
export SYSROOTS=${HOME}/source/toolchain/setup-scripts/build/tmp-angstrom_2010_x-eglibc/sysroots
export PATH=${PATH}:${SYSROOTS}/x86_64-linux/usr/bin/armv7a-angstrom-linux-gnueabi
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$ ./run.sh
make: Entering directory `/home/tom/source/toolchain/setup-scripts/build/tmp-angstrom_2010_x-eglibc/sysroots/beagleboard/kernel'
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/build/tmp-angstrom_2010_x-eglibc/sysroots/beagleboard/kernel'

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!
Thanks, Tom


All times are GMT -5. The time now is 05:23 PM.