Skip to content

udev match fields for USB devices are case-sensitive (ID_MODEL_ID / ID_VENDOR_ID) #1733

@reilandeubank

Description

@reilandeubank

While adding a new resource to a Labgrid exporter, I ran into some non-obvious behavior that seems undocumented and potentially unexpected.

When using udev matching for USB resources, the ID_VENDOR_ID and ID_MODEL_ID fields are treated as case-sensitive strings. This means uppercase hex digits do not match lowercase ones.

Failing Configurations

"example-resource-group":
  USBFlashableDevice:
    match:
      SUBSYSTEM: "usb"
      ID_VENDOR_ID: "091e"
      ID_MODEL_ID: "FFFF"
"example-resource-group":
  USBFlashableDevice:
    match:
      SUBSYSTEM: "usb"
      ID_VENDOR_ID: 0x091e
      ID_MODEL_ID: 0xFFFF

Actual Behavior

  • The exporter does not match any connected USB device with vendor ID 091e and model ID ffff.

  • There is no error or warning explaining why the match failed.

Expected Behavior

Either:

  • Matching should be case-insensitive (ffff == FFFF), which aligns with how USB vendor/product ID numbers are typically represented, or

  • The exporter should emit a clear error/warning when uppercase hex digits are used.

Working Configuration

"example-resource-group":
  USBFlashableDevice:
    match:
      SUBSYSTEM: "usb"
      ID_VENDOR_ID: "091e"
      ID_MODEL_ID: "ffff"

With this configuration, the exporter successfully identifies the USB device and exports a USBFlashableDevice resource.

Additional Notes

I was not able to find any documentation highlighting that these fields are case sensitive. According to the USB standard, these values are numbers, so case should not matter.

Environment

  • Labgrid version: v24.0a1
  • OS: Ubuntu 22.04

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions