Ubuntu udev rules issues


Hi All,

My WP7 arrived today. Yippee!

I’m having a few issues getting the WP7 (as an Android device) to connect to the Ubuntu 12.04 desktop I’ve installed. I can connect to the module using minicom when the WP7 enumerates as a USB ACM device on /dev/ttyACM0 (although there are a lot of errors in dmesg when the device is enumerated).

dmesg reports the following when the device is plugged in (after doing sys_reboot bootloader from the UART):

[ 1181.723562] usb 1-1: new high-speed USB device number 4 using ehci-pci [ 1181.997160] usb 1-1: New USB device found, idVendor=18d1, idProduct=d00d [ 1181.997169] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 1181.997174] usb 1-1: Product: Android [ 1181.997178] usb 1-1: Manufacturer: Google [ 1181.997182] usb 1-1: SerialNumber: MDM9615 which looks to me that the device is being connected.

lsusb reports the followingBus 001 Device 004: ID 18d1:d00d Google Inc.

And my /etc/udev/rules.d/51-android.rules file looks like this:[code]SUBSYSTEM==“usb”, ATTRS{idVendor}==“1199”, MODE="0666"
SUBSYSTEM==“usb”, ATTRS{idVendor}==“18d1”, MODE=“0666”


But fastboot can’t find the device. Looking further, the device file ls -l /dev/bus/usb/001/004 shows that the permissions and ownership etc are as follows:crw-rw-rw- 1 root root 189, 3 Feb 4 16:50 /dev/bus/usb/001/004 - which sort of looks OK (wr- should be mode ‘6’).

However, when I run sudo udevadm test /dev/bus/001/004 to test that the udev rules are being fired, I get the followingudev_rules_new: rules use 272652 bytes tokens (22721 * 12 bytes), 44886 bytes buffer udev_rules_new: temporary index used 76940 bytes (3847 * 20 bytes) unable to open device '/sys/dev/bus/001/004' which suggests that the udev rules for the android device are not being fired. And the /sys/dev directory only has block and char sub-directories … no bus sub directory.

Ubuntu is not my usual distribution, so I would appreciate any thoughts that anyone has. Specifically if I need to enable any different kernel modules. I have read that Ubuntu x64 does not support usbfs (/proc/bus/usb) and I’m wondering if that is part of my problem.

ciao, Dave


Hi Dave,

There are a couple of simple things to try before diving too deep. Firstly, can you run fastboot with sudo to see if that detects the device?

Secondly, try adding your user to the dialout group. The logout/login and try again.



Hi Andrew,

Thanks for the hints. I’ll let you know how I get on.

I did try running fastboot using sudo. Depending on where I ran it from (I.e I added it to the path so I could run it from my dev directory) it gave me different responses - but nothing I did would detect the device.

I’ll detail the responses when I get back up to the office.

Ciao, Dave


Hi Andrew,

[quote=“amitchell”]Hi Dave,
There are a couple of simple things to try before diving too deep. Firstly, can you run fastboot with sudo to see if that detects the device?
First of all, I have set up my PATH as follows:[code]dev@legato-dev:~ echo PATH /usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/android-sdk-linux:/opt/android-sdk-linux/tools:/opt/android-sdk-linux/platform-tools dev@legato-dev:~
[/code]so that fastboot is in the path.

This is what I get when I run fastboot from my dev directory:dev@legato-dev:~$ sudo fastboot devices [sudo] password for dev: sudo: fastboot: command not found dev@legato-dev:~$
and when I run it from my dev directory using the full path to fastboot:dev@legato-dev:~$ sudo /opt/android-sdk-linux/platform-tools/fastboot devices dev@legato-dev:~$ i.e. no response at all.

My default groups are:dev@legato-dev:~$ groups dev dev : dev adm cdrom sudo dip plugdev lpadmin sambashare dev@legato-dev:~$After adding user to the dialout group usingsudo usermod -a -G dialout dev and logging out and back in again I getdev@legato-dev:~$ groups dev dev : dev adm dialout cdrom sudo dip plugdev lpadmin sambashare dev@legato-dev:~$

Now when I try fastboot three different ways, I get the following:dev@legato-dev:~$ fastboot devices bash: /opt/android-sdk-linux/platform-tools/fastboot: No such file or directory dev@legato-dev:~$ sudo fastboot devices [sudo] password for dev: sudo: fastboot: command not found dev@legato-dev:~$ sudo /opt/android-sdk-linux/platform-tools/fastboot devices dev@legato-dev:~$

So I still appear to have problems with the android device not being available. As before, dmesg is reporting the Android device being plugged in with the following:[ 984.267626] usb 1-1: new high-speed USB device number 2 using ehci-pci [ 984.568643] usb 1-1: New USB device found, idVendor=18d1, idProduct=d00d [ 984.568652] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [ 984.568658] usb 1-1: Product: Android [ 984.568662] usb 1-1: Manufacturer: Google [ 984.568666] usb 1-1: SerialNumber: MDM9615

Thanks for your help to get to the bottom of this…

ciao, Dave


Hi Andrew,

Another little bit of info:

I tried to access the WP7 from windows (win7 x64) as detailed in the end of the Getting Started guide.

Until I sent the [quote]At!unlock=”A710”
At!custom=”ADBENABLE”,1[/quote]commends, fastboot would not see the device from Windows, either.

Now, fastboot(on Windows) reports MSM9615 fastboot - which looks like it’s connected OK.

Still no joy in Ubuntu though.

ciao, Dave


Hi All,

A little bit more info:

I realised that fastboot should be returning a list of help and command line options when run without any options. I noticed that in my installation fastboot was simply returning with nothing… sort of indicating that it probably wasn’t running properly.

First thing I did was replace the version of Java in my install - the default JVM for Ubuntu is openjdk. I replaced this with the ‘genuine’ Oracle JVM as per the instructions here how-to-install-oracle-java-7-in-ubuntu-12-04. This made no difference.

I then found this link about installing fastboot on Ubuntu 12.04. Note there is an extra step of installing the IA32-LIBS package that is apparently required for the Android SDK. After installing these libraries, fastboot now appears to be reacting as expected:[code]dev@legato-dev:/opt/android-sdk-linux/platform-tools$ ./fastboot
usage: fastboot [ ]

update reflash device from update.zip
flashall flash boot + recovery + system
flash [ ] write a file to a flash partition
erase erase a flash partition
format format a flash partition
getvar display a bootloader variable
boot [ ] download and boot kernel
flash:raw boot [ ] create bootimage and flash it
devices list all connected devices
continue continue with autoboot
reboot reboot device normally
reboot-bootloader reboot device into bootloader
help show this help message

-w erase userdata and cache (and format
if supported by partition type)
-u do not first erase partition before
-s specify device serial number
or path to device port
-l with “devices”, lists device paths
-p specify product name
-c override kernel commandline
-i specify a custom USB vendor id
-b <base_addr> specify a custom kernel base address. default: 0x10000000
-n specify the nand page size. default: 2048
-S [K|M|G] automatically sparse files greater than
size. 0 to disable

This is looking better than before.

I’ll try the hardware when I get to the office tomorrow.

Stay tuned!

ciao, Dave



Confirmation! Fastboot now enumerates the devices attached to my dev box:dev@legato-dev:~$ fastboot devices MDM9615 fastboot dev@legato-dev:~$
Adding the user to dialout also seems to have removed the requirement for sudo.

Now for the next challenge…

ciao, Dave


Hi Dave,

that’s great. Glad you got it sorted out.



I found this guide online which makes setting up fastboot on Ubuntu much easier if anyone is running into the same issue.
webupd8.org/2012/08/install- … tools.html