Commit Graph

216 Commits

Author SHA1 Message Date
Andrius Štikonas 4bf5bb467f Fix conversion to/from QString/QByteArray
BUG: 384321
2017-12-03 12:37:21 +00:00
Andrius Štikonas 9ea983654c Do not export symbols of CopySource(Target)Device
Calamares resize jobs was ported to ResizeOperation, so this is no longer
necessary.
2017-11-01 20:11:38 +00:00
Andrius Štikonas 72dfbe480a Replace readSectors/writeSectors backend functions.
New alternatives use QByteArray to store data and use bytes, not sectors.
2017-10-28 18:07:44 +01:00
Andrius Štikonas e4c125c519 Do not over encapsulate Partition methods.
This caused more trouble than helped. There is no reason not to allow
e.g. settings new flags on partition or changing it's path.
2017-10-09 21:13:58 +01:00
Andrius Štikonas d741fe4a00 Fix a typo in a comment. 2017-10-09 17:37:16 +01:00
Andrius Štikonas 2760f02fbf Move LVM device scanning code.
Now it's the backend's responsibility to find LVM devices.
All LVM scanning code was moved into LvmDevice::scanSystemLVM helper,
so that it is very easy to plug LVM into backend.

LVM devices are now intentionally not detected in Dummy Backend.
2017-10-06 03:17:51 +01:00
Andrius Štikonas 15eabf9859 Add some comments about LVM in DeviceScanner. 2017-10-03 21:02:40 +01:00
Adriaan de Groot c4ae5d680c Docs: document Device (a description) and CoreBackendDevice (an operational class) 2017-10-03 05:56:16 -04:00
Andrius Štikonas 098fdee506 fstab fixes:
* Do not output # for empty inline comments.
  * More checks to validate fstab entry.
2017-09-20 21:22:53 +01:00
Andrius Štikonas a3732c1459 Fix a typo. Remove extra trimmed(). 2017-09-17 13:52:48 +01: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 4a64465738 Remove MountEntry class. 2017-09-16 20:56:32 +01:00
Andrius Štikonas 8dd1e70b21 Fix inline comment handling.
CCBUG: 305469
2017-09-16 20:50:57 +01:00
Andrius Štikonas baec157314 Add a function to write fstab file.
CCBUG: 305469
2017-09-16 20:40:46 +01:00
Andrius Štikonas 8719fb0bf3 Add fstab mutators. 2017-09-16 20:16:17 +01:00
Andrius Štikonas 4257021857 Use QStringList to store fstab options. 2017-09-16 19:09:03 +01:00
Andrius Štikonas ec89795326 Allow accessing untranslated partition roles. 2017-09-15 13:09:01 +01:00
Andrius Štikonas dff6086e64 Copy paste typo. 2017-09-15 12:59:10 +01:00
Andrius Štikonas 0d16e945c1 Add a partition role name for LVM logical volume. 2017-09-15 12:50:05 +01:00
Andrius Štikonas f1888f0d1c Change a way untranslated file system name is accessed. 2017-09-15 12:47:01 +01:00
Andrius Štikonas f29534e7c7 Use untranslated file system name when exporting partition table.
CCBUG: 364648
2017-09-14 14:47:00 +01:00
Andrius Štikonas 50ba46a693 Fix a typo where declarared variable was not used. 2017-09-14 01:27:38 +01:00
Andrius Štikonas 268a68a318 Split fstab lines with both spaces and tabs. 2017-09-13 23:05:32 +01:00
Andrius Štikonas 8f7e0beb0f Sort files in CMakeLists.txt alphabetically. 2017-09-13 18:52:43 +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 17e6c32633 Fix more implicit type conversion warnings. 2017-09-11 13:41:03 +01:00
Andrius Štikonas a041090168 Port LvmDevice away from KDiskFreeSpaceInfo. 2017-09-11 12:15:37 +01:00
Andrius Štikonas 8a477e689e Minor clang warnings++ 2017-09-11 12:01:39 +01: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 1889b9e8fa Port unmount code away from KMountPoints (KIO). 2017-09-08 17:58:27 +01:00
Andrius Štikonas 3866bf6fef Only include <linux/fs.h> on GNU/Linux 2017-09-07 21:34:45 +01:00
Andrius Štikonas 0badfebcb1 lvm: disable error channel for vgs/pvs commands.
Having an error channel can result in unwanted devices, e.g.:
"/dev//dev/mapper/test: read failed after 0 of 4096 at 0: Input/output error"
2017-09-04 19:55:08 +01:00
Andrius Štikonas 7dba4b8245 Record sector size in FileSystem class. 2017-09-03 15:37:14 +01:00
Andrius Štikonas d797a47229 QList->QVector. 2017-08-31 10:48:10 +01:00
Andrius Štikonas 756c5b5beb Use QHash instead of QMap for storing LVM LV sizes. 2017-08-31 10:16:16 +01:00
Andrius Štikonas 13c063a150 Fix a possible null pointer dereference.
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
2017-07-04 21:07:54 +01:00
Andrius Štikonas 6b31dd0e85 Remove accidentally commited debug code. 2017-06-14 15:26:02 +02:00
Andrius Štikonas b98dcc90d8 Bump version to 3.1.1. 2017-06-14 00:20:13 +02:00
Andrius Štikonas 9252bc6156 seteuid has to be used instead of setuid.
According to setuid manual, seteuid has to be used to be able to
regain root privileges later.
2017-06-12 22:00:36 +02:00
Andrius Štikonas 63ddb4e472 QList<QString> -> QStringList. 2017-06-12 12:47:17 +02:00
Andrius Štikonas 63b5c8c34c Suspend Plasma removable device automounting.
Before doing operations, we connect to DBus session of the original user
and stop kded module for device automounting.

BUG: 368175
2017-06-07 19:21:59 +02:00
Andrius Štikonas 3228fa081a Use qAsConst in ranged based for loops. 2017-06-04 22:26:24 +01:00
Andrius Štikonas d2ce014589 Use range based for instead of Q_FOREACH.
Bump Qt version requirements to 5.7.0
2017-06-01 11:16:09 +01:00
Andrius Štikonas 5f0d1cd72b Port qSort. 2017-05-03 19:24:20 +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
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