Udev rules for seemingly indistinguishable devices

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I'm trying to use udev to automatically set up symlinks to an Intel RealSense D415. This is because I use several cameras on the machine and need to be able to reliably refer to them via a filename (that doesn't change on reboot).



The RealSense D415 creates three video devices in /dev. I'm having no problem setting up symlinks for the first two, but as far as I can see the first and third devices are identical apart from the KERNEL and KERNELS attributes which are liable to change if another camera is plugged in first.



How can I use a udev rule to differentiate between these?



Output for sudo udevadm info -ap /devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0/video4linux/video0:



 looking at device '/devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0/video4linux/video0':
KERNEL=="video0"
SUBSYSTEM=="video4linux"
DRIVER==""
ATTRdev_debug=="0"
ATTRindex=="0"
ATTRname=="Intel(R) RealSense(TM) 415: Int"

looking at parent device '/devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0':
KERNELS=="2-1:1.0"
SUBSYSTEMS=="usb"
DRIVERS=="uvcvideo"
ATTRSauthorized=="1"
ATTRSbAlternateSetting==" 0"
ATTRSbInterfaceClass=="0e"
ATTRSbInterfaceNumber=="00"
ATTRSbInterfaceProtocol=="00"
ATTRSbInterfaceSubClass=="01"
ATTRSbNumEndpoints=="01"
ATTRSiad_bFirstInterface=="00"
ATTRSiad_bFunctionClass=="0e"
ATTRSiad_bFunctionProtocol=="00"
ATTRSiad_bFunctionSubClass=="03"
ATTRSiad_bInterfaceCount=="03"
ATTRSinterface=="Intel(R) RealSense(TM) 415 Depth"
ATTRSsupports_autosuspend=="1"

looking at parent device '/devices/pci0000:00/0000:00:14.0/usb2/2-1':
KERNELS=="2-1"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRSauthorized=="1"
ATTRSavoid_reset_quirk=="0"
ATTRSbConfigurationValue=="1"
ATTRSbDeviceClass=="ef"
ATTRSbDeviceProtocol=="01"
ATTRSbDeviceSubClass=="02"
ATTRSbMaxPacketSize0=="9"
ATTRSbMaxPower=="440mA"
ATTRSbNumConfigurations=="1"
ATTRSbNumInterfaces==" 5"
ATTRSbcdDevice=="508f"
ATTRSbmAttributes=="c0"
ATTRSbusnum=="2"
ATTRSconfiguration==""
ATTRSdevnum=="2"
ATTRSdevpath=="1"
ATTRSidProduct=="0ad3"
ATTRSidVendor=="8086"
ATTRSltm_capable=="no"
ATTRSmanufacturer=="Intel(R) RealSense(TM) 415"
ATTRSmaxchild=="0"
ATTRSproduct=="Intel(R) RealSense(TM) 415"
ATTRSquirks=="0x0"
ATTRSremovable=="removable"
ATTRSserial=="736613021813"
ATTRSspeed=="5000"
ATTRSurbnum=="56"
ATTRSversion==" 3.10"

looking at parent device '/devices/pci0000:00/0000:00:14.0/usb2':
KERNELS=="usb2"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRSauthorized=="1"
ATTRSauthorized_default=="1"
ATTRSavoid_reset_quirk=="0"
ATTRSbConfigurationValue=="1"
ATTRSbDeviceClass=="09"
ATTRSbDeviceProtocol=="03"
ATTRSbDeviceSubClass=="00"
ATTRSbMaxPacketSize0=="9"
ATTRSbMaxPower=="0mA"
ATTRSbNumConfigurations=="1"
ATTRSbNumInterfaces==" 1"
ATTRSbcdDevice=="0415"
ATTRSbmAttributes=="e0"
ATTRSbusnum=="2"
ATTRSconfiguration==""
ATTRSdevnum=="1"
ATTRSdevpath=="0"
ATTRSidProduct=="0003"
ATTRSidVendor=="1d6b"
ATTRSinterface_authorized_default=="1"
ATTRSltm_capable=="yes"
ATTRSmanufacturer=="Linux 4.15.0-36-generic xhci-hcd"
ATTRSmaxchild=="10"
ATTRSproduct=="xHCI Host Controller"
ATTRSquirks=="0x0"
ATTRSremovable=="unknown"
ATTRSserial=="0000:00:14.0"
ATTRSspeed=="5000"
ATTRSurbnum=="101"
ATTRSversion==" 3.00"

looking at parent device '/devices/pci0000:00/0000:00:14.0':
KERNELS=="0000:00:14.0"
SUBSYSTEMS=="pci"
DRIVERS=="xhci_hcd"
ATTRSbroken_parity_status=="0"
ATTRSclass=="0x0c0330"
ATTRSconsistent_dma_mask_bits=="64"
ATTRSd3cold_allowed=="1"
ATTRSdbc=="disabled"
ATTRSdevice=="0xa2af"
ATTRSdma_mask_bits=="64"
ATTRSdriver_override=="(null)"
ATTRSenable=="1"
ATTRSirq=="123"
ATTRSlocal_cpulist=="0-3"
ATTRSlocal_cpus=="f"
ATTRSmsi_bus=="1"
ATTRSnuma_node=="-1"
ATTRSrevision=="0x00"
ATTRSsubsystem_device=="0x310c"
ATTRSsubsystem_vendor=="0x17aa"
ATTRSvendor=="0x8086"

looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""


Output for sudo udevadm info -ap /devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.3/video4linux/video2:



 looking at device '/devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.3/video4linux/video2':
KERNEL=="video2"
SUBSYSTEM=="video4linux"
DRIVER==""
ATTRdev_debug=="0"
ATTRindex=="0"
ATTRname=="Intel(R) RealSense(TM) 415: Int"

looking at parent device '/devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.3':
KERNELS=="2-1:1.3"
SUBSYSTEMS=="usb"
DRIVERS=="uvcvideo"
ATTRSauthorized=="1"
ATTRSbAlternateSetting==" 0"
ATTRSbInterfaceClass=="0e"
ATTRSbInterfaceNumber=="03"
ATTRSbInterfaceProtocol=="00"
ATTRSbInterfaceSubClass=="01"
ATTRSbNumEndpoints=="00"
ATTRSiad_bFirstInterface=="03"
ATTRSiad_bFunctionClass=="0e"
ATTRSiad_bFunctionProtocol=="00"
ATTRSiad_bFunctionSubClass=="03"
ATTRSiad_bInterfaceCount=="02"
ATTRSinterface=="Intel(R) RealSense(TM) 415 RGB"
ATTRSsupports_autosuspend=="1"

looking at parent device '/devices/pci0000:00/0000:00:14.0/usb2/2-1':
KERNELS=="2-1"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRSauthorized=="1"
ATTRSavoid_reset_quirk=="0"
ATTRSbConfigurationValue=="1"
ATTRSbDeviceClass=="ef"
ATTRSbDeviceProtocol=="01"
ATTRSbDeviceSubClass=="02"
ATTRSbMaxPacketSize0=="9"
ATTRSbMaxPower=="440mA"
ATTRSbNumConfigurations=="1"
ATTRSbNumInterfaces==" 5"
ATTRSbcdDevice=="508f"
ATTRSbmAttributes=="c0"
ATTRSbusnum=="2"
ATTRSconfiguration==""
ATTRSdevnum=="2"
ATTRSdevpath=="1"
ATTRSidProduct=="0ad3"
ATTRSidVendor=="8086"
ATTRSltm_capable=="no"
ATTRSmanufacturer=="Intel(R) RealSense(TM) 415"
ATTRSmaxchild=="0"
ATTRSproduct=="Intel(R) RealSense(TM) 415"
ATTRSquirks=="0x0"
ATTRSremovable=="removable"
ATTRSserial=="736613021813"
ATTRSspeed=="5000"
ATTRSurbnum=="56"
ATTRSversion==" 3.10"

looking at parent device '/devices/pci0000:00/0000:00:14.0/usb2':
KERNELS=="usb2"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRSauthorized=="1"
ATTRSauthorized_default=="1"
ATTRSavoid_reset_quirk=="0"
ATTRSbConfigurationValue=="1"
ATTRSbDeviceClass=="09"
ATTRSbDeviceProtocol=="03"
ATTRSbDeviceSubClass=="00"
ATTRSbMaxPacketSize0=="9"
ATTRSbMaxPower=="0mA"
ATTRSbNumConfigurations=="1"
ATTRSbNumInterfaces==" 1"
ATTRSbcdDevice=="0415"
ATTRSbmAttributes=="e0"
ATTRSbusnum=="2"
ATTRSconfiguration==""
ATTRSdevnum=="1"
ATTRSdevpath=="0"
ATTRSidProduct=="0003"
ATTRSidVendor=="1d6b"
ATTRSinterface_authorized_default=="1"
ATTRSltm_capable=="yes"
ATTRSmanufacturer=="Linux 4.15.0-36-generic xhci-hcd"
ATTRSmaxchild=="10"
ATTRSproduct=="xHCI Host Controller"
ATTRSquirks=="0x0"
ATTRSremovable=="unknown"
ATTRSserial=="0000:00:14.0"
ATTRSspeed=="5000"
ATTRSurbnum=="101"
ATTRSversion==" 3.00"

looking at parent device '/devices/pci0000:00/0000:00:14.0':
KERNELS=="0000:00:14.0"
SUBSYSTEMS=="pci"
DRIVERS=="xhci_hcd"
ATTRSbroken_parity_status=="0"
ATTRSclass=="0x0c0330"
ATTRSconsistent_dma_mask_bits=="64"
ATTRSd3cold_allowed=="1"
ATTRSdbc=="disabled"
ATTRSdevice=="0xa2af"
ATTRSdma_mask_bits=="64"
ATTRSdriver_override=="(null)"
ATTRSenable=="1"
ATTRSirq=="123"
ATTRSlocal_cpulist=="0-3"
ATTRSlocal_cpus=="f"
ATTRSmsi_bus=="1"
ATTRSnuma_node=="-1"
ATTRSrevision=="0x00"
ATTRSsubsystem_device=="0x310c"
ATTRSsubsystem_vendor=="0x17aa"
ATTRSvendor=="0x8086"

looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""








