]> pere.pagekite.me Git - homepage.git/blobdiff - blog/data/2011-01-23-hardware-info.txt
Generated.
[homepage.git] / blog / data / 2011-01-23-hardware-info.txt
index fad634966d6e193a37826a359a082f912e63b3e6..0872e6affed6417e063bdeac91ea4d8a3277145c 100644 (file)
@@ -1,14 +1,18 @@
-Title: Which module is loaded for a given PCI device?
+Title: Which module is loaded for a given PCI and USB device?
 Tags: english, debian
-Date: 2011-01-23 00:15
+Date: 2011-01-23 00:20
 
-<p>In the discover-data package in Debian, there is a script to report
-useful information about the running hardware for use when people
-report missing information.  One part I find very useful when
-debugging, is the part report which kernel module is loaded for a
-given PCI device.  To see the output, make sure discover-data is
-installed and run <tt>/usr/share/bug/discover-data 3>&1</tt>.  The
-relevant output on one of my machines like this:
+<p>In the
+<a href="http://packages.qa.debian.org/discover-data">discover-data</a>
+package in Debian, there is a script to report useful information
+about the running hardware for use when people report missing
+information.  One part of this script that I find very useful when
+debugging hardware problems, is the part mapping loaded kernel module
+to the PCI device it claims.  It allow me to quickly see if the kernel
+module I expect is driving the hardware I am struggling with.  To see
+the output, make sure discover-data is installed and run
+<tt>/usr/share/bug/discover-data 3>&1</tt>.  The relevant output on
+one of my machines like this:</p>
 
 <pre>
 loaded modules:
@@ -37,7 +41,7 @@ if [ -d /sys/bus/pci/devices/ ] ; then
                 module=`cd $address/driver/module ; pwd -P | xargs basename`
                 if grep -q "^$module " /proc/modules ; then
                     address=$(echo $address |sed s/0000://)
-                   id=`lspci -n -s $address | tail -n 1 | awk '{print $3}'`
+                    id=`lspci -n -s $address | tail -n 1 | awk '{print $3}'`
                     echo "$id $module"
                 fi
             fi