summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2009-05-24 13:33:16 +0200
committerGravatar Nikias Bassen2009-05-24 13:33:16 +0200
commit7feced9e014c6478eca0391685c57d4c3ae2fc91 (patch)
treedcda5dcecb3e29f5ae2b96abb777be044c7e1868
parentfca059d76626a18b086e793f9283ee3070e853d8 (diff)
downloadusbmuxd-7feced9e014c6478eca0391685c57d4c3ae2fc91.tar.gz
usbmuxd-7feced9e014c6478eca0391685c57d4c3ae2fc91.tar.bz2
Make udev rules set the right usb config and create pretty usbmux symlinks
Signed-off-by: Nikias Bassen <nikias@gmx.li>
-rw-r--r--udev/85-usbmuxd.rules.in34
1 files changed, 10 insertions, 24 deletions
diff --git a/udev/85-usbmuxd.rules.in b/udev/85-usbmuxd.rules.in
index 7820a36..8aca2ce 100644
--- a/udev/85-usbmuxd.rules.in
+++ b/udev/85-usbmuxd.rules.in
@@ -1,35 +1,21 @@
1# usbmuxd (iPhone "Apple Mobile Device" MUXer listening on /var/run/usbmuxd) 1# usbmuxd (iPhone "Apple Mobile Device" MUXer listening on /var/run/usbmuxd)
2#if
3#SUBSYSTEMS=="usb_interface", SYMLINK+="usbmux/interface"
4 2
5#SUBSYSTEMS!="usb", GOTO="usbmuxd_rules_end" # stops the whole script working 3# Skip anything non Apple
6ATTR{idVendor}!="05ac", GOTO="usbmuxd_rules_end" 4ACTION=="add|remove", SUBSYSTEM!="usb|usb_endpoint", ATTRS{idVendor}!="05ac", GOTO="usbmuxd_rules_end"
7 5
8# If it's plug insertion, flip it into dual "PTP + Apple Mobile Device" configuration 6# Forces iPhone 1.0, 3G and iPodTouch 1 and 2 to USB configuration 3
9# This allows another application to switch it later without it getting switched back (hopefully) 7ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="1290|1291|1292|1293", ATTR{bConfigurationValue}!="3", ATTR{bConfigurationValue}="3", GOTO="usbmuxd_rules_end"
10# TODO: check iPod Touch/3G
11SUBSYSTEM=="usb", ACTION=="add", ATTR{product}=="iPhone", ATTR{bConfigurationValue}!="3", ATTR{bConfigurationValue}="3", GOTO="usbmuxd_rules_end"
12 8
13# SYMLINK the usbmux endpoints, if we get them
14# TODO: Multiple devices
15# TODO: work out how to make nice, incrementing usbmux/{0,1,2,3}-in for
16LABEL="usbmuxd_rules_usbmux" 9LABEL="usbmuxd_rules_usbmux"
17 10
18# ff/fe/02 == usbmux 11# Only apply to usb endpoints
19# 12ACTION=="add|remove", SUBSYSTEM!="usb_endpoint", GOTO="usbmuxd_rules_end"
20#ACTION=="add",
21 13
22# Try to symlink the interface, containing the endpoints. 14# Setup cute names for the endpoints
23# ...But it doesn't work 15ACTION=="add", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep04", SYMLINK+="usbmux/%s{serial}/%s{direction}"
24#KERNELS=="7-3:3.1", SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="01", ATTRS{bAlternateSetting}==" 0", ATTRS{bNumEndpoints}=="02", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="fe", ATTRS{bInterfaceProtocol}=="02", SYMLINK+="usbmux/prettyplease", RUN+="/bin/ls -l /dev/usbmux/prettyplease" 16ACTION=="add", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep85", SYMLINK+="usbmux/%s{serial}/%s{direction}"
25 17
26#ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="fe", ATTRS{bInterfaceProtocol}=="02", SYMLINK+="usbmux/interface" 18# Start and stop 'usbmuxd' as required
27
28# Cute names, really they should have nice numerically increasing names.
29ACTION=="add", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep04", SYMLINK+="usbmux/in"
30ACTION=="add", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep85", SYMLINK+="usbmux/out"
31
32# Start and stop 'usbmuxd' as required.
33ACTION=="add", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep85", RUN+="/sbin/start-stop-daemon --start --oknodo --exec @prefix@/sbin/usbmuxd" 19ACTION=="add", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep85", RUN+="/sbin/start-stop-daemon --start --oknodo --exec @prefix@/sbin/usbmuxd"
34ACTION=="remove", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep85", RUN+="/sbin/start-stop-daemon --stop --signal 3 --exec @prefix@/sbin/usbmuxd" 20ACTION=="remove", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep85", RUN+="/sbin/start-stop-daemon --stop --signal 3 --exec @prefix@/sbin/usbmuxd"
35 21