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

Richard Jones rich at annexia.org
Mon Nov 15 11:13:55 UTC 2010


On Mon, Nov 15, 2010 at 12:14:19AM +0000, James Courtier-Dutton wrote:
> On 14 November 2010 21:18,  <salsaman at xs4all.nl> wrote:
> > Hi, I am currently working on a plugin which uses vloopback. Vloopback can
> > be either installed as a module or compiled directly into the kernel.
> >
> > If it is a module, it is easy to check for its presence with lsmod | grep
> > vloopback. However, this will fail if the module is compiled into the
> > kernel. Is there some way to check for this in linux ?
> >
> 
> I have not used vloopback, but as modules initialise they normally
> output at least one line to the kernel log.
> So, look in "dmesg".

This is a bad idea.  dmesg is a fixed ring, and older messages may
have fallen off the end.

> Another option is to simply see if the needed files in /dev are present.

Looking for some evidence of the module by what devices, proc entries
or sys entries it exports is the right thing to do.  A variation on
this is to open and use the API blindly, and catch the errors when
specific API calls fail because the module is not present.

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