我正在尝试为 GPS 创建 udev 规则。我尝试了几种方法,但无法让规则捕获该设备:
lsusb:
总线 002 设备 007:ID 067b:2303 Prolific Technology, Inc. PL2303 串行端口
udevadm info -a -p $(udevadm info -q path -n /dev/ttyUSB0)
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/pci0000:00/0000:00:10.0/usb2/2-1/2-1:1.0/ttyUSB0/tty/ttyUSB0':
KERNEL=="ttyUSB0"
SUBSYSTEM=="tty"
DRIVER==""
looking at parent device '/devices/pci0000:00/0000:00:10.0/usb2/2-1/2-1:1.0/ttyUSB0':
KERNELS=="ttyUSB0"
SUBSYSTEMS=="usb-serial"
DRIVERS=="pl2303"
ATTRS{port_number}=="0"
looking at parent device '/devices/pci0000:00/0000:00:10.0/usb2/2-1/2-1:1.0':
KERNELS=="2-1:1.0"
SUBSYSTEMS=="usb"
DRIVERS=="pl2303"
ATTRS{bInterfaceNumber}=="00"
ATTRS{bAlternateSetting}==" 0"
ATTRS{bNumEndpoints}=="03"
ATTRS{bInterfaceClass}=="ff"
ATTRS{bInterfaceSubClass}=="00"
ATTRS{bInterfaceProtocol}=="00"
ATTRS{modalias}=="usb:v067Bp2303d0300dc00dsc00dp00icFFisc00ip00"
ATTRS{supports_autosuspend}=="1"
looking at parent device '/devices/pci0000:00/0000:00:10.0/usb2/2-1':
KERNELS=="2-1"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{configuration}==""
ATTRS{bNumInterfaces}==" 1"
ATTRS{bConfigurationValue}=="1"
ATTRS{bmAttributes}=="80"
ATTRS{bMaxPower}=="100mA"
ATTRS{urbnum}=="20"
ATTRS{idVendor}=="067b"
ATTRS{idProduct}=="2303"
ATTRS{bcdDevice}=="0300"
ATTRS{bDeviceClass}=="00"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bDeviceProtocol}=="00"
ATTRS{bNumConfigurations}=="1"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{speed}=="12"
ATTRS{busnum}=="2"
ATTRS{devnum}=="7"
ATTRS{version}==" 1.10"
ATTRS{maxchild}=="0"
ATTRS{quirks}=="0x0"
ATTRS{authorized}=="1"
ATTRS{manufacturer}=="Prolific Technology Inc."
ATTRS{product}=="USB-Serial Controller"
looking at parent device '/devices/pci0000:00/0000:00:10.0/usb2':
KERNELS=="usb2"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{configuration}==""
ATTRS{bNumInterfaces}==" 1"
ATTRS{bConfigurationValue}=="1"
ATTRS{bmAttributes}=="e0"
ATTRS{bMaxPower}==" 0mA"
ATTRS{urbnum}=="157"
ATTRS{idVendor}=="1d6b"
ATTRS{idProduct}=="0001"
ATTRS{bcdDevice}=="0206"
ATTRS{bDeviceClass}=="09"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bDeviceProtocol}=="00"
ATTRS{bNumConfigurations}=="1"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{speed}=="12"
ATTRS{busnum}=="2"
ATTRS{devnum}=="1"
ATTRS{version}==" 1.10"
ATTRS{maxchild}=="2"
ATTRS{quirks}=="0x0"
ATTRS{authorized}=="1"
ATTRS{manufacturer}=="Linux 2.6.32-34-generic-pae uhci_hcd"
ATTRS{product}=="UHCI Host Controller"
ATTRS{serial}=="0000:00:10.0"
ATTRS{authorized_default}=="1"
looking at parent device '/devices/pci0000:00/0000:00:10.0':
KERNELS=="0000:00:10.0"
SUBSYSTEMS=="pci"
DRIVERS=="uhci_hcd"
ATTRS{vendor}=="0x1106"
ATTRS{device}=="0x3038"
ATTRS{subsystem_vendor}=="0x1106"
ATTRS{subsystem_device}=="0x3038"
ATTRS{class}=="0x0c0300"
ATTRS{irq}=="21"
ATTRS{local_cpus}=="ff"
ATTRS{local_cpulist}=="0-7"
ATTRS{modalias}=="pci:v00001106d00003038sv00001106sd00003038bc0Csc03i00"
ATTRS{enable}=="1"
ATTRS{broken_parity_status}=="0"
ATTRS{msi_bus}==""
looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS=="
我尝试使用这些规则,我尝试使用这些规则,但都不起作用:
#DRIVERS=="sierra",SUBSYSTEMS=="usb",ATTRS{bInterfaceNumber}=="03",SYMLINK="ttyACM10"
#DRIVERS=="pl2303",SUBSYSTEMS=="usb-serial",ATTRS{idVendor}=="067b",ATTRS{idProduct}=="2303",ATTRS{bInterfaceNumber}=="00",SYMLINK="ttyGPS"
#DRIVERS=="pl2303",SUBSYSTEMS=="usb-serial",ATTRS{idVendor}=="067b",ATTRS{idProduct}=="2303",ATTRS{manufacturer}=="Prolific Technology Inc.",ATTRS{port_number}=="0",SYMLINK="ttyGPS"
#DRIVERS=="pl2303",SUBSYSTEM == "usb-serial", ATTRS{serial}=="0000:00:10.0", SYMLINK="ttyAGSP"
#DRIVERS=="pl2303",SUBSYSTEM=="tty"ATTRS{idVendor}=="067b",ATTRS{idProduct}=="2303",ATTRS{serial}=="0000:00:10.0",SYMLINK="ttyGPS"
系统曾经生成以下符号链接:
[ 4516.789581] pl2303 2-1:1.0: pl2303 converter detected
[ 4516.803239] usb 2-1: pl2303 converter now attached to ttyUSB0
有解决办法吗?谢谢!!