Comment 12 for bug 399319

Revision history for this message
Abel Deuring (adeuring) wrote : Re: [Bug 399319] Re: Remove the HAL dependency from Launchpad HWDB and checkbox

On 23.08.2009 06:52, Marc Tardif wrote:
> To illustrate the above schema, I have attached a script which parses
> the output from the command "udevadm info --export-db" and prints a
> simplified representation of each device on separate lines. The format
> for this representation should be simple enough to understand
> considering there are so few attributes.
>
> Furthermore, I have taken this opportunity to introduce another element
> to the schema called "type". The motivation for this element is to
> generalize the concept of PCI class across all devices, so that devices
> can be categorized in accordance with enduser expectations.

Right, we need some "type information" for devcies. I had a closer look
into the class and subclass data of PCI and USB devices in existing
submissions -- and they turned out to be quite messy.

My original intention was to represent the devcies classes roughly in a
similar way as you suggest (technically, I intended to use Launchpad's
DBEnum type to "normalize" device classes, but the difference to a set
of fixed strings as your script is using is not inportant). But after a
closer look at the data we really get I concluded that it is better to
store the raw calls data for now and to do some clean up manually. For
example, we have a PCI SCSI controller which claims to be a video
device, and we have all kind of completely nonsense class data in the
submissions. (I can send you a list of all PCI and USB class IDs I found
and some very rough data about how often they apper)

We can later "normalize" this data so that we can do runy DB query like
"show me all USB printers" or "show me all graphics cards from NVidia",

>
> Note that the script does not resolve names for pci and usb ids.
> However, this can be easily compensated by parsing the pci.ids and
> usb.ids file. At far as names are concerned, the important part at this
> point is to concentrate on other devices such as scsi for example which
> don't have such ids files.

As I wrote in another comment for this bug, SCSI devcies have the string
attributes "vendor" and "model" (they have exactly the same meaning as
the vendor and product IDs of PCI and USB devices) and they have the
attribute "type", telling us if the given device is aa disk, tape
driver, CDROM driver etc.