Olf0 / mount-sdcard

Enhanced mounting scripts for SD-cards
https://openrepos.net/content/olf/mount-sdcard
GNU Lesser General Public License v2.1
3 stars 0 forks source link

[feature suggestion] Write a new tool to query and set pretty names for partitions #53

Open DrYak opened 2 years ago

DrYak commented 2 years ago

Given the number of "Why does Sailfish OS mounts cards as hash instead of nickname?" bug reports on Sailfish forum, you might be interested to include the following snippet among your udev rules:

$ cat /etc/udev/rules.d/99-udisknames.rules 
SUBSYSTEM=="block", ENV{PARTNAME}!="", ENV{UDISKS_NAME}="$env{PARTNAME}" 
Olf0 commented 2 years ago

References for this topic at FSO:

Answer: Not really, because there are too many corner cases when this may go wrong and setting an udisk display name is only of little use, as you already found out.

Other caveats:

Hence I am not considering to include this into mount-sdcard.

But a separate tool may be created, which queries these pretty names, then sets the UDISKS_NAME and a symbolic link to the mount-point, utilising one of these pretty names. The order of this evaluation also has to be well considered and these considerations along with their conclusions have to be documented.

As udev deals with devices, not mount-points, this may be hard or even infeasible to achieve this via udev rules. Implementing this as a shell script seems to be adequate. Would need further investigation.

External references: