Need help getting sdcard mounted with iocharset=utf8


mars2040

Still Fresh
Joined
Jan 22, 2014
Messages
2
What is the magic to getting a vfat sdcard automounted as utf8? It probably has something to do with udev, but I haven't been able to puzzle it out. The pandora mounts /dev/mmcblk0p1 as iocharset=8859-1 which is annoying for files that have utf8 umlauts in the names.

Thanks much.
 
Hmm, I can't help you I'm afraid. I've had a bit of a google around how to do it on x86 Linux, but I can't find the AutoFS configuration files or the AMD binary on Pandora, so I assume it uses something else, but I can't figure out what and now I'm intrigued.
 
I just tested it on my ordinary SD card with FAT32: There were no issues with umlauts. I will retry it with another SD card and other format settings.

EDIT: I even reformated my other SD card to vfat. There is still no problem in the filemanager, but LXTerminal cannot handle umlauts.
 
Last edited by a moderator:
But you get your umlauts encoded in ISO-8859-1 which is different from UTF-8, which makes it difficult to be interoperable with systems using UTF-8 when your file names contain umlauts.


Edit: actually 8859-1 encoding of umlauts will in a lot of cases lead to code sequences invalid in UTF-8
 
Last edited by a moderator:
Here is a bit more explanation:

This is how my linux box (locale of en_US.utf-8) automounts a vfat formatted sdcard:
 


/dev/mmcblk0p1 /media/user/PANDA01 vfat rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,flush,uhelper=udisks2 0 0


This is how the openpandora automounts the same card:
 


/dev/mmcblk0p1 /media/PANDA01 vfat rw,dirsync,noatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0


Notice utf8 in one versus iso8859-1 in the other. Thus files with utf8 filenames (e.g., with umlauts) that get transferred from the linux box to the sdcard get garbled when shown on the openpandora in iso8859-1 filenames.

As an aside, in reading up on vfat (https://www.kernel.org/doc/Documentation/filesystems/vfat.txt), it recommends against iocharset=utf8 and instead recommends utf8-1, which is the "filesystem safe version of unicode that is used by the console." So, my original title was not quite correct.

An unsatisfactory workaround is to manually mount the sdcard on the linux box with "-o iocharset=iso8859-1" and copy the files over to the card (with linux automatically taking care of the filename encodings). When mounted on the openpandora, the now iso8859-1 umlauts look good. However, this doesn't solve my quest to get the openpandora to automount with utf8.
 
 
Yeah, figuring out how it's mounted and the right set of runes to control the mount command to mount it as UTF8 (or 8-1 etc.) is easy. The bit I got stuck it working out how the Pandora automounts anything.
 
Well, my desktop GNU/Linux also mounts fat filesystems using "iocharset=iso8859-1". The difference is an extra utf8 argument. Here:

/dev/sdb1 on /run/media/vinipsmaker/OPENPANDORA type vfat (rw,nosuid,nodev,relatime,uid=1050,gid=100,fmask=0022,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)
You can see from linux documentation ( https://www.kernel.org/doc/Documentation/filesystems/vfat.txt ) that "iocharset=utf8" is not recommended. But use "utf8" instead.
I believe that's handled by /etc/udev/scripts/mount.sh

- Neelix
Yes, it worked for me. I changed the script to add the extra utf8 argument and now I can see the filenames of my music folder correctly.=)

Now I need to figure it out how to submit changes upstream. My first change to the SuperZaxxon is still awaiting approval.
 
Thanks for this information, helped me make my music collection show up correctly. I'm anxious to know what the proper solution is, if this isn't it :)

Here are my changes: https://github.com/vinipsmaker/meta-openpandora-vendor/commit/04db9d42cb824208353e11b81cdcb892cee62c31

But I won't submit to upstream Pandora. It looks like a fucking workaround.

I'm curious about how the system gets defaults mount params. Is it kernel arguments passed during kernel building? I'll make a little research.
 
After a bit of research, looks like I found something to try: http://ubuntuforums.org/showthread.php?t=805124&p=5406012#post5406012

OpenEmbedded uses the ancient hal (good thing we're moving away from it) and it's difficult to find documentation or support. Also, I haven't find how to change the default mount options reading the mount manpage, then I think it'll probably be done on the automounting layer (this is hal on SuperZaxxon).
 
I've spent a lot of time with research and then wrote a nice solution: https://github.com/vinipsmaker/meta-openpandora-vendor/commit/5a356b463b6799d4b2801cf3016c303eccad0c41

Now I'll submit a pull request, but there is still functionality missing for complete Unicode support. This change, for instance, only works on automounting (if you try the mount and umount buttons on the Thunar, it won't work). Another missing functionality is default locale (I've sent a pull request many weeks ago changing a single line and nobody did anything).
 
Back
Top