Commit Graph

19 Commits

Author SHA1 Message Date
Andrius Štikonas 8534265421 REUSE: SPDX headers for src/fs/*. 2020-09-28 00:51:18 +01:00
Gaël PORTAY 9d6c98ff4a Replace FSFeature by QVariantMap
The object QVariant is a native object in the Qt world that represents
any type of value: boolean, integer, string, floating point, date,
UUID...

This change updates the API to use the object QVariant and provide a
more flexible API to represent the filesystem features.
2020-03-21 18:09:01 -04:00
Arnaud Ferraris d24191ebd8 Add support for filesystem-specific features
In some cases, it may be necessary to create a filesystem with specific features
enabled/disabled.

This PR makes it possible to create filesystems this way. It does so
by introducing a new m_Features member variable and the createWithFeatures()
function to the FileSystem base class. The latter function is implemented
for the btrfs, ext2/3/4 and FAT filesystems.

Additionnally, the CreateFileSystemJob has been modified to enable
creating/formatting filesystems with specific features enabled.

Differential Revision: https://phabricator.kde.org/D21903
CCBUG: 342178
2020-01-12 11:58:32 +00:00
Shubham Jangra d1a82f65d4 Revert "Remove redundant includes and refactor"
This reverts commit 4229b02fd2.
2019-06-12 22:11:11 +05:30
Shubham Jangra 4229b02fd2 Remove redundant includes and refactor 2019-06-10 23:07:06 +05:30
Andrius Štikonas 17c8772240 Explicitely specify the scope of enum. 2018-04-07 19:54:30 +01:00
Andrius Štikonas 4069e5112e Post merge fixes.
In kauth branch ExternalCommand::write should be called before start.
2018-01-11 11:45:39 +01:00
Andrius Štikonas 790553aa0b Merge branch 'smart' into kauth 2018-01-11 11:31:18 +01:00
Pali Rohár 2f4aeaf851 Add support for reading capacity and changing label/uuid on UDF filesystem 2018-01-03 20:09:53 +02:00
Andrius Štikonas 47429dd1bf Proof of concept attempt to implement KAuth. 2017-12-10 17:36:39 +00:00
Andrius Štikonas 6b6ddbdcef Use int for maxLabelLength. 2017-09-11 16:52:20 +01:00
Andrius Štikonas 2b52ec492b Only create QRegularExpressionValidator when needed and destroy it afterwards. 2017-09-05 16:20:50 +01:00
Pali Rohár 9cc6596cb4 Implement udf::labelValidator() for validating UDF label
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().
2017-09-05 15:53:24 +01:00
Andrius Štikonas 6ad873223e udf: set MBR partition id to 0x07. 2017-09-03 21:24:15 +01:00
Andrius Štikonas 703270b64c udf: do not hardcode min/max sector size. 2017-09-03 18:40:19 +01:00
Andrius Štikonas c4628ad715 Use block size provided by the backend in UDF file system. 2017-09-03 18:27:57 +01:00
Pali Rohár db13a4bab9 Process UDF label correctly when creating new UDF file system
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.
2017-08-31 10:13:32 +01:00
Andrius Štikonas 6a78a74515 Add support for creating file systems with label.
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.
2017-08-31 10:13:01 +01:00
Pali Rohár feec00f4e7 Add basic support for UDF filesystem
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)
2017-08-31 10:12:44 +01:00