aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2018-05-27 16:39:17 +0200
committerAleksander Morgado <aleksander@aleksander.es>2018-06-02 16:54:37 +0200
commitc07382a486f53e1b3cf729b41518d2a0ba528f5a (patch)
treeba0f419c995de0ff97ca3fbeb92c91b084c5cba4 /src
parent4bc7d6862d3b908476e8bddd70cfc9e571dc9622 (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 'src')
-rw-r--r--src/77-mm-pcmcia-device-blacklist.rules2
-rw-r--r--src/77-mm-usb-device-blacklist.rules2
-rw-r--r--src/77-mm-usb-serial-adapters-greylist.rules2
-rw-r--r--src/80-mm-candidate.rules2
4 files changed, 4 insertions, 4 deletions
diff --git a/src/77-mm-pcmcia-device-blacklist.rules b/src/77-mm-pcmcia-device-blacklist.rules
index f0f8474f..b496a8e5 100644
--- a/src/77-mm-pcmcia-device-blacklist.rules
+++ b/src/77-mm-pcmcia-device-blacklist.rules
@@ -1,6 +1,6 @@
# do not edit this file, it will be overwritten on update
-ACTION!="add|change|move", GOTO="mm_pcmcia_device_blacklist_end"
+ACTION!="add|change|move|bind", GOTO="mm_pcmcia_device_blacklist_end"
SUBSYSTEM!="pcmcia", GOTO="mm_pcmcia_device_blacklist_end"
# Gemplus Serial Port smartcard adapter
diff --git a/src/77-mm-usb-device-blacklist.rules b/src/77-mm-usb-device-blacklist.rules
index e06643ad..854739a6 100644
--- a/src/77-mm-usb-device-blacklist.rules
+++ b/src/77-mm-usb-device-blacklist.rules
@@ -1,6 +1,6 @@
# do not edit this file, it will be overwritten on update
-ACTION!="add|change|move", GOTO="mm_usb_device_blacklist_end"
+ACTION!="add|change|move|bind", GOTO="mm_usb_device_blacklist_end"
SUBSYSTEM!="usb", GOTO="mm_usb_device_blacklist_end"
# APC UPS devices
diff --git a/src/77-mm-usb-serial-adapters-greylist.rules b/src/77-mm-usb-serial-adapters-greylist.rules
index f4f588bf..2dc6f7db 100644
--- a/src/77-mm-usb-serial-adapters-greylist.rules
+++ b/src/77-mm-usb-serial-adapters-greylist.rules
@@ -1,6 +1,6 @@
# do not edit this file, it will be overwritten on update
-ACTION!="add|change|move", GOTO="mm_usb_serial_adapters_greylist_end"
+ACTION!="add|change|move|bind", GOTO="mm_usb_serial_adapters_greylist_end"
SUBSYSTEM!="usb", GOTO="mm_usb_serial_adapters_greylist_end"
# Belkin F5U183 Serial Adapter
diff --git a/src/80-mm-candidate.rules b/src/80-mm-candidate.rules
index 2f95e7d2..3d9cd6e7 100644
--- a/src/80-mm-candidate.rules
+++ b/src/80-mm-candidate.rules
@@ -7,7 +7,7 @@
# that don't have this tag. MM will still get the udev 'add' event for the
# device a short while later and then process it as normal.
-ACTION!="add|change|move", GOTO="mm_candidate_end"
+ACTION!="add|change|move|bind", GOTO="mm_candidate_end"
# Opening bound but disconnected Bluetooth RFCOMM ttys would initiate the
# connection. Don't do that.