Commit Graph

68 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 622def3b56 Convert more enums to scoped enums. 2018-04-09 15:14:34 +01:00
Andrius Štikonas 17c8772240 Explicitely specify the scope of enum. 2018-04-07 19:54:30 +01:00
Andrius Štikonas 738842799a Make kpmcore link libraries private. 2018-03-31 16:30:53 +01:00
Andrius Štikonas 8b9451c8d7 We don't need keyLocation for luks1 file system it is always dm-crypt. 2017-12-29 22:53:02 +00:00
Andrius Štikonas 4773f49edc Initial support for resizing LUKS2 volumes.
Does not yet work when LUKS2 is used with dm-integrity.
2017-12-29 20:01:06 +00:00
Andrius Štikonas 7aa77f489d Add FileSystem::Luks2 child class. 2017-12-14 02:08:32 +00:00
Andrius Štikonas 8afe33a4a4 Allow setting label for inner LUKS file system during the initial creation. 2017-12-03 16:28:16 +00:00
Andrius Štikonas 5433294a5b Fix more minor clang issues. 2017-09-11 00:29:30 +01:00
Andrius Štikonas f7e5f7c7bf Rename KPMcore include guards.
clang in -Weverything mode does not like double underscore.
2017-09-10 20:12:52 +01:00
Andrius Štikonas 7dba4b8245 Record sector size in FileSystem class. 2017-09-03 15:37:14 +01:00
Andrius Štikonas 901d01185f Do not set LUKS logical sector size to 512.
This breaks used space reporting for LUKS encrypted LVM LV.
2017-01-25 18:21:25 +01:00
Andrius Štikonas cbe21e7ef9 Fix online resize of encrypted volumes. 2016-12-06 21:42:44 +00:00
Andrius Štikonas 2e960d5c00 Make initLUKS function non-static. 2016-11-30 17:18:51 +00:00
Teo Mrnjavac 5e40017238 Add FS::luks::outerUuid(). 2016-11-30 16:42:03 +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 5592c05ef3 Mark luks sector size to be constexpr. 2016-09-12 19:43:58 +01:00
Chantara Tith 874900fe72 Move initLUKS from helpers to FS::luks. 2016-09-12 23:49:20 +07:00
Andrius Štikonas d197b9b06e Optimize LUKS scanning. 2016-09-06 18:21:17 +01:00
Andrius Štikonas 5e5178b3af Initial work on storing LVM variables during initial scan. 2016-09-05 14:48:36 +01: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 7e8ee77edf Make luks helper functions non-static. 2016-05-20 19:38:12 +01:00
Andrius Štikonas 12bc2329a2 Used space is larger for luks volumes due to payload. 2016-05-20 19:17:52 +01:00
Andrius Štikonas fdfc47cf8f Leave LUKS cmdSupport variables static for now. 2016-05-18 17:39:28 +01:00
Andrius Štikonas 7914e0aa98 Improve luks::supportCopy and luks::supportSetLabel. 2016-05-18 02:04:33 +01:00
Andrius Štikonas ecbbdb3b1d Do not allow moving open luks volumes. 2016-05-18 00:46:08 +01:00
Andrius Štikonas a610e24686 Move luks init code to constructor. 2016-05-17 19:05:17 +01:00
Andrius Štikonas 142ff07938 Remove reduntant virtual keywords. 2016-05-17 18:01:31 +01:00
Andrius Štikonas 094042cc75 Fix luks operations. 2016-05-17 17:38:17 +01:00
Andrius Štikonas 5d28790152 Simplify Luks support tool (and do not init Luks filesystem). 2016-05-17 17:35:49 +01:00
Andrius Štikonas 927a6421fe Make FileSystem::init virtual instead of static. 2016-05-17 16:33:52 +01:00
Chantara Tith b653b5b6e3 move mount logic from Partition to FileSystem 2016-05-13 23:00:27 +01:00
Chantara Tith 2a12571d44 move unmount logic from Partition to FileSystem 2016-05-13 23:00:27 +01:00
Andrius Štikonas 513bbdac4c Convert FS::luks static cmdSupport members to non-static. 2016-05-11 18:01:21 +01:00
Andrius Štikonas 464b3060fb Remove remaining ../ from #includes. 2016-05-06 22:36:24 +01:00
Teo Mrnjavac d584c70696 Passphrase accessor. 2016-05-06 16:50:23 +02:00
Teo Mrnjavac 6013b5887c Always use outer UUID for mapper name. 2016-05-05 14:15:57 +02:00
Andrius Štikonas 91c36c3d20 Adjust minCapacity for btrfs and luks. After all, it seems 40 MiB doesn't work. 2016-04-29 17:09:41 +01:00
Andrius Štikonas e2f21360bb Add support for reading used capacity of innerFS.
Also make sure labels, used capacity and UUID are properly updated when
opening or closing luks volumes."
2016-04-29 14:27:01 +01:00
Andrius Štikonas 85aca763a2 Pass a pointer to the parent widget to decrypt dialog. 2016-04-29 12:36:24 +01:00
Andrius Štikonas 25e28a0e16 Only enable deactivation of LUKS volume if cryptsetup is found. 2016-04-28 21:56:03 +01:00
Andrius Štikonas ea4b945ebb Add override keyword to virtual functions. 2016-04-27 21:54:02 +01:00
Andrius Štikonas 26047b35ef Fix copy-paste typo. 2016-04-27 00:10:28 +01:00
Andrius Štikonas d87ac7dc20 Add support for checking innerFS. 2016-04-26 13:26:40 +01:00
Teo Mrnjavac d5438ba007 Make LUKS grow/shrink support depend on open/closed state and inner FS. 2016-04-26 13:36:07 +02:00