当我将手机插入USB端口时,我试图阻止调制解调器管理器运行。
我尝试使用udev添加自定义规则,但是我的自定义规则似乎被忽略了。我创建了一个文件/etc/udev/rules.d/99-mm-usb-device-blacklist.rules
,其中包含
# LG Phone
ATTRS{idVendor}=="1004", ENV{ID_MM_DEVICE_IGNORE}="1"
但是,当我插入电话并检查dmesg时,这就是我得到的:
[ 1809.761940] usb 3-1: new high-speed USB device number 11 using xhci_hcd
[ 1809.778662] usb 3-1: New USB device found, idVendor=1004, idProduct=61fc
[ 1809.778670] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1809.778674] usb 3-1: Product: B Project USB Device
[ 1809.778677] usb 3-1: Manufacturer: LG Electronics. Inc
[ 1809.778680] usb 3-1: SerialNumber: XXXXXXXXXXXXXXXXX
[ 1809.779501] cdc_acm 3-1:1.0: This device cannot do calls on its own. It is not a modem.
[ 1809.779584] cdc_acm 3-1:1.0: ttyACM0: USB ACM device
[ 1809.780899] cdc_ether 3-1:1.3 usb0: register 'cdc_ether' at usb-0000:00:14.0-1, CDC Ethernet Device, 6e:34:73:4f:68:4c
[ 1809.781454] scsi8 : usb-storage 3-1:1.5
[ 1809.807331] IPv6: ADDRCONF(NETDEV_UP): usb0: link is not ready
[ 1809.816566] IPv6: ADDRCONF(NETDEV_UP): usb0: link is not ready
[ 1809.816759] IPv6: ADDRCONF(NETDEV_UP): usb0: link is not ready
我也尝试过编辑,/lib/udev/rules.dev/77-mm-usb-device-blacklist.rules
但这也不起作用。我想念什么?什么是调试此步骤的有用步骤?
更新:运行udevadm info --export-db
表明udev规则正在更新。相关输出为:
P: /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.7
N: bus/usb/002/012
E: BUSNUM=002
E: DEVNAME=/dev/bus/usb/002/012
E: DEVNUM=012
E: DEVPATH=/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.7
E: DEVTYPE=usb_device
E: DRIVER=usb
E: ID_BUS=usb
E: ID_MM_DEVICE_IGNORE=1
E: ID_MODEL=B_Project_USB_Device
E: ID_MODEL_ENC=B\x20Project\x20USB\x20Device
E: ID_MODEL_ID=61fc
E: ID_REVISION=0216
E: ID_SERIAL=LG_Electronics._Inc_B_Project_USB_Device_XXXXXXXXXXXXX
E: ID_SERIAL_SHORT=XXXXXXXXXXXX
E: ID_USB_INTERFACES=:020201:0a0000:ffffff:020600:080650:
E: ID_VENDOR=LG_Electronics._Inc
E: ID_VENDOR_ENC=LG\x20Electronics.\x20Inc
E: ID_VENDOR_ID=1004
E: MAJOR=189
E: MINOR=139
E: PRODUCT=1004/61fc/216
E: SUBSYSTEM=usb
E: TYPE=239/2/1
E: UDEV_LOG=7
E: USEC_INITIALIZED=5987581808
因此,调制解调器管理器应忽略该设备。但是,每当我将手机插入USB端口时,我的计算机就会继续尝试通过手机初始化网络连接。udev正在启动另一个程序吗?
ID_MM_CANDIDATE
不会出现在USB设备输出中,但是在TTY设备的数据库输出中有一个单独的条目,并且具有ID_MM_CANDIDATE=1
和ID_MM_DEVICE_IGNORE=1
。调制解调器管理器调试日志显示它确实在探测设备。