J'ai un Alcatel One Touch 4045D Android.
Il ne s'est pas monté dans Ubuntu jusqu'à ce que j'ajoute les ID à /lib/udev/rules.d/69-libmtp.rules
.
Mais le téléphone se monte comme un CD avec "pilote USB". Si j'éjecte ce CD, le téléphone se monte normalement.
Il semble que le micrologiciel du téléphone essaie de détecter si un pilote est installé et s'il ne se monte pas en tant que disque avec le pilote.
Existe-t-il une option dans les règles udev pour éjecter automatiquement ce disque?
Sortie de lsusb; lsusb -t & udevadm monitor -u
lorsque je branche le téléphone:
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 048d:1336 Integrated Technology Express, Inc. SD/MMC Cardreader
Bus 002 Device 003: ID 1bbb:af00 T & A Mobile Phones
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 04b8:0898 Seiko Epson Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 002: ID 046d:c05a Logitech, Inc. M90/M100 Optical Mouse
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
[1] 10998
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
/: Bus 07.Port 1: Dev 1, Class=root_hub, Driver=ohci-pci/2p, 12M
/: Bus 06.Port 1: Dev 1, Class=root_hub, Driver=ohci-pci/3p, 12M
/: Bus 05.Port 1: Dev 1, Class=root_hub, Driver=ohci-pci/3p, 12M
/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=ohci-pci/3p, 12M
|__ Port 1: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, 1.5M
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=ohci-pci/3p, 12M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/6p, 480M
|__ Port 1: Dev 3, If 0, Class=Mass Storage, Driver=usb-storage, 480M
|__ Port 3: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 480M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/6p, 480M
|__ Port 2: Dev 2, If 0, Class=Vendor Specific Class, Driver=, 480M
|__ Port 2: Dev 2, If 1, Class=Printer, Driver=usblp, 480M
|__ Port 2: Dev 2, If 2, Class=Mass Storage, Driver=usb-storage, 480M
Voici la sortie lorsque j'éjecte le CD:
UDEV [44405.211303] remove /devices/pci0000:00/0000:00:13.2/usb2/2-1/2-1:1.0/Host10/target10:0:0/10:0:0:0/bsg/10:0:0:0 (bsg)
UDEV [44405.212494] remove /devices/pci0000:00/0000:00:13.2/usb2/2-1/2-1:1.0/Host10/target10:0:0/10:0:0:0/scsi_device/10:0:0:0 (scsi_device)
UDEV [44405.212539] remove /devices/virtual/bdi/8:64 (bdi)
UDEV [44405.212817] remove /devices/pci0000:00/0000:00:13.2/usb2/2-1/2-1:1.0/Host10/target10:0:0/10:0:0:0/scsi_disk/10:0:0:0 (scsi_disk)
UDEV [44405.214150] remove /devices/pci0000:00/0000:00:13.2/usb2/2-1/2-1:1.0/Host10/target10:0:0/10:0:0:0/scsi_generic/sg5 (scsi_generic)
UDEV [44405.214811] remove /devices/pci0000:00/0000:00:13.2/usb2/2-1/2-1:1.0/Host10/target10:0:0/10:0:0:0/block/sde (block)
UDEV [44405.216890] remove /devices/pci0000:00/0000:00:13.2/usb2/2-1/2-1:1.0/Host10/target10:0:0/10:0:0:0 (scsi)
UDEV [44405.232937] remove /devices/pci0000:00/0000:00:13.2/usb2/2-1/2-1:1.0/Host10/target10:0:0/10:0:0:1/bsg/10:0:0:1 (bsg)
UDEV [44405.233453] remove /devices/pci0000:00/0000:00:13.2/usb2/2-1/2-1:1.0/Host10/target10:0:0/10:0:0:1/scsi_generic/sg6 (scsi_generic)
UDEV [44405.234138] remove /devices/pci0000:00/0000:00:13.2/usb2/2-1/2-1:1.0/Host10/target10:0:0/10:0:0:1/block/sr1 (block)
UDEV [44405.235900] remove /devices/virtual/bdi/11:1 (bdi)
UDEV [44405.236151] remove /devices/pci0000:00/0000:00:13.2/usb2/2-1/2-1:1.0/Host10/target10:0:0/10:0:0:1/scsi_device/10:0:0:1 (scsi_device)
UDEV [44405.237304] remove /devices/pci0000:00/0000:00:13.2/usb2/2-1/2-1:1.0/Host10/target10:0:0/10:0:0:1 (scsi)
UDEV [44405.238416] remove /devices/pci0000:00/0000:00:13.2/usb2/2-1/2-1:1.0/Host10/target10:0:0 (scsi)
UDEV [44405.260852] remove /devices/pci0000:00/0000:00:13.2/usb2/2-1/2-1:1.0/Host10/scsi_Host/host10 (scsi_Host)
UDEV [44405.261862] remove /devices/pci0000:00/0000:00:13.2/usb2/2-1/2-1:1.0/Host10 (scsi)
UDEV [44405.262597] remove /devices/pci0000:00/0000:00:13.2/usb2/2-1/2-1:1.0 (usb)
UDEV [44405.267755] remove /devices/pci0000:00/0000:00:13.2/usb2/2-1 (usb)
UDEV [44405.650792] add /devices/pci0000:00/0000:00:13.2/usb2/2-1 (usb)
UDEV [44405.652229] add /devices/pci0000:00/0000:00:13.2/usb2/2-1/2-1:1.0 (usb)
Créez un nouveau fichier de règles:
Sudo nano /etc/udev/rules.d/99-eject-virtual-cd.rules
Ajouter cette règle
ACTION=="add", KERNEL=="sr[0-9]*", ATTRS{idVendor}=="1bbb", ATTRS{idProduct}=="af00", RUN+="/bin/sh -c 'eject /dev/%k'"
Recharger les règles
Sudo udevadm control -R
Rebranchez le téléphone pour vérifier