Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
DrYak opened this issue Jun 8, 2022 · 1 comment
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@DrYak
Copy link

DrYak commented Jun 8, 2022

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 Olf0 added the help wanted Extra attention is needed label Jun 11, 2022
@Olf0
Copy link
Owner

Olf0 commented Jun 11, 2022

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:

  • File-system labels (LABEL), partition-names per GPT (PARTLABEL) / udisk 's PARTNAME (wherever that comes from; I would have to look that up) is user-supplied data, which may be (ab)used by an attacker to inject special characters, escape sequences etc. Hence they should be filtered properly, rsp. check if the mechanisms employed do that, otherwise perform the filtering expilcitly.
  • By default these aforementioned three names / labels are all empty!
  • Software may rely on the UUID-based "names" for mount-points, hence they should always exist. These are designed to be unique, hence they are best suited as primary identifier / path.

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:

@Olf0 Olf0 closed this as completed Jun 11, 2022
@Olf0 Olf0 reopened this Jun 11, 2022
@Olf0 Olf0 changed the title [feature suggestion] Consider PARTNAME [feature suggestion] Write a new tool to query and set pretty names for partitions Nov 14, 2022
@Olf0 Olf0 added enhancement New feature or request wontfix This will not be worked on labels Dec 21, 2022
@Olf0 Olf0 removed the help wanted Extra attention is needed label Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants