Re: List my Staging Drivers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 09 Dec 2014 22:18:48 -0200, Lucas Tanure said:

> This command:
> 
> $ lsmod  | grep -Eo '^[^ ]+' | sed 1d | xargs modinfo | grep filename

Note that only finds stuff that's been built with CONFIG_FOOMOD=m,  Modules
that were built into the kernel with =y won't show on an lsmod.  On my laptop
at the moment:

% lsmod | wc -l
34
% ls /sys/module | wc -l
129

Quite obviously, relying on lsmod isn't going to help.

So you really want something like:

% ls /sys/module | xargs modinfo 2> /dev/null | grep filename
% echo the following are built-in; echo `ls /sys/module | xargs modinfo 2>&1 > /dev/null | awk '{print $4}'`

The following *seems* to work.  I admit I haven't tested it against a distro kernel
where the build/ and source/ symlinks may point different places, etc etc...

find /lib/modules/`uname -r`/build/ `ls /sys/module | xargs modinfo 2>&1 > /dev/null | awk '{print " -name " $4".o -o"} END {print "-name null"}'`

(And even the 129 entries in /sys/module doesn't cover the whole story.

find /lib/modules/3.18.0-next-20141208/build/ -name '*.o' | wc -l
4257
zgrep =y /proc/config.gz | wc -l
1072

So there's *lots* more chunks of code that are builtin as options that
simply don't identify as "modules".  At that point, it's time to re-ask
what question you *really* wanted answered. "Find drivers that I'm using"
is *not* the same thing as "what modules do I have"....


Attachment: pgpRpiOPXJCTI.pgp
Description: PGP signature


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux