This would rapidly simplify UDF code if all checks are done by caller.
Also checks for MIN_UDF_BLOCKS/MAX_UDF_BLOCKS are removed as they should be
covered by udf::minCapacity() and udf::maxCapacity().
Mkudffs from udftools prior to version 1.1 damages the label if it contains
non-ASCII characters.
The Volume Identifier (--vid) can only contain 30 bytes, either 30
ISO-8859-1 (Latin 1) characters or 15 UCS-2BE characters. Store the most
characters possible in the Volume Identifier.
Some file systems such as UDF or F2FS only support writing labels when creating
them.
At the moment this only works in new partition dialog and not in the partition
properties dialog.
For reading UDF label and UUID is needed blkid >= 2.30. For creating new
UDF filesystem is needed mkudffs binary from the udftools package.
When creating new UDF fileystem, revision 2.01 for hard disk media is used.
Therefore it is not possible to use it for optical (or other) medias.
Problems:
* Check for min and max capacity is incorrect as it depends on logical
(sector) size of the disk.
* Check for max label length is incorrect too as it depends on characters
itself in label.
* Specifying label is not working yet as FileSystem::create() does not get
label parameter.
* UDF filesystem should be used on unpartitioned disk, without MBR or GPT
and spanning whole disk, but KDE Partition Manager does not support it.
* When MBR is used, MBR partition id should be 0x07, but currently it is
incorrect 0x83. See: https://serverfault.com/a/829172 (same for GPT)
On some systems getlogin() function might fail to obtain user name.
For now just check whether pointer is nullptr. In that case suspending
plasma device automounter would not work but at least we will not crash.
In future it might make sense to try to use other methods of obtaining login
name, such as running "who am i".
BUG: 381987
Summary:
- mark deviceNode const
- copy it as deviceName
- mutate deviceName by removing `/dev/`
- use the new deviceName for the read-only check
this makes sure we emit the unmodified deviceNode (e.g. /dev/vda) rather
than the name (e.g. vda). unbreaks for example calamares which doesn't
know what to do with "vda".
CCBUG: 378607
Test Plan:
- without fix clamares fails to list devices
- with the fix calamares lists devices
Reviewers: stikonas
Reviewed By: stikonas
Differential Revision: https://phabricator.kde.org/D6414
The previous way relied on kernel device numbers but this gets ugly, especially
in cases when device number is not assigned such as virtio disks.
BUG: 378607
Some filesystems require mountpoint while some deviceNode to change file system
label only. So split writeLabel action into online and offline actions.