From: Valdis.Kletnieks@vt.edu (Valdis.Kletnieks at vt.edu)
To: kernelnewbies@lists.kernelnewbies.org
Subject: List my Staging Drivers
Date: Tue, 09 Dec 2014 20:50:47 -0500 [thread overview]
Message-ID: <72569.1418176247@turing-police.cc.vt.edu> (raw)
In-Reply-To: Your message of "Tue, 09 Dec 2014 22:18:48 -0200." <CAJyon0vqHauxYxy0=efGr1Hpk6pE5mQUUTutDj5jMSf6u_Ysgw@mail.gmail.com>
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"....
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 848 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20141209/abfc9ed0/attachment.bin
next prev parent reply other threads:[~2014-12-10 1:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-09 20:45 List my Staging Drivers Lucas Tanure
2014-12-09 20:53 ` Davide Gianforte
2014-12-09 21:19 ` Saket Sinha
2014-12-09 22:42 ` Lucas Tanure
2014-12-10 0:18 ` Lucas Tanure
2014-12-10 1:50 ` Valdis.Kletnieks at vt.edu [this message]
2014-12-10 13:21 ` Lucas Tanure
2014-12-09 21:04 ` Bjørn Mork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=72569.1418176247@turing-police.cc.vt.edu \
--to=valdis.kletnieks@vt.edu \
--cc=kernelnewbies@lists.kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).