View Single Post
Posts: 267 | Thanked: 183 times | Joined on Jan 2010 @ Campinas, SP, Brazil
#17
Thanks for your recipe, stair. But I found that it didn't work quite correctly on mine. I did the following extra step:

I modified /usr/sbin/mmc-mount which is in fact a shell script. It contains:

Code:
#!/bin/sh
mount -t vfat -o $3,noauto,nodev,noexec,nosuid,noatime,nodiratime,utf8,uid=29999,shortname=mixed,dmask=000,fmask=0133,rodir "$1" "$2" > /dev/null
That is, it tries to forcibly mount the mmc as a vfat filesystem. As this script is run everytime the back cover is attached to the phone (and its counterpart /usr/bin/mmc-unmount is run every time the back cover is opened -- yes, the path is different and it's a binary file!), I find it safer to modify it this way:

Code:
#!/bin/sh
mount -t vfat -o $3,noauto,nodev,noexec,nosuid,noatime,nodiratime,utf8,uid=29999,shortname=mixed,dmask=000,fmask=0133,rodir "$1" "$2" > /dev/null || mount -o $3,noauto,noatime,nodiratime "$1" "$2" > /dev/null
This way, mmc-mount first tries to mount it as a vfat card, with all the options. If it is unable to do it, it tries to mount the card with the filesystem type autodetected. It works best because this setup allows you to insert other types of MMC (vfat, ext2, ext3, whatever the N900 kernel supports) and also works correctly with the internal MMC card, which is vfat. I verified by plugging it with the USB cable and also removing the back cover and putting it back. It worked right in all these occasions and also unmounted and mounted the internal MMC correctly.
 

The Following 7 Users Say Thank You to Patola For This Useful Post: