だから私はPC-Engines ALIX.2D13、Huawei E220 umtsモデム、Debian Wheezy、gammu-smsdを使って小さくて素晴らしいGSMゲートウェイを構築しました。再起動後も gammu-smsd の固定装置名が必要です。私は次のudevルールを作成しましたが、なぜ動作しないのかわかりません。
SUBSYSTEM=="tty", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1003", ATTRS{bInterfaceNumber}=="00", SYMLINK+="gsm0"
SUBSYSTEM=="tty", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1003", ATTRS{bInterfaceNumber}=="01", SYMLINK+="gsm1"
私のudevadm出力は次のようになります。
root@ko-smsgw-01:~# udevadm info -a -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:0f.4/usb2/2-1/2-1:1.0/ttyUSB0/tty/ttyUSB0':
KERNEL=="ttyUSB0"
SUBSYSTEM=="tty"
DRIVER==""
looking at parent device '/devices/pci0000:00/0000:00:0f.4/usb2/2-1/2-1:1.0/ttyUSB0':
KERNELS=="ttyUSB0"
SUBSYSTEMS=="usb-serial"
DRIVERS=="option1"
ATTRS{port_number}=="0"
looking at parent device '/devices/pci0000:00/0000:00:0f.4/usb2/2-1/2-1:1.0':
KERNELS=="2-1:1.0"
SUBSYSTEMS=="usb"
DRIVERS=="option"
ATTRS{bInterfaceNumber}=="00"
ATTRS{bAlternateSetting}==" 0"
ATTRS{bNumEndpoints}=="03"
ATTRS{bInterfaceClass}=="ff"
ATTRS{bInterfaceSubClass}=="ff"
ATTRS{bInterfaceProtocol}=="ff"
ATTRS{supports_autosuspend}=="1"
ATTRS{interface}=="Data Interface"
looking at parent device '/devices/pci0000:00/0000:00:0f.4/usb2/2-1':
KERNELS=="2-1"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{configuration}==""
ATTRS{bNumInterfaces}==" 3"
ATTRS{bConfigurationValue}=="1"
ATTRS{bmAttributes}=="a0"
ATTRS{bMaxPower}=="500mA"
ATTRS{urbnum}=="1126"
ATTRS{idVendor}=="12d1"
ATTRS{idProduct}=="1003"
ATTRS{bcdDevice}=="0000"
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{devpath}=="1"
ATTRS{version}==" 1.10"
ATTRS{maxchild}=="0"
ATTRS{quirks}=="0x0"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{authorized}=="1"
ATTRS{manufacturer}=="HUAWEI Technologies"
ATTRS{product}=="HUAWEI Mobile"
looking at parent device '/devices/pci0000:00/0000:00:0f.4/usb2':
KERNELS=="usb2"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{configuration}==""
ATTRS{bNumInterfaces}==" 1"
ATTRS{bConfigurationValue}=="1"
ATTRS{bmAttributes}=="e0"
ATTRS{bMaxPower}==" 0mA"
ATTRS{urbnum}=="180"
ATTRS{idVendor}=="1d6b"
ATTRS{idProduct}=="0001"
ATTRS{bcdDevice}=="0302"
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{devpath}=="0"
ATTRS{version}==" 1.10"
ATTRS{maxchild}=="4"
ATTRS{quirks}=="0x0"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{authorized}=="1"
ATTRS{manufacturer}=="Linux 3.2.0-4-486 ohci_hcd"
ATTRS{product}=="OHCI Host Controller"
ATTRS{serial}=="0000:00:0f.4"
ATTRS{authorized_default}=="1"
looking at parent device '/devices/pci0000:00/0000:00:0f.4':
KERNELS=="0000:00:0f.4"
SUBSYSTEMS=="pci"
DRIVERS=="ohci_hcd"
ATTRS{vendor}=="0x1022"
ATTRS{device}=="0x2094"
ATTRS{subsystem_vendor}=="0x1022"
ATTRS{subsystem_device}=="0x2094"
ATTRS{class}=="0x0c0310"
ATTRS{irq}=="12"
ATTRS{local_cpus}=="1"
ATTRS{local_cpulist}=="0"
ATTRS{dma_mask_bits}=="32"
ATTRS{consistent_dma_mask_bits}=="32"
ATTRS{enable}=="1"
ATTRS{broken_parity_status}=="0"
ATTRS{msi_bus}==""
looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""
答え1
これを見て、http://reactivated.net/writing_udev_rules.html#udevinfo
関連デバイスと単一の親デバイスの属性を結合することは合法的ですが、複数の親デバイスの属性を混合して一致させることはできません。ルールが機能しません。
あなたの例によると、各ルールは2つの親デバイスを参照していますが、これは間違っています。
ATTRS{bInterfaceNumber}==“00”
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1003"