Gentoo Archives: gentoo-user

From: Michael Mol <mikemol@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Anyone can afford information about build kernel?
Date: Sun, 09 Oct 2011 13:41:46
Message-Id: CA+czFiB8jkqRJkAJmYZHSXku_a-4-QQSfFg22gPk2C8+ge9kbQ@mail.gmail.com
In Reply to: Re: [gentoo-user] Anyone can afford information about build kernel? by Michael Mol
1 On Sun, Oct 9, 2011 at 9:30 AM, Michael Mol <mikemol@×××××.com> wrote:
2 > On Sun, Oct 9, 2011 at 12:53 AM, Lavender <448463782@××.com> wrote:
3 >> Yeah, your reply is exact what I mean , but I'm really confused by those
4 >> modules' names, I can't find any contact between the hard device name and
5 >> its module name . For example,  there is a module named 3c59x.ko , I totally
6 >> don't know what device it present for ,
7 >
8 > This got a *lot* easier back when sysfs was added.
9 >
10 > cd /sys/module/<modulename>/drivers/
11 >
12 > And go from there
13 >
14 > lspci will help you see the 'text' name for the device in question.
15 >
16 > For example, let's say I don't know what the 'ahci' module is for.
17 >
18 > $ cd /sys/module/ahci/drivers
19 > $ ls
20 > pci:ahci
21 > $ cd pci\:ahci/
22 > $ ls
23 > 0000:00:11.0  bind  module  new_id  remove_id  uevent  unbind
24 > $ sudo lspci|grep 11.0
25 > 00:11.0 SATA controller: ATI Technologies Inc SB700/SB800 SATA
26 > Controller [AHCI mode]
27 > $
28 >
29 > So now I know the ahci module manages my SATA controller.
30
31 Came up with something possibly a little handier. This command should
32 tell you what driver is associated with every device on the system.
33
34 find /sys/devices -name driver -print0|xargs -0 ls -l|cut -d' '
35 -f10-|sed -e 's/\.\.\///g'
36
37 Output could probably still be a bit better cleaned up, but it should help.
38
39 --
40 :wq

Replies