diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2018-05-27 16:39:17 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2018-06-02 16:54:37 +0200 |
commit | c07382a486f53e1b3cf729b41518d2a0ba528f5a (patch) | |
tree | ba0f419c995de0ff97ca3fbeb92c91b084c5cba4 /plugins/simtech | |
parent | 4bc7d6862d3b908476e8bddd70cfc9e571dc9622 (diff) |
udev: add tags also on bind action
When a new USB device is hotplugged, e.g. a USB<->RS232 converter that
exposes a single ttyUSB0, these udev events happen:
add /devices/pci0000:00/0000:00:14.0/usb2/2-1 (usb/usb-device)
add /devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0 (usb/usb-interface)
add /devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0/ttyUSB0 (usb-serial)
add /devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0/ttyUSB0/tty/ttyUSB0 (tty)
bind /devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0/ttyUSB0 (usb-serial)
bind /devices/pci0000:00/0000:00:14.0/usb2/2-1/2-1:1.0 (usb/usb-interface)
bind /devices/pci0000:00/0000:00:14.0/usb2/2-1 (usb/usb-device)
Our udev rules in MM only added tags in the 'add' events, and it looks
like the only ones 'persistent' after this sequence are those of the
last event happening on the specific path.
This meant that all TTY subsystem rules (e.g. ID_MM_CANDIDATE) would
be stored for later check (e.g. if ModemManager is started after these
rules have been applied), which was ok. "udevadm info -p ..." would
show these tags correctly always.
But this also meant that the 'bind' udev event happening for the USB
device didn't get any of our device-specific tags, and so we would be
missing them (e.g. ID_MM_DEVICE_MANUAL_SCAN_ONLY) if MM is started
after the last event has happened. "udevadm info -p ..." would
not show these tags.
Modify all our rules to also run at the 'bind' events.
See, for context:
https://github.com/systemd/systemd/issues/8221
Diffstat (limited to 'plugins/simtech')
-rw-r--r-- | plugins/simtech/77-mm-simtech-port-types.rules | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/simtech/77-mm-simtech-port-types.rules b/plugins/simtech/77-mm-simtech-port-types.rules index d0a9a6fc..27ec6d93 100644 --- a/plugins/simtech/77-mm-simtech-port-types.rules +++ b/plugins/simtech/77-mm-simtech-port-types.rules @@ -10,7 +10,7 @@ # *ser.inf lists the aux ports that may be used for PPP. -ACTION!="add|change|move", GOTO="mm_simtech_port_types_end" +ACTION!="add|change|move|bind", GOTO="mm_simtech_port_types_end" SUBSYSTEMS=="usb", ATTRS{idVendor}=="1e0e", GOTO="mm_simtech_port_types" GOTO="mm_simtech_port_types_end" |