Re: Module Load order

From: Kay Sievers
Date: Sun Feb 26 2012 - 09:30:23 EST


On Sun, Feb 26, 2012 at 09:08, Prasanna Kumar T S M
<prasannatsmkumar@xxxxxxxxx> wrote:
> Is there any specific module load order in Linux? If there is a GPL
> driver and binary driver for a particular device which will be loaded?
> Is there any logic to load GPL driver built inside the kernel? Or is the
> module search and load is handled by some other component (like udev)
> and not the kernel? Sorry for my ignorance if I have asked this to a
> wrong list.

The order is defined by the link-order of the kernel build, the order
of appearance in the Makefile. The kernel build system creates
compiled-in modules which always have a defined link-order of init
functions. Loadable modules create a file modules.order which is
installed along with the kernel modules. The modules.order file read
by the modprobe tool, and if multiple modules match on the same
hardware alias, the modules are always loaded in the order specified
by that file.

In general, the compiled-in order and the loadable-module order are
always predictable and reflect the order of appearance in the kernel
Makefile.

Out-of-tree/proprietary modules do not hook into that facility and
there is usually no predictable order.

It is possible though, that the out-of-tree module can be installed in
a separate directory in lib/modules and the search order is defined in
/etc/depmod.d/*.conf. Not sure, if that always works, it's something
that usually only enterprise Linux versions use, need and test, and
which might not be available and doesn't get tested in usual
distributions which do not care at all about driver priorities.

Kay
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/