[maemo-developers] N900 kernel module recompile

From: Jeff Moe moe at blagblagblag.org
Date: Thu Feb 18 23:34:24 EET 2010
On Thursday 18 February 2010 10:18:48 Nils Faerber wrote:
> Hi all!
> After all that RPM vs DEB debate I thought I could bring up something
> more productive ;)
> 
> I would like to hack on some drivers on the N900, so I need to be able
> to recompile kernel modules. Ideally I would like only to replace
> modules, not the whole kernel+modules package.
> 
> So what I did was I installed the Maemo5 SDK first in order to get the
> proper toolchain.
> Then I took a vanilla 2.6.28 Linux kernel archive and applied the kernel
> patch from
> 	http://repository.maemo.org/pool/fremantle/free/k/kernel/
> 	kernel_2.6.28-20094803.3+0m5.diff.gz
> 
> Then I setup my comile environment:
> 
> export PATH=/scratchbox/compilers/cs2007q3-glibc2.5-arm7/bin/:$PATH
> export CROSS_COMPILE=arm-none-linux-gnueabi-
> export ARCH=arm
> 
> Then kernel config:
> cp arch/arm/configs/rx51_defconfig ./.config
> make oldconfig
> 
> A "make modules" does cleanly compile the modules. Fine so far (except
> for that te modules are *huge* and a "arm-none-linux-gnueabi-strip -R
> .not -R .comment --strip-unneeded" seems reasonable).
> 
> But when I try to load one of the new modules I get:
> 	-1 Invalid module format
> And dmesg shows:
> 	"no symbol version for struct_module"
> 
> This usually means that CONFIG_MODVERSIONS is not set but I double
> checked that and I do have "CONFIG_MODVERSIONS=y" in ".config".
> 
> I also changed the extra version name in the kernel toplevel Makefile,
> which should be correct (to my knowledge):
> 
> #NAME = Erotic Pickled Herring
> NAME = maemo
> 
> There is an older page about recompiling kernel for Diablo in the Wiki:
> 	http://wiki.maemo.org/Compiling_the_kenrel
> Would that still apply (of course replacing Diablo with Freemantle and
> N810 with N900 or RX51 respectively)?
> 
> Again, I just want to hack on one single module. So I would like to
> avoid having to flash a completely home-grown kernel+modules set
> (frankly that scares me a little ;)
> 
> 
> Any hint would be really appreciated ;)
> Some N900 kernel hackers around here?
> 
> Ideally I would like to make my changes available again so that others
> can also play with them by just replacing a single .ko-module...

This isn't exactly what you want, but should provide some hints:

http://wiki.maemo.org/User:Jebba/Kernel

This dir has my live scratchbox with some scriptlets which may help you see the procedure:
http://www.freemoe.org/users/jebba/scratchbox/kernel/

Have fun,

-Jeff Moe
More information about the maemo-developers mailing list