answered
2016-05-08 15:50:57 +0300
In Sailfish OS, the automounting is handled by the script /usr/sbin/mount-sd.sh
from package sd-utils
. This is the thing you'd want to edit to add newer behaviours (we've already hacked it a bit with @V10lator - like adding support for swap partitions, NTFS/exFAT/etc. - have a look on our githubs, his openrepo, etc.)
The general flow of it is:
It's this last part that you want to change. You should add more logic to check whether $LABEL
is set, and then name the mounting point based either on $LABEL
or $UUID
depending on availability. (Don't forget to also change the unmounting logic accordingly).
An alternate solution would be to leave the current logic as-is and add code to create symlinks named with $LABEL
and pointing to $UUID
. (If I manage to find some free time, I would add this one).
In theory, it's better to use UUIDs rather than labels, because the former are supposed to be unique to each media (in theory. in practice FAT32 uses rather short 32bits ones, so collisions / birthday paradoxes are a likelyhood) whereas labels are user defined, and it can get really confusing if some end-user decide to call all their memory cards "My data" (or in case of constructors who use the product name for every single item).
In practice, as the Jolla phone has only 1 single SD-card slot, and as very few people use external readers (as the OTG port isn't powered), you won't find that many situations where having two partitions with the same name is problematic.
As far as I can tell, this is default Linux behaviour. Try to find something about how this is done with Ubuntu. Chances are that will work with Sailfish.
Xmasjos ( 2016-05-08 01:41:21 +0300 )edit@Xmasjos: Nope. It's not a "default Linux behaviour". There are lots of different automounting scripts out there, each with its own specificities. And Sailfish uses a different one that hasn't much in common with Ubuntu (it's not like Palm/HP's WebOS which was inspired by Ubuntu up to some point)
DrYak ( 2016-05-08 15:36:55 +0300 )edit