Hi Rowboat friends,
I have a quick question. I'm using a DM3730 board similar to
Beagle-XM. I am able to get automatic mounting of USB storage devices
to work in Rowboat Gingerbread. But I can't seem to figure out why it
doesn't work for my SD card when done via hotplug. It works fine when
done using vdc. Here are my steps as per the porting guide:
a) set EXTERNAL_STORAGE and create dirs in init.rc
export EXTERNAL_STORAGE /mnt/frontsd
mkdir /mnt/frontsd 0000 system system
btw, has anyone implemented a patch such that Gingerbread can support
multiple external storage devices rather than only 1?
b) appropriate vold.fstab
# cat /etc/vold.fstab
dev_mount sdcard /mnt/sdcard auto /devices/platform/mmci-omap-hs.0/mmc_host/mmc0
dev_mount frontsd /mnt/frontsd auto /devices/platform/mmci-omap-hs.1/mmc_host/mmc1
dev_mount frontusb /mnt/frontusb auto /devices/platform/ehci-omap.0/usb1/1-2/1-2.2/
c) okay, now hotplug the SD card (mmc1)
[ 60.924804] twl4030ldo_set_voltage:343 min=3100000, max=3150000
[ 61.073333] mmc1: new SD card at address a95c
[ 61.079864] mmcblk1: mmc1:a95c SD128 120 MiB
[ 61.087036] mmcblk1: p1
D/Vold ( 1165): Volume frontsd state changing 0 (No-Media) -> 2 (Pending)
D/VoldCmdListener( 1165): volume mount /mnt/frontsd
W/MountService( 1327): Insertion mount failed (-1), path=/mnt/frontsd
I/PackageManager( 1327): Updating external media status from unmounted
to unmounted
D/Vold ( 1165): Volume frontsd state changing 2 (Pending) -> 1
(Idle-Unmounted)
I/StorageNotification( 1434): Media {/mnt/frontsd} state changed from
{removed} -> {unmounted}
D/VoldCmdListener( 1165): volume shared /mnt/frontsd ums
D/dalvikvm( 1434): GC_EXTERNAL_ALLOC freed 189K, 48% free 2958K/5639K,
external 972K/1038K, paused 24ms
As can be seen above, the uevent was generated, the SD card was
detected, then the event was passed to MountService which issued the
command "volume mount /mnt/frontsd" to the native connector. But that
command failed.
Double checking, I see:
# mount
rootfs on / type rootfs (rw)
/dev/root on / type ext3 (rw,relatime,errors=continue,barrier=0,data=ordered)
tmpfs on /dev type tmpfs (rw,relatime,mode=755)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
tmpfs on /mnt/asec type tmpfs (rw,relatime,mode=755,gid=1000)
none on /tmp type ramfs (rw,relatime)
# ls /mnt/frontsd/
So it did not mount.
d) Now if I issue the command manually:
# vdc volume mount /mnt/frontsd
D/VoldCmdListener( 1165): volume mount /mnt/frontsd
I/Vold ( 1165): /dev/block/vold/179:9 being considered for volume frontsd
D/Vold ( 1165): Volume frontsd state changing 1 (Idle-Unmounted) ->
3 (Checking)
I/StorageNotification( 1434): Media {/mnt/frontsd} state changed from
{unmounted} -> {checking}
605 Volume frontsd /mnt/frontsd state changed from 1 (Idle-Unmounted)
to 3 (Checking)
W/logwrapper( 1988): Unable to background process (No such file or directory)
I//system/bin/fsck_msdos( 1165): ** /dev/block/vold/179:9
I//system/bin/fsck_msdos( 1165): ** Phase 1 - Read and Compare FATs
I//system/bin/fsck_msdos( 1165): Attempting to allocate 120 KB for FAT
I//system/bin/fsck_msdos( 1165): Attempting to allocate 120 KB for FAT
I//system/bin/fsck_msdos( 1165): ** Phase 2 - Check Cluster Chains
I//system/bin/fsck_msdos( 1165): ** Phase 3 - Checking Directories
I//system/bin/fsck_msdos( 1165): ** Phase 4 - Checking for Lost Files
I//system/bin/fsck_msdos( 1165): 27 files, 70942 free (35471 clusters)
I/Vold ( 1165): Filesystem check completed OK
I/Vold ( 1165): Device /dev/block/vold/179:9, target /mnt/frontsd
mounted @ /mnt/secure/staging
I/PackageManager( 1327): Updating external media status from unmounted
to mounted
D/Vold ( 1165): Volume frontsd state changing 3 (Checking) -> 4 (Mounted)
605 Volume frontsd /mnt/frontsd state changed from 3 (Checking) to 4 (Mounted)
200 volume operation succeeded
I/BootReceiver( 1606): Got intent with action
android.intent.action.MEDIA_MOUNTED
D/VoldCmdListener( 1165): asec list
# I/PackageManager( 1327): No secure containers on sdcard
I/StorageNotification( 1434): Media {/mnt/frontsd} state changed from
{checking} -> {mounted}
# mount
rootfs / rootfs rw 0 0
/dev/root / ext3 rw,relatime,errors=continue,barrier=0,data=ordered 0 0
tmpfs /dev tmpfs rw,relatime,mode=755 0 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0
none /tmp ramfs rw,relatime 0 0
/dev/block/vold/179:9 /mnt/frontsd vfat
rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro
0 0
/dev/block/vold/179:9 /mnt/secure/asec vfat
rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro
0 0
tmpfs /mnt/frontsd/.android_secure tmpfs ro,relatime,size=0k,mode=000 0 0
So it seems to work fine when I do it manually. I don't see this
problem when I switch to USB. I guess I could debug further inside the
native connector but I can't see why it only works from the command
line. Any suggestions on what could be going wrong? Is there some
timing issue? I would welcome any advice or suggestions.
Thanks,
jayakumar