Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

351
Vistas
How to find a device node in /dev from physical USB port?

Given two identical USB devices with the exact same USB descriptors and thus with absolutely no way to differentiate them only using the leaf information of the device information view (the USB device descriptor) as usually done (yes, this device is badly designed).

But since I am talking about a closed system, I thought I could solve the problem using the physical USB ports used to connect the devices. I can tell that one is plugged on the physical port #1 and the other is plugged on the physical port #2 of my motherboard's root usb hub. And lsusb gives me this information.

So now I need to be able to find the device node in /dev according to these two physical coordinates only. But when looking at sysfs, I can't find any link to this physical topology. Like if the sysfs usb tree was only a logical view of the physical's. And it seems sysfs usb devices names like /sys/bus/usb/devices/2-2.1 or /sys/bus/usb/devices/2-2.1/2-2.2 are dynamic and unpredictable.

I found this:

$ ls /dev/serial/by-path/ pci-0000:02:00.0-usb-0:2.1:1.0-port0@ 
pci-0000:02:00.0-usb-0:2.2:1.0-port0@

Should I write udev rules to freeze the pci and usb port names? Are they already predictable?

My final goal is to be able to write a udev rule to obtain predictable and frozen device's names according to the physical usb port used.

The solution could also apply to a PCI device.

Thanks

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda