[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Discover 2.x brief tutorial



On Wed, Apr 23, 2003 at 10:54:39AM +0200, Petter Reinholdtsen wrote:
> [Branden Robinson]
> >> Agreed. I think ethdetect is the most critical thing to get working, and
> >> I'll try to have a look at it.
> > 
> > Cool.  As I said before, just let us know what you need.
> 
> OK.  The d-i modules using discover are now reorganized and rewritten
> to limit the discover-udeb dependency to a single package hw-detect in
> source ddetect.  I've tried to steal the code to handle both discover1
> and 2 from xfree86, but it only lists video cards.  I need the
> discover2 equivalent of the following command line:
> 
>   /sbin/discover --format="%m\t%V\t%M\n" \
>       --disable-all --enable=pci,ide,scsi,pcmcia scsi cdrom
> 
> How do I get discover2 to output the same info, only with kernel 2.4
> kernel module names?

I thought I'd answer this with a little bit of a tutorial.

What the above Discover 1.x command does is scan the PCI, IDE, SCSI, and
PCMCIA buses (and *only* those buses) for "scsi" and "cdrom" devices.

(We already see some of the terminological confusion arising from
Discover 1.x -- is one going to find a "scsi" device on a non-SCSI bus?)

Our output format is "<module name><tab><vendor name><tab><model
name><newline>".

Now let's apply the above to Discover 2.x.

To scan by device type, or class of hardware, with Discover 2.x, use the
"-t" or "--type-summary" option.  This option does not take arguments;
rather, it tells Discover how to interpret the operands (non-option
arguments).

E.g.:

% discover -t bridge        
Intel Corp 82815 Chipset Host Bridge and Memory Controller Hub 
Intel Corp 82815 Chipset AGP Bridge 
Intel Corp 82820 820 (Camino 2) Chipset PCI 
Intel Corp 82820 820 (Camino 2) Chipset ISA Bridge (ICH2) 
Intel Corp 82815 Chipset IDE controller 
Intel Corp 82815 Chipset USB (A) 

Because --type-summary sets Discover's "mode of operation", you can
search for as many device types as you wish:

% discover -t display network
ATI Technologies Inc Radeon [QD] 
Realtek Semiconductor Co Ltd RTL-8139 

Discover 2.x's "-d" ("--disable-bus") and "-e" ("--enable-bus") options
can be used to select the peripheral buses of interest.

The following command scans every bus supported by Discover 2.x except
for USB:

% discover -d all -e ata -e pci -e pcmcia -e scsi
Intel Corp 82815 Chipset Host Bridge and Memory Controller Hub 
Intel Corp 82815 Chipset AGP Bridge 
Intel Corp 82820 820 (Camino 2) Chipset PCI 
Intel Corp 82820 820 (Camino 2) Chipset ISA Bridge (ICH2) 
Intel Corp 82815 Chipset IDE controller 
Intel Corp 82815 Chipset USB (A) 
Intel Corp 82815 System Management bus controller 
ATI Technologies Inc Radeon [QD] 
Realtek Semiconductor Co Ltd RTL-8139 
Ensoniq ES1371 [AudioPCI-97] 

Finally, we may be interested in information about the hardware on the
system other than the vendor and model names of the devices.

For example, let's find the Linux kernel module name for all network devices on
the ATA, PCI, PCMCIA, and SCSI buses.

% discover -t -d all -e ata -e pci -e pcmcia -e scsi --data-path=linux/module/name network
8139too

When querying for Linux kernel module names, though, we probably want to
avail ourselves of Discover 2.x's data versioning ability.

For instance, the above output is wrong for 2.2.x Linux kernels.  Let's
construct a command that works for kernel 2.2.

% discover -t -d all -e ata -e pci -e pcmcia -e scsi --data-path=linux/module/name --data-version=2.2 network
rtl8139

All of the above is the good news.  The bad news is that there is no way
to *exactly* duplicate the output of the Discover 1.x command you
specified.  Perhaps with some enhancement to the discover(1) program,
this will be possible.

However, we can invoke the discover command twice to get the goods.

[Argh, sorry, something has come up at work and I cannot finish this
mail at the moment.  Hopefully the above is of some use.]

-- 
Branden Robinson          | GPG signed/encrypted mail welcome
branden@progeny.com       | 1024D/9C0BCBFB
Progeny Linux Systems     | D5F6 D4C9 E25B 3D37 068C
                          | 72E8 0F42 191A 9C0B CBFB



Reply to: