discover(1)

discover ๐Ÿ’… โ€” the manual page, bestie edition

ok so real talk: this is discover(1), a General Commands Manual page, and by the end of this you're gonna know it like the back of your hand. no cap. ๐Ÿซถ


โœจ NAME โœจ

discover โ€” hardware detection utility. that's it. that's the whole vibe. it finds your hardware. she's an icon, she's a legend, and she is the moment. ๐Ÿ‘‘


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

ok bestie here's how you actually call her, and yes there are multiple whole forms so let's not skip any:

discover [DATA_OPTIONS]  [DISPLAY_OPTIONS]  [--bus-summary]  [bus ...]

discover [DATA_OPTIONS]  [DISPLAY_OPTIONS] --type-summary  [type ...]

discover [DATA_OPTIONS] --data-path=path/to/data ...  [--data-
version=version]  [--normalize-whitespace]  [--format=format string]
[type | id ...]

and then the two lil option groups, because the manpage is being cute about it:

DATA_OPTIONS

  • -d | --disable-bus=bus
  • -e | --enable-bus=bus
  • --insert-url=url
  • --append-url=url
  • -v | --verbose

DISPLAY_OPTIONS

  • --model | --no-model
  • --model-id | --no-model-id
  • --vendor | --no-vendor
  • --vendor-id | --no-vendor-id

๐ŸŒธ Description ๐ŸŒธ

so discover gives you an extensible hardware detection and reporting interface. the hardware info lives in an XML data format, and you can literally pull it across the network. she's networked. she's extensible. she ate. ๐Ÿ’–

the fundamental modes of operation are:

  • Display a list of hardware devices based on the type of device, or based on the system bus the devices live on โ€” you do this with --type-summary or --bus-summary (and --bus-summary is the default behavior, iykyk).
  • Query specified data for attached hardware, using --data-path.

๐Ÿ’… Options ๐Ÿ’…

this is the long part bestie, hydrate, get a snack, we're doing all of them. ๐Ÿ“

  • -h | --help โ€” shows you a simple help message. low effort, high reward.
  • -v | --verbose โ€” tells the tool to give you feedback while it's doing its thing. โš ๏ธ important: this affects the output as discover parses certain arguments, so it should appear early in the command line. put it up front, bestie. don't be shy.
  • -V | --version โ€” shows the tool name and the version. simple. iconic. โœจ
  • -b | --bus-summary โ€” this is the default behavior: display basic info about all devices on the appropriate buses. see "Selecting Buses" below. ๐Ÿ‘‡
  • -t | --type-summary โ€” summarize devices by class of hardware. examples of valid device types include broadband, fixeddisk, display, and network. see "Device Types". ๐ŸŒˆ
  • --data-path=path/to/data โ€” query matching devices for detailed info. device-specific data is stored in a hierarchical fashion, and your query argument is basically strings naming each level in that hierarchy.

usually the top-level component of the data path is the ``platform'' that needs the info โ€” like linux or xfree86. for example, to get the Linux kernel module name for a piece of hardware, your --data-path argument would be linux/module/name.

๐Ÿšจ heads up: if you give multiple --data-path arguments and you don't provide a format string (see --format), only the last path gets used. that's it. one path. the last one.

see also the --data-version argument. ๐Ÿ‘€

  • --data-version=version โ€” specify a version string for the platform that'll use the info from --data-path.

this string must be in dotted-decimal notation so it can be matched against a range of values, which means it's allowed to be shorter than the real version. slay, shorthand. ๐Ÿ’…

  • --format=format string โ€” controls the output of your --data-path query results. this format string should follow printf(3) specifications, except only %s and the appropriate flags, precision, and width values are supported (or even make sense). literal text and %% also work.
๐Ÿ’€ the behavior when the string is poorly formatted is undefined. so like. don't. bestie. please.

see also --normalize-whitespace.

  • -d | --disable-bus=bus โ€” use this to override the list of buses to scan by default, as defined in discover.conf. use all as the argument to disable all the buses โ€” but that's only useful if you follow it up with --enable-bus (or -e) arguments. combo move. ๐ŸŽ€
  • -e | --enable-bus=bus โ€” specify a bus to be scanned. that's the whole thing. she's simple.
  • --insert-url=url โ€” insert a URL at the head of the list of network resources to include when searching for hardware info. ๐Ÿ”ฅ earlier data overrides later data, so if you wanna override the local data sources, insert your URLs into the list. see also --append-url.
  • --append-url=url โ€” append a URL to the end of the list of network resources to search for hardware info. see also --insert-url. (insert = front of the line, append = back of the line, that's the tea โ˜•)
  • --model โ€” include the model description in summary info. this is enabled by default.
  • --model-id โ€” include the numeric model identifier in summary info.
  • --no-model โ€” do not include the model description in summary info.
  • --no-model-id โ€” do not include the numeric model identifier in summary info. this is the default.
  • --vendor โ€” include the vendor description in summary info. this is enabled by default.
  • --vendor-id โ€” include the numeric vendor identifier in summary info.
  • --no-vendor โ€” do not include the vendor description in summary info.
  • --no-vendor-id โ€” do not include the numeric vendor identifier in summary info. this is the default.
  • --normalize-whitespace โ€” consolidate whitespace in the results of a --data-path query. the default is NOT to do so, which faithfully reproduces all text in the raw XML data.

with this option on, leading and trailing whitespace is removed, and any consecutive internal whitespaces get compressed down to a single space character. tidy. โœจ


๐ŸšŒ Selecting Buses ๐ŸšŒ

ok so discover.conf defines two lists of system buses:

  • one to scan by default (used by the discover command)
  • one to never scan (used by the Discover library)

you can override and/or extend the default bus list with --disable-bus and --enable-bus. ๐Ÿ’…

๐Ÿšจ but the list of buses NOT to scan cannot be overridden without changing discover.conf โ€” so that list should only be used for buses that may be dangerous to probe. respect the danger list, bestie. fr fr.

both arguments accept the string `all` as a value.

if a bus summary is being performed โ€” which is indicated either by the presence of --bus-summary, or by the absence of both --type-summary and --data-path โ€” then any unattached arguments on the command line get interpreted as the only buses to scan. this is equivalent to using --disable-bus all before invoking --enable-bus for the buses you actually care about. ๐ŸŽฏ

the following buses are currently supported by Discover:

  • ata
  • pci
  • pcmcia
  • scsi
  • usb

โ€ฆand that's where part 1 wraps, bestie โ€” more is coming, don't go anywhere ๐Ÿฆ‹

๐Ÿ’– DEVICE TYPES ๐Ÿ’–

okay so here's the tea, bestie: Discover doesn't just vibe with whatever raw device types each bus throws at it โ€” it has its own little taxonomy, and every bus's device types get mapped onto these. Discover currently recognizes the following device types:

  • audio โ€” a device that can produce an analog or digital sound signal. Basically, if you'd call it a "sound card" in casual conversation, Discover is filing it under audio. periodt.
  • bridge โ€” a device that opens the door to devices of a different type, usually on a different bus. Think consumer PCI chipsets that come with a bridge over to ATA (aka IDE) devices. it's giving "middle management for hardware". ๐ŸŒ‰
  • broadband โ€” an interface to a computer communications network, but implemented on top of a technology that was not explicitly designed for that job. examples: ISDN terminal adapters, DSL "modems", and cable "modems". Important: analog phone-line modems do not count here โ€” they get their own category (scroll down to modem). ๐Ÿ™ˆ
  • display โ€” a device controlled by the host machine's CPU that can produce an analog or digital video signal for output. you know it, you love it: the "video card". Discover calls it a display device. โœจ
  • fixeddisk โ€” a high-speed, fixed magnetic storage device, like a hard disk drive. not included: removable media stuff like floppy disk drives, CD-ROM drives, magneto-optical devices, tape drives, and Compact Flash card readers. they're in other buckets, iykyk. ๐Ÿ’…
  • humaninput โ€” a device that takes tactile input from a person to direct what the computer does. keyboards, mice, trackballs, joysticks, gamepads, digital tablets you poke with a stylus or a finger, and so on. not included: input devices that figure out your intent by non-tactile means โ€” speech-recognition devices, cameras, that whole squad. ๐Ÿซถ
  • imaging โ€” a device that captures still images for input. scanners and digital cameras, hello. not included: motion-capture devices like television tuner cards, webcams, and digital video cameras. ๐Ÿ“ธ
  • miscellaneous โ€” literally anything that can't logically be classified as another device type. the catch-all bin, the group chat everyone eventually ends up in. ๐Ÿ—‘๏ธโœจ
  • modem โ€” an analog phone-line modulator/demodulator. Discover classifies it as a modem device, and no other kind of device gets this label. exclusive. ๐Ÿ‘‘
  • network โ€” an interface to a conventional computer data communications network that does not need a terminal adapter. Ethernet and Token Ring NICs? yes bestie, network devices. Analog phone-line modems; terminal adapters for things like ISDN and DSL; and "cable modems"? not network devices. sorry not sorry. ๐ŸŒ
  • optical โ€” an optical-technology storage device, often using read-only media. by far the most common examples are CD-ROM and DVD-ROM drives โ€” including the versions of those drives that can "burn" (write to) optical discs. ๐Ÿ”ฅ
  • printer โ€” a device that renders visual output in a permanent or semi-permanent way onto a physical medium. and yeah, if you'd colloquially call it a "printer", Discover probably agrees with you. ๐Ÿ–จ๏ธ
  • removabledisk โ€” storage devices with removable media using just about any technology except magnetic tape, CD-ROM, and DVD-ROM drives. examples: floppy disk drives, magneto-optical drives, and Compact Flash card readers. ๐Ÿ’พ
  • tape โ€” a sequential-access mass storage device using magnetic tape. commonly used for archival and backup purposes; DAT drives are the classic example. ๐Ÿ“ผ
  • video โ€” a device that produces a real-time digital video signal for input. webcams, digital video cameras, and television tuners all say hi. note: still digital cameras with "movie" capability are not considered video devices unless they can transmit the live video signal to the host in real time. โฑ๏ธ

๐ŸŒˆ EXAMPLES ๐ŸŒˆ

Scan the local buses

# discover
Intel Corporation 82815 Chipset Host Bridge and Memory Controller Hub
unknown unknown
unknown unknown
unknown unknown
Intel Corporation 82815 Chipset IDE controller
Intel Corporation 82815 Chipset USB (A)
Intel Corporation 82815 System Management bus controller
ATI Technologies, Inc. Rage 128 Pro GL [PF]
3Com Corporation 3c905C-TX [Fast Etherlink]
Ensoniq ES1371 [AudioPCI-97]
unknown unknown

View PCI video cards

# discover -v --type-summary --disable-bus all --enable-bus pci display
Disabled pci
Disabled pcmcia
Disabled scsi
Disabled usb
Enabled pci
Loading XML data... pci Done
Scanning buses... pci Done
ATI Technologies, Inc. Rage 128 Pro GL [PF]

Query for the driver module for XFree86 server version 4.2.0

# discover --data-path=xfree86/server/device/driver --data-version=4.2.0 display
ati

Get model and vendor information by type

$ discover -t --no-model
Intel Corporation
NVIDIA Corporation
3Com Corporation
$ discover -t --no-vendor
82815 System Management bus controller
Vanta [NV6]
3c905C-TX [Fast Etherlink]

๐Ÿ—‚๏ธ FILES ๐Ÿ—‚๏ธ

  • /etc/discover.conf.d โ€” the directory holding the configuration files that control the default behavior for both the discover tool and the Discover library. two for one, we love to see it. ๐Ÿ’–
  • file:///lib/discover/list.xml โ€” an XML file containing URLs with hardware information. this list can be extended with --append-url and --extend-url. ๐Ÿ”—

๐Ÿ‘‘ AUTHORS ๐Ÿ‘‘

Josh Bressers, John R. Daily, and G. Branden Robinson developed the current implementation of Discover for Progeny Linux Systems. iconic trio behavior. โœจ

The Linux implementation of the system-dependent interfaces is derived from detect, by MandrakeSoft SA. shoutout to the ancestors. ๐Ÿซก


๐Ÿ”ญ SEE ALSO ๐Ÿ”ญ

discover.conf(5), discover-modprobe(8)


and that's the whole discover(1) page, bestie โ€” go forth, scan some buses, and remember: when in doubt, it's probably miscellaneous ๐Ÿ’…๐ŸŒธ๐Ÿฆ‹

mwah ๐Ÿ’‹ โ€” xoxo, your favorite manpage, discover(1)