Image modules?

Rask Ingemann Lambertsen ccc94453 at
Sun Jul 5 21:06:45 CEST 2009

On Sat, Jul 04, 2009 at 08:45:12PM +0200, David Fokkema wrote:
> On Sat, 2009-07-04 at 17:52 +0200, Glenn Moeller-Holst wrote:
> > This is what I am not able to read anywhere:
> > *I actually do not know if I already having modules installed? How do
> > I test it?
> Look in /lib/modules/<kernel-version>, or unpack the modules file and
> check. You'll find you already have it.
> > *Why is there a separate file called modules? Why not include it in the image?
> It _is_ included in the root image, as it lives in the root filesystem
> in /lib/modules. The thing is: if you decide to use that kernel but
> _not_ use that root filesystem (because you'd like to build your own,
> for example, or you just want to upgrade your kernel and _not_ your
> filesystem) you'll have to untar the corresponding modules into your own
> filesystem.

   Once you've extraced the modules into /lib/modules/<version>, do remember
to run (as root)

depmod -a <version>

because not all distribution do so during startup. Supposed the rootfs is on
an external card reader mounted on /mnt/flash, the depmod command becomes

depmod -a -b /mnt/flash <version> 

   For someone working on the kernel, modules are very useful because you
can test your changes simply with

rmmod <module>; modprobe <module>

instead of rebooting. 

   Some distribution (e.g. Fedora) ship a kernel image with only a few
drivers and generate a customized initial ram disk with modules during
kernel installation. So the same kernel build works across the supported
systems without being bloated by unused drivers.

Rask Ingemann Lambertsen
Danish law requires addresses in e-mail to be logged and stored for a year

More information about the community mailing list