Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Listing Kernel Modules
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
int3grate
n00b
n00b


Joined: 12 Mar 2005
Posts: 9

PostPosted: Thu Sep 15, 2005 8:14 pm    Post subject: Listing Kernel Modules Reply with quote

I find myself recompiling my kernel often, and it's helpful to have a script that list all the modules that were compiled.
I created a bash script that uses the command found in the documentation and strips out all the extraneous stuff, so just the modules themselves are listed. Make sure you substitute "<kernel version>" with the version of your current kernel .

bash script list_modules:
Code:
 
#!/bin/bash
find /lib/modules/<version version>/ -type f -iname '*.o' -or -iname '*.ko' |
rev | cut -d '/' -f1 | rev | cut -d '.' -f1


If you want, you can redirect the output right into your modules.autoload.d (replace "<kernel version>" with the version of your current kernel):
Code:

./list_modules > /etc/modules.autoload.d/<kernel version>


I thought someone might find this useful.

-Int3grate
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 44189
Location: 56N 3W

PostPosted: Thu Sep 15, 2005 8:21 pm    Post subject: Reply with quote

int3grate,

Have you tried
Code:
modprobe -l

It only works for the running kernel of course. You can also add -t for a tyep of module e.g.
Code:
-t net
for network modules.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
int3grate
n00b
n00b


Joined: 12 Mar 2005
Posts: 9

PostPosted: Thu Sep 15, 2005 8:23 pm    Post subject: lsmod Reply with quote

The script is an aid in finding modules that need to be loaded, not for listing modules that have already been loaded. Sorry for any confusion.

-Int3grate
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 44189
Location: 56N 3W

PostPosted: Thu Sep 15, 2005 8:59 pm    Post subject: Reply with quote

int3grate,

modprobe -l lists all the modules in
Code:
/lib/modules/`uname -r`/

Code:
lsmod
lists modules already loaded.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum