Is there a complete list of kernel modules?

Using applications, configuring, problems
Message
Author
Shel
Posts: 103
Joined: Sat 11 Apr 2009, 17:33
Location: Seattle, WA, USA, or Southern France

Is there a complete list of kernel modules?

#1 Post by Shel »

Folks-

Can someone direct me to a complete list of Linux kernel modules, so I can tell what the various modules affect?

I know e100 is my Intel Ethernet card, and iw2100 is the WiFi card, but what are the others?

Thanks.

-Shel

User avatar
rjbrewer
Posts: 4405
Joined: Tue 22 Jan 2008, 21:41
Location: merriam, kansas

Re: Complete list of kernel modules

#2 Post by rjbrewer »

Shel wrote:Folks-

Can someone direct me to a complete list of Linux kernel modules, so I can tell what the various modules affect?

I know e100 is my Intel Ethernet card, and iw2100 is the WiFi card, but what are the others?

Thanks.

-Shel
Click "Setup" icon on desktop -> click "Configure startup of Puppy."

Inspiron 700m, Pent.M 1.6Ghz, 1Gb ram.
Msi Wind U100, N270 1.6>2.0Ghz, 1.5Gb ram.
Eeepc 8g 701, 900Mhz, 1Gb ram.
Full installs

Shel
Posts: 103
Joined: Sat 11 Apr 2009, 17:33
Location: Seattle, WA, USA, or Southern France

Re: Complete list of kernel modules

#3 Post by Shel »

rjbrewer wrote:Click "Setup" icon on desktop -> click "Configure startup of Puppy."
Thanks, but that only gives the (somewhat abbreviated) names of the modules.

However, that did lead me to pupscan, which can be cajoled into giving me a list of the loaded modules and, more importantly, descriptions.

What I'm trying to determine is which modules I can unload when the hardware they drive isn't in use. I realize that `modprobe -r` isn't supposed to unload something that you're using, but I'm a bit leery of just unloading random modules.

That's why I'm looking for a real list of _all_ the modules, with descriptions.

Thanks.

-Shel

User avatar
rjbrewer
Posts: 4405
Joined: Tue 22 Jan 2008, 21:41
Location: merriam, kansas

#4 Post by rjbrewer »

System > Pprocess shows all the running processes and allows killing them.

Top and Htop also show what's running.

Inspiron 700m, Pent.M 1.6Ghz, 1Gb ram.
Msi Wind U100, N270 1.6>2.0Ghz, 1.5Gb ram.
Eeepc 8g 701, 900Mhz, 1Gb ram.
Full installs

Shel
Posts: 103
Joined: Sat 11 Apr 2009, 17:33
Location: Seattle, WA, USA, or Southern France

#5 Post by Shel »

rjbrewer wrote:System > Pprocess shows all the running processes and allows killing them.

Top and Htop also show what's running.
Maybe I'm not making myself clear.

What I'm looking for is a list I can print out, that has the names and descriptions of all the loadable kernel modules Puppy installed on the computer. This would include the ones Puppy actually uses on my system, as well as all the ones it does not use.

Code: Select all

find /lib/modules -name '*.ko' | awk 'END {print NR}'
reports that there are 1565 loadable module files files on my computer. I want to know what all of them are for.

I'm sure such a list exists somewhere in the world. Maybe not on my Puppy installation, but surely at some Linux-developer-oriented website or someplace like that.

Thanks.

-Shel

User avatar
Sit Heel Speak
Posts: 2595
Joined: Fri 31 Mar 2006, 03:22
Location: downwind

Re: Complete list of kernel modules

#6 Post by Sit Heel Speak »

Shel wrote:...I'm looking for a real list of _all_ the modules, with descriptions.
try:
lspci -k
(show loaded kernel modules)
and
lspci -vv
(very verbose)

Shel
Posts: 103
Joined: Sat 11 Apr 2009, 17:33
Location: Seattle, WA, USA, or Southern France

Re: Complete list of kernel modules

#7 Post by Shel »

Sit Heel Speak wrote:
Shel wrote:...I'm looking for a real list of _all_ the modules, with descriptions.
try:
lspci -k
(show loaded kernel modules)
and
lspci -vv
(very verbose)
The -k option gives me an "invalid option" error message.

The -vv option is indeed verbose, but includes neither the name of the module nor a concise description.

And, of course, both are just for the loaded modules, not for _ALL_ the modules included with Puppy.

-Shel

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#8 Post by Béèm »

The -k option works perfectly on my machine, lucid 501.
It's not -K

There is that pci.ids file in /usr/share/misc, which holds 10990 line
The pci id's are in there and I suppose it's complete.

Also google is your friend for f.e. pci.ids
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

npierce
Posts: 858
Joined: Tue 29 Dec 2009, 01:40

#9 Post by npierce »

find /lib/modules/ -type f -exec modinfo -F filename '{}' ';' \
-exec modinfo -F description '{}' ';' | less

Shel
Posts: 103
Joined: Sat 11 Apr 2009, 17:33
Location: Seattle, WA, USA, or Southern France

#10 Post by Shel »

npierce wrote:find /lib/modules/ -type f -exec modinfo -F filename '{}' ';' \
-exec modinfo -F description '{}' ';' | less
Now that's some progress!

It gives descriptions of many, but not nearly all, of the modules.

Now, what about the rest of them? Got any ideas about finding the descriptions for them?

Thanks!

-Shel

User avatar
Sit Heel Speak
Posts: 2595
Joined: Fri 31 Mar 2006, 03:22
Location: downwind

#11 Post by Sit Heel Speak »

Béèm wrote:The -k option works perfectly on my machine, lucid 501.
It's not -K

There is that pci.ids file in /usr/share/misc, which holds 10990 line
The pci id's are in there and I suppose it's complete...
@Shel,

pci.ids (and its companion, usb.ids) is the key trove of information you are looking for.

I routinely install it on my machines without even thinking, so didn't remember that all "stock" Puppies do not come with it.

If you don't have pci.ids in /usr/share/misc then go download it from

http://pciids.sourceforge.net/

then run the lspci commands again

and you will see aaaa-lllllll the information you desire, on what is loaded.

As for a list of allllll modules that come with Puppy, it's the contents of /lib/modules/(kernel version number) (what npierce's suggested command shows) plus what is compiled into the kernel.

This latter, you can deduce by spelunking the kernel compile-time DOTconfig. There is an easier way but I don't remember it offhand. Anybody?

.

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#12 Post by Béèm »

SitHealpeak wrote:If you don't have pci.ids in /usr/share/misc then go download it from
And I don't have usb.ids in lucid 501.
Found it with google and did download it. Thanks for the info.
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#13 Post by Béèm »

There is another issue.
As far as I know, puppy don't have the lsusb script, so a usb.ids isn't exploited.
But I wonder how the information is retrieved in PupScan Interface Information.

In kdpup I found a lsusb script binary, copied it to sbin and did put the usb.ids /var/usbutils (had to create it) and have now:

Code: Select all

# lsusb
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 152d:2336 JMicron Technology Corp. / JMicron USA Technology Corp. Hard Disk Drive
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
# 
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

Shel
Posts: 103
Joined: Sat 11 Apr 2009, 17:33
Location: Seattle, WA, USA, or Southern France

#14 Post by Shel »

Béèm wrote:The -k option works perfectly on my machine, lucid 501.
It's not -K
... but not on Puppy 4.3.1.
There is that pci.ids file in /usr/share/misc, which holds 10990 line
The pci id's are in there and I suppose it's complete.
There are no files in /usr/share/misc on Puppy 4.3.1.

-Shel

Shel
Posts: 103
Joined: Sat 11 Apr 2009, 17:33
Location: Seattle, WA, USA, or Southern France

#15 Post by Shel »

Sit Heel Speak wrote:If you don't have pci.ids in /usr/share/misc then go download it from

http://pciids.sourceforge.net/

then run the lspci commands again
OK, I downloaded the file ...

Code: Select all

flatso:/root # ls -la /usr/share/misc
total 644
drwxr-xr-x  2 root root     60 2010-05-28 20:43 .
drwxr-xr-x 84 root root     60 2007-11-16 18:47 ..
-rw-r--r--  1 root root 650881 2010-05-28 20:43 pci.ids
flatso:/root # lspci -k
lspci: invalid option -- k
Usage: lspci [<switches>]

-v              Be verbose
-n              Show numeric ID's
-b              Bus-centric view (PCI addresses and IRQ's instead of those seen by the CPU)
-x              Show hex-dump of the standard portion of config space
-xxx            Show hex-dump of the whole config space (dangerous; root only)
-s [[<bus>]:][<slot>][.[<func>]]        Show only devices in selected slots
-d [<vendor>]:[<device>]        Show only selected devices
-t              Show bus tree
-m              Produce machine-readable output
-i <file>       Use specified ID database instead of /usr/share/pci.ids
-M              Enable `bus mapping' mode (dangerous; root only)
-P <dir>        Use specified directory instead of /proc/bus/pci
-H <mode>       Use direct hardware access (<mode> = 1 or 2)
-F <file>       Read configuration data from given file
-G              Enable PCI access debugging
I may have mentioned this; the -k option doesn't work under Puppy 4.3.1.
and you will see aaaa-lllllll the information you desire, on what is loaded.
Groovy, if it worked, but not what I'm looking for.
As for a list of allllll modules that come with Puppy, it's the contents of /lib/modules/(kernel version number) (what npierce's suggested command shows) plus what is compiled into the kernel.
Right, but only about 30% of the modules show descriptions with modinfo.

Thanks.

-Shel

User avatar
Béèm
Posts: 11763
Joined: Wed 22 Nov 2006, 00:47
Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win

#16 Post by Béèm »

Shel wrote:
Béèm wrote:The -k option works perfectly on my machine, lucid 501.
It's not -K
... but not on Puppy 4.3.1.
There is that pci.ids file in /usr/share/misc, which holds 10990 line
The pci id's are in there and I suppose it's complete.
There are no files in /usr/share/misc on Puppy 4.3.1.

-Shel
Altho I have 4.3.1 installed, I don't use it. I am in lucid or quirky.
Sorry to hear it doesn't have what you want.
Quite a difference for lspci then, as I have:

Code: Select all

# lspci --help
lspci: invalid option -- '-'
Usage: lspci [<switches>]

Basic display modes:
-mm		Produce machine-readable output (single -m for an obsolete format)
-t		Show bus tree

Display options:
-v		Be verbose (-vv for very verbose)
-k		Show kernel drivers handling each device
-x		Show hex-dump of the standard part of the config space
-xxx		Show hex-dump of the whole config space (dangerous; root only)
-xxxx		Show hex-dump of the 4096-byte extended config space (root only)
-b		Bus-centric view (addresses and IRQ's as seen by the bus)
-D		Always show domain numbers

Resolving of device ID's to names:
-n		Show numeric ID's
-nn		Show both textual and numeric ID's (names & numbers)
-q		Query the PCI ID database for unknown ID's via DNS
-qq		As above, but re-query locally cached entries
-Q		Query the PCI ID database for all ID's via DNS

Selection of devices:
-s [[[[<domain>]:]<bus>]:][<slot>][.[<func>]]	Show only devices in selected slots
-d [<vendor>]:[<device>]			Show only devices with specified ID's

Other options:
-i <file>	Use specified ID database instead of /usr/share/misc/pci.ids.gz
-p <file>	Look up kernel modules in a given file instead of default modules.pcimap
-M		Enable `bus mapping' mode (dangerous; root only)

PCI access options:
-A <method>	Use the specified PCI access method (see `-A help' for a list)
-O <par>=<val>	Set PCI access parameter (see `-O help' for a list)
-G		Enable PCI access debugging
-H <mode>	Use direct hardware access (<mode> = 1 or 2)
-F <file>	Read PCI configuration dump from a given file
#
Good you downloaded the pci.ids file then
Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
[url=http://puppylinux.org/wikka/HomePage]Consult Wikka[/url]
Use peppyy's [url=http://wellminded.com/puppy/pupsearch.html]puppysearch[/url]

Shel
Posts: 103
Joined: Sat 11 Apr 2009, 17:33
Location: Seattle, WA, USA, or Southern France

#17 Post by Shel »

Just to bring this to a close, and for completeness, I'd like to mention that a partial list of modules is installed with Puppy 4.3.1. The file

Code: Select all

/etc/networkmodules
contains names and descriptions of the, well, network modules that come with Puppy. While the file isn't well set up for automatic parsing, just having the names means one can grovel though the list of modules in use and know which ones have to do with networking.

-Shel

npierce
Posts: 858
Joined: Tue 29 Dec 2009, 01:40

#18 Post by npierce »

Shel wrote:Now, what about the rest of them? Got any ideas about finding the descriptions for them?
Shel,

Although you now have the pci.ids file recommended by Sit Heel Speak, it hasn't been of much use to you because (as you have verified) the lspci version 2.1.11 used by Puppy 4.3.1 doesn't support the -k option.

Below are a couple of short scripts that should help you make use of the data in the pci.ids file. You will also need the usb.ids file that Sit Heel Speak mentioned (I found a copy at http://www.linux-usb.org/usb.ids).

These scripts still won't give you a description of every single module, but should help you to find some identities which you haven't found elsewhere. Not surprisingly, pci.ids and usb.ids have information only for hardware devices used on the PCI and USB buses, but that covers a lot of ground.

The first script, bus_device_name, supplies the vendor and device names when given the bus type, vendor ID, and device ID. For your purposes, this script is called from the second script; you won't need to run this script directly.

The second script, mod_device_name, when given a module name, lists all of the vendor and device names supported by the module if vendor and device IDs are available in modules.alias and names are available in pci.ids or usb.ids.

Here are the scripts. Put them in /usr/local/bin/ or anywhere else in $PATH.

(When trying to read these scripts remember to make your browser window wide enough to prevent line-wrapping.)

bus_device_name

Code: Select all

#!/bin/sh
[ $5 ] || [ -z $3 ] || ( [ "$1" != "pci" ] && [ "$1" != "usb" ] ) && echo -e \
"Usage: bus_device_name pci|usb <vendor id> <device id> [<.ids directory>]\n"\
"Where: <vendor id> and <device id> are exactly four hex digits each\n"\
"   and optional <.ids directory> is location of pci.ids and usb.ids" && exit
IDS="$1.ids"
[ $4 ] && [ ! -f $4/$IDS ] && echo "$4/$IDS file not found." && exit
DIR=$4
[ -z "$DIR" ] && DIR=/usr/share/misc
[ ! -f $DIR/$IDS ] && DIR=/usr/share
[ ! -f $DIR/$IDS ] && echo "$IDS file not found." && exit
VENDOR_ID=`echo $2 | tr "ABCDEF" "abcdef"`
DEVICE_ID=`echo $3 | tr "ABCDEF" "abcdef"`
VENDOR_NAME=`grep -m 1 "^$VENDOR_ID" $DIR/$IDS`
[ -z "$VENDOR_NAME" ] && echo "$VENDOR_ID [not found]" && exit
VENDOR_NAME2=`(grep -m 1 "^$VENDOR_ID" ; grep -m 1 "^[0-9a-f]" ) < $DIR/$IDS`
DEVICE_NAME=`(grep -m 1 "^$VENDOR_ID" ; grep -m 1 "^[0-9a-f]
^.$DEVICE_ID" ) < $DIR/$IDS`
[ "$DEVICE_NAME" = "$VENDOR_NAME2" ] && echo \
"$VENDOR_NAME  $DEVICE_ID [not found]" && exit
echo "$DEVICE_NAME"
mod_device_name

Code: Select all

#!/bin/sh
[ $# != 1 ] && echo "Usage: mod_device_name <module-name>" && exit
DIR=/usr/share/misc
[ -f $DIR/pci.ids ] && [ -f $DIR/usb.ids ] || DIR=/usr/share
[ -f $DIR/pci.ids ] && [ -f $DIR/usb.ids ] || { echo ".ids missing" ; exit ; }
MODULES_ALIAS=/lib/modules/`uname -r`/modules.alias
DEVICE_LIST=`grep " $1$" $MODULES_ALIAS | cut -f 2 -d ' '`
for DEVICE in $DEVICE_LIST ; do
[ "`echo "$DEVICE" | cut -b 6`" != "*" ] ; HAVE_ID=$?
if [ $HAVE_ID = 0 ] && [ "`echo "$DEVICE" | cut -b 1-5`" = "pci:v" ] ; then 
echo -n "pci "
VENDOR_ID=`echo "$DEVICE" | cut -b 10-13`
DEVICE_ID=`echo "$DEVICE" | cut -b 19-22`
bus_device_name pci $VENDOR_ID $DEVICE_ID $DIR
elif [ $HAVE_ID = 0 ] && [ "`echo "$DEVICE" | cut -b 1-5`" = "usb:v" ] ; then
echo -n "usb "
VENDOR_ID=`echo "$DEVICE" | cut -b 6-9`
DEVICE_ID=`echo "$DEVICE" | cut -b 11-14`
bus_device_name usb $VENDOR_ID $DEVICE_ID $DIR
else
echo $DEVICE
fi
done
pci.ids and usb.ids

Your pci.ids and usb.ids files should both be in in /usr/share/misc/ or both be in /usr/share/ (two common places for pci.ids, depending upon the version of lspci). If yours are somewhere else, you can use a symlink, or modify the scripts.


mod_device_name

Now you should be able to run mod_device_name with the name of the module you are interested in and get a list of devices, like this:

Code: Select all

# mod_device_name snd-emu10k1
pci 1102  Creative Labs
        0002  SB Live! EMU10k1
pci 1102  Creative Labs
        0004  SB Audigy
pci 1102  Creative Labs
        0008  SB0400 Audigy2 Value
As you can see, each device lists on two lines. The format is

<bus> <vendor id> <vendor name>
<device id> <device name>

(Note that although I use the term "device" when speaking of both PCI and USB devices, I believe "product" is the preferred term for the USB bus "products". I'll just stick with "device" here, since using both terms complicates matters.)

The modules.alias file doesn't always show a specific device in the alias. Sometimes it just gives class and/or protocol information. This script doesn't decode that, but simply lists the raw alias, in which case you will see something like this:

Code: Select all

# mod_device_name hwa-hc   
usb:v*p*d*dc*dsc*dp*icE0isc02ip01*
And because devices not on the PCI or USB buses are not included in pci.ids and usb.ids, such devices are not supported by this script. Again the script will list a raw alias, like this:

Code: Select all

# mod_device_name snd   
char-major-116-*
Hyphens or underscores? Module names in modules.alias mostly use hyphens. For some reason, however, there are some that use underscores instead. Try hyphens first, and if nothing is found try underscores.


bus_device_name

The first script, bus_device_name, can be run directly if you know a device's bus type, vendor ID. and device ID. Supply those parameters in that order. The bus type is either pci or usb. The vendor and device IDs must each have exactly four hexadecimal digits (so use leading zeros if necessary, but don't use the "0x" prefix).

Optionally you may supply, as a fourth parameter, the name of the directory in which pci.ids and usb.ids live. Since the script searches for those files anyway, it is not worth taking your time to type the directory name unless the files are in an unusual place. The real reason this fourth parameter is available is that it is supplied by the mod_device_name script when it calls bus_device_name, which saves time for the latter since it won't have to go hunting for the files with each iteration.


Anyway, I hope you find the scripts useful. They are rather minimal, not very efficient, not bullet-proof, and are bound to have a bug or two lurking in them. But they seem to work fairly well for me, so I hope they will for you.

By the way, Sit Heel Speak, thanks for letting us know about pci.ids and usb.ids. I learned a lot from working with them.

--Norm

Shel
Posts: 103
Joined: Sat 11 Apr 2009, 17:33
Location: Seattle, WA, USA, or Southern France

#19 Post by Shel »

npierce, you are a scholar and a gentleman!

That's great stuff.

To add my tiny bit, I'll say that you can find the names and descriptions of the networking modules in use (say if you want to unload and reload 'em) with some variation on ...

Code: Select all

for i in `/sbin/lsmod | cut -d' ' -f1` ; do
     grep "^$i " /etc/networkmodules
 done
... but that's not a patch on what you and SitHeelSpeak dug up.

Thanks a ton.

-Shel

npierce
Posts: 858
Joined: Tue 29 Dec 2009, 01:40

#20 Post by npierce »

You're welcome!

And thanks for your code, which works fine for me. It's short and sweet and does the job.

--Norm

Post Reply