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

Re : Accès à /proc/bus/usb/001/xxx avec un user "normal"



Le 05.01.2004 17:04, Sylvain LE GALL a écrit :
On Mon, Jan 05, 2004 at 02:20:07PM +0100, Jean-Luc Coulon (f5ibh) wrote:
Bonjour,

J'ai un appareil photo numérique que je connecte à l'ordinateur par un port

USB. J'utilise gphoto2 pour transférer les images de l'appareil vers
l'ordinateur.

Si j'utilise root, pas problème, tout se passe bien.

Si j'utiliseun user "normal", alors, j'ai un problème de droits sur /proc/
bus/usb.

J'ai fait diverses tentatives dont celle conseillée dans le README de
libgphoto262 : j'ai créé un goupe usb et je me suis fait membre de ce
groupe  et j'ai ajouté la ligne suivante à mon /etc/fstab :
none  /proc/bus/usb usbfs  uid=0,devgid=1000,devmode=0660 0 0

1000 correspond à l'id du groupe usb

Malgré ça, je n'arrive toujours pas à charger mes fichiers en provenance de

l'appareil. J'utilise usbmgr pour le hotplug de l'usb.

Si, à la main, je change les droits (chmod o+w) pour le device en question,

je peux alors y accéder normalement.



Bonjour,

Votre problème me rappelle le mien ;->

Donc dans un élan de solidarité j'ai fait les manip qui vont bien pour
que ca marche... ;-)

Bon j'arréte, j'ai juste suivi les exemples donnée dans
/usr/share/doc/libgphoto2-2... Mais de la unstable ;-)

Donc pour résoudre tout ca :

1) su -
2) /usr/lib/libgphoto2-2/print-usb-usermap >
/etc/hotplug/usb/usbcamera.usermap
3) copier le script en attachement dans /etc/hotplug/usb/usbcamera
4) chmod a+x /etc/hotplug/usb/usbcamera
5) addgroup camera
6) adduser moi-meme camera
7) ... plugger l'appareil photo
8) ls -alR /proc/bus/usb pour etre sure qu'il y a un noeud avec les
droit camera
9) gphoto2 --port usb: -L

Pour moi ca marche, mais il faut utiliser hotplug. Pour usbmngr je ne
connais pas la manip a faire.

Bonne chance
Sylvain LE GALL

ps : il ne faut absolument pas avoir dc2xx comme module, ca marche trés
mal et ca va empécher le script précédent de tourner




#!/bin/bash
# $Id: usbcam.group,v 1.3 2003/09/16 16:42:44 hun Exp $
#
# /etc/hotplug/usb/usbcam
#
# Sets up newly plugged in USB camera so that only members of the
# group

GROUP=camera

# can access it from user space. (Replace camera with the name of the
# group you want to have access to the cameras.)
#
# Note that for this script to work, you'll need all of the following:
# a) a line in the file /etc/hotplug/usermap that corresponds to the
#    camera you are using. You can get the correct lines for all cameras
#    supported by libgphoto2 by running "print-usb-usermap".
# b) a group "camera" where all users allowed access to the
#    camera are listed
# c) a Linux kernel supporting hotplug and usbdevfs
# d) the hotplug package (http://linux-hotplug.sourceforge.net/)
#
# In the usermap file, the first field "usb module" should be named
# "usbcam" like this script.
#

if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ]
then
   chmod o-rwx "${DEVICE}"
   chgrp "${GROUP}" "${DEVICE}"
   chmod g+rw "${DEVICE}"
fi


J'ai viré usbmgr et j'ai installé hotplug avec la procédure ci-dessus (merci sylvain).

Après lancement du bazar, j'obtiens, miracle :
[jean-luc@tangerine] ~ $ ls -lR /proc/bus/usb/
/proc/bus/usb/:
total 0
dr-xr-xr-x    1 root     root            0 2004-01-05 18:25 001
-r--r--r--    1 root     root            0 2004-01-05 18:25 devices
-r--r--r--    1 root     root            0 2004-01-05 18:25 drivers

/proc/bus/usb/001:
total 0
-rw-rw----    1 root     usb            18 2004-01-05 18:25 001
-rw-rw----    1 root     usb            18 2004-01-05 18:25 002
[jean-luc@tangerine] ~ $

Et c'est juste à ce moment que l'appareil numérique en question tombe en panne de batteries ... ;-)


Autre petit problème au lancement, j'ai les messages suivants :
[root@tangerine] /home/jean-luc # /etc/init.d/hotplug start
Starting hotplug subsystem: input** can't synthesize input events - /proc/ bus/input/devices missing
pci** can't synthesize pci hotplug events

Je n'ai pas de /proc/bus/input ... Je n'en ai jamais eu ..

--
			- Jean-Luc

Attachment: pgpF2DxczhZc9.pgp
Description: PGP signature


Reply to: