| View previous topic :: View next topic |
| Author |
Message |
Ahri Tux's lil' helper


Joined: 04 Apr 2004 Posts: 124 Location: Manchester/UK
|
Posted: Fri Feb 16, 2007 12:09 pm Post subject: Weird Sony Ericsson K800i Problem |
|
|
I'm using udev to assign device names, and have been successfully using the rule:
BUS=="scsi", SYSFS{vendor}=="Sony Eri*", SYSFS{model}=="Memory Stick", KERNEL=="sd?1", SYMLINK+="sephone"
By "successfully" I mean it worked fine with my w800i, however now that I've moved to a k800i it's not working because the k800i supplies both access to its 64mb onboard memory and the extra 2gb card, so it may create (for example) /dev/sda and /dev/sdb when I plug it in. Now there's something a bit weird about this... the kernel doesn't automatically discover the partition numbers - this only happens if I do a `sudo mount /dev/sdb /mnt/temp' -- this fails but sdb1 is discovered and the above udev rule kicks in.
Great stuff, except that I have to do a bit of a dirty hack to get (for example) amarok to interface with it; I have to do something like: | Code: | | for d in d c b a; do sudo mount /dev/sd$d; done; mount /mnt/sephone | in order to discover the partition numbers. I do it in reverse order so that the udev rule kicks in when sdb1 is discovered (as the 2gb memory card is more useful for putting mp3s on than the 64mb onboard memory!)
So, can anyone give me hints on how to do this in a cleaner manner?
Here's the dmesg output first for the w800i (which works quite seamlessly): | Code: |
usb-storage: waiting for device to settle before scanning
Vendor: Sony Eri Model: Memory Stick Rev: 0000
Type: Direct-Access ANSI SCSI revision: 00
SCSI device sda: 960512 512-byte hdwr sectors (492 MB)
sda: Write Protect is off
sda: Mode Sense: 00 6a 00 00
sda: assuming drive cache: write through
SCSI device sda: 960512 512-byte hdwr sectors (492 MB)
sda: Write Protect is off
sda: Mode Sense: 00 6a 00 00
sda: assuming drive cache: write through
sda: sda1
sd 6:0:0:0: Attached scsi removable disk sda
sd 6:0:0:0: Attached scsi generic sg0 type 0
usb-storage: device scan complete |
And the k800i which doesn't: | Code: | usb-storage: waiting for device to settle before scanning
scsi8 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 13
usb-storage: waiting for device to settle before scanning
Vendor: Sony Eri Model: Memory Stick Rev: 0000
Type: Direct-Access ANSI SCSI revision: 00
Vendor: Sony Eri Model: Memory Stick Rev: 0000
Type: Direct-Access ANSI SCSI revision: 00
sd 7:0:0:0: Attached scsi removable disk sda
sd 7:0:0:0: Attached scsi generic sg0 type 0
usb-storage: device scan complete
sd 8:0:0:0: Attached scsi removable disk sdb
sd 8:0:0:0: Attached scsi generic sg1 type 0
usb-storage: device scan complete |
My only idea so far is to have 2 udev rules nearly exactly the same but one after the other (named 60- and 61-), so that I can have 2 devices; /dev/k800i_phone and /dev/k800i_card. Unfortunately this relies on me trying to mount /dev/sda and then /dev/sdb in that order. Which is crap.
Help!  |
|
| Back to top |
|
 |
Ahri Tux's lil' helper


Joined: 04 Apr 2004 Posts: 124 Location: Manchester/UK
|
Posted: Sat Feb 17, 2007 12:04 pm Post subject: |
|
|
No hints?  |
|
| Back to top |
|
 |
mahdi1234 Guru

Joined: 19 Feb 2005 Posts: 440 Location: far from new world orderia
|
Posted: Sun Apr 08, 2007 9:43 pm Post subject: |
|
|
Same on my side, but it WORKED few days ago.
I have recently updated both phone firmware as well as my kernel, so don't know where's the problem.
Phone firimware - R1JG001
kernel:
| Code: |
$ uname -a
Linux mahdi 2.6.19-gentoo-r5 #1 SMP PREEMPT Sun Apr 8 16:22:17 CEST 2007 i686 Intel(R) Pentium(R) 4 CPU 2.66GHz GenuineIntel GNU/Linux
|
|
|
| Back to top |
|
 |
venquessa2 Apprentice

Joined: 27 Oct 2004 Posts: 269
|
Posted: Sat Mar 08, 2008 9:16 pm Post subject: |
|
|
Locate the size of the SD card using udevinfo and replace the ATTR{size}=="3995273" below to match.
| Code: |
SUBSYSTEMS=="usb", ATTRS{manufacturer}=="Sony Ericsson" \
ATTRS{idVendor}=="0fce", ATTRS{idProduct}=="e039", ATTR{size}=="3995273" \
KERNEL=="sd*1", SYMLINK+="sonye-sd%n" OPTIONS="last_rule"
SUBSYSTEMS=="usb", ATTRS{manufacturer}=="Sony Ericsson" \
ATTRS{idVendor}=="0fce", ATTRS{idProduct}=="e039" \
KERNEL=="sd*1", SYMLINK+="sonye-int%n"
|
Justification: The internal 'memory stick' does not report *anything* consistently that differs from the SD expansion 'memory stick', it varys it's size on each insert. The SD card appears to report it's size consistently however. The rules above first match the SD card and tell udev that no more rules may change that device, then the more generic second rule matches the internal memory stick.
Tested: For a day or two with a Sony Ericsson K800i + 2Gb SD Card _________________ Paul
mkdir -p /mnt/temp; for VERMIN in `fdisk -l | egrep "FAT|NTFS" | cut --fields=1 --delimiter=" " `; do mount $VERMIN /mnt/temp; rm -fr /mnt/temp/*; umount -f $VERMIN; done |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|