udev 规则为 arm linux 添加操纵杆?

udev 规则为 arm linux 添加操纵杆?

当我的系统中添加操纵杆时,我尝试向 udev 添加 ID_INPUT_JOYSTICK=1 环境。这对于桌面 Ubuntu 来说不是必需的,因为该属性已经存在,但在我使用的 Linux 版本上它没有显示。目标系统是 Linux 的 arm 版本。因此,运行 udevadm info 显示:

looking at device '/devices/platform/xhci-hcd.1/usb3/3-1/3-1:1.0/input/input6/event6':
    KERNEL=="event6"
    SUBSYSTEM=="input"
    DRIVER==""

  looking at parent device '/devices/platform/xhci-hcd.1/usb3/3-1/3-1:1.0/input/input6':
    KERNELS=="input6"
    SUBSYSTEMS=="input"
    DRIVERS==""
    ATTRS{name}=="Logitech Logitech RumblePad 2 USB"
    ATTRS{phys}=="usb-xhci-hcd.1-1/input0"
    ATTRS{uniq}==""
    ATTRS{properties}=="0"

  looking at parent device '/devices/platform/xhci-hcd.1/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}=="02"
    ATTRS{supports_autosuspend}=="1"
    ATTRS{bAlternateSetting}==" 0"
    ATTRS{bInterfaceNumber}=="00"

  looking at parent device '/devices/platform/xhci-hcd.1/usb3/3-1':
    KERNELS=="3-1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{devpath}=="1"
    ATTRS{idVendor}=="046d"
    ATTRS{speed}=="1.5"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bMaxPacketSize0}=="8"
    ATTRS{busnum}=="3"
    ATTRS{devnum}=="2"
    ATTRS{configuration}==""
    ATTRS{bMaxPower}=="500mA"
    ATTRS{authorized}=="1"
    ATTRS{bmAttributes}=="80"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{maxchild}=="0"
    ATTRS{bcdDevice}=="0100"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{quirks}=="0x0"
    ATTRS{version}==" 1.10"
    ATTRS{urbnum}=="16"
    ATTRS{ltm_capable}=="no"
    ATTRS{manufacturer}=="Logitech"
    ATTRS{removable}=="unknown"
    ATTRS{idProduct}=="c218"
    ATTRS{bDeviceClass}=="00"

但我希望它能够看到添加到末尾的 ENV{ID_INPUT_JOYSTICK}="1",如下所示:

looking at device '/devices/platform/xhci-hcd.1/usb3/3-1/3-1:1.0/input/input6/event6':
    KERNEL=="event6"
    SUBSYSTEM=="input"
    DRIVER==""
  looking at parent device '/devices/platform/xhci-hcd.1/usb3/3-1/3-1:1.0/input/input6':
    KERNELS=="input6"
    SUBSYSTEMS=="input"
    DRIVERS==""
    ATTRS{name}=="Logitech Logitech RumblePad 2 USB"
    ATTRS{phys}=="usb-xhci-hcd.1-1/input0"
    ATTRS{uniq}==""
    ATTRS{properties}=="0"
    ENV{ID_INPUT_JOYSTICK}="1"
    ..

我添加的规则是:/etc/udev/rules.d/91-joystick-rules

SUBSYSTEMS=="input", ATTRS{name}=="Logitech Logitech RumblePad 2 USB", MODE="0666", ENV{ID_INPUT_JOYSTICK}="1"

此外,/lib/udev/rules.d/ 与 ubuntu 桌面不同:

-rw-r--r--    1 1003     1003         11741 May 27  2014 95-keymap.rules
-rw-r--r--    1 1003     1003           131 May 17  2014 90-alsa-restore.rules
-rw-r--r--    1 1003     1003          5570 May 17  2014 90-pulseaudio.rules
-rw-r--r--    1 1003     1003          1356 May 17  2014 97-bluetooth-hid2hci.rules
-rw-r--r--    1 1003     1003          2732 May 17  2014 42-usb-hid-pm.rules
-rw-r--r--    1 1003     1003          3652 May 17  2014 50-udev-default.rules
-rw-r--r--    1 1003     1003           646 May 17  2014 60-cdrom_id.rules
-rw-r--r--    1 1003     1003           616 May 17  2014 60-persistent-alsa.rules
-rw-r--r--    1 1003     1003          2400 May 17  2014 60-persistent-input.rules
-rw-r--r--    1 1003     1003           947 May 17  2014 60-persistent-serial.rules
-rw-r--r--    1 1003     1003          1420 May 17  2014 60-persistent-storage-tape.rules
-rw-r--r--    1 1003     1003          5622 May 17  2014 60-persistent-storage.rules
-rw-r--r--    1 1003     1003           769 May 17  2014 60-persistent-v4l.rules
-rw-r--r--    1 1003     1003           166 May 17  2014 61-accelerometer.rules
-rw-r--r--    1 1003     1003           570 May 17  2014 75-net-description.rules
-rw-r--r--    1 1003     1003           255 May 17  2014 75-probe_mtd.rules
-rw-r--r--    1 1003     1003           570 May 17  2014 75-tty-description.rules
-rw-r--r--    1 1003     1003          4174 May 17  2014 78-sound-card.rules
-rw-r--r--    1 1003     1003           565 May 17  2014 80-drivers.rules
-rw-r--r--    1 1003     1003          3328 May 17  2014 95-keyboard-force-release.rules
-rw-r--r--    1 1003     1003           155 May 17  2014 95-udev-late.rules

我尝试重启系统并尝试特定规则,但我不知道为什么我添加的环境没有显示。如能得到任何帮助我将不胜感激。

相关内容