From 7364e09f6849076c710ac9ce52a5d5fd2445e19c Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Mon, 4 May 2009 18:18:40 +0200 Subject: Use autotools build system and add license Signed-off-by: Nikias Bassen --- udev/85-usbmuxd.rules | 37 +++++++++++++++++++++++++++++++++++++ udev/Makefile.am | 4 ++++ 2 files changed, 41 insertions(+) create mode 100644 udev/85-usbmuxd.rules create mode 100644 udev/Makefile.am (limited to 'udev') diff --git a/udev/85-usbmuxd.rules b/udev/85-usbmuxd.rules new file mode 100644 index 0000000..69ddef8 --- /dev/null +++ b/udev/85-usbmuxd.rules @@ -0,0 +1,37 @@ +# usbmuxd (iPhone "Apple Mobile Device" MUXer listening on /var/run/usbmuxd) +#if +#SUBSYSTEMS=="usb_interface", SYMLINK+="usbmux/interface" + +#SUBSYSTEMS!="usb", GOTO="usbmuxd_rules_end" # stops the whole script working +ATTR{idVendor}!="05ac", GOTO="usbmuxd_rules_end" + +# If it's plug insertion, flip it into dual "PTP + Apple Mobile Device" configuration +# This allows another application to switch it later without it getting switched back (hopefully) +# TODO: check iPod Touch/3G +SUBSYSTEM=="usb", ACTION=="add", ATTR{product}=="iPhone", ATTR{bConfigurationValue}!="3", ATTR{bConfigurationValue}="3", GOTO="usbmuxd_rules_end" + +# SYMLINK the usbmux endpoints, if we get them +# TODO: Multiple devices +# TODO: work out how to make nice, incrementing usbmux/{0,1,2,3}-in for +LABEL="usbmuxd_rules_usbmux" + +# ff/fe/02 == usbmux +# +#ACTION=="add", + +# Try to symlink the interface, containing the endpoints. +# ...But it doesn't work +#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" + +#ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="fe", ATTRS{bInterfaceProtocol}=="02", SYMLINK+="usbmux/interface" + +# Cute names, really they should have nice numerically increasing names. +ACTION=="add", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep04", SYMLINK+="usbmux/in" +ACTION=="add", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep85", SYMLINK+="usbmux/out" + +# Start and stop 'usbmuxd' as required. +ACTION=="add", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep85", RUN+="/sbin/start-stop-daemon --start --oknodo --exec /usr/local/sbin/usbmuxd" +ACTION=="remove", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep85", RUN+="/sbin/start-stop-daemon --stop --signal 2 --exec /usr/local/sbin/usbmuxd" + +# skip +LABEL="usbmuxd_rules_end" diff --git a/udev/Makefile.am b/udev/Makefile.am new file mode 100644 index 0000000..321008a --- /dev/null +++ b/udev/Makefile.am @@ -0,0 +1,4 @@ +udevdir=$(sysconfdir)/udev/rules.d/ +udev_DATA=85-usbmuxd.rules + +EXTRA_DIST = 85-usbmuxd.rules -- cgit v1.1-32-gdbae From 5d34c2e7c70de039c75c7a39933b98d14a659176 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Tue, 19 May 2009 14:00:28 +0200 Subject: modified udev rules file to reflect autoconf prefix specification --- udev/85-usbmuxd.rules | 37 ------------------------------------- udev/85-usbmuxd.rules.in | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 37 deletions(-) delete mode 100644 udev/85-usbmuxd.rules create mode 100644 udev/85-usbmuxd.rules.in (limited to 'udev') diff --git a/udev/85-usbmuxd.rules b/udev/85-usbmuxd.rules deleted file mode 100644 index 69ddef8..0000000 --- a/udev/85-usbmuxd.rules +++ /dev/null @@ -1,37 +0,0 @@ -# usbmuxd (iPhone "Apple Mobile Device" MUXer listening on /var/run/usbmuxd) -#if -#SUBSYSTEMS=="usb_interface", SYMLINK+="usbmux/interface" - -#SUBSYSTEMS!="usb", GOTO="usbmuxd_rules_end" # stops the whole script working -ATTR{idVendor}!="05ac", GOTO="usbmuxd_rules_end" - -# If it's plug insertion, flip it into dual "PTP + Apple Mobile Device" configuration -# This allows another application to switch it later without it getting switched back (hopefully) -# TODO: check iPod Touch/3G -SUBSYSTEM=="usb", ACTION=="add", ATTR{product}=="iPhone", ATTR{bConfigurationValue}!="3", ATTR{bConfigurationValue}="3", GOTO="usbmuxd_rules_end" - -# SYMLINK the usbmux endpoints, if we get them -# TODO: Multiple devices -# TODO: work out how to make nice, incrementing usbmux/{0,1,2,3}-in for -LABEL="usbmuxd_rules_usbmux" - -# ff/fe/02 == usbmux -# -#ACTION=="add", - -# Try to symlink the interface, containing the endpoints. -# ...But it doesn't work -#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" - -#ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="fe", ATTRS{bInterfaceProtocol}=="02", SYMLINK+="usbmux/interface" - -# Cute names, really they should have nice numerically increasing names. -ACTION=="add", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep04", SYMLINK+="usbmux/in" -ACTION=="add", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep85", SYMLINK+="usbmux/out" - -# Start and stop 'usbmuxd' as required. -ACTION=="add", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep85", RUN+="/sbin/start-stop-daemon --start --oknodo --exec /usr/local/sbin/usbmuxd" -ACTION=="remove", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep85", RUN+="/sbin/start-stop-daemon --stop --signal 2 --exec /usr/local/sbin/usbmuxd" - -# skip -LABEL="usbmuxd_rules_end" diff --git a/udev/85-usbmuxd.rules.in b/udev/85-usbmuxd.rules.in new file mode 100644 index 0000000..e661ccd --- /dev/null +++ b/udev/85-usbmuxd.rules.in @@ -0,0 +1,37 @@ +# usbmuxd (iPhone "Apple Mobile Device" MUXer listening on /var/run/usbmuxd) +#if +#SUBSYSTEMS=="usb_interface", SYMLINK+="usbmux/interface" + +#SUBSYSTEMS!="usb", GOTO="usbmuxd_rules_end" # stops the whole script working +ATTR{idVendor}!="05ac", GOTO="usbmuxd_rules_end" + +# If it's plug insertion, flip it into dual "PTP + Apple Mobile Device" configuration +# This allows another application to switch it later without it getting switched back (hopefully) +# TODO: check iPod Touch/3G +SUBSYSTEM=="usb", ACTION=="add", ATTR{product}=="iPhone", ATTR{bConfigurationValue}!="3", ATTR{bConfigurationValue}="3", GOTO="usbmuxd_rules_end" + +# SYMLINK the usbmux endpoints, if we get them +# TODO: Multiple devices +# TODO: work out how to make nice, incrementing usbmux/{0,1,2,3}-in for +LABEL="usbmuxd_rules_usbmux" + +# ff/fe/02 == usbmux +# +#ACTION=="add", + +# Try to symlink the interface, containing the endpoints. +# ...But it doesn't work +#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" + +#ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="fe", ATTRS{bInterfaceProtocol}=="02", SYMLINK+="usbmux/interface" + +# Cute names, really they should have nice numerically increasing names. +ACTION=="add", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep04", SYMLINK+="usbmux/in" +ACTION=="add", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep85", SYMLINK+="usbmux/out" + +# 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 2 --exec @prefix@/sbin/usbmuxd" + +# skip +LABEL="usbmuxd_rules_end" -- cgit v1.1-32-gdbae From 0c55afdb315f12b0f2a37f37a3ec711c75507c0d Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Tue, 19 May 2009 16:44:39 +0200 Subject: Let the daemon terminate only when no more device is attached --- udev/85-usbmuxd.rules.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'udev') diff --git a/udev/85-usbmuxd.rules.in b/udev/85-usbmuxd.rules.in index e661ccd..7820a36 100644 --- a/udev/85-usbmuxd.rules.in +++ b/udev/85-usbmuxd.rules.in @@ -31,7 +31,7 @@ ACTION=="add", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep85", SYMLINK+="usbm # 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 2 --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" -- cgit v1.1-32-gdbae From 7feced9e014c6478eca0391685c57d4c3ae2fc91 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Sun, 24 May 2009 13:33:16 +0200 Subject: Make udev rules set the right usb config and create pretty usbmux symlinks Signed-off-by: Nikias Bassen --- udev/85-usbmuxd.rules.in | 34 ++++++++++------------------------ 1 file changed, 10 insertions(+), 24 deletions(-) (limited to 'udev') 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 @@ # usbmuxd (iPhone "Apple Mobile Device" MUXer listening on /var/run/usbmuxd) -#if -#SUBSYSTEMS=="usb_interface", SYMLINK+="usbmux/interface" -#SUBSYSTEMS!="usb", GOTO="usbmuxd_rules_end" # stops the whole script working -ATTR{idVendor}!="05ac", GOTO="usbmuxd_rules_end" +# Skip anything non Apple +ACTION=="add|remove", SUBSYSTEM!="usb|usb_endpoint", ATTRS{idVendor}!="05ac", GOTO="usbmuxd_rules_end" -# If it's plug insertion, flip it into dual "PTP + Apple Mobile Device" configuration -# This allows another application to switch it later without it getting switched back (hopefully) -# TODO: check iPod Touch/3G -SUBSYSTEM=="usb", ACTION=="add", ATTR{product}=="iPhone", ATTR{bConfigurationValue}!="3", ATTR{bConfigurationValue}="3", 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" -# SYMLINK the usbmux endpoints, if we get them -# TODO: Multiple devices -# TODO: work out how to make nice, incrementing usbmux/{0,1,2,3}-in for LABEL="usbmuxd_rules_usbmux" -# ff/fe/02 == usbmux -# -#ACTION=="add", +# Only apply to usb endpoints +ACTION=="add|remove", SUBSYSTEM!="usb_endpoint", GOTO="usbmuxd_rules_end" -# Try to symlink the interface, containing the endpoints. -# ...But it doesn't work -#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" +# Setup cute names for the endpoints +ACTION=="add", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep04", SYMLINK+="usbmux/%s{serial}/%s{direction}" +ACTION=="add", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep85", SYMLINK+="usbmux/%s{serial}/%s{direction}" -#ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="fe", ATTRS{bInterfaceProtocol}=="02", SYMLINK+="usbmux/interface" - -# Cute names, really they should have nice numerically increasing names. -ACTION=="add", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep04", SYMLINK+="usbmux/in" -ACTION=="add", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep85", SYMLINK+="usbmux/out" - -# Start and stop 'usbmuxd' as required. +# 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" -- cgit v1.1-32-gdbae From 12c244a76cc6a75a385ddfc5dc44734825383fe2 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Sun, 24 May 2009 18:20:54 +0200 Subject: Make udev symlink rules work with recent udev by using usb_id --- udev/85-usbmuxd.rules.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'udev') diff --git a/udev/85-usbmuxd.rules.in b/udev/85-usbmuxd.rules.in index 8aca2ce..3acc944 100644 --- a/udev/85-usbmuxd.rules.in +++ b/udev/85-usbmuxd.rules.in @@ -12,8 +12,8 @@ LABEL="usbmuxd_rules_usbmux" ACTION=="add|remove", SUBSYSTEM!="usb_endpoint", GOTO="usbmuxd_rules_end" # Setup cute names for the endpoints -ACTION=="add", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep04", SYMLINK+="usbmux/%s{serial}/%s{direction}" -ACTION=="add", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep85", SYMLINK+="usbmux/%s{serial}/%s{direction}" +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" -- cgit v1.1-32-gdbae From bb33ccdf06f261dca033d70772bc256c890c76f7 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Fri, 19 Jun 2009 14:34:16 +0200 Subject: Add product ids to support iPhone 3GS Signed-off-by: Nikias Bassen --- udev/85-usbmuxd.rules.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'udev') diff --git a/udev/85-usbmuxd.rules.in b/udev/85-usbmuxd.rules.in index 3acc944..4f28cdf 100644 --- a/udev/85-usbmuxd.rules.in +++ b/udev/85-usbmuxd.rules.in @@ -3,8 +3,8 @@ # 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" +# Forces iPhone 1.0, 3G, 3GS and iPodTouch 1 and 2 to USB configuration 3 +ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="1290|1291|1292|1293|1294", ATTR{bConfigurationValue}!="3", ATTR{bConfigurationValue}="3", GOTO="usbmuxd_rules_end" LABEL="usbmuxd_rules_usbmux" -- cgit v1.1-32-gdbae From 2bff11cdd189745dd044c759afec9ce9c6ceb9fa Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Mon, 13 Jul 2009 14:30:23 +0200 Subject: Added support for PTP + Apple Mobile Device + Apple USB Ethernet interfaces by setting to the highest configuration value available(thanks Martin). --- udev/85-usbmuxd.rules.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'udev') diff --git a/udev/85-usbmuxd.rules.in b/udev/85-usbmuxd.rules.in index 4f28cdf..4e35f7e 100644 --- a/udev/85-usbmuxd.rules.in +++ b/udev/85-usbmuxd.rules.in @@ -4,7 +4,7 @@ ACTION=="add|remove", SUBSYSTEM!="usb|usb_endpoint", ATTRS{idVendor}!="05ac", GOTO="usbmuxd_rules_end" # Forces iPhone 1.0, 3G, 3GS and iPodTouch 1 and 2 to USB configuration 3 -ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="1290|1291|1292|1293|1294", ATTR{bConfigurationValue}!="3", ATTR{bConfigurationValue}="3", GOTO="usbmuxd_rules_end" +ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="1290|1291|1292|1293|1294", ATTR{bConfigurationValue}!="$attr{bNumConfigurations}", ATTR{bConfigurationValue}="$attr{bNumConfigurations}", GOTO="usbmuxd_rules_end" LABEL="usbmuxd_rules_usbmux" -- cgit v1.1-32-gdbae From 91fc30c3247dbc41ce2dfcedfd6086c513ffa80a Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Mon, 3 Aug 2009 21:23:25 +0200 Subject: Use udev mode in the udev rules Otherwise this only works on Debian-based systems. Signed-off-by: Nikias Bassen --- udev/85-usbmuxd.rules.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'udev') diff --git a/udev/85-usbmuxd.rules.in b/udev/85-usbmuxd.rules.in index 4e35f7e..64f7c3f 100644 --- a/udev/85-usbmuxd.rules.in +++ b/udev/85-usbmuxd.rules.in @@ -16,8 +16,8 @@ ACTION=="add", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep04", IMPORT{program 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" +ACTION=="add", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep85", RUN+="@prefix@/sbin/usbmuxd -u" +# usbmuxd will go away when the last device is removed, when in udev mode # skip LABEL="usbmuxd_rules_end" -- cgit v1.1-32-gdbae From 29ab549b8bf981243efcc924bf6539a8170de3cc Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Tue, 4 Aug 2009 00:43:09 +0200 Subject: Revert "Use udev mode in the udev rules" This reverts commit 91fc30c3247dbc41ce2dfcedfd6086c513ffa80a. Not working as expected. --- udev/85-usbmuxd.rules.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'udev') diff --git a/udev/85-usbmuxd.rules.in b/udev/85-usbmuxd.rules.in index 64f7c3f..4e35f7e 100644 --- a/udev/85-usbmuxd.rules.in +++ b/udev/85-usbmuxd.rules.in @@ -16,8 +16,8 @@ ACTION=="add", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep04", IMPORT{program 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+="@prefix@/sbin/usbmuxd -u" -# usbmuxd will go away when the last device is removed, when in udev mode +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" -- cgit v1.1-32-gdbae From 8fc5311c3d1b9bcf39cd209004d92824b87d3883 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Tue, 4 Aug 2009 19:14:55 +0200 Subject: Use udev -x/-u in udev rules This will make them work on non-Debian distributions. Signed-off-by: Nikias Bassen --- udev/85-usbmuxd.rules.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'udev') diff --git a/udev/85-usbmuxd.rules.in b/udev/85-usbmuxd.rules.in index 4e35f7e..82221d4 100644 --- a/udev/85-usbmuxd.rules.in +++ b/udev/85-usbmuxd.rules.in @@ -16,8 +16,8 @@ ACTION=="add", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep04", IMPORT{program 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" +ACTION=="add", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep85", RUN+="@prefix@/sbin/usbmuxd -u" +ACTION=="remove", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep85", RUN+="@prefix@/sbin/usbmuxd -x" # skip LABEL="usbmuxd_rules_end" -- cgit v1.1-32-gdbae From f44dcbc5ec73baa3652627fc4b7a38875b2d496b Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Sat, 15 Aug 2009 14:52:13 +0200 Subject: Install udev rules in the correct location The ones in /etc are supposed to be configurable ones. Signed-off-by: Nikias Bassen --- udev/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'udev') diff --git a/udev/Makefile.am b/udev/Makefile.am index 321008a..e44b077 100644 --- a/udev/Makefile.am +++ b/udev/Makefile.am @@ -1,4 +1,4 @@ -udevdir=$(sysconfdir)/udev/rules.d/ +udevdir=/lib/udev/rules.d/ udev_DATA=85-usbmuxd.rules EXTRA_DIST = 85-usbmuxd.rules -- cgit v1.1-32-gdbae From 79ca4d9a3c3a82bb5a3f9be1ac7a2533c7a89b05 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Sat, 15 Aug 2009 14:55:14 +0200 Subject: Port udev rules to newer kernels Remove use of usb_endpoint, it's gone in newer kernels. Signed-off-by: Nikias Bassen --- udev/85-usbmuxd.rules.in | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) (limited to 'udev') diff --git a/udev/85-usbmuxd.rules.in b/udev/85-usbmuxd.rules.in index 82221d4..c0a3900 100644 --- a/udev/85-usbmuxd.rules.in +++ b/udev/85-usbmuxd.rules.in @@ -1,23 +1,7 @@ # 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, 3GS and iPodTouch 1 and 2 to USB configuration 3 and run usbmuxd +ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="129[0-4]", ATTR{bConfigurationValue}!="$attr{bNumConfigurations}", ATTR{bConfigurationValue}="$attr{bNumConfigurations}", RUN+="@prefix@/sbin/usbmuxd -u" -# Forces iPhone 1.0, 3G, 3GS and iPodTouch 1 and 2 to USB configuration 3 -ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="1290|1291|1292|1293|1294", ATTR{bConfigurationValue}!="$attr{bNumConfigurations}", ATTR{bConfigurationValue}="$attr{bNumConfigurations}", 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+="@prefix@/sbin/usbmuxd -u" -ACTION=="remove", SUBSYSTEM=="usb_endpoint", KERNEL=="usbdev*_ep85", RUN+="@prefix@/sbin/usbmuxd -x" - -# skip -LABEL="usbmuxd_rules_end" +# Exit usbmuxd when the last phone is removed +ACTION=="remove", SUBSYSTEM=="usb", ENV{ID_VENDOR_ID}=="05ac", ENV{ID_MODEL_ID}=="129[0-4]", RUN+="@prefix@/sbin/usbmuxd -x" -- cgit v1.1-32-gdbae