将 Linux 中的特定硬件设备列入黑名单

将 Linux 中的特定硬件设备列入黑名单

希望有人能帮助我。我的笔记本电脑的触摸设备出现故障。无法在 BIOS 中或通过任何其他方式禁用该设备(除了更换屏幕(成本超过笔记本电脑的价值))。断开连接位于胶合屏幕后面,移除后会破碎。

我想彻底禁用该设备或以某种方式将其硬件地址列入黑名单。理想情况下是内核引导参数、udev 规则或类似的东西。似乎可以识别为

acpi:NTRG0001:PNP0C50 . LNXSYBUS:00/PNP0A08:00/INT33C3:00/NTRG0001:01

它不是 PCI 设备,不会出现在 lspci 中。当然,我还有其他输入设备(触摸板或鼠标),因此不能仅仅阻止所有驱动程序。

我努力了:

  1. 使用 禁用 hid_multitouch 模块echo "blacklist hid_multitouch" > /etc/modprobe.d/hid_multitouch.conf,重新启动(并使用 lsmod 确认它没有加载),但是它随后在后备 hid-generic (而不是 hid_multitouch)下注册,并且仍然在我的屏幕上注册点击。因此这似乎并不能解决我的问题。
  2. 尝试编写一个设置“authorized=0”的 udev 规则(在 /etc/udev/rules.d/80-touchscreen 中),但是我似乎无法弄清楚如何正确地制定它 - 或者 - (更准确地说,因为该参数似乎不存在)我认为它不适用于 HID 设备或其子设备。在 INT33C3 或 i2c-NTRG0001 下的所有这些不同设备中,“授权”不是可写文件。我认为这是错误的路径,因为授权文件不存在。
  3. 尝试从 NTRG 设备中解除 i2c_hid 驱动程序的绑定,echo "i2c-NTRG0001:01" > /sys/bus/i2c/drivers/i2c_hid/unbind这似乎是唯一可行的方法,但它在重新启动后不会持续存在。将其添加到 rc.local 或其他东西似乎有点像黑客。我希望有一种方法可以通过其他方式来完成此任务(尽管这是我的后备方案)。

任何见解如何从内核、udev 或模块加载的角度简单地说“不要对此设备执行任何操作”或始终确保它不绑定到任何驱动程序或简单地阻止来自的所有事件/输入输入设备?

一些摘录(可能是在不同的重新启动模块状态下获取的)可能有助于识别来自 dmesg 的设备(禁用 hid_multitouch)

[3.555071] input: NTRG0001:01 1B96:1B05             as /devices/pci0000:00/INT33C3:00/i2c-2/i2c-NTRG0001:01/0018:1B96:1B05.0003/input/input11
[3.555358] input: NTRG0001:01 1B96:1B05 Touchscreen as /devices/pci0000:00/INT33C3:00/i2c-2/i2c-NTRG0001:01/0018:1B96:1B05.0003/input/input12
[3.555527] input: NTRG0001:01 1B96:1B05 Mouse       as /devices/pci0000:00/INT33C3:00/i2c-2/i2c-NTRG0001:01/0018:1B96:1B05.0003/input/input13
[3.555702] input: NTRG0001:01 1B96:1B05             as /devices/pci0000:00/INT33C3:00/i2c-2/i2c-NTRG0001:01/0018:1B96:1B05.0003/input/input14
[3.555763] input: NTRG0001:01 1B96:1B05             as /devices/pci0000:00/INT33C3:00/i2c-2/i2c-NTRG0001:01/0018:1B96:1B05.0003/input/input15
[3.555880] hid-generic 0018:1B96:1B05.0003: input,hidraw2: I2C HID v1.00 Mouse [NTRG0001:01 1B96:1B05] on i2c-NTRG0001:01

乌德瓦德姆

looking at device '/devices/pci0000:00/INT33C3:00/i2c-2/i2c-NTRG0001:01/0018:1B96:1B05.0003/hidraw/hidraw1':
  KERNEL=="hidraw1"
  SUBSYSTEM=="hidraw"
  DRIVER==""
looking at parent device '/devices/pci0000:00/INT33C3:00/i2c-2/i2c-NTRG0001:01/0018:1B96:1B05.0003':
  KERNELS=="0018:1B96:1B05.0003"
  SUBSYSTEMS=="hid"
  DRIVERS=="hid-multitouch"
  ATTRS{country}=="00"
  ATTRS{quirks}=="1"
looking at device '/devices/pci0000:00/INT33C3:00/i2c-2/i2c-NTRG0001:01':
  KERNEL=="i2c-NTRG0001:01"
  SUBSYSTEM=="i2c"
  DRIVER==""
  ATTR{name}=="NTRG0001:01"
looking at parent device '/devices/pci0000:00/INT33C3:00/i2c-2':
  KERNELS=="i2c-2"
  SUBSYSTEMS=="i2c"
  DRIVERS==""
  ATTRS{name}=="Synopsys DesignWare I2C adapter"
looking at parent device '/devices/pci0000:00/INT33C3:00':
  KERNELS=="INT33C3:00"
  SUBSYSTEMS=="platform"
  DRIVERS=="i2c_designware"
  ATTRS{driver_override}=="(null)"
looking at parent device '/devices/pci0000:00':
  KERNELS=="pci0000:00"S
  UBSYSTEMS==""
  DRIVERS==""

加载时的 udevadm

P: /devices/pci0000:00/INT33C3:00
L: 0
E: DEVPATH=/devices/pci0000:00/INT33C3:00
E: SUBSYSTEM=platform
E: DRIVER=i2c_designware
E: MODALIAS=acpi:INT33C3:INT33C3:
E: USEC_INITIALIZED=29617217
E: ID_VENDOR_FROM_DATABASE=Interphase Corporation
P: /devices/pci0000:00/INT33C3:00/i2c-2
L: 0
E: DEVPATH=/devices/pci0000:00/INT33C3:00/i2c-2
E: SUBSYSTEM=i2c
P: /devices/pci0000:00/INT33C3:00/i2c-2/i2c-NTRG0001:01
L: 0
E: DEVPATH=/devices/pci0000:00/INT33C3:00/i2c-2/i2c-NTRG0001:01
E: SUBSYSTEM=i2c
E: DRIVER=i2c_hid
E: MODALIAS=acpi:NTRG0001:PNP0C50:
E: USEC_INITIALIZED=29693864
E: ID_VENDOR_FROM_DATABASE=N-trig Innovative Technologies, Inc.
P: /devices/pci0000:00/INT33C3:00/i2c-2/i2c-NTRG0001:01/0018:1B96:1B05.0003
L: 0
E: DEVPATH=/devices/pci0000:00/INT33C3:00/i2c-2/i2c-NTRG0001:01/0018:1B96:1B05.0003
E: SUBSYSTEM=hid
E: DRIVER=hid-multitouch
E: HID_ID=0018:00001B96:00001B05
E: HID_NAME=NTRG0001:01 1B96:1B05
E: HID_PHYS=i2c-NTRG0001:01
E: HID_UNIQ=
E: MODALIAS=hid:b0018g0004v00001B96p00001B05
P: /devices/pci0000:00/INT33C3:00/i2c-2/i2c-NTRG0001:01/0018:1B96:1B05.0003/hidraw/hidraw1
N: hidraw1
L: 0
E: DEVPATH=/devices/pci0000:00/INT33C3:00/i2c-2/i2c-NTRG0001:01/0018:1B96:1B05.0003/hidraw/hidraw1
E: SUBSYSTEM=hidraw
E: DEVNAME=/dev/hidraw1
E: MAJOR=245
E: MINOR=1
P: /devices/pci0000:00/INT33C3:00/i2c-2/i2c-NTRG0001:01/0018:1B96:1B05.0003/input/input32
L: 0
E: DEVPATH=/devices/pci0000:00/INT33C3:00/i2c-2/i2c-NTRG0001:01/0018:1B96:1B05.0003/input/input32
E: SUBSYSTEM=input
E: PRODUCT=18/1b96/1b05/100
E: NAME="NTRG0001:01 1B96:1B05 Pen"
E: PHYS="i2c-NTRG0001:01"
E: UNIQ=""
E: PROP=0
E: EV=1b
E: KEY=c03 0 0 0 0 0
E: ABS=1000003
E: MSC=10
E: MODALIAS=input:b0018v1B96p1B05e0100-e0,1,3,4,k140,141,14A,14B,ra0,1,18,m4,lsfw
E: USEC_INITIALIZED=1589142529
E: ID_INPUT=1
E: ID_INPUT_TABLET=1
E: ID_SERIAL=noserial
E: ID_PATH=platform-INT33C3:00
E: ID_PATH_TAG=platform-INT33C3_00
E: ID_FOR_SEAT=input-platform-INT33C3_00
E: TAGS=:seat:
P: /devices/pci0000:00/INT33C3:00/i2c-2/i2c-NTRG0001:01/0018:1B96:1B05.0003/input/input32/event5
N: input/event5
L: 0
S: input/by-path/platform-INT33C3:00-event-mouse
E: DEVPATH=/devices/pci0000:00/INT33C3:00/i2c-2/i2c-NTRG0001:01/0018:1B96:1B05.0003/input/input32/event5
E: SUBSYSTEM=input
E: DEVNAME=/dev/input/event5
E: MAJOR=13
E: MINOR=69
E: USEC_INITIALIZED=1589364685
E: ID_INPUT=1
E: ID_INPUT_TABLET=1
E: ID_INPUT_WIDTH_MM=252
E: ID_INPUT_HEIGHT_MM=167
E: ID_SERIAL=noserial
E: ID_PATH=platform-INT33C3:00
E: ID_PATH_TAG=platform-INT33C3_00
E: LIBINPUT_DEVICE_GROUP=18/1b96/1b05:i2c-NTRG0001:01
E: DEVLINKS=/dev/input/by-path/platform-INT33C3:00-event-mouse
P: /devices/pci0000:00/INT33C3:00/i2c-2/i2c-NTRG0001:01/0018:1B96:1B05.0003/input/input32/mouse1
N: input/mouse1
L: 0
S: input/by-path/platform-INT33C3:00-mouse
E: DEVPATH=/devices/pci0000:00/INT33C3:00/i2c-2/i2c-NTRG0001:01/0018:1B96:1B05.0003/input/input32/mouse1
E: SUBSYSTEM=input
E: DEVNAME=/dev/input/mouse1
E: MAJOR=13
E: MINOR=33
E: USEC_INITIALIZED=1589149616
E: ID_INPUT=1
E: ID_INPUT_TABLET=1
E: ID_SERIAL=noserial
E: ID_PATH=platform-INT33C3:00
E: ID_PATH_TAG=platform-INT33C3_00
E: DEVLINKS=/dev/input/by-path/platform-INT33C3:00-mouse
P: /devices/pci0000:00/INT33C3:00/i2c-2/i2c-NTRG0001:01/0018:1B96:1B05.0003/input/input33
L: 0
E: DEVPATH=/devices/pci0000:00/INT33C3:00/i2c-2/i2c-NTRG0001:01/0018:1B96:1B05.0003/input/input33
E: SUBSYSTEM=input
E: PRODUCT=18/1b96/1b05/100
E: NAME="NTRG0001:01 1B96:1B05"
E: PHYS="i2c-NTRG0001:01"
E: UNIQ=""
E: PROP=2
E: EV=1b
E: KEY=400 0 0 0 0 0
E: ABS=3273800000000003
E: MSC=20
E: MODALIAS=input:b0018v1B96p1B05e0100-e0,1,3,4,k14A,ra0,1,2F,30,31,34,35,36,39,3C,3D,m5,lsfw
E: USEC_INITIALIZED=1589143403
E: ID_INPUT=1
E: ID_INPUT_TOUCHSCREEN=1
E: ID_PATH=platform-INT33C3:00
E: ID_PATH_TAG=platform-INT33C3_00
E: ID_FOR_SEAT=input-platform-INT33C3_00
E: TAGS=:seat:
P: /devices/pci0000:00/INT33C3:00/i2c-2/i2c-NTRG0001:01/0018:1B96:1B05.0003/input/input33/event6
N: input/event6
L: 0
S: input/by-path/platform-INT33C3:00-event
E: DEVPATH=/devices/pci0000:00/INT33C3:00/i2c-2/i2c-NTRG0001:01/0018:1B96:1B05.0003/input/input33/event6
E: SUBSYSTEM=input
E: DEVNAME=/dev/input/event6
E: MAJOR=13
E: MINOR=70
E: USEC_INITIALIZED=1589368910
E: ID_INPUT=1
E: ID_INPUT_TOUCHSCREEN=1
E: ID_INPUT_WIDTH_MM=252
E: ID_INPUT_HEIGHT_MM=167
E: ID_PATH=platform-INT33C3:00
E: ID_PATH_TAG=platform-INT33C3_00
E: LIBINPUT_DEVICE_GROUP=18/1b96/1b05:i2c-NTRG0001:01
E: DEVLINKS=/dev/input/by-path/platform-INT33C3:00-event
P: /devices/pci0000:00/INT33C3:00/i2c-2/i2c-NTRG0001:01/0018:1B96:1B05.0003/input/input33/mouse2
N: input/mouse2
L: 0
E: DEVPATH=/devices/pci0000:00/INT33C3:00/i2c-2/i2c-NTRG0001:01/0018:1B96:1B05.0003/input/input33/mouse2
E: SUBSYSTEM=input
E: DEVNAME=/dev/input/mouse2
E: MAJOR=13
E: MINOR=34
E: USEC_INITIALIZED=1589149528
E: ID_INPUT=1
E: ID_INPUT_TOUCHSCREEN=1
E: ID_PATH=platform-INT33C3:00
E: ID_PATH_TAG=platform-INT33C3_00

udevadm 扩展

P: /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/INT33C3:00/NTRG0001:00
L: 0
E: DEVPATH=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/INT33C3:00/NTRG0001:00
E: SUBSYSTEM=acpi
E: MODALIAS=
P: /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/INT33C3:00/NTRG0001:01
L: 0
E: DEVPATH=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/INT33C3:00/NTRG0001:01
E: SUBSYSTEM=acpi
E: MODALIAS=acpi:NTRG0001:PNP0C50:
E: USEC_INITIALIZED=29483509
E: ID_VENDOR_FROM_DATABASE=N-trig Innovative Technologies, Inc.
P: /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/INT33C3:00/SYNA2393:00
L: 0
E: DEVPATH=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/INT33C3:00/SYNA2393:00
E: SUBSYSTEM=acpi
E: MODALIAS=

答案1

您可以使用 禁用它xinput

执行xinput list并识别您的设备。它将有一个id=NUM.

然后你做:

xinput --disable NUM

相关内容