diff options
-rw-r--r-- | INSTALL | 39 | ||||
-rw-r--r-- | util/mtp-hotplug.c | 9 |
2 files changed, 36 insertions, 12 deletions
@@ -149,20 +149,37 @@ example SANE backends use. The libmtp.rules file that comes with libmtp can be used as a starter. -First you need a crazy rule that creates a device node in the -/dev/bus/usb hierarchy whenever any USB device is connected. The -script has this at the top, you can comment it in if your -distribution does not already create these device nodes. +This will set the environment variables ID_MEDIA_PLAYER and +ID_MTP_DEVICE to "1" and the former one will be recognized by the +scripts distributed by recent versions of udev to be a +console-writable device that should be accessible for all +users. -Then libusb may need to be patched to recognize this hierarchy. +Ancient udev, HAL, libusb +------------------------- + +The old script for udev used to set the device access to "666" +which is rather nasty (not that big security issue, unless you +think someone will break into your jukebox) some systems used +to let PAM do this by placing a configuration file in +/etc/security/ somewhere. Then it was replaced with simple +udev rules. + +At one point HAL was used to take devices detected by udev and +signal to userspace that they were available and provide some +information about them. This was unnecessary middleware, it has +been killed and most userspace applications now get their +information directly from udev instead. + +In old libusb first you need a crazy rule that creates a device +node in the /dev/bus/usb hierarchy whenever any USB device is +connected. The script has this at the top, you can comment it +in if your distribution does not already create these device +nodes. + +Then libusb may need to be patched to recognize this hierarchy. The 0.1.12 version is the first which is properly fixed. -The script sets the device access to "666" which is rather nasty -(not that big security issue, unless you think someone will break -into your jukebox) some systems prefer to let PAM do this by placing -a configuration file in /etc/security/ somewhere. See the Fedora Extras -SRPM source package in case you're interested in how it is handled -there. If you cannot run hotplugging diff --git a/util/mtp-hotplug.c b/util/mtp-hotplug.c index 95807e4..a37366c 100644 --- a/util/mtp-hotplug.c +++ b/util/mtp-hotplug.c @@ -56,7 +56,14 @@ int main (int argc, char **argv) extern int optind; extern char *optarg; char *udev_action = NULL; - char default_udev_action[] = "SYMLINK+=\"libmtp-%k\", MODE=\"666\", ENV{ID_MTP_DEVICE}=\"1\", ENV{ID_MEDIA_PLAYER}=\"1\""; + /* + * You could tag on MODE="0666" here to enfore writeable + * device nodes, use the command line argument for that. + * Current udev default rules will make any device tagged + * with ENV{ID_MEDIA_PLAYER}=1 writable for the console + * user. + */ + char default_udev_action[] = "SYMLINK+=\"libmtp-%k\", ENV{ID_MTP_DEVICE}=\"1\", ENV{ID_MEDIA_PLAYER}=\"1\""; char *action; // To hold the action actually used. uint16_t last_vendor = 0x0000U; |