[Gllug] How to check if module is in kernel ?

Richard Jones rich at annexia.org
Mon Nov 15 11:21:47 UTC 2010


On Mon, Nov 15, 2010 at 12:03:52AM +0100, salsaman at xs4all.nl wrote:
> On Sun, November 14, 2010 23:53, John Hearns wrote:
> > /proc/config.gz contains the kernel configuration for the running kernel.
> > Is that any use?
> 
> i don't have that file on my system (ubuntu 10.10)

Everyone is confusing two different mechanisms by which the .config
file from the kernel source is made available at runtime:

Either: (a) the distro packaging system copies this file into
somewhere under / or /boot.  The exact location is not well-defined
and varies according to distro packaging whims.

Or: (b) the kernel can be configured so it includes this information
in the compiled kernel image, and it is made available through
/proc/config.  However since this increases the size of the kernel
image significantly, many distros disable this option.

In summary, looking in/for the config file is *not* a reliable way to
detect if a kernel supports a feature.

Instead the correct way to do it is as follows: look for /dev, /sys or
/proc devices or files which show evidence of the API, or use the API
and catch errors from its non-presence.  For some kernel APIs there
may be API-specific ways to tell if a feature of the API is available.
I've no idea if this is the case for V4L.

Rich.

-- 
Richard Jones
Red Hat
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list