How do I compile kernel modules on the beagleboard itself?

How do I compile kernel modules on the beagleboard itself?

It seems I need the directory /lib/modules/$(uname -r)/build, but this
directory is absent, even after installing the kernel headers (opkg
install kernel-headers). I know it is possible to build kernel modules
using some kind of cross compiling environment, but I'd like to build
the modules on the beagleboard itself for simplicity and since compile
speed is not really important in this case. Extensive googling didn't
provide an answer.

So,
1. Is it possible to natively build kernel modules on the beagleboard?
2. If so, how do I obtain the necessary files?

Thanks in advance!

How do I compile kernel modules on the beagleboard itself?

Not sure what kernel you're using on the BB, however, most kernels are
compiled with module version support, which would only allow loading
of modules specifically for that kernel version.

1. Is it possible to natively build kernel modules on the beagleboard?

Yes, the step would be similar to what you would do if you needed to
build kernel for Ubuntu-x86, for example.

2. If so, how do I obtain the necessary files?

I dont use angstrong so I wouldn't know if you can pull down gcc,
kernel headers from angstrong package manager. Depending on how the
kernel module is packaged, usually you just execute something like the
below syntax in the module directory.

make KDIR=<path to kernel main dir> -f <local make file>

Depending on the output of (uname -r) i may be help you with 2..

Regards,

Uname -r gives 2.6.32.

i don't remember if opkg had a get source command..

So you'll have to decode it:

bb script: http://cgit.openembedded.org/cgit.cgi/openembedded/tree/recipes/linux/linux-omap-psp_2.6.32.bb

most of the patches:
http://cgit.openembedded.org/cgit.cgi/openembedded/tree/recipes/linux/linux-omap-psp-2.6.32

Regards,