Re: [Libmtp-discuss] udev and libmtp: detect a new mtp device based on its USB interface descriptor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2010/11/26  <lan.liu@xxxxxxxxx>:

> change on 'example/hotplug.c' on release 1.0.1 (the most recent release I
> get from “http://libmtp.sourceforge.net/download.php”;),

1.0.3 is the latest, sorry that page isn't working, I will hack it to redirect
to the SF download page unless Sean has some time to fix it like soon-ish...

> 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",

Aha clever!

> SYMLINK+="libmtp-%k", ENV{ID_MTP_DEVICE}="1",
> ENV{ID_MEDIA_PLAYER}="1"

Hm I only added ID_MEDIA_PLAYER, I guess ID_MTP_DEVICE wouldn't
hurt so I have added that too.

> ENV{ID_MTP_DEVICE}=="?*", MODE="666"

Aha yeah that solves an immediate problem for many people I guess.

> 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.

This is not the hard thing. The hard thing is that scripts like
"check_mtp_device.sh" take a long time to invoke, and I would
prefer to have it rewritten in plain C.

That would make it simpler to add OS descriptor probing too,
if desired.

examples/devicecheck.c

Installs as <prefix>/bin/mtp-devicecheck

And is used from the udev script.

Can it be done?

> 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.

Such is life, copying it into Ubuntu/Debian/Fedora/whatever locations
is a task for the packager.

If libmtp can help with any of this, the packagers (which are on this
list) should voice their needs...

Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux