summaryrefslogtreecommitdiffstats
path: root/udev/85-usbmuxd.rules.in
blob: 3acc94415cb36d42bc7fc4949d674d1020921108 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# usbmuxd (iPhone "Apple Mobile Device" MUXer listening on /var/run/usbmuxd)

# Skip anything non Apple
ACTION=="add|remove", SUBSYSTEM!="usb|usb_endpoint", ATTRS{idVendor}!="05ac", GOTO="usbmuxd_rules_end"

# Forces iPhone 1.0, 3G and iPodTouch 1 and 2 to USB configuration 3
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="1290|1291|1292|1293", ATTR{bConfigurationValue}!="3", ATTR{bConfigurationValue}="3", GOTO="usbmuxd_rules_end"

LABEL="usbmuxd_rules_usbmux"

# Only apply to usb endpoints
ACTION=="add|remove", SUBSYSTEM!="usb_endpoint", GOTO="usbmuxd_rules_end"

# Setup cute names for the endpoints
ACTION=="add", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep04", IMPORT{program}="usb_id %p --export", SYMLINK+="usbmux/$env{ID_SERIAL_SHORT}/%s{direction}"
ACTION=="add", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep85", IMPORT{program}="usb_id %p --export", SYMLINK+="usbmux/$env{ID_SERIAL_SHORT}/%s{direction}"

# Start and stop 'usbmuxd' as required
ACTION=="add", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep85", RUN+="/sbin/start-stop-daemon --start --oknodo --exec @prefix@/sbin/usbmuxd"
ACTION=="remove", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep85", RUN+="/sbin/start-stop-daemon --stop --signal 3 --exec @prefix@/sbin/usbmuxd"

# skip
LABEL="usbmuxd_rules_end"