操作系统 Debian Jessieuname -a Linux Taomon 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2+deb8u2 (2017-06-26) x86_64 GNU/Linux
笔记本
dmidecode -t 1
# dmidecode 2.12
SMBIOS 2.5 present.
Handle 0x0001, DMI type 1, 27 bytes
System Information
Manufacturer: Acer
Product Name: Aspire 7736
Version: 0100
Serial Number: LXPJA0231102209DE42000
UUID: 34399FC0-6F14-11DF-BF16-AE2F22C409A5
Wake-up Type: Power Switch
SKU Number: Not Specified
Family: Not Specified
加载模块 acer-wmi 后,我的游戏手柄无法使用。在 Xorg.0.log 中我发现
[ 32.403] (II) config/udev: Adding input device Acer BMA150 accelerometer (/dev/input/js0)
[ 32.403] (II) No input driver specified, ignoring this device.
[ 32.403] (II) This device may have been added with another device file.
即使作为 root 我也无法访问设备节点 /dev/input/js0
Error opening joystick device "/dev/input/js0": Operation is not permitted
有没有办法避免这种情况,无需黑名单模块 acer-wmi ?
modinfo acer-wmi | grep -F parm
parm: mailled:Set initial state of Mail LED (int)
parm: brightness:Set initial LCD backlight brightness (int)
parm: threeg:Set initial state of 3G hardware (int)
parm: force_series:Force a different laptop series (int)
parm: ec_raw_mode:Enable EC raw mode (bool)
从 Stretch 安装内核是不可能的,它将安装一堆来自稳定版的软件包。迟早会破易于
答案1
现在它按照我的意愿工作了。我创建了 2 个 udev 规则。 1.擦除设备/dev/input/js0。
cat /etc/udev/rules.d/98-accelerometer.rules
# joystick-fix
SUBSYSTEM=="input", ACTION=="remove", ATTRS{name}=="Acer BMA150 accelerometer", ATTRS{phys}=="wmi/input1", RUN+="/bin/rm %E{DEVNAME}"
SUBSYSTEM=="input", ACTION=="add", ATTRS{name}=="Acer BMA150 accelerometer", ATTRS{phys}=="wmi/input1", RUN+="/bin/rm %E{DEVNAME}"
遗憾的是,linux 记住了这个设备,而我的游戏手柄又是 /dev/input/js1。
2.创建一个符号链接/dev/input/js0,这样我的模拟器就不再抱怨了。
cat /etc/udev/rules.d/99-joystick.rules
#joystick-fix 2. part
ACTION=="add", KERNEL=="js[1-9]", SUBSYSTEM=="input", ATTRS{product}=="USB Joystick ", SYMLINK+="input/js0"