share

























    up vote
    0
    down vote

    favorite












    I'm trying to use udev to automatically set up symlinks to an Intel RealSense D415. This is because I use several cameras on the machine and need to be able to reliably refer to them via a filename (that doesn't change on reboot).



    The RealSense D415 creates three video devices in /dev. I'm having no problem setting up symlinks for the first two, but as far as I can see the first and third devices are identical apart from the KERNEL and KERNELS attributes which are liable to change if another camera is plugged in first.



    How can I use a udev rule to differentiate between these?



    Output for sudo udevadm info -ap /devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0/video4linux/video0:



     looking at device '/devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0/video4linux/video0':
    KERNEL=="video0"
    SUBSYSTEM=="video4linux"
    DRIVER==""
    ATTRdev_debug=="0"
    ATTRindex=="0"
    ATTRname=="Intel(R) RealSense(TM) 415: Int"

    looking at parent device '/devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0':
    KERNELS=="2-1:1.0"
    SUBSYSTEMS=="usb"
    DRIVERS=="uvcvideo"
    ATTRSauthorized=="1"
    ATTRSbAlternateSetting==" 0"
    ATTRSbInterfaceClass=="0e"
    ATTRSbInterfaceNumber=="00"
    ATTRSbInterfaceProtocol=="00"
    ATTRSbInterfaceSubClass=="01"
    ATTRSbNumEndpoints=="01"
    ATTRSiad_bFirstInterface=="00"
    ATTRSiad_bFunctionClass=="0e"
    ATTRSiad_bFunctionProtocol=="00"
    ATTRSiad_bFunctionSubClass=="03"
    ATTRSiad_bInterfaceCount=="03"
    ATTRSinterface=="Intel(R) RealSense(TM) 415 Depth"
    ATTRSsupports_autosuspend=="1"

    looking at parent device '/devices/pci0000:00/0000:00:14.0/usb2/2-1':
    KERNELS=="2-1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRSauthorized=="1"
    ATTRSavoid_reset_quirk=="0"
    ATTRSbConfigurationValue=="1"
    ATTRSbDeviceClass=="ef"
    ATTRSbDeviceProtocol=="01"
    ATTRSbDeviceSubClass=="02"
    ATTRSbMaxPacketSize0=="9"
    ATTRSbMaxPower=="440mA"
    ATTRSbNumConfigurations=="1"
    ATTRSbNumInterfaces==" 5"
    ATTRSbcdDevice=="508f"
    ATTRSbmAttributes=="c0"
    ATTRSbusnum=="2"
    ATTRSconfiguration==""
    ATTRSdevnum=="2"
    ATTRSdevpath=="1"
    ATTRSidProduct=="0ad3"
    ATTRSidVendor=="8086"
    ATTRSltm_capable=="no"
    ATTRSmanufacturer=="Intel(R) RealSense(TM) 415"
    ATTRSmaxchild=="0"
    ATTRSproduct=="Intel(R) RealSense(TM) 415"
    ATTRSquirks=="0x0"
    ATTRSremovable=="removable"
    ATTRSserial=="736613021813"
    ATTRSspeed=="5000"
    ATTRSurbnum=="56"
    ATTRSversion==" 3.10"

    looking at parent device '/devices/pci0000:00/0000:00:14.0/usb2':
    KERNELS=="usb2"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRSauthorized=="1"
    ATTRSauthorized_default=="1"
    ATTRSavoid_reset_quirk=="0"
    ATTRSbConfigurationValue=="1"
    ATTRSbDeviceClass=="09"
    ATTRSbDeviceProtocol=="03"
    ATTRSbDeviceSubClass=="00"
    ATTRSbMaxPacketSize0=="9"
    ATTRSbMaxPower=="0mA"
    ATTRSbNumConfigurations=="1"
    ATTRSbNumInterfaces==" 1"
    ATTRSbcdDevice=="0415"
    ATTRSbmAttributes=="e0"
    ATTRSbusnum=="2"
    ATTRSconfiguration==""
    ATTRSdevnum=="1"
    ATTRSdevpath=="0"
    ATTRSidProduct=="0003"
    ATTRSidVendor=="1d6b"
    ATTRSinterface_authorized_default=="1"
    ATTRSltm_capable=="yes"
    ATTRSmanufacturer=="Linux 4.15.0-36-generic xhci-hcd"
    ATTRSmaxchild=="10"
    ATTRSproduct=="xHCI Host Controller"
    ATTRSquirks=="0x0"
    ATTRSremovable=="unknown"
    ATTRSserial=="0000:00:14.0"
    ATTRSspeed=="5000"
    ATTRSurbnum=="101"
    ATTRSversion==" 3.00"

    looking at parent device '/devices/pci0000:00/0000:00:14.0':
    KERNELS=="0000:00:14.0"
    SUBSYSTEMS=="pci"
    DRIVERS=="xhci_hcd"
    ATTRSbroken_parity_status=="0"
    ATTRSclass=="0x0c0330"
    ATTRSconsistent_dma_mask_bits=="64"
    ATTRSd3cold_allowed=="1"
    ATTRSdbc=="disabled"
    ATTRSdevice=="0xa2af"
    ATTRSdma_mask_bits=="64"
    ATTRSdriver_override=="(null)"
    ATTRSenable=="1"
    ATTRSirq=="123"
    ATTRSlocal_cpulist=="0-3"
    ATTRSlocal_cpus=="f"
    ATTRSmsi_bus=="1"
    ATTRSnuma_node=="-1"
    ATTRSrevision=="0x00"
    ATTRSsubsystem_device=="0x310c"
    ATTRSsubsystem_vendor=="0x17aa"
    ATTRSvendor=="0x8086"

    looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""


    Output for sudo udevadm info -ap /devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.3/video4linux/video2:



     looking at device '/devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.3/video4linux/video2':
    KERNEL=="video2"
    SUBSYSTEM=="video4linux"
    DRIVER==""
    ATTRdev_debug=="0"
    ATTRindex=="0"
    ATTRname=="Intel(R) RealSense(TM) 415: Int"

    looking at parent device '/devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.3':
    KERNELS=="2-1:1.3"
    SUBSYSTEMS=="usb"
    DRIVERS=="uvcvideo"
    ATTRSauthorized=="1"
    ATTRSbAlternateSetting==" 0"
    ATTRSbInterfaceClass=="0e"
    ATTRSbInterfaceNumber=="03"
    ATTRSbInterfaceProtocol=="00"
    ATTRSbInterfaceSubClass=="01"
    ATTRSbNumEndpoints=="00"
    ATTRSiad_bFirstInterface=="03"
    ATTRSiad_bFunctionClass=="0e"
    ATTRSiad_bFunctionProtocol=="00"
    ATTRSiad_bFunctionSubClass=="03"
    ATTRSiad_bInterfaceCount=="02"
    ATTRSinterface=="Intel(R) RealSense(TM) 415 RGB"
    ATTRSsupports_autosuspend=="1"

    looking at parent device '/devices/pci0000:00/0000:00:14.0/usb2/2-1':
    KERNELS=="2-1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRSauthorized=="1"
    ATTRSavoid_reset_quirk=="0"
    ATTRSbConfigurationValue=="1"
    ATTRSbDeviceClass=="ef"
    ATTRSbDeviceProtocol=="01"
    ATTRSbDeviceSubClass=="02"
    ATTRSbMaxPacketSize0=="9"
    ATTRSbMaxPower=="440mA"
    ATTRSbNumConfigurations=="1"
    ATTRSbNumInterfaces==" 5"
    ATTRSbcdDevice=="508f"
    ATTRSbmAttributes=="c0"
    ATTRSbusnum=="2"
    ATTRSconfiguration==""
    ATTRSdevnum=="2"
    ATTRSdevpath=="1"
    ATTRSidProduct=="0ad3"
    ATTRSidVendor=="8086"
    ATTRSltm_capable=="no"
    ATTRSmanufacturer=="Intel(R) RealSense(TM) 415"
    ATTRSmaxchild=="0"
    ATTRSproduct=="Intel(R) RealSense(TM) 415"
    ATTRSquirks=="0x0"
    ATTRSremovable=="removable"
    ATTRSserial=="736613021813"
    ATTRSspeed=="5000"
    ATTRSurbnum=="56"
    ATTRSversion==" 3.10"

    looking at parent device '/devices/pci0000:00/0000:00:14.0/usb2':
    KERNELS=="usb2"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRSauthorized=="1"
    ATTRSauthorized_default=="1"
    ATTRSavoid_reset_quirk=="0"
    ATTRSbConfigurationValue=="1"
    ATTRSbDeviceClass=="09"
    ATTRSbDeviceProtocol=="03"
    ATTRSbDeviceSubClass=="00"
    ATTRSbMaxPacketSize0=="9"
    ATTRSbMaxPower=="0mA"
    ATTRSbNumConfigurations=="1"
    ATTRSbNumInterfaces==" 1"
    ATTRSbcdDevice=="0415"
    ATTRSbmAttributes=="e0"
    ATTRSbusnum=="2"
    ATTRSconfiguration==""
    ATTRSdevnum=="1"
    ATTRSdevpath=="0"
    ATTRSidProduct=="0003"
    ATTRSidVendor=="1d6b"
    ATTRSinterface_authorized_default=="1"
    ATTRSltm_capable=="yes"
    ATTRSmanufacturer=="Linux 4.15.0-36-generic xhci-hcd"
    ATTRSmaxchild=="10"
    ATTRSproduct=="xHCI Host Controller"
    ATTRSquirks=="0x0"
    ATTRSremovable=="unknown"
    ATTRSserial=="0000:00:14.0"
    ATTRSspeed=="5000"
    ATTRSurbnum=="101"
    ATTRSversion==" 3.00"

    looking at parent device '/devices/pci0000:00/0000:00:14.0':
    KERNELS=="0000:00:14.0"
    SUBSYSTEMS=="pci"
    DRIVERS=="xhci_hcd"
    ATTRSbroken_parity_status=="0"
    ATTRSclass=="0x0c0330"
    ATTRSconsistent_dma_mask_bits=="64"
    ATTRSd3cold_allowed=="1"
    ATTRSdbc=="disabled"
    ATTRSdevice=="0xa2af"
    ATTRSdma_mask_bits=="64"
    ATTRSdriver_override=="(null)"
    ATTRSenable=="1"
    ATTRSirq=="123"
    ATTRSlocal_cpulist=="0-3"
    ATTRSlocal_cpus=="f"
    ATTRSmsi_bus=="1"
    ATTRSnuma_node=="-1"
    ATTRSrevision=="0x00"
    ATTRSsubsystem_device=="0x310c"
    ATTRSsubsystem_vendor=="0x17aa"
    ATTRSvendor=="0x8086"

    looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""








    share























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I'm trying to use udev to automatically set up symlinks to an Intel RealSense D415. This is because I use several cameras on the machine and need to be able to reliably refer to them via a filename (that doesn't change on reboot).



      The RealSense D415 creates three video devices in /dev. I'm having no problem setting up symlinks for the first two, but as far as I can see the first and third devices are identical apart from the KERNEL and KERNELS attributes which are liable to change if another camera is plugged in first.



      How can I use a udev rule to differentiate between these?



      Output for sudo udevadm info -ap /devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0/video4linux/video0:



       looking at device '/devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0/video4linux/video0':
      KERNEL=="video0"
      SUBSYSTEM=="video4linux"
      DRIVER==""
      ATTRdev_debug=="0"
      ATTRindex=="0"
      ATTRname=="Intel(R) RealSense(TM) 415: Int"

      looking at parent device '/devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0':
      KERNELS=="2-1:1.0"
      SUBSYSTEMS=="usb"
      DRIVERS=="uvcvideo"
      ATTRSauthorized=="1"
      ATTRSbAlternateSetting==" 0"
      ATTRSbInterfaceClass=="0e"
      ATTRSbInterfaceNumber=="00"
      ATTRSbInterfaceProtocol=="00"
      ATTRSbInterfaceSubClass=="01"
      ATTRSbNumEndpoints=="01"
      ATTRSiad_bFirstInterface=="00"
      ATTRSiad_bFunctionClass=="0e"
      ATTRSiad_bFunctionProtocol=="00"
      ATTRSiad_bFunctionSubClass=="03"
      ATTRSiad_bInterfaceCount=="03"
      ATTRSinterface=="Intel(R) RealSense(TM) 415 Depth"
      ATTRSsupports_autosuspend=="1"

      looking at parent device '/devices/pci0000:00/0000:00:14.0/usb2/2-1':
      KERNELS=="2-1"
      SUBSYSTEMS=="usb"
      DRIVERS=="usb"
      ATTRSauthorized=="1"
      ATTRSavoid_reset_quirk=="0"
      ATTRSbConfigurationValue=="1"
      ATTRSbDeviceClass=="ef"
      ATTRSbDeviceProtocol=="01"
      ATTRSbDeviceSubClass=="02"
      ATTRSbMaxPacketSize0=="9"
      ATTRSbMaxPower=="440mA"
      ATTRSbNumConfigurations=="1"
      ATTRSbNumInterfaces==" 5"
      ATTRSbcdDevice=="508f"
      ATTRSbmAttributes=="c0"
      ATTRSbusnum=="2"
      ATTRSconfiguration==""
      ATTRSdevnum=="2"
      ATTRSdevpath=="1"
      ATTRSidProduct=="0ad3"
      ATTRSidVendor=="8086"
      ATTRSltm_capable=="no"
      ATTRSmanufacturer=="Intel(R) RealSense(TM) 415"
      ATTRSmaxchild=="0"
      ATTRSproduct=="Intel(R) RealSense(TM) 415"
      ATTRSquirks=="0x0"
      ATTRSremovable=="removable"
      ATTRSserial=="736613021813"
      ATTRSspeed=="5000"
      ATTRSurbnum=="56"
      ATTRSversion==" 3.10"

      looking at parent device '/devices/pci0000:00/0000:00:14.0/usb2':
      KERNELS=="usb2"
      SUBSYSTEMS=="usb"
      DRIVERS=="usb"
      ATTRSauthorized=="1"
      ATTRSauthorized_default=="1"
      ATTRSavoid_reset_quirk=="0"
      ATTRSbConfigurationValue=="1"
      ATTRSbDeviceClass=="09"
      ATTRSbDeviceProtocol=="03"
      ATTRSbDeviceSubClass=="00"
      ATTRSbMaxPacketSize0=="9"
      ATTRSbMaxPower=="0mA"
      ATTRSbNumConfigurations=="1"
      ATTRSbNumInterfaces==" 1"
      ATTRSbcdDevice=="0415"
      ATTRSbmAttributes=="e0"
      ATTRSbusnum=="2"
      ATTRSconfiguration==""
      ATTRSdevnum=="1"
      ATTRSdevpath=="0"
      ATTRSidProduct=="0003"
      ATTRSidVendor=="1d6b"
      ATTRSinterface_authorized_default=="1"
      ATTRSltm_capable=="yes"
      ATTRSmanufacturer=="Linux 4.15.0-36-generic xhci-hcd"
      ATTRSmaxchild=="10"
      ATTRSproduct=="xHCI Host Controller"
      ATTRSquirks=="0x0"
      ATTRSremovable=="unknown"
      ATTRSserial=="0000:00:14.0"
      ATTRSspeed=="5000"
      ATTRSurbnum=="101"
      ATTRSversion==" 3.00"

      looking at parent device '/devices/pci0000:00/0000:00:14.0':
      KERNELS=="0000:00:14.0"
      SUBSYSTEMS=="pci"
      DRIVERS=="xhci_hcd"
      ATTRSbroken_parity_status=="0"
      ATTRSclass=="0x0c0330"
      ATTRSconsistent_dma_mask_bits=="64"
      ATTRSd3cold_allowed=="1"
      ATTRSdbc=="disabled"
      ATTRSdevice=="0xa2af"
      ATTRSdma_mask_bits=="64"
      ATTRSdriver_override=="(null)"
      ATTRSenable=="1"
      ATTRSirq=="123"
      ATTRSlocal_cpulist=="0-3"
      ATTRSlocal_cpus=="f"
      ATTRSmsi_bus=="1"
      ATTRSnuma_node=="-1"
      ATTRSrevision=="0x00"
      ATTRSsubsystem_device=="0x310c"
      ATTRSsubsystem_vendor=="0x17aa"
      ATTRSvendor=="0x8086"

      looking at parent device '/devices/pci0000:00':
      KERNELS=="pci0000:00"
      SUBSYSTEMS==""
      DRIVERS==""


      Output for sudo udevadm info -ap /devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.3/video4linux/video2:



       looking at device '/devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.3/video4linux/video2':
      KERNEL=="video2"
      SUBSYSTEM=="video4linux"
      DRIVER==""
      ATTRdev_debug=="0"
      ATTRindex=="0"
      ATTRname=="Intel(R) RealSense(TM) 415: Int"

      looking at parent device '/devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.3':
      KERNELS=="2-1:1.3"
      SUBSYSTEMS=="usb"
      DRIVERS=="uvcvideo"
      ATTRSauthorized=="1"
      ATTRSbAlternateSetting==" 0"
      ATTRSbInterfaceClass=="0e"
      ATTRSbInterfaceNumber=="03"
      ATTRSbInterfaceProtocol=="00"
      ATTRSbInterfaceSubClass=="01"
      ATTRSbNumEndpoints=="00"
      ATTRSiad_bFirstInterface=="03"
      ATTRSiad_bFunctionClass=="0e"
      ATTRSiad_bFunctionProtocol=="00"
      ATTRSiad_bFunctionSubClass=="03"
      ATTRSiad_bInterfaceCount=="02"
      ATTRSinterface=="Intel(R) RealSense(TM) 415 RGB"
      ATTRSsupports_autosuspend=="1"

      looking at parent device '/devices/pci0000:00/0000:00:14.0/usb2/2-1':
      KERNELS=="2-1"
      SUBSYSTEMS=="usb"
      DRIVERS=="usb"
      ATTRSauthorized=="1"
      ATTRSavoid_reset_quirk=="0"
      ATTRSbConfigurationValue=="1"
      ATTRSbDeviceClass=="ef"
      ATTRSbDeviceProtocol=="01"
      ATTRSbDeviceSubClass=="02"
      ATTRSbMaxPacketSize0=="9"
      ATTRSbMaxPower=="440mA"
      ATTRSbNumConfigurations=="1"
      ATTRSbNumInterfaces==" 5"
      ATTRSbcdDevice=="508f"
      ATTRSbmAttributes=="c0"
      ATTRSbusnum=="2"
      ATTRSconfiguration==""
      ATTRSdevnum=="2"
      ATTRSdevpath=="1"
      ATTRSidProduct=="0ad3"
      ATTRSidVendor=="8086"
      ATTRSltm_capable=="no"
      ATTRSmanufacturer=="Intel(R) RealSense(TM) 415"
      ATTRSmaxchild=="0"
      ATTRSproduct=="Intel(R) RealSense(TM) 415"
      ATTRSquirks=="0x0"
      ATTRSremovable=="removable"
      ATTRSserial=="736613021813"
      ATTRSspeed=="5000"
      ATTRSurbnum=="56"
      ATTRSversion==" 3.10"

      looking at parent device '/devices/pci0000:00/0000:00:14.0/usb2':
      KERNELS=="usb2"
      SUBSYSTEMS=="usb"
      DRIVERS=="usb"
      ATTRSauthorized=="1"
      ATTRSauthorized_default=="1"
      ATTRSavoid_reset_quirk=="0"
      ATTRSbConfigurationValue=="1"
      ATTRSbDeviceClass=="09"
      ATTRSbDeviceProtocol=="03"
      ATTRSbDeviceSubClass=="00"
      ATTRSbMaxPacketSize0=="9"
      ATTRSbMaxPower=="0mA"
      ATTRSbNumConfigurations=="1"
      ATTRSbNumInterfaces==" 1"
      ATTRSbcdDevice=="0415"
      ATTRSbmAttributes=="e0"
      ATTRSbusnum=="2"
      ATTRSconfiguration==""
      ATTRSdevnum=="1"
      ATTRSdevpath=="0"
      ATTRSidProduct=="0003"
      ATTRSidVendor=="1d6b"
      ATTRSinterface_authorized_default=="1"
      ATTRSltm_capable=="yes"
      ATTRSmanufacturer=="Linux 4.15.0-36-generic xhci-hcd"
      ATTRSmaxchild=="10"
      ATTRSproduct=="xHCI Host Controller"
      ATTRSquirks=="0x0"
      ATTRSremovable=="unknown"
      ATTRSserial=="0000:00:14.0"
      ATTRSspeed=="5000"
      ATTRSurbnum=="101"
      ATTRSversion==" 3.00"

      looking at parent device '/devices/pci0000:00/0000:00:14.0':
      KERNELS=="0000:00:14.0"
      SUBSYSTEMS=="pci"
      DRIVERS=="xhci_hcd"
      ATTRSbroken_parity_status=="0"
      ATTRSclass=="0x0c0330"
      ATTRSconsistent_dma_mask_bits=="64"
      ATTRSd3cold_allowed=="1"
      ATTRSdbc=="disabled"
      ATTRSdevice=="0xa2af"
      ATTRSdma_mask_bits=="64"
      ATTRSdriver_override=="(null)"
      ATTRSenable=="1"
      ATTRSirq=="123"
      ATTRSlocal_cpulist=="0-3"
      ATTRSlocal_cpus=="f"
      ATTRSmsi_bus=="1"
      ATTRSnuma_node=="-1"
      ATTRSrevision=="0x00"
      ATTRSsubsystem_device=="0x310c"
      ATTRSsubsystem_vendor=="0x17aa"
      ATTRSvendor=="0x8086"

      looking at parent device '/devices/pci0000:00':
      KERNELS=="pci0000:00"
      SUBSYSTEMS==""
      DRIVERS==""








      share













      I'm trying to use udev to automatically set up symlinks to an Intel RealSense D415. This is because I use several cameras on the machine and need to be able to reliably refer to them via a filename (that doesn't change on reboot).



      The RealSense D415 creates three video devices in /dev. I'm having no problem setting up symlinks for the first two, but as far as I can see the first and third devices are identical apart from the KERNEL and KERNELS attributes which are liable to change if another camera is plugged in first.



      How can I use a udev rule to differentiate between these?



      Output for sudo udevadm info -ap /devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0/video4linux/video0:



       looking at device '/devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0/video4linux/video0':
      KERNEL=="video0"
      SUBSYSTEM=="video4linux"
      DRIVER==""
      ATTRdev_debug=="0"
      ATTRindex=="0"
      ATTRname=="Intel(R) RealSense(TM) 415: Int"

      looking at parent device '/devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0':
      KERNELS=="2-1:1.0"
      SUBSYSTEMS=="usb"
      DRIVERS=="uvcvideo"
      ATTRSauthorized=="1"
      ATTRSbAlternateSetting==" 0"
      ATTRSbInterfaceClass=="0e"
      ATTRSbInterfaceNumber=="00"
      ATTRSbInterfaceProtocol=="00"
      ATTRSbInterfaceSubClass=="01"
      ATTRSbNumEndpoints=="01"
      ATTRSiad_bFirstInterface=="00"
      ATTRSiad_bFunctionClass=="0e"
      ATTRSiad_bFunctionProtocol=="00"
      ATTRSiad_bFunctionSubClass=="03"
      ATTRSiad_bInterfaceCount=="03"
      ATTRSinterface=="Intel(R) RealSense(TM) 415 Depth"
      ATTRSsupports_autosuspend=="1"

      looking at parent device '/devices/pci0000:00/0000:00:14.0/usb2/2-1':
      KERNELS=="2-1"
      SUBSYSTEMS=="usb"
      DRIVERS=="usb"
      ATTRSauthorized=="1"
      ATTRSavoid_reset_quirk=="0"
      ATTRSbConfigurationValue=="1"
      ATTRSbDeviceClass=="ef"
      ATTRSbDeviceProtocol=="01"
      ATTRSbDeviceSubClass=="02"
      ATTRSbMaxPacketSize0=="9"
      ATTRSbMaxPower=="440mA"
      ATTRSbNumConfigurations=="1"
      ATTRSbNumInterfaces==" 5"
      ATTRSbcdDevice=="508f"
      ATTRSbmAttributes=="c0"
      ATTRSbusnum=="2"
      ATTRSconfiguration==""
      ATTRSdevnum=="2"
      ATTRSdevpath=="1"
      ATTRSidProduct=="0ad3"
      ATTRSidVendor=="8086"
      ATTRSltm_capable=="no"
      ATTRSmanufacturer=="Intel(R) RealSense(TM) 415"
      ATTRSmaxchild=="0"
      ATTRSproduct=="Intel(R) RealSense(TM) 415"
      ATTRSquirks=="0x0"
      ATTRSremovable=="removable"
      ATTRSserial=="736613021813"
      ATTRSspeed=="5000"
      ATTRSurbnum=="56"
      ATTRSversion==" 3.10"

      looking at parent device '/devices/pci0000:00/0000:00:14.0/usb2':
      KERNELS=="usb2"
      SUBSYSTEMS=="usb"
      DRIVERS=="usb"
      ATTRSauthorized=="1"
      ATTRSauthorized_default=="1"
      ATTRSavoid_reset_quirk=="0"
      ATTRSbConfigurationValue=="1"
      ATTRSbDeviceClass=="09"
      ATTRSbDeviceProtocol=="03"
      ATTRSbDeviceSubClass=="00"
      ATTRSbMaxPacketSize0=="9"
      ATTRSbMaxPower=="0mA"
      ATTRSbNumConfigurations=="1"
      ATTRSbNumInterfaces==" 1"
      ATTRSbcdDevice=="0415"
      ATTRSbmAttributes=="e0"
      ATTRSbusnum=="2"
      ATTRSconfiguration==""
      ATTRSdevnum=="1"
      ATTRSdevpath=="0"
      ATTRSidProduct=="0003"
      ATTRSidVendor=="1d6b"
      ATTRSinterface_authorized_default=="1"
      ATTRSltm_capable=="yes"
      ATTRSmanufacturer=="Linux 4.15.0-36-generic xhci-hcd"
      ATTRSmaxchild=="10"
      ATTRSproduct=="xHCI Host Controller"
      ATTRSquirks=="0x0"
      ATTRSremovable=="unknown"
      ATTRSserial=="0000:00:14.0"
      ATTRSspeed=="5000"
      ATTRSurbnum=="101"
      ATTRSversion==" 3.00"

      looking at parent device '/devices/pci0000:00/0000:00:14.0':
      KERNELS=="0000:00:14.0"
      SUBSYSTEMS=="pci"
      DRIVERS=="xhci_hcd"
      ATTRSbroken_parity_status=="0"
      ATTRSclass=="0x0c0330"
      ATTRSconsistent_dma_mask_bits=="64"
      ATTRSd3cold_allowed=="1"
      ATTRSdbc=="disabled"
      ATTRSdevice=="0xa2af"
      ATTRSdma_mask_bits=="64"
      ATTRSdriver_override=="(null)"
      ATTRSenable=="1"
      ATTRSirq=="123"
      ATTRSlocal_cpulist=="0-3"
      ATTRSlocal_cpus=="f"
      ATTRSmsi_bus=="1"
      ATTRSnuma_node=="-1"
      ATTRSrevision=="0x00"
      ATTRSsubsystem_device=="0x310c"
      ATTRSsubsystem_vendor=="0x17aa"
      ATTRSvendor=="0x8086"

      looking at parent device '/devices/pci0000:00':
      KERNELS=="pci0000:00"
      SUBSYSTEMS==""
      DRIVERS==""


      Output for sudo udevadm info -ap /devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.3/video4linux/video2:



       looking at device '/devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.3/video4linux/video2':
      KERNEL=="video2"
      SUBSYSTEM=="video4linux"
      DRIVER==""
      ATTRdev_debug=="0"
      ATTRindex=="0"
      ATTRname=="Intel(R) RealSense(TM) 415: Int"

      looking at parent device '/devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.3':
      KERNELS=="2-1:1.3"
      SUBSYSTEMS=="usb"
      DRIVERS=="uvcvideo"
      ATTRSauthorized=="1"
      ATTRSbAlternateSetting==" 0"
      ATTRSbInterfaceClass=="0e"
      ATTRSbInterfaceNumber=="03"
      ATTRSbInterfaceProtocol=="00"
      ATTRSbInterfaceSubClass=="01"
      ATTRSbNumEndpoints=="00"
      ATTRSiad_bFirstInterface=="03"
      ATTRSiad_bFunctionClass=="0e"
      ATTRSiad_bFunctionProtocol=="00"
      ATTRSiad_bFunctionSubClass=="03"
      ATTRSiad_bInterfaceCount=="02"
      ATTRSinterface=="Intel(R) RealSense(TM) 415 RGB"
      ATTRSsupports_autosuspend=="1"

      looking at parent device '/devices/pci0000:00/0000:00:14.0/usb2/2-1':
      KERNELS=="2-1"
      SUBSYSTEMS=="usb"
      DRIVERS=="usb"
      ATTRSauthorized=="1"
      ATTRSavoid_reset_quirk=="0"
      ATTRSbConfigurationValue=="1"
      ATTRSbDeviceClass=="ef"
      ATTRSbDeviceProtocol=="01"
      ATTRSbDeviceSubClass=="02"
      ATTRSbMaxPacketSize0=="9"
      ATTRSbMaxPower=="440mA"
      ATTRSbNumConfigurations=="1"
      ATTRSbNumInterfaces==" 5"
      ATTRSbcdDevice=="508f"
      ATTRSbmAttributes=="c0"
      ATTRSbusnum=="2"
      ATTRSconfiguration==""
      ATTRSdevnum=="2"
      ATTRSdevpath=="1"
      ATTRSidProduct=="0ad3"
      ATTRSidVendor=="8086"
      ATTRSltm_capable=="no"
      ATTRSmanufacturer=="Intel(R) RealSense(TM) 415"
      ATTRSmaxchild=="0"
      ATTRSproduct=="Intel(R) RealSense(TM) 415"
      ATTRSquirks=="0x0"
      ATTRSremovable=="removable"
      ATTRSserial=="736613021813"
      ATTRSspeed=="5000"
      ATTRSurbnum=="56"
      ATTRSversion==" 3.10"

      looking at parent device '/devices/pci0000:00/0000:00:14.0/usb2':
      KERNELS=="usb2"
      SUBSYSTEMS=="usb"
      DRIVERS=="usb"
      ATTRSauthorized=="1"
      ATTRSauthorized_default=="1"
      ATTRSavoid_reset_quirk=="0"
      ATTRSbConfigurationValue=="1"
      ATTRSbDeviceClass=="09"
      ATTRSbDeviceProtocol=="03"
      ATTRSbDeviceSubClass=="00"
      ATTRSbMaxPacketSize0=="9"
      ATTRSbMaxPower=="0mA"
      ATTRSbNumConfigurations=="1"
      ATTRSbNumInterfaces==" 1"
      ATTRSbcdDevice=="0415"
      ATTRSbmAttributes=="e0"
      ATTRSbusnum=="2"
      ATTRSconfiguration==""
      ATTRSdevnum=="1"
      ATTRSdevpath=="0"
      ATTRSidProduct=="0003"
      ATTRSidVendor=="1d6b"
      ATTRSinterface_authorized_default=="1"
      ATTRSltm_capable=="yes"
      ATTRSmanufacturer=="Linux 4.15.0-36-generic xhci-hcd"
      ATTRSmaxchild=="10"
      ATTRSproduct=="xHCI Host Controller"
      ATTRSquirks=="0x0"
      ATTRSremovable=="unknown"
      ATTRSserial=="0000:00:14.0"
      ATTRSspeed=="5000"
      ATTRSurbnum=="101"
      ATTRSversion==" 3.00"

      looking at parent device '/devices/pci0000:00/0000:00:14.0':
      KERNELS=="0000:00:14.0"
      SUBSYSTEMS=="pci"
      DRIVERS=="xhci_hcd"
      ATTRSbroken_parity_status=="0"
      ATTRSclass=="0x0c0330"
      ATTRSconsistent_dma_mask_bits=="64"
      ATTRSd3cold_allowed=="1"
      ATTRSdbc=="disabled"
      ATTRSdevice=="0xa2af"
      ATTRSdma_mask_bits=="64"
      ATTRSdriver_override=="(null)"
      ATTRSenable=="1"
      ATTRSirq=="123"
      ATTRSlocal_cpulist=="0-3"
      ATTRSlocal_cpus=="f"
      ATTRSmsi_bus=="1"
      ATTRSnuma_node=="-1"
      ATTRSrevision=="0x00"
      ATTRSsubsystem_device=="0x310c"
      ATTRSsubsystem_vendor=="0x17aa"
      ATTRSvendor=="0x8086"

      looking at parent device '/devices/pci0000:00':
      KERNELS=="pci0000:00"
      SUBSYSTEMS==""
      DRIVERS==""






      udev video





      share












      share










      share



      share










      asked 42 secs ago









      Omegastick

      1163




      1163

























          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f479302%2fudev-rules-for-seemingly-indistinguishable-devices%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f479302%2fudev-rules-for-seemingly-indistinguishable-devices%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?