1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-02 10:51:20 +03:00
systemd/rules/rules.d/60-persistent-serial.rules
Kay Sievers bc4c751802 rules: add persistent /dev/serial/{by-id,by-path} rules
$ tree /dev/serial/
 /dev/serial/
 |-- by-id
 |   |-- usb-067b_2303-if00-port0 -> ../../ttyUSB0
 |   |-- usb-FTDI_FT232R_USB_UART_A7005uBP-if00-port0 -> ../../ttyUSB3
 |   |-- usb-HUAWEI_Technology_HUAWEI_Mobile-if00-port0 -> ../../ttyUSB1
 |   `-- usb-HUAWEI_Technology_HUAWEI_Mobile-if01-port0 -> ../../ttyUSB2
 `-- by-path
     |-- pci-0000:00:1d.0-usb-0:1:1.0-port0 -> ../../ttyUSB3
     |-- pci-0000:00:1d.7-usb-0:2.2.2:1.0-port0 -> ../../ttyUSB0
     |-- pci-0000:00:1d.7-usb-0:2.3:1.0-port0 -> ../../ttyUSB1
     `-- pci-0000:00:1d.7-usb-0:2.3:1.1-port0 -> ../../ttyUSB2

 $ tree /dev/serial/
 /dev/serial/
 |-- by-id
 |   |-- usb-Inside_Out_Networks_Edgeport_4_04-01-006467-if00-port0 -> ../../ttyUSB0
 |   |-- usb-Inside_Out_Networks_Edgeport_4_04-01-006467-if00-port1 -> ../../ttyUSB1
 |   |-- usb-Inside_Out_Networks_Edgeport_4_04-01-006467-if00-port2 -> ../../ttyUSB2
 |   |-- usb-Inside_Out_Networks_Edgeport_4_04-01-006467-if00-port3 -> ../../ttyUSB3
 |   |-- usb-Keyspan__a_division_of_InnoSys_Inc._USB_4-port_Serial_Adapter-if00-port0 -> ../../ttyUSB8
 |   |-- usb-Keyspan__a_division_of_InnoSys_Inc._USB_4-port_Serial_Adapter-if00-port1 -> ../../ttyUSB9
 |   |-- usb-Keyspan__a_division_of_InnoSys_Inc._USB_4-port_Serial_Adapter-if00-port2 -> ../../ttyUSB10
 |   |-- usb-Keyspan__a_division_of_InnoSys_Inc._USB_4-port_Serial_Adapter-if00-port3 -> ../../ttyUSB11
 |   `-- usb-Prolific_Technology_Inc._USB-Serial_Controller-if00-port0 -> ../../ttyUSB7
 `-- by-path
     |-- pci-0000:00:1d.2-usb-0:1.3:1.0-port0 -> ../../ttyUSB7
     |-- pci-0000:00:1d.7-usb-0:6.1.4.1:1.0-port0 -> ../../ttyUSB4
     |-- pci-0000:00:1d.7-usb-0:6.1.4.1:1.0-port1 -> ../../ttyUSB5
     |-- pci-0000:00:1d.7-usb-0:6.1.4.1:1.0-port2 -> ../../ttyUSB6
     |-- pci-0000:00:1d.7-usb-0:6.1.4.4:1.0-port0 -> ../../ttyUSB0
     |-- pci-0000:00:1d.7-usb-0:6.1.4.4:1.0-port1 -> ../../ttyUSB1
     |-- pci-0000:00:1d.7-usb-0:6.1.4.4:1.0-port2 -> ../../ttyUSB2
     |-- pci-0000:00:1d.7-usb-0:6.1.4.4:1.0-port3 -> ../../ttyUSB3
     |-- pci-0000:00:1d.7-usb-0:6.3:1.0-port0 -> ../../ttyUSB8
     |-- pci-0000:00:1d.7-usb-0:6.3:1.0-port1 -> ../../ttyUSB9
     |-- pci-0000:00:1d.7-usb-0:6.3:1.0-port2 -> ../../ttyUSB10
     `-- pci-0000:00:1d.7-usb-0:6.3:1.0-port3 -> ../../ttyUSB11
2008-12-04 01:43:33 +01:00

20 lines
715 B
Plaintext

# do not edit this file, it will be overwritten on update
ACTION!="add|change", GOTO="persistent_serial_end"
SUBSYSTEM!="tty", GOTO="persistent_serial_end"
KERNEL!="ttyUSB[0-9]*", GOTO="persistent_serial_end"
SUBSYSTEMS=="usb-serial", ENV{ID_PORT}="$attr{port_number}"
ENV{ID_PORT}=="", GOTO="persistent_serial_end"
IMPORT="path_id"
ENV{ID_PATH}=="?*", SYMLINK+="serial/by-path/$env{ID_PATH}-port$env{ID_PORT}"
IMPORT="usb_id --export"
ENV{ID_SERIAL}=="", GOTO="persistent_serial_end"
SUBSYSTEMS=="usb", ENV{ID_IFACE}="$attr{bInterfaceNumber}"
ENV{ID_IFACE}=="", GOTO="persistent_serial_end"
SYMLINK+="serial/by-id/$env{ID_BUS}-$env{ID_SERIAL}-if$env{ID_IFACE}-port$env{ID_PORT}"
LABEL="persistent_serial_end"