1

I am creating a udev rule which simply logs the usb storage devices. I have a usb flash disc with ID_MODEL_ID==1234 and ID_VENDOR_ID==abcd. udev shows that this is:

ID_MODEL=UDisk
ID_VENDOR=General

But I don't get where it gets this information. According to what I see in usb.ids of latest hwdata:

$ cat /usr/share/hwdata/usb.ids | grep abcd
    abcd  Unknown

$ cat /usr/share/hwdata/usb.ids | grep 1234
    1234  IronLogic RFID Adapter [Z-2 USB]
    1234  Bluetooth Device
    1234  Typhoon Redfun Modem V90 56k
    1234  Flash Drive
    1234  Cruzer Mini Flash Drive
    1234  USB to ATAPI
    1234  BACKPACK
    1234  Storage Device
    1234  Fastrack Xtend FXT001 Modem
1234  Brain Actuated Technologies
    1234  PDS6062T Oscilloscope
    1234  ATAPI Bridge
    1234  Prototype Reader/Writer

My goal is to simply log ID_VENDOR_ID and ID_MODEL_ID instead of strings ID_VENDOR and ID_MODEL and to get these strings later when I need by looking up the hwdata's usb.ids file. It seems to me that udev gets these strings from somewhere else but where?

0

Looks like nowhere from. I have found out that UDisk is not a real model name, it is just a hard drive in USB form, nothing more or less. The same, the vendor id is Unknown and it is just printed as General (this is my guess already). So it is correct it seems just to lookup the usb.ids file.

lsusb does not show this information aswell, so probably there is no any other way to lookup this information and this information is not stored inside the usb device itself along with vendor and model ids.

  • 1
    udev has its own databases (because of NIH syndrome), but I doubt they are very comprehensive. udisk is also a desktop component that manages storage devices, so this looks like a generic fallback value. Logging the numeric values is definitely the right thing to do. – dirkt May 25 '18 at 13:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.