Blame SOURCES/0001-udev-ensure-that-all-events-relating-to-device-are-t.patch

ba63c5
From 7f54d304149f405dc70ac924471df0d5e3e5ea09 Mon Sep 17 00:00:00 2001
ba63c5
From: Gavin Li <gavinli@thegavinli.com>
ba63c5
Date: Sun, 14 Jan 2018 02:10:18 -0800
ba63c5
Subject: [PATCH 1/2] udev: ensure that all events relating to device are
ba63c5
 tagged systemd
ba63c5
ba63c5
systemd will not restart the usbmuxd service the after the first time it
ba63c5
is plugged in if it does not receive the "remove" events, which also
ba63c5
happen to lack the idVendor and idProduct attributes, so use
ba63c5
ENV{PRODUCT} instead.
ba63c5
---
ba63c5
 configure.ac             | 2 +-
ba63c5
 udev/39-usbmuxd.rules.in | 7 +++++--
ba63c5
 2 files changed, 6 insertions(+), 3 deletions(-)
ba63c5
ba63c5
diff --git a/configure.ac b/configure.ac
ba63c5
index b836f45..1ce46d8 100644
ba63c5
--- a/configure.ac
ba63c5
+++ b/configure.ac
ba63c5
@@ -74,7 +74,7 @@ fi
ba63c5
 AM_CONDITIONAL(WANT_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno -a "x$with_systemd" = "xyes" ])
ba63c5
 
ba63c5
 if test "x$with_systemd" = xyes; then
ba63c5
-  udev_activation_rule="TAG+=\"systemd\", ENV{SYSTEMD_WANTS}=\"usbmuxd.service\""
ba63c5
+  udev_activation_rule="ENV{SYSTEMD_WANTS}=\"usbmuxd.service\""
ba63c5
 else
ba63c5
   udev_activation_rule="RUN+=\"@sbindir@/usbmuxd --user usbmux --udev\""
ba63c5
 fi
ba63c5
diff --git a/udev/39-usbmuxd.rules.in b/udev/39-usbmuxd.rules.in
ba63c5
index 91b14db..7d14d22 100644
ba63c5
--- a/udev/39-usbmuxd.rules.in
ba63c5
+++ b/udev/39-usbmuxd.rules.in
ba63c5
@@ -1,7 +1,10 @@
ba63c5
 # usbmuxd (Apple Mobile Device Muxer listening on /var/run/usbmuxd)
ba63c5
 
ba63c5
+# systemd should receive all events relating to device
ba63c5
+SUBSYSTEM=="usb", ENV{PRODUCT}=="5ac/12[9a][0-9a-f]/*", TAG+="systemd"
ba63c5
+
ba63c5
 # Initialize iOS devices into "deactivated" USB configuration state and activate usbmuxd
ba63c5
-ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="12[9a][0-9a-f]", ENV{USBMUX_SUPPORTED}="1", ATTR{bConfigurationValue}="0", OWNER="usbmux", @udev_activation_rule@
ba63c5
+SUBSYSTEM=="usb", ENV{PRODUCT}=="5ac/12[9a][0-9a-f]/*", ACTION=="add", ENV{USBMUX_SUPPORTED}="1", ATTR{bConfigurationValue}="0", OWNER="usbmux", @udev_activation_rule@
ba63c5
 
ba63c5
 # Exit usbmuxd when the last device is removed
ba63c5
-ACTION=="remove", SUBSYSTEM=="usb", ENV{PRODUCT}=="5ac/12[9a][0-9a-f]/*", ENV{INTERFACE}=="255/*", RUN+="@sbindir@/usbmuxd -x"
ba63c5
+SUBSYSTEM=="usb", ENV{PRODUCT}=="5ac/12[9a][0-9a-f]/*", ACTION=="remove", RUN+="@sbindir@/usbmuxd -x"
ba63c5
-- 
ba63c5
2.17.0
ba63c5