commit 359286582049445e9339c9765e460f7470d6b028
Author: Christophe Fergeau <cferg...@mandriva.com>
Date:   Sat Feb 6 01:46:48 2010 +0100

    add udev support to iphone callout too

 tools/Makefile.am      |   18 ++++++++++--------
 tools/iphone-callout.c |    8 ++++++--
 tools/libgpod.rules.in |    4 ++++
 3 files changed, 20 insertions(+), 10 deletions(-)
---
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 57e1535..b2b783a 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -62,19 +62,21 @@ rulesdir=${libudevdir}/rules.d
 rules_DATA= libgpod.rules
 endif # USE_UDEV
 
-if HAVE_LIBIPHONE
-if HAVE_HAL
-hal_PROGRAMS+=iphone-callout
-endif
-if USE_UDEV
-libudev_PROGRAMS+=iphone-callout
-endif
-
 if HAVE_LIBIMOBILEDEVICE
+if HAVE_HAL
 hal_PROGRAMS+=iphone-callout
 iphone_callout_SOURCES = iphone-callout.c ipod-lockdown.c
 iphone_callout_CFLAGS = $(LIBIMOBILEDEVICE_CFLAGS)
 iphone_callout_LDADD = $(LIBIMOBILEDEVICE_LIBS)
+endif
+
+if USE_UDEV
+libudev_PROGRAMS+=iphone-set-info
+iphone_set_info_SOURCES = iphone-callout.c ipod-lockdown.c
+iphone_set_info_CFLAGS = $(LIBIMOBILEDEVICE_CFLAGS)
+iphone_set_info_LDADD = $(LIBIMOBILEDEVICE_LIBS)
+iphone_set_info_CPPFLAGS = -DUSE_UDEV
+endif
 endif # HAVE_LIBIPHONE
 
 if HAVE_SGUTILS
diff --git a/tools/iphone-callout.c b/tools/iphone-callout.c
index f23cecb..5aa6f6d 100644
--- a/tools/iphone-callout.c
+++ b/tools/iphone-callout.c
@@ -35,13 +35,17 @@ int main (int argc, char **argv)
     const char *uuid;
 
     if (argc != 1) {
-        g_print ("%s should only be ran by HAL\n", argv[0]);
+        g_print ("%s should only be ran by HAL or udev\n", argv[0]);
         return 1;
     }
 
+#ifdef USE_UDEV
+    uuid = g_getenv ("ID_SERIAL_SHORT");
+#else
     uuid = g_getenv ("HAL_PROP_USB_SERIAL");
+#endif
     if (uuid == NULL) {
-        g_print ("%s should only be ran by HAL\n", argv[0]);
+        g_print ("%s should only be ran by HAL or udev\n", argv[0]);
         return 1;
     }
 
diff --git a/tools/libgpod.rules.in b/tools/libgpod.rules.in
index b5ffd44..feeb589 100644
--- a/tools/libgpod.rules.in
+++ b/tools/libgpod.rules.in
@@ -1 +1,5 @@
+# iPods showing up as mass storage devices
 ACTION=="add|change", SUBSYSTEM=="block", ENV{ID_FS_USAGE}=="filesystem", 
ATTRS{idVendor}=="05ac", ENV{ID_MODEL}=="iPod", 
IMPORT{program}="@udevdir@/ipod-set-info $tempnode $attr{busnum} $attr{devnum}"
+
+# "iPods" using the afc protocol (iPhone, iPod Touch, ...)
+ACTION=="add|change", SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", 
ATTR{idProduct}=="129[0-9]", IMPORT{program}+="@udevdir@/iphone-set-info"

------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
gtkpod-cvs2 mailing list
gtkpod-cvs2@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to