I have two types of gamepad that have the same udev properties. One is a USB NES controller and the other is a USB SNES controller. The udev info is identical for both of them.
P: /devices/pci0000:00/0000:00:1c.6/0000:0e:00.0/usb3/3-1/3-1:1.0/input/input18/js2
N: input/js2
S: input/by-id/usb-0079_USB_Gamepad-joystick
S: input/by-path/pci-0000:0e:00.0-usb-0:1:1.0-joystick
E: DEVLINKS=/dev/input/by-id/usb-0079_USB_Gamepad-joystick /dev/input/by-path/pci-0000:0e:00.0-usb-0:1:1.0-joystick
E: DEVNAME=/dev/input/js2
E: DEVPATH=/devices/pci0000:00/0000:00:1c.6/0000:0e:00.0/usb3/3-1/3-1:1.0/input/input18/js2
E: ID_BUS=usb
E: ID_FOR_SEAT=input-pci-0000_0e_00_0-usb-0_1_1_0
E: ID_INPUT=1
E: ID_INPUT_JOYSTICK=1
E: ID_MODEL=USB_Gamepad
E: ID_MODEL_ENC=USB\x20Gamepad\x20
E: ID_MODEL_ID=0011
E: ID_PATH=pci-0000:0e:00.0-usb-0:1:1.0
E: ID_PATH_TAG=pci-0000_0e_00_0-usb-0_1_1_0
E: ID_REVISION=0106
E: ID_SERIAL=0079_USB_Gamepad
E: ID_TYPE=hid
E: ID_USB_DRIVER=usbhid
E: ID_USB_INTERFACES=:030000:
E: ID_USB_INTERFACE_NUM=00
E: ID_VENDOR=0079
E: ID_VENDOR_ENC=0079
E: ID_VENDOR_ID=0079
E: MAJOR=13
E: MINOR=2
E: SUBSYSTEM=input
E: TAGS=:seat:uaccess:
E: USEC_INITIALIZED=738808992
The application uses the ID_MODEL value to identify the controller and assign a button map. I have several gamepads that do the same thing but am keeping it to 2 for this example.
How would I get udev to either rename or alias ifferent devices that have the same info? What would that rule look like?
looking at device '/devices/pci0000:00/0000:00:1c.6/0000:0e:00.0/usb3/3-1/3-1:1.0/input/input32/js2':
KERNEL=="js2"
SUBSYSTEM=="input"
DRIVER==""
looking at parent device '/devices/pci0000:00/0000:00:1c.6/0000:0e:00.0/usb3/3-1/3-1:1.0/input/input32':
KERNELS=="input32"
SUBSYSTEMS=="input"
DRIVERS==""
ATTRS{name}=="USB Gamepad "
ATTRS{phys}=="usb-0000:0e:00.0-1/input0"
ATTRS{uniq}==""
ATTRS{properties}=="0"
looking at parent device '/devices/pci0000:00/0000:00:1c.6/0000:0e:00.0/usb3/3-1/3-1:1.0':
KERNELS=="3-1:1.0"
SUBSYSTEMS=="usb"
DRIVERS=="usbhid"
ATTRS{bInterfaceClass}=="03"
ATTRS{bInterfaceSubClass}=="00"
ATTRS{bInterfaceProtocol}=="00"
ATTRS{bNumEndpoints}=="01"
ATTRS{supports_autosuspend}=="1"
ATTRS{bAlternateSetting}==" 0"
ATTRS{bInterfaceNumber}=="00"
looking at parent device '/devices/pci0000:00/0000:00:1c.6/0000:0e:00.0/usb3/3-1':
KERNELS=="3-1"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bDeviceProtocol}=="00"
ATTRS{devpath}=="1"
ATTRS{idVendor}=="0079"
ATTRS{speed}=="1.5"
ATTRS{bNumInterfaces}==" 1"
ATTRS{bConfigurationValue}=="1"
ATTRS{bMaxPacketSize0}=="8"
ATTRS{busnum}=="3"
ATTRS{devnum}=="15"
ATTRS{configuration}==""
ATTRS{bMaxPower}=="100mA"
ATTRS{authorized}=="1"
ATTRS{bmAttributes}=="80"
ATTRS{bNumConfigurations}=="1"
ATTRS{maxchild}=="0"
ATTRS{bcdDevice}=="0106"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{quirks}=="0x0"
ATTRS{version}==" 1.00"
ATTRS{urbnum}=="13"
ATTRS{ltm_capable}=="no"
ATTRS{removable}=="unknown"
ATTRS{idProduct}=="0011"
ATTRS{bDeviceClass}=="00"
ATTRS{product}=="USB Gamepad "
looking at parent device '/devices/pci0000:00/0000:00:1c.6/0000:0e:00.0/usb3':
KERNELS=="usb3"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bDeviceProtocol}=="01"
ATTRS{devpath}=="0"
ATTRS{idVendor}=="1d6b"
ATTRS{speed}=="480"
ATTRS{bNumInterfaces}==" 1"
ATTRS{bConfigurationValue}=="1"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{authorized_default}=="1"
ATTRS{busnum}=="3"
ATTRS{devnum}=="1"
ATTRS{configuration}==""
ATTRS{bMaxPower}=="0mA"
ATTRS{authorized}=="1"
ATTRS{bmAttributes}=="e0"
ATTRS{bNumConfigurations}=="1"
ATTRS{maxchild}=="2"
ATTRS{bcdDevice}=="0313"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{quirks}=="0x0"
ATTRS{serial}=="0000:0e:00.0"
ATTRS{version}==" 2.00"
ATTRS{urbnum}=="241"
ATTRS{ltm_capable}=="no"
ATTRS{manufacturer}=="Linux 3.13.0-74-generic xhci_hcd"
ATTRS{removable}=="unknown"
ATTRS{idProduct}=="0002"
ATTRS{bDeviceClass}=="09"
ATTRS{product}=="xHCI Host Controller"
looking at parent device '/devices/pci0000:00/0000:00:1c.6/0000:0e:00.0':
KERNELS=="0000:0e:00.0"
SUBSYSTEMS=="pci"
DRIVERS=="xhci_hcd"
ATTRS{irq}=="18"
ATTRS{subsystem_vendor}=="0x17aa"
ATTRS{broken_parity_status}=="0"
ATTRS{class}=="0x0c0330"
ATTRS{consistent_dma_mask_bits}=="64"
ATTRS{dma_mask_bits}=="64"
ATTRS{local_cpus}=="00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff"
ATTRS{device}=="0x0194"
ATTRS{enable}=="1"
ATTRS{msi_bus}==""
ATTRS{local_cpulist}=="0-7"
ATTRS{vendor}=="0x1033"
ATTRS{subsystem_device}=="0x21cf"
ATTRS{numa_node}=="-1"
ATTRS{d3cold_allowed}=="1"
looking at parent device '/devices/pci0000:00/0000:00:1c.6':
KERNELS=="0000:00:1c.6"
SUBSYSTEMS=="pci"
DRIVERS=="pcieport"
ATTRS{irq}=="18"
ATTRS{subsystem_vendor}=="0x17aa"
ATTRS{broken_parity_status}=="0"
ATTRS{class}=="0x060400"
ATTRS{consistent_dma_mask_bits}=="32"
ATTRS{dma_mask_bits}=="32"
ATTRS{local_cpus}=="00000000,00000000,00000000,00000000,00000000,00000000,00000000,000000ff"
ATTRS{device}=="0x1c1c"
ATTRS{enable}=="2"
ATTRS{msi_bus}=="1"
ATTRS{local_cpulist}=="0-7"
ATTRS{vendor}=="0x8086"
ATTRS{subsystem_device}=="0x21cf"
ATTRS{numa_node}=="-1"
ATTRS{d3cold_allowed}=="0"
looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""
udevadm info ...
command ? An expanded output, extending to the parent hierarchy would be useful. Can you please edit yr post with that added info ?