Commit Graph

70 Commits

Author SHA1 Message Date
Tomaz Canabrava 770e16eb02 Use --recursive instead of -r 2021-12-28 15:07:35 +00:00
Tomaz Canabrava 9093b27bd8 Move the changePosixPermission to the Filesystem
And implement it on ext2, 3, 4. I don't know all the filesystems
that can have posix permissions, those three will do. if we need
more in the future we implement them, it's two lines of code.
2021-12-28 15:07:35 +00:00
Andrius Štikonas 0c25d1f9c4 Use QFile::decodeFileName for decoding device node names.
BUG: 384321
2020-10-01 23:51:59 +01:00
Andrius Štikonas d68ffeadef REUSE: SPDX style license headers for src/util. 2020-10-01 00:33:19 +01:00
Andrius Štikonas 8534265421 REUSE: SPDX headers for src/fs/*. 2020-09-28 00:51:18 +01:00
Andrius Štikonas a810d0d2fd Merge branch 'gportay/kpmcore-update-filesystem-features-api' 2020-03-22 01:24:57 +00: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
Yuri Chornoivan 62aaa90a29
Fix minor EBN issues 2020-03-21 11:22:15 +00: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 ef20244be5 Add support for Minix(Mini Unix) Filesystem
Reviewers: stikonas, cjlcarvalho

Reviewed By: stikonas

Subscribers: cjlcarvalho, #kde_partition_manager

Tags: #kde_partition_manager

Differential Revision: https://phabricator.kde.org/D21652
2019-06-09 00:01:30 +05:30
Andrius Štikonas 559c326be7 Add detection support for Apple File System (APFS). 2019-01-13 17:34:05 +00:00
Andrius Štikonas 708318a5ad Add BitLocker detection support.
CCBUG: 392892
2019-01-13 02:24:18 +00:00
Caio Carvalho 2298d08c41 Adding support for detecting linux_raid_member file system. 2018-07-15 17:38:43 -03:00
Andrius Štikonas 99c14ad074 Correctly report when excutable is not found. 2018-04-16 11:06:13 +03:00
Andrius Štikonas 622def3b56 Convert more enums to scoped enums. 2018-04-09 15:14:34 +01:00
Andrius Štikonas 2e5f0fbcb2 d-pointerize FileSystem class. 2018-04-08 01:46:08 +01:00
Andrius Štikonas 17c8772240 Explicitely specify the scope of enum. 2018-04-07 19:54:30 +01:00
Andrius Štikonas 63cea60ff1 Replace std::array with std::vector
Less efficient but helps with keeping ABI stable
2018-04-05 21:52:17 +01:00
Andrius Štikonas 7ed6657e30 Restore functionality of FileSystem::findExternal
This also fixes unused variable warnings
2018-03-31 23:49:37 +01:00
Andrius Štikonas 738842799a Make kpmcore link libraries private. 2018-03-31 16:30:53 +01:00
Andrius Štikonas 9ea7cab92a Merge branch 'master' into kauth 2018-01-31 15:15:25 +00:00
Andrius Štikonas ba4e443223 Move file system label and UUID read code to backends.
This allows to use different implementations on different platforms.
E.g. libblkid is not available on FreeBSD.

libparted backend still uses the same libblkid implementation
sfdisk backend reads label and UUID from udev database
2018-01-31 15:13:34 +00:00
Andrius Štikonas f20bea9bf8 Merge branch 'sfdisk' into kauth 2017-12-24 23:40:06 +00:00
Andrius Štikonas 5123411f1f Add support for FAT12 file system. 2017-12-24 23:24:37 +00:00
Andrius Štikonas 8de54d390e Make default LUKS2 colour different from LUKS. 2017-12-24 20:38:46 +00:00
Andrius Štikonas 7aa77f489d Add FileSystem::Luks2 child class. 2017-12-14 02:08:32 +00:00
Andrius Štikonas 47429dd1bf Proof of concept attempt to implement KAuth. 2017-12-10 17:36:39 +00:00
Andrius Štikonas 4bf5bb467f Fix conversion to/from QString/QByteArray
BUG: 384321
2017-12-03 12:37:21 +00:00
Andrius Štikonas be7ba11f17 Remove unnecessary semicolons. 2017-11-12 14:55:55 +00:00
Andrius Štikonas d99b3f6eb3 Improve QFileInfo usage.
Cache QFileInfo result in a local variable.
Before repeated request often incorrectly resulted in QString()
2017-09-17 00:39:53 +01:00
Andrius Štikonas f1888f0d1c Change a way untranslated file system name is accessed. 2017-09-15 12:47:01 +01:00
Andrius Štikonas 95a74c63d1 Do not report wrong mountpoint for closed LUKS file systems.
When libparted scans luks partitions it calls detectFileSystem
regardless of whether luks is open or closed. This results in
mapperNode being empty, so we need to prevent detectFileSystem
from reporting anything in this case.
2017-09-14 17:50:21 +01:00
Andrius Štikonas 5d65d83990 Add functions to access untranslated name of file system.
CCBUG: 364648
2017-09-14 14:23:07 +01:00
Andrius Štikonas 50ba46a693 Fix a typo where declarared variable was not used. 2017-09-14 01:27:38 +01:00
Andrius Štikonas 6b4185cff1 Do not crash when partition has no mount points. 2017-09-13 23:28:37 +01:00
Andrius Štikonas 34712dd2ed Add fstab file parser.
Remove dependency on KMountPoint and hence KIO.
2017-09-13 18:46:33 +01:00
Andrius Štikonas 6b6ddbdcef Use int for maxLabelLength. 2017-09-11 16:52:20 +01:00
Andrius Štikonas 5a83e741cb Add support for detecting ISO9660 file systems.
BUG: 364476
2017-09-08 11:42:12 +01:00
Andrius Štikonas 447ae7fc90 Use QValidator to validate label input. 2017-09-05 12:52:34 +01:00
Andrius Štikonas 4a39e453dc Add a function for validating labels. 2017-09-04 17:39:29 +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
Andrius Štikonas 684a1ce073 Add colour for UDF file system. 2017-08-31 10:12:54 +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
Andrius Štikonas ff714f2f0e Fix online label support.
Some filesystems require mountpoint while some deviceNode to change file system
label only. So split writeLabel action into online and offline actions.
2017-04-09 17:49:55 +01:00
Andrius Štikonas e765316f9e Mark LVM PV as mounted if it is part of Volume Group.
* Add support for online LVM PV resize and check actions.
* Fix support for online actions inside LUKS container.
2016-10-30 01:47:29 +01:00
Andrius Štikonas 559fad9803 Show mount point for swap as "none".
This also silences QFileInfo warning from KMountPoint.
2016-10-03 00:14:46 +01:00
Chantara Tith bcd6156628 Reduce code duplication in handling mountPoint/mount/diskSpace. 2016-09-12 17:23:19 +07:00
Andrius Štikonas d83ec394b1 Make Filesystem::create non-const. 2016-09-05 12:10:56 +01:00
Andrius Štikonas b3e82d7c75 Cache LUKS specific variables during initial scan. 2016-09-04 23:32:00 +01:00
Andrius Štikonas ef2c85e60f Silence clang warning + some other small changes.
Fix a typo in a comment
2016-08-24 23:01:36 +01:00