Commit Graph

370 Commits

Author SHA1 Message Date
Teo Mrnjavac a749d1c84d Handle parent change in Partition copy constructor. 2016-12-01 19:00:39 +01:00
Andrius Štikonas 2e960d5c00 Make initLUKS function non-static. 2016-11-30 17:18:51 +00:00
Andrius Štikonas e0afdeb6cb Move sorting comparison function to lambda. 2016-11-19 01:39:10 +00:00
Andrius Štikonas 6926046edb Sort LVM LV volumes alphabetically. 2016-11-19 01:36:15 +00:00
Andrius Štikonas 3c58349561 Make sure KDiskFreeSpaceInfo is never used for swap. 2016-11-15 17:00:59 +00:00
Andrius Štikonas a78e6f986e Disable pasting into LVM VG. It does not yet work. 2016-11-10 14:52:02 +00:00
Andrius Štikonas 0c8035f667 Improve wording in comments a bit. 2016-11-10 14:37:48 +00:00
Andrius Štikonas ee49c05d60 Remove ResizeVolumeGroup operation from operation stack if it has no jobs. 2016-11-07 18:56:26 +00:00
Andrius Štikonas ca0def38f7 Add a comment. 2016-11-07 17:49:30 +00:00
Andrius Štikonas 4ed3ce6267 Check if fileSystem pointer is nullptr before trying to read used space
Hopefully it fixes the following crashes as well:
BUG: 364863
BUG: 365872
2016-11-07 17:45:22 +00:00
Andrius Štikonas f948569fef Pass --force to vgremove in order to allow removing deactivated volume groups. 2016-11-05 21:48:30 +00:00
Andrius Štikonas e3214a1b48 Do not call KDiskFreeSpaceInfo::freeSpaceInfo without a non-empty mount point. 2016-11-05 20:29:31 +00:00
Andrius Štikonas d6c375f959 Update copyrights. 2016-11-04 14:20:11 +00:00
Andrius Štikonas 5d2bb2f8af Store list of physical volumes in a global variable. 2016-11-03 13:26:14 +00:00
Andrius Štikonas 36202cc1ad Replace complicated QPair type with custom LvmPV class. 2016-11-02 23:06:55 +00:00
Andrius Štikonas 724574e436 Fix creation of LVM VGs when LVM PV is encrypted. 2016-10-30 03:24:01 +00:00
Andrius Štikonas 98d0ea309b Fix include header: QDebug->QTextStream. 2016-10-30 02:37:48 +00:00
Andrius Štikonas 3272cd3f5f Do not allow deactivating LUKS containers containing active LVM physical volumes. 2016-10-30 02:31:46 +00:00
Andrius Štikonas 28fa6ac5a4 Add support for GTP partition labels. 2016-09-24 22:15:15 +01:00
Andrius Štikonas 9c7db501bf Use cached values for resizing volume groups. 2016-09-24 21:09:11 +01:00
Andrius Štikonas 23bf7585ed Small typo in a comment. 2016-09-20 22:56:48 +01:00
Andrius Štikonas 5e4b16b7fe Add a context to UI string. 2016-09-18 11:55:35 +01:00
Andrius Štikonas 28478ee0ad More conversion from QStringList to QList<const Partition*>. 2016-09-18 01:53:42 +01:00
Andrius Štikonas c41b008dc1 Remove obsolete note. 2016-09-17 01:23:04 +01:00
Chantara Tith 874900fe72 Move initLUKS from helpers to FS::luks. 2016-09-12 23:49:20 +07:00
Chantara Tith bcd6156628 Reduce code duplication in handling mountPoint/mount/diskSpace. 2016-09-12 17:23:19 +07:00
Andrius Štikonas 123369f78b Store the list of LVM Physical Volumes in operationStack.
This is necessary in order to make LVM LV formatted as LVM PV work.
2016-09-10 22:10:25 +01:00
Teo Mrnjavac 05e6ea82a3 Make copy constructor public. 2016-09-08 18:13:05 +02:00
Andrius Štikonas 70a9a0dd9a More optimizations for LVM. 2016-09-08 01:42:04 +01:00
Teo Mrnjavac 882886c1d4 Copy constructor for PartitionTable. 2016-09-07 17:36:53 +02:00
Teo Mrnjavac 25b8cc0a42 core/smartattribute.h must be included in smartstatus.h for deep copy. 2016-09-07 17:36:20 +02:00
Teo Mrnjavac ea9e079ee8 Add copy constructor to Device. 2016-09-07 17:35:35 +02:00
Andrius Štikonas c480d80273 Make LvmDevice::LVPathList public. 2016-09-05 17:28:54 +01:00
Andrius Štikonas 5e5178b3af Initial work on storing LVM variables during initial scan. 2016-09-05 14:48:36 +01:00
Andrius Štikonas b3e82d7c75 Cache LUKS specific variables during initial scan. 2016-09-04 23:32:00 +01:00
Andrius Štikonas 68539ad97a Remove some comments about data loss.
lvresize --force should not cause data loss when reducing because we reduce file system first.
vgextend --yes is about overwriting number of metadata copies, so it shouldn't cause data loss either.
2016-09-01 22:22:46 +01:00
Andrius Štikonas cd4a6314e7 Simplify QStringList->QString conversion. 2016-09-01 22:05:35 +01:00
Andrius Štikonas 4889a0ef34 Remove some TODO comments. 2016-08-31 20:37:32 +01:00
Andrius Štikonas 56533022cb Simplify if-return code a bit. 2016-08-31 20:14:21 +01:00
Andrius Štikonas a1ebb5205b Round used sectors up in lvm device scanner. 2016-08-29 13:03:26 +01:00
Andrius Štikonas 5ab60c6dfa Enable used space reporting for swap.
BUG: 367473
2016-08-29 12:12:57 +01:00
Anthony Fieroni ac16bd6185 [smart] SSD attribute names
REVIEW: 128710

Signed-off-by: Anthony Fieroni <bvbfan@abv.bg>
2016-08-21 07:44:31 +03:00
Chantara Tith 28dd42839d More documentations. 2016-08-15 17:20:50 +01:00
Andrius Štikonas 3eda1d79c6 Make sure to activate all LVM LVs on start. 2016-08-15 17:20:50 +01:00
Chantara Tith eb3910679c Add all LVM devices to the bottom of the devices list. 2016-08-15 17:20:50 +01:00
Andrius Štikonas 8a3c11774c Make variable names slightly more consistent thruoght kmpcore.
Add more doxygen comments.
2016-08-15 17:20:50 +01:00
Chantara Tith 426a9385cd Remove unused includes. 2016-08-15 17:20:50 +01:00
Chantara Tith 69536b1129 Remove unused parameters from LvmDevice. 2016-08-15 17:20:50 +01:00
Chantara Tith 6fd0c7a0db API changes, Refactor and Raname to a consistant interface. 2016-08-15 17:20:50 +01:00
Andrius Štikonas 40ff0861a8 Convert most of the remaining foreach cases. 2016-08-15 17:20:50 +01:00
Andrius Štikonas 9c524c40fe Fix a compilation error in KPM. 2016-08-15 17:20:50 +01:00
Andrius Štikonas 16a2d063e3 More work on C++11 for loops. 2016-08-15 17:20:50 +01:00
Andrius Štikonas a10c8d3aaa Convert to C++11 for loop where it is safe (avoid detaching Qt objects). 2016-08-15 17:20:50 +01:00
Chantara Tith 25bbce4975 A small dirty hack to keep track of all the PVs that to be added to any VG. 2016-08-15 17:20:50 +01:00
Chantara Tith 6915187fb2 Add activating LVM LV and VG. 2016-08-15 17:20:50 +01:00
Chantara Tith ca2bbb27d7 Add deactivating LVM LV and VG. 2016-08-15 17:20:50 +01:00
Chantara Tith 5befd7484e Decouple VG scan and system scan. 2016-08-15 17:20:50 +01:00
Chantara Tith 77ff25e160 Move LVM deviceNodeList and LvPathList to public. 2016-08-15 17:20:50 +01:00
Chantara Tith 4b7289fa0d Add UUID for LV filesystem. 2016-08-15 17:20:50 +01:00
Chantara Tith 467759d0a9 Set partitionTable Last/First sector setter as public. 2016-08-15 17:20:50 +01:00
Chantara Tith 53b154fe16 Add internal storage to LVM Device to keep track of its LVs and PVs. 2016-08-15 17:20:50 +01:00
Chantara Tith 5447768a76 LUKS static cast here should be sufficient. 2016-08-15 17:20:50 +01:00
Chantara Tith bc0cd8c411 Enable smartStatus for Disk Device only. 2016-08-15 17:20:50 +01:00
Chantara Tith 20c79023c8 Micro optimization. calling one external function instead of two. 2016-08-15 17:20:50 +01:00
Chantara Tith c3c718615d Add LVM snapshotting functionality. 2016-08-15 17:20:50 +01:00
Chantara Tith 484c1765ed Reduce the calls of external functions to speed up scanning time. 2016-08-15 17:20:50 +01:00
Chantara Tith 87e9bf9cb5 House-cleaning, removing finished TODO and FIXME tasks. 2016-08-15 17:20:50 +01:00
Andrius Štikonas 510feefc55 Various small cleanups. 2016-08-15 17:20:50 +01:00
Andrius Štikonas 2a62bc4b14 Fix crashes in LVM scanner when external device is unplugged without deactivating LVM partitions.
This commit removes stderror channel from output of external commands.
2016-08-15 17:20:50 +01:00
Andrius Štikonas 54a78b150d Do not limit number of partitions in Volume Manager Devices. 2016-08-15 17:20:50 +01:00
Andrius Štikonas fd8c81921e Get rid of unused LVM flag for LVM LV. 2016-08-15 17:20:50 +01:00
Chantara Tith 1c7dd64e68 Move LVM scanning logic from DeviceScanner to LvmDevice. 2016-08-15 17:20:50 +01:00
Chantara Tith cbb077ffbd House-cleaning and removing irrelevant TODO. 2016-08-15 17:20:50 +01:00
Chantara Tith 4d78cad920 Deactivate VG before removing it. 2016-08-15 17:20:50 +01:00
Chantara Tith 0952ffb11f Hardcode LUKS payload offset return value in byte size instead of sector number. 2016-08-15 17:20:50 +01:00
Chantara Tith 27290f04f3 Handle LUKS inside LVM. still need to fix incorrect sectorUsed. 2016-08-15 17:20:50 +01:00
Chantara Tith 0feb7a7330 Display preview for LV operation. 2016-08-15 17:20:50 +01:00
Chantara Tith 52ee15f3c0 Rephrashing comment. 2016-08-15 17:20:50 +01:00
Chantara Tith 254ac012af Add functionality to specify PE size when creating VG group. 2016-08-15 17:20:50 +01:00
Chantara Tith bef1085ce7 Fix LVM volume showing incorrect preview when creating new LV. 2016-08-15 17:20:50 +01:00
Chantara Tith 85c7106ab9 Move LvmDevice member variables from 32 bits to 64 bits. 2016-08-15 17:20:50 +01:00
Chantara Tith 042878b66f Add optional destination partitions to LVM movePV. This also helps preventing moving data back and forth when resizing. 2016-08-15 17:20:50 +01:00
Andrius Štikonas 5edebbc32b Fix integer overflow. 2016-08-15 17:20:50 +01:00
Chantara Tith 3d0df854b5 Handle case when the to-be-moved PV is not used. 2016-08-15 17:20:50 +01:00
Chantara Tith 17d3d9305a Refactor functions for getting list of PV and LV. 2016-08-15 17:20:50 +01:00
Chantara Tith c5472f2162 Handle LvmDevice's getField case when VG name is not supplied. 2016-08-15 17:20:50 +01:00
Chantara Tith 0cfc323f84 Add LVM PV move. 2016-08-15 17:20:50 +01:00
Chantara Tith ef7b4003b7 Move LVM removeVG parameter to LvmDevice instead of QString of VG name. 2016-08-15 17:20:50 +01:00
Chantara Tith ad23d6cbce Fix createVG PV list white space problem. 2016-08-15 17:20:50 +01:00
Chantara Tith 167432844e Add removeVG lvmdevice. And, Change createVG to accpeting QStringList instead. 2016-08-15 17:20:50 +01:00
Chantara Tith 32b978074f Add LvmDevice createVG. 2016-08-15 17:20:50 +01:00
Chantara Tith 3c229f8a5a Add freeSetors for partitionTable 2016-08-15 17:20:50 +01:00
Chantara Tith e9ff3c874a Remove else clause 2016-08-15 17:20:50 +01:00
Chantara Tith 818ab34ce9 Move LVM totalPE to 64 bits 2016-08-15 17:20:50 +01:00
Chantara Tith fd3580e62f LVM LV resize Operation 2016-08-15 17:20:50 +01:00
Chantara Tith ff2bf7b022 Fix LV used space. 2016-08-15 17:20:50 +01:00
Chantara Tith 41d6a21bf2 Better LVM operations report 2016-08-15 17:20:50 +01:00
Chantara Tith ab6df5ff86 Move from creating unallocated LVM partitio manually to PartitionTable 2016-08-15 17:20:50 +01:00
Chantara Tith 3b7eda5933 Add LVM operations 2016-08-15 17:20:50 +01:00
Chantara Tith 933ecc9cce Add Label for LVM partition's filesystem 2016-08-15 17:20:50 +01:00
Chantara Tith a07e57cbb5 Add LVM delete partition job 2016-08-15 17:20:50 +01:00
Chantara Tith fedfc0d440 Fix PartitionTable sector representation and used space for LVM partition 2016-08-15 17:20:50 +01:00
Chantara Tith 713c26ded0 Use KMountPoint for LvmDevice's Partition 2016-08-15 17:20:50 +01:00
Chantara Tith 0e54626355 Move scanPartitions to LVM Field 2016-08-15 17:20:50 +01:00
Chantara Tith aeaecad6fb Move from regex to LVM Field options 2016-08-15 17:20:50 +01:00
Chantara Tith 3170e0a6a9 Refactor and add UUID to LvmDevice 2016-08-15 17:20:50 +01:00
Chantara Tith bd892fd2d6 Construct PartitionTable and Partition in LvmDevice 2016-08-15 17:20:50 +01:00
Chantara Tith 103b5343d6 Initial work on LvmDevice 2016-08-15 17:20:50 +01:00
Chantara Tith fcc8a7c992 Initial Device separation 2016-08-15 17:20:50 +01:00
Andrius Štikonas ea99bcc76f Correctly report used space of FAT partitions whose dirty bit is set.
BUG: 366313
2016-08-02 21:41:09 +01:00
Andrius Štikonas e64a82ff19 Use KAuth to get privileges needed for detecting partitions. 2016-07-22 12:00:01 +01:00
Andrius Štikonas 3a2b78e143 Improve semantic markup of translations. 2016-07-17 23:41:00 +01:00
Andrius Štikonas 9d040e6081 Use reverse iterator. 2016-07-08 00:57:16 +01:00
Andrius Štikonas 09711cdf1d Whitespace fixes. 2016-06-01 21:00:31 +01:00
Andrius Štikonas 3d57b3211a Convert remaining signals to the new syntax. 2016-05-24 01:37:15 +01:00
Andrius Štikonas 6e4c330410 Do not run moc on classes where it is not necessary. 2016-05-22 23:53:17 +01:00
Andrius Štikonas f820c8d764 Adjust minimal filesystem size for luks partitions. 2016-05-20 20:13:11 +01:00
Andrius Štikonas 4278172f35 Iterate over operation stack backwards.
BUG: 363216
2016-05-19 16:40:20 +01:00
Andrius Štikonas da550fb534 Fix null pointer dereference. 2016-05-19 01:53:30 +01:00
Andrius Štikonas 6f8a2c7016 Also disable decryption of luks partition if it is copied in the operation stack. 2016-05-18 15:45:00 +01:00
Andrius Štikonas 063c50aec6 Add a method to check whether partition is part of operationStack. 2016-05-18 14:56:13 +01:00
Andrius Štikonas ffa24e4451 Revert "Disable OperationStack merging of operations for luks partitions."
This is no longer necessary now that copying/resizing of new luks partitions is
forbidden.
This reverts commit aec564f1a2.
2016-05-18 13:58:08 +01:00
Andrius Štikonas aec564f1a2 Disable OperationStack merging of operations for luks partitions. 2016-05-18 13:13:51 +01:00
Andrius Štikonas 142ff07938 Remove reduntant virtual keywords. 2016-05-17 18:01:31 +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 7e8cfaf25c Convert QRegExp->QRegularExpression in Partition class. 2016-05-12 16:46:25 +01:00
Andrius Štikonas 1ea4f4976d Revert "Revert "Port away from QRegExp to QRegularExpression.""
This reverts commit c291af2c83.
2016-05-12 16:45:13 +01:00
Andrius Štikonas c291af2c83 Revert "Port away from QRegExp to QRegularExpression."
This reverts commit bb2de6cd56.

This was causing a crash when restoring partitions.
2016-05-11 22:31:33 +01:00
Andrius Štikonas 4fc3f321dd Revert "Better to use deleteLater with QObjects."
This reverts commit 3ec80be2a1.

This was causing a crash when changing filesystem (reformatting).
2016-05-11 22:17:38 +01:00
Andrius Štikonas bb2de6cd56 Port away from QRegExp to QRegularExpression. 2016-05-08 00:22:22 +01:00
Andrius Štikonas 7e7d9e2a9a Use long style command line parameters. 2016-05-06 22:47:56 +01:00
Andrius Štikonas 464b3060fb Remove remaining ../ from #includes. 2016-05-06 22:36:24 +01:00
Andrius Štikonas 0bd44b94dc Use trimmed() instead of simplified(). 2016-05-05 12:46:27 +01:00
Andrius Štikonas ea4b945ebb Add override keyword to virtual functions. 2016-04-27 21:54:02 +01:00
Andrius Štikonas f7e62d93f9 Merge branch 'master' into luks-decorator 2016-04-27 16:34:02 +01:00
Teo Mrnjavac 83787cbdfc Make the parent in Partition a QPointer.
This also reverts commit dc9e9651ac.
2016-04-27 16:58:17 +02:00
Teo Mrnjavac 3ec80be2a1 Better to use deleteLater with QObjects. 2016-04-27 15:36:07 +02:00
Andrius Štikonas 2e7055aa69 Merge branch 'master' into luks-decorator 2016-04-21 23:03:28 +01:00
Teo Mrnjavac 26026b6232 PartitionRole::LUKS is now PartitionRole::Luks. 2016-04-19 16:46:18 +02:00
Andrius Štikonas 58e9876307
Rename qglobal.h to QtGlobal 2016-04-18 17:14:31 +01:00
Teo Mrnjavac b4a57db54d Update copyright and strings. 2016-04-15 15:43:21 +02:00
Teo Mrnjavac 12e7da5b1c Add LUKS role. Both open and closed LUKS "filesystems" should use this. 2016-04-15 15:10:14 +02:00
Teo Mrnjavac 0a8a5887df Bring back LUKS code which was previously merged+reverted.
Revert "Revert merge of branch luks-decorator."
This reverts commit efd3179d95.
Messages:
FS::luks is now a decorator for an actual FS composed inside.
Implement cryptOpen/cryptClose/mount/unmount operations.
detectFileSystem, which only uses blkid, is now in FileSystem.cpp.
FileSystem::mount now requires a mountPoint.
Use umount -A to immediately umount all mount points in unmountCmds.
Add override keywords, TODO: add them everywhere.
LibPartedBackend no longer links against libblkid.
Fix LUKS handling in LibPartedBackend::scanDevicePartitions.
Allow detecting FS::Type by path, and remove libparted workaround.
FS detection now only uses blkid (from util-linux).
2016-03-31 18:43:38 +02:00
Andrius Štikonas ca5bc8000b Merge branch 'more-parted-flags' 2016-03-08 20:48:09 +00:00
Teo Mrnjavac 3c2f383b8e Define underlying type for enums so they can be forward-declared. 2016-03-03 16:03:41 +01:00
Andrius Štikonas 41f9dc36dd Cleanup unused include. 2016-03-03 10:17:41 +01:00
Andrius Štikonas e0c23f443b Update copyright. 2016-03-02 19:00:31 +00:00
Teo Mrnjavac 852c8c8516 Bring partition flags support up to current libparted level.
This doesn't quite support all the types listed by fdisk as described
in bug 359819 since we are limited by what's exposed by libparted, but
it covers the most important ones.
BUG: 359819
2016-03-02 11:43:27 +01:00
Andrius Štikonas a0592de93a Cleanup unused include. 2016-02-29 17:58:25 +00:00
Andrius Štikonas d9f87b1031 Simplify prettyName logic. We already check for empty name in the constructor. 2016-02-25 22:24:46 +00:00
Andrius Štikonas b25d7c19de Make Partition Manager device selector more user friendly:
Show Device name – Capacity (Device node)

BUG:259679
2016-02-22 16:14:50 +00:00
Andrius Štikonas efd3179d95 Revert merge of branch luks-decorator. 2015-09-16 14:18:13 +01:00
Teo Mrnjavac d8494a00a5 FS::luks is now a decorator for an actual FS composed inside.
Implement cryptOpen/cryptClose/mount/unmount operations.
detectFileSystem, which only uses blkid, is now in FileSystem.cpp.
FileSystem::mount now requires a mountPoint.
Use umount -A to immediately umount all mount points in unmountCmds.
Add override keywords, TODO: add them everywhere.
LibPartedBackend no longer links against libblkid.
Fix LUKS handling in LibPartedBackend::scanDevicePartitions.
2015-08-14 17:53:06 +02:00
Teo Mrnjavac ab049467b7 First check, then assert. Also fix check syntax. 2015-07-23 17:52:22 +02:00
Teo Mrnjavac de27f840bf Always use nullptr instead of NULL because it is type-safe. 2015-07-22 15:48:03 +02:00
Teo Mrnjavac df01276a53 config.h is no more. 2015-07-21 12:44:59 +02:00
Teo Mrnjavac 4e6655c356 Parameter intentionally unused, do not warn. 2015-07-20 17:11:40 +02:00
Teo Mrnjavac fda3c2c814 Use PartitionAlignment::sectorAlignment instead of KConfig. 2015-07-15 18:38:41 +02:00
Teo Mrnjavac f343f4c3b2 Make sectorAlignment a static setting in PartitionAlignment.
Also yank out cylinder alignment from sectorAlignment.
2015-07-15 18:37:30 +02:00
Teo Mrnjavac 0a4ac3065b By default we never align to cylinder boundaries because it's not 1987. 2015-07-14 18:41:44 +02:00
Andrius Štikonas 626f560e52 Format kpmcore code using KDE style. 2015-07-13 17:16:36 +03:00
Teo Mrnjavac fd8603f70c Do not use KConfig for the shred action. 2015-07-13 16:03:49 +02:00
Teo Mrnjavac eb1879774f Export Copy{Source,Target}Device classes. 2015-07-13 16:03:49 +02:00
Teo Mrnjavac 7fa51ae067 Make it possible to set partition sectors from the outside world 2015-07-13 16:03:49 +02:00
Teo Mrnjavac 3da87feba1 Make Device::setPartitionTable() public 2015-07-13 16:03:49 +02:00
Teo Mrnjavac 3bbce2865f Revert "Format kpmcore code using KDE style."
This reverts commit 21b569e499.
2015-07-13 16:03:36 +02:00
Andrius Štikonas 21b569e499 Format kpmcore code using KDE style. 2015-07-13 17:02:13 +03:00
Teo Mrnjavac b5a2403e57 Add core/copy*.h to installed headers list. 2015-07-02 14:20:03 +02:00
Andrius Štikonas 1ef6fa8131 Move kpmcore library into its own repository. 2015-06-04 01:29:22 +01:00