Re: Cross-compile kernel modules
From: Chris Hallinan <hidden>
Date: 2005-02-20 14:58:23
On Sun, Feb 20, 2005 at 10:49:50AM +0100, Markus Westergren wrote:
Hi, I'm trying to get loadable kernel modules support on a Adder development board. The kernel is cross-compiled on an regular PC and boots fine but I can't insert any modules into the running kernel, all I get is undefined reference for all functions called by the module. I use the kernel module utilities (insmod, lsmod, modprobe) supplied by BusyBox to manage the modules on the Adder board.
You don't give many details, but in general the above should work, assuming you have properly built and configured your kernel, modules and root file system.
What am I doning wrong? Do I need to perform any aditional steps when
Yes. You need to make sure your modules are built from the same kernel source tree, with the same configuration as the kernel you are booting. Then you need to install those modules on your target's root file system. In general, you must do a 'make modules' followed by a 'make modules_install' with INSTALL_MOD_PATH pointing to your target's root file system. The details depend on how you've built your rootfs and your cross-development setup. I usually mount my rootfs image on a loop device somewhere, and point INSTALL_MOD_PATH to it.
cross-compiling kernel modules? My cross-compile toolchain have no depmod so I
Fix your development environment.
have no modules.dep file. But I only need it if a module depend on other modules, right?
modprobe depends on modules.dep. You can run depmod on your target assuming you have the depmod binary for your architecture on your target file system. Regards, Chris
/Markus ----------------- Markus Westergren Biologigrand 17 907 32 Umea SWEDEN _______________________________________________ Linuxppc-embedded mailing list Linuxppc-embedded@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-embedded
-- Chris Hallinan clh at net1plus d0t com - via mutt/Linux ----------------------------------