| 
     
      
      
      From: <che...@ly...> - 2010-11-26 11:37:28
      
     
   | 
----- lan liu <la...@no...> wrote: > Hi All, > Thanks for your kindly feedback. Based on following suggestions, I did some change on 'example/hotplug.c' on release 1.0.1 (the most recent release I get from "http://libmtp.sourceforge.net/download.php"), to generate following rule for mtp device: > #For Nokia-based devices,their interface string descriptor contains 'mtp' pattern,consider it to be a mtp device > ATTR{idVendor}=="0421", PROGRAM="/usr/local/bin/check_mtp_device.sh /sys$env{DEVPATH} mtp", SYMLINK+="libmtp-%k", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1" > ENV{ID_MTP_DEVICE}=="?*", MODE="666" > > #For Nokia-based devices,their interface string descriptor contains 'mtp' pattern,consider it to be a mtp device > ATTRS{idVendor}=="0421", PROGRAM="/usr/local/bin/check_mtp_device.sh /sys$env{DEVPATH} mtp", SYMLINK+="libmtp-%k", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1" > ENV{ID_MTP_DEVICE}=="?*", MODE="666" > > Also I attached the generated libmtp.rules and the 'check_mtp_device.sh' which will be invoked by this rule, for your kindly review. > > Some issue: > 1. Makefile need to be updated so that 'check_mtp_device.sh' could be installed , since I am new with this, could anybody give me a help? Currently, I hardcode the install path as '/usr/local/bin/' in rule file. > 2. Currently, after you run 'make install', the generated 'libmtp.rules' will NOT be automatically copied to '/etc/udev/rules.d' or '/lib/udev/rules.d'(the directory where udev rules files located on Ubuntu system), user has to copy it manually. Thus we still could not provide an out-of-box experience for these devices. > > Any concern, please contact me. Thanks. > > Regards, > Lan Liu > Hi Lan, First of all it's great that vendors such as Nokia are committed to improving client libraries in working with their devices. 1. The latest libmtp version is v1.0.3 and can be download from - http://sourceforge.net/projects/libmtp/files/ . It has been noted that the main website has an out of date link, but hasn't been fixed as of yet. Could you please recreate your patch against that version or even better against the CVS version. 2. Regarding libmtp.rules not being copied, please be aware that libmtp does work on other operating systems other than Linux, and as far as I know none of the others use udev. My recommendation is either: a, leave behaviour as is, and make sure it's documented in the INSTALL document. b, have configure detect OS type and if it is Linux then add a line in the 'install' target to copy it. As someone who uses libmtp on Solaris 10, I would recommend option a. Regards having the Makefile run 'check_mtp_device.sh', instead of hardcoding the path, use '$(PREFIX)/bin/check_mtp_device.h' instead. $(PREFIX) will expand to the correct location that libmtp is installed to as defined by the user when running the ./configure file (if they choose to use the --prefix option). Similar for hotplug.c, as far as I remember the install path may be defined in the config.c file (which is created by the configure script). -- Regards, Darran  |