Commit Graph

1162 Commits

Author SHA1 Message Date
Andrius Štikonas 32d146eed3 externalcommandhelper: Make copy direction an enum. 2020-11-26 23:26:31 +00:00
Andrius Štikonas d16d9e8019 Do not reuse QProcess object in externalcommandhelper for different invocations. 2020-11-26 22:05:25 +00:00
Andrius Štikonas fae9f83451 Fix division by zero. 2020-11-26 21:58:24 +00:00
Andrius Štikonas 4d3fcb7691 Merge branch 'release/20.12' 2020-11-17 11:25:44 +00:00
Friedrich W. H. Kossebau 6e8424bed6 Clean up include dirs
Move include of BLKID_INCLUDE_DIRS into scope it is used.
UUID_INCLUDE_DIRS is unused, left over from before partitionmanager
switched away from libuuid in 26e7f9d7ef306d61380e1c8965feb83bb6b07d18 .
Explicit Qt5Core_INCLUDE_DIRS no longer needed.
src/ is automatically available for kpmcore target, also exposed in
its build link interface.
2020-11-16 20:56:57 +00:00
Friedrich W. H. Kossebau 5413e696d3 Generate libpartitionmanagerexport.h 2020-11-16 20:56:57 +00:00
Andrius Štikonas 9d4ab0e6fd Merge branch 'release/20.12' 2020-11-16 16:18:14 +00:00
Friedrich W. H. Kossebau 07e5a3ac28 Make plugins compatible to latest KPluginFactory code
That one uses std::is_constructible<impl, QObject *, const QVariantList &>
which will fail for our current plugin constructors due to being private
and with only friend class KPluginFactory.
2020-11-16 17:14:52 +01:00
Andrius Štikonas 26acd7c10d Remove extra semicolon. 2020-11-14 01:09:23 +00:00
Andrius Štikonas 70d4819aae Merge branch 'release/20.12' 2020-11-14 01:04:31 +00:00
Andrius Štikonas 2e91730f7a Fix parsing fstab mountpoints when they contain spaces or tabs.
If the name of the mount point contains spaces or tabs these
can be escaped as `\040' and '\011' respectively.

BUG: 428932
2020-11-14 00:55:29 +00:00
Andrius Štikonas 2382b9e1c5 Rename d pointer to d_ptr to disambiguate from Device d. 2020-11-12 01:04:47 +00:00
Gaël PORTAY 82566e63e7 d-pointerize NewOperation class. 2020-11-11 16:41:14 -05:00
l10n daemon script 495b1d7c45 GIT_SILENT made messages (after extraction) 2020-11-07 02:39:27 +01:00
l10n daemon script 6f89a9886b GIT_SILENT made messages (after extraction) 2020-11-05 02:41:29 +01:00
l10n daemon script a42fbfa5e4 GIT_SILENT made messages (after extraction) 2020-11-01 02:40:41 +01:00
l10n daemon script 5b8b8d2228 GIT_SILENT made messages (after extraction) 2020-10-29 02:50:01 +01:00
Andrius Štikonas 3448815596 kpmcore does not ship .ui or .rc files. 2020-10-28 11:12:27 +00:00
l10n daemon script b59f34aeb5 GIT_SILENT made messages (after extraction) 2020-10-28 02:43:18 +01:00
Andrius Štikonas 2c8d081357 reuse: Add SPDX info to src/util/org.kde.kpmcore.externalcommand.policy. 2020-10-27 12:20:34 +00:00
l10n daemon script 14777483a1 GIT_SILENT made messages (after extraction) 2020-10-27 02:40:51 +01:00
Andrius Štikonas 68fdf2fcf2 Use XmlMessages.sh for translations of polkit policy files. 2020-10-25 23:45:28 +00:00
Andrius Štikonas 19f78ef76a Port away from qAsConst. 2020-10-24 22:01:45 +01:00
Andrius Štikonas 0c37cc54a6 Remove unnecessary semicolon (-Wpedantic). 2020-10-24 16:29:09 +01:00
Andrius Štikonas ec3479f302 Add overrides to destructors. 2020-10-24 01:33:52 +01:00
Andrius Štikonas 85396708f4 Use Qt::SplitBehavior
Old version QString::SplitBehavious is now deprecated.
2020-10-13 01:23:29 +01:00
Andrius Štikonas d3ebabb6cb Move find_package to top level CMakeLists.txt. 2020-10-13 00:10:03 +01:00
Andrius Štikonas cf5ff51832 Remove unused applicationinterface DBus interface. 2020-10-12 21:49:07 +01:00
Andrius Štikonas e085ba9ed9 Do not link to KAuth. But there is still a build time dependency on kauth-policy-gen. 2020-10-12 20:23:37 +01:00
Andrius Štikonas 6cff70567b Fix signals between helper and client. 2020-10-12 20:23:37 +01:00
Andrius Štikonas cd4d9b1985 Rename helper interfaces. 2020-10-12 20:23:37 +01:00
Andrius Štikonas a2ee82e021 Simplify createFile function, it was checking for authorization twice. 2020-10-12 20:23:37 +01:00
Andrius Štikonas 2dff59260c Remove exit call from the helper. It is no longer used.
BUG: 412887
2020-10-12 20:23:04 +01:00
Andrius Štikonas 89bd4eb6c7 Store successful polkit authentication requests.
We need this to avoid multiple authentication requests when applying
long operations.

Otherwise, the user will have to authenticate after each job,
which can mean up to 4 password dialogs for some longer operations.
2020-10-12 20:22:48 +01:00
Andrius Štikonas 424c8f0bf0 Update comment describing kpmcore_externalcommandhelper. 2020-10-12 20:18:55 +01:00
David Edmundson f646b507ae Fix a crash. 2020-10-12 20:18:55 +01:00
Andrius Štikonas 296f281ffb WIP: cleanup polkit port: licenses, dead code and kauth removal, add TODO about signals. 2020-10-12 20:18:55 +01:00
David Edmundson edfabb90dc WIP: port to polkit 2020-10-12 20:18:55 +01:00
Adriaan de Groot 08c1acb6b4 Missing include (clang/FreeBSD triggers this) 2020-10-10 21:59:57 +02:00
Andrius Štikonas 7ecdaf3ac8 Fix resizing of fat partitions.
Workaround a bug in fatresize (or libparted) where resizing to
partition length failed. Instead try to resize to length - 1.

BUG: 407834
2020-10-04 22:21:58 +01:00
Andrius Štikonas 4819eec59b Allow moving partitions with unknown file system.
BUG: 404398
2020-10-04 21:18:08 +01:00
Andrius Štikonas 924830ebbd When falling back to blkid for filesystem type detection, distinguish between FAT16/32.
CCBUG: 418253
2020-10-04 18:34:00 +01:00
Andrius Štikonas d396e56694 Add support for importing "PartitionTable" of whole device filesystems. 2020-10-04 15:20:58 +01:00
Andrius Štikonas 034311a7cc Add support for whole disk file systems.
BUG: 400652
2020-10-03 15:14:51 +01:00
Andrius Štikonas 0910875137 Do not delete partitions when we have no partition table. 2020-10-03 14:15:10 +01:00
Andrius Štikonas 9ca3a5740a Add information about PartitionTable::TableType::none. 2020-10-03 14:03:59 +01:00
Andrius Štikonas 779cc6cfb7 Split scanPartition function from scanDevicePartitions. 2020-10-03 13:25:05 +01:00
Andrius Štikonas de346177b5 Do not allow moving partitions without partition table. 2020-10-03 12:41:18 +01:00
Andrius Štikonas 81f8939cb1 Add a new type of partition table "none".
This would be useful for block devices without partition table.
2020-10-03 12:39:26 +01:00
Andrius Štikonas 26b352180b Reword a comment. 2020-10-03 12:38:40 +01:00
Andrius Štikonas 30bd4d62a9 Add blkid fallback for file system detection if udev method fails. 2020-10-02 23:12:33 +01:00
Andrius Štikonas ae05c031b7 Further splitting of detectFileSystem function. 2020-10-02 23:00:40 +01:00
Andrius Štikonas ba05f99720 Split detectFileSystem function in sfdiskbackend into two smaller functions. 2020-10-02 22:37:51 +01:00
Andrius Štikonas b97fd0eeaa rename jsonCommand variable to sfdiskJsonCommand. 2020-10-02 17:35:23 +01: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 be4d032f8b REUSE: SPDX style license headers for src/plugins. 2020-09-30 23:58:54 +01:00
Andrius Štikonas 8b10771327 REUSE: SPDX style license headers for src/ops. 2020-09-30 23:28:47 +01:00
Andrius Štikonas f7eb6eec5d REUSE: SPDX license headers for src/jobs. 2020-09-29 23:55:11 +01:00
Andrius Štikonas b592dd1a74 REUSE: SPDX license headers for src/gui. 2020-09-29 00:01:24 +01:00
Andrius Štikonas 8534265421 REUSE: SPDX headers for src/fs/*. 2020-09-28 00:51:18 +01:00
Andrius Štikonas 11bb5799ec REUSE: SPDX license headers for backend and core folders. 2020-09-20 20:33:16 +01:00
Andrius Štikonas 51996bd3fa Switch Messages.sh license to MIT. 2020-09-18 11:45:35 +01:00
Andrius Štikonas fc826690b9 SPDX licenses for tests and CMakeLists.txt. 2020-09-17 02:15:16 +01:00
Andrius Štikonas c5c21849b9 Compile kpmcore with QT_NO_KEYWORDS. 2020-09-15 02:36:46 +01:00
Andrius Štikonas fbe54e21f3 Merge branch 'fstab' 2020-09-15 01:09:38 +01:00
Andrius Štikonas ba46ea64ba defaults option in fstab is not necessary, e.g. defaults,ro is the same as defaults. 2020-09-14 02:25:36 +01:00
Andrius Štikonas a928c62a7d Make fstab parsing slightly more readable. 2020-09-14 02:19:14 +01:00
Andrius Štikonas 1d195b00da Prettier formatting of fstab file. 2020-09-14 02:15:20 +01:00
Andrius Štikonas 1782a9d4bb Port away from deprecated QTime::elapsed. 2020-09-13 17:25:51 +01:00
Andrius Štikonas 2ed9953694 Simplify some External Command functions. 2020-09-11 20:27:24 +01:00
Andrius Štikonas 5b80c6045c Fix fstab editing functionality.
In the old code QByteArray fstabContents was actually empty.
Also, writeData function was opening file in append mode,
thus nothing was actually written.

Split writeData function into two:
  * one for block devices
  * another for writing fstab file

BUG: 417205
2020-09-10 23:54:23 +01:00
Adriaan de Groot 45bd205e79 Typofix: the function was half-renamed before the merge 2020-09-01 13:44:22 +02:00
Andrius Štikonas 997e8df183 Add a note about json fixes in util-linux 2.37 2020-08-28 22:41:43 +01:00
Adriaan de Groot 6aa9d93728 Workaround bad JSON output from sfdisk.
The output of `sfdisk --json /dev/sdb` is not necessarily
valid JSON. Then, no partition information is stored,
no first-valid-lba in particular. This leads to new partitions
being made from sector 0, which is invalid on a GPT table.

The workaround is to manually fix the known-broken JSON
from sfdisk. This is amply documented in a standalone
static function.

FIXES #425097
2020-08-24 22:53:54 +02:00
l10n daemon script 394859444f SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2020-07-26 05:51:19 +02:00
l10n daemon script 73a1deb092 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2020-07-25 05:37:40 +02:00
Andrius Štikonas dc604c4d31 sfdisk: simplify scanDevice by moving out partition setup logic. 2020-06-19 01:52:16 +01:00
l10n daemon script ffb7147f01 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2020-06-18 05:48:51 +02:00
l10n daemon script 1843a99895 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2020-06-17 14:16:14 +02:00
Gaël PORTAY 6f4b883130 sfdisk: Move GPT Attributes functions to new sfdiskgptattributes
This centralizes the two get functions related to GPT Attributes.
2020-06-16 20:15:56 -04:00
Gaël PORTAY 547fa609fe sfdisk: Read GPT type and attributes at scanning
The GPT type and attributes can be set since the commits 0529ebf (Add
support for setting the specific GPT type) and 0ffec31 (Add new job to
set the GPT partition attributes).

But these two data from existing partitions are not read and are missing
though.

This reads the GPT type and attributes data at scanning from the json
output, after the GPT name/label and uuid are read.
2020-06-16 15:45:53 -04:00
Gaël PORTAY 0ffec31e2b Add new job to set the GPT partition attributes
The GPT partition layout supports partition attributes.

The CLI sfdisk sets the partition attributes using the option
--part-attrs. See the examples below:

	$ cat <<EOF | sfdisk disk.img
	label: gpt
	type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, size=64M
	type=0FC63DAF-8483-4772-8E79-3D69D8477DE4
	EOF
	(...)

	$ sfdisk --part-attrs disk.img 1 RequiredPartition,NoBlockIOProtocol,LegacyBIOSBootable,48
	(...)

	$ sfdisk --part-attrs disk.img 2 60,61,62,63
	(...)

	$ sfdisk --dump disk.img
	(...)
	disk.img1 : start=        2048, size=      131072, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, uuid=BBE806BB-8567-A843-9FF5-9B6B35D2908E, attrs="RequiredPartition NoBlockIOProtocol LegacyBIOSBootable GUID:48"
	disk.img2 : start=      133120, size=     1963999, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=7DB39F08-C138-664B-B38E-ED2DEB549AA6, attrs="GUID:60,61,62,63"

This commit introduces the new job set-partition-attributes that is used
in the new-operation to set the attributes of the partition. The job
uses the newly introduced method setPartitionAttributes that is
implemented by the sfdisk and dummy backends.

Note: This is a copypaste of what was done for GPT partition label in
commit f585f6c (Add new job to set the GPT partition label) and GPT
partition UUID in commit 1dde035 (Add new job to set the GPT partition
UUID).

Note: RequiredPartition, NoBlockIOProtocol, LegacyBIOSBootable are
key words for 0, 1 and 2.
2020-06-15 17:51:42 -04:00
Gaël PORTAY e12f0ec391 Store the generated partitition UUID after creation
The GPT UUID are generated by the backends automatically once a
partition is created.

This reads the UUID that was generated after the creation of a partition
and stores it back to the object Partition.
2020-05-15 12:13:41 -04:00
Gaël PORTAY 1dde035705 Add new job to set the GPT partition UUID
The GPT partition layout supports unique GUID partitions.

The CLI sfdisk sets the partition UUID using the option --part-uuid.
See the examples below:

	$ cat <<EOF | sfdisk disk.img
	label: gpt
	type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, size=64M
	type=0FC63DAF-8483-4772-8E79-3D69D8477DE4
	EOF
	(...)

	$ sfdisk --dump disk.img
	(...)
	disk.img1 : start=        2048, size=      131072, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, uuid=BBE806BB-8567-A843-9FF5-9B6B35D2908E
	disk.img2 : start=      133120, size=     1963999, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=7DB39F08-C138-664B-B38E-ED2DEB549AA6

	$ sfdisk --part-uuid disk.img 1 00000000^C000-0000-0000-000000000000
	(...)

	$ sfdisk --part-uuid disk.img 2 11111111-1111-1111-1111-111111111111
	(...)

	$ sfdisk --dump disk.img
	(...)
	disk.img1 : start=        2048, size=      131072, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, uuid=00000000-0000-0000-0000-000000000000
	disk.img2 : start=      133120, size=     1963999, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=11111111-1111-1111-1111-111111111111

This commit introduces the new job set-partition-uuid that is used in
the new-operation to set the UUID of the partition. The job uses the
newly introduced method setPartitionUUID that is implemented by the
sfdisk and dummy backends.

Note: This is a copypaste of what was done for GTP partition label in
commit f585f6c (Add new job to set the GPT partition label).
2020-05-15 12:13:17 -04:00
Gaël PORTAY e9992714a1 Fix typos 2020-05-15 11:39:55 -04:00
l10n daemon script 3c6ee043f6 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2020-05-09 06:34:55 +02:00
Adriaan de Groot 1d9b1161d4 On non-Linux, findBlkIdDevice() has unused parameters
Summary: Add Q_UNUSED() to mark the unused parameters

Test Plan: Builds with fewer warnings on FreeBSD

Differential Revision: https://phabricator.kde.org/D24155
2020-05-08 16:18:14 +02:00
Andrius Štikonas cacdb7b634 Fix some issues spotted by David Faure.
In particular, add a check for partition capacity to be positive.
2020-05-08 15:10:56 +01:00
l10n daemon script a2a9bb8301 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2020-04-04 06:23:31 +02:00
Andrius Štikonas d6b2584d1b Merge branch 'partition-name' into 'master'
Add support for setting the GPT partition name.

See merge request kde/kpmcore!4
2020-03-28 00:42:09 +00:00
l10n daemon script a4379583b3 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2020-03-27 06:21:07 +01:00
Gaël PORTAY f585f6c3ad Add new job to set the GPT partition label
The GPT partition layout supports naming partitions.

The support for the partition label was added in the backend libparted
since commit 28fa6ac (Add support for GTP partition labels).

The libparted was removed later by commit 8fa1814 (Remove libparted
backend) and no backend sets the partition label.

The CLI sfdisk sets the partition label using the option --part-label.
See the examples below:

	$ cat <<EOF | sfdisk disk.img
	label: gpt
	type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, size=64M
	type=0FC63DAF-8483-4772-8E79-3D69D8477DE4
	EOF
	(...)

	$ sfdisk --part-label disk.img 1 efi
	(...)

	$ sfdisk --part-label disk.img 2 rootfs
	(...)

	$ sfdisk --dump disk.img
	(...)
	disk.img1 : start=        2048, size=      131072, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, uuid=D08E5B2A-4649-9F4A-AEA3-6C3048888EAA, name="efi"
	disk.img2 : start=      133120, size=     1963999, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=0BEEFE82-19EA-DC4C-BB6A-27B6DA0C3BD2, name="rootfs"

This commit introduces the new job set-partition-label that is used in
the new-operation to set the label of the partition. The job uses the
newly introduced method setPartitionLabel that is implemented by the
sfdisk and dummy backends.
2020-03-25 11:20:01 -04:00
l10n daemon script 52c29aaf10 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2020-03-25 06:42:28 +01:00
Andrius Štikonas 6921398ba3 Merge branch 'gportay/kpmcore-partition-type' 2020-03-22 01:49:35 +00: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
Gaël PORTAY 0529ebfb01 Add support for setting the specific GPT type
The GPT partition layout defines the type of the partition using a
UUID[1]. The type of the partition is not related to the underlying
filesystem but to its functionality: rootfs, home, var, swap, esp...

The UUID 4f68bce3-e8cd-4db1-96e7-fbcaf984b709 defines the root partition
(/), the UUID 933ac7e1-2eb4-4f13-b844-0e14e2aef915 defines the home
partition (/home), the UUID 4d21b016-b534-45c2-a9fb-5c16e091fd2d defines
the variable partition (/var)... Also, the UUIDs may vary depending on
the architecture (x86, x86_64, arm or aarch64).

KPMcore guesses the type depending on the underlying filesystem.

This commit enables the setting of a more specific GPT type if it is
specified through the method Partition::setType(). It falls back to the
previous guess type if the type is left unset.

[1]: https://systemd.io/DISCOVERABLE_PARTITIONS/
2020-03-20 22:15:50 -04:00
l10n daemon script 59269f63df SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2020-03-11 06:00:21 +01:00
Andrius Štikonas efb970ba11 Add a missing features.h include. 2020-02-08 22:01:24 +00:00
l10n daemon script b7306d2d19 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2020-02-07 05:43:45 +01: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
l10n daemon script 50697be784 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2019-12-08 05:22:07 +01:00
Andrius Štikonas dfce039421 Only trigger udev events for block device subsystem.
Triggerring other subsystems is not necessary and occasionally
results in triggering unrelated bugs.

BUG: 413973
2019-12-02 22:01:10 +00:00
Yuri Chornoivan ca2180f526 Fix minor typo 2019-11-22 15:45:18 +02:00
Yuri Chornoivan 1a7b673792 Fix minor issues found by EBN 2019-11-22 15:45:12 +02:00
Yuri Chornoivan 2980b21b8d Update references 2019-11-22 15:45:04 +02:00
Andrius Štikonas bb7bf3ca03 Make FileSystemFactory::init reentrant.
BUG: 413927
2019-11-18 22:45:58 +02:00
Andrius Štikonas 2c7b3f2bfa Fix resizing of encrypted partitions.
BUG: 413883
2019-11-18 21:16:05 +02:00
Andrius Štikonas 13beb99319 Use partx instead of blockdev to update partition table in the kernel.
CCBUG: 413883
2019-11-18 20:42:36 +02:00
l10n daemon script c4c6ca18ba SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2019-11-12 05:31:35 +01:00
Andrius Štikonas 1c771436d4 Merge branch '4.0' 2019-11-07 22:13:39 +00:00
l10n daemon script 5eae2e1625 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2019-11-04 05:16:18 +01:00
Andrius Štikonas 59c9ba2f8d Set MBR partition type of FAT32 partitions to 0x0c.
BUG: 412959
2019-10-15 21:37:58 +01:00
Andrius Štikonas 40b65438f0 Do not align partitions if they are mounted.
Moving data when partitions are mounted is almost guaranteed to cause data loss.

BUG: 412575
2019-10-05 12:08:20 +01:00
Caio Jordão Carvalho d062cf50fb Including Caio's middle name in aboutData 2019-10-05 12:07:46 +01:00
Andrius Štikonas df235a7751 Make S.M.A.R.T. disk temperature label show only integers.
BUG: 411226
2019-10-05 12:07:28 +01:00
Shubham Jangra a264a28237 Reduce temperature's precision from six decimal places to two
Summary: BUG: 411226

Test Plan: I couldn't test it since my device does not support SMART

Reviewers: stikonas

Reviewed By: stikonas

Subscribers: #kde_partition_manager

Tags: #kde_partition_manager

Differential Revision: https://phabricator.kde.org/D23572
2019-10-05 12:07:20 +01:00
Andrius Štikonas 6f17476b75 Run udevadm settle once more after udevadm trigger.
CCBUG: 412204
2019-10-05 12:03:35 +01:00
Andrius Štikonas 0b5e5040eb Do not align partitions if they are mounted.
Moving data when partitions are mounted is almost guaranteed to cause data loss.

BUG: 412575
2019-10-05 11:52:59 +01:00
Andrius Štikonas 76ca72eccd Revert "Create a timer to wait for system to free resources"
This reverts commit 2627d476f4.
2019-09-26 23:47:34 +01:00
Andrius Štikonas 467ea50aeb Run udevadm settle once more after udevadm trigger.
CCBUG: 412204
2019-09-25 22:33:35 +01:00
Caio Jordão Carvalho 35dabdeb1c Including Caio's middle name in aboutData 2019-09-17 23:59:06 +00:00
Andrius Štikonas 4b0261230d Make S.M.A.R.T. disk temperature label show only integers.
BUG: 411226
2019-09-07 11:51:05 +01:00
Shubham Jangra 78f29ae8b5 Reduce temperature's precision from six decimal places to two
Summary: BUG: 411226

Test Plan: I couldn't test it since my device does not support SMART

Reviewers: stikonas

Reviewed By: stikonas

Subscribers: #kde_partition_manager

Tags: #kde_partition_manager

Differential Revision: https://phabricator.kde.org/D23572
2019-09-01 23:11:43 +05:30
l10n daemon script 60bba03afa SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2019-08-07 05:01:03 +02:00
l10n daemon script f40762a220 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2019-07-27 05:10:32 +02:00
l10n daemon script a97162fb04 SVN_SILENT made messages (.desktop file) - always resolve ours
In case of conflict in i18n, keep the version of the branch "ours"
To resolve a particular conflict, "git checkout --ours path/to/file.desktop"
2019-07-12 05:13:22 +02:00
Shubham Jangra 6ea88cc737 Add QString include 2019-06-12 22:18:08 +05:30
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
Shubham Jangra 2627d476f4 Create a timer to wait for system to free resources
Reviewers: stikonas

Reviewed By: stikonas

Differential Revision: https://phabricator.kde.org/D21696
2019-06-09 22:41:13 +05:30
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
Shubham Jangra 6f7cea6b27 Quit application if bus is not connected, interface not registered
Reviewers: stikonas, cjlcarvalho

Reviewed By: stikonas

Subscribers: #kde_partition_manager

Tags: #kde_partition_manager

Differential Revision: https://phabricator.kde.org/D21616
2019-06-08 15:43:24 +05:30
Andrius Štikonas ba48851d34 Merge branch '4.0' 2019-06-07 19:12:07 +01:00
Shubham Jangra 67795a08ab Fix uninitialized variable warning 2019-06-07 09:39:29 +05:30
Harald Sitter 9b45e25f81 manually quit kauth's mainloop
Summary:
kauth helpers have a qcoreapplication started which auto-terminates after
10 seconds of idle time. this would be an added time out on top of our
life time management that is not necessary. to prevent this additional
delay simply quit the qapplication directly.

this makes helper termination almost instantaneous even when the dbus
client disappears due to crash or SIGINT, and largely removes the
need to call stopHelper altogether.

BUG: 408245

Test Plan:
both partitionmanager and calamares instantly quit the helper no matter how the client process gets terminated

other than that everything seems to work as before

Reviewers: stikonas

Differential Revision: https://phabricator.kde.org/D21559
2019-06-05 18:34:35 +01:00
Andrius Štikonas 6a3b1e02b6 smart: obtain disk size in blocks.
Also drop pre 7.0 support as any earlier version was not supported.
2019-06-05 18:32:11 +01:00
Harald Sitter 5413150c67 manually quit kauth's mainloop
Summary:
kauth helpers have a qcoreapplication started which auto-terminates after
10 seconds of idle time. this would be an added time out on top of our
life time management that is not necessary. to prevent this additional
delay simply quit the qapplication directly.

this makes helper termination almost instantaneous even when the dbus
client disappears due to crash or SIGINT, and largely removes the
need to call stopHelper altogether.

BUG: 408245

Test Plan:
both partitionmanager and calamares instantly quit the helper no matter how the client process gets terminated

other than that everything seems to work as before

Reviewers: stikonas

Differential Revision: https://phabricator.kde.org/D21559
2019-06-03 15:08:10 +02:00
Shubham Jangra f481109417 Do not move further if system bus is not connected
Reviewers: stikonas, cjlcarvalho

Reviewed By: stikonas

Differential Revision: https://phabricator.kde.org/D21506
2019-05-30 23:27:50 +05:30
Shubham Jangra 68cf1efd6b Notify user when they enter non whitelisted command
Reviewers: stikonas, cjlcarvalho

Reviewed By: stikonas

Subscribers: #kde_partition_manager

Tags: #kde_partition_manager

Differential Revision: https://phabricator.kde.org/D21504
2019-05-30 23:27:04 +05:30
Shubham Jangra 3184cbcee3 Remove extra semicolon 2019-05-30 22:47:17 +05:30
Valerii Malov 9565ef61ab Add support for smartmontools 7.0 user_capacity json output
Summary:
smartmontools 7.0 reports user capacity as an object that contains bytes and blocks value, instead of being an int that just contains bytes
This should fix incorrect calculation of bad blocks threshold and incorrect display of "Overall" status

Test Plan:
run partitionmanager on a system that has smartmontools 7, open smart status
overall status should be reported correctly

Reviewers: stikonas

Reviewed By: stikonas

Differential Revision: https://phabricator.kde.org/D21311
2019-05-23 17:43:44 +03:00
Shubham Jangra a7532d4041 Scrap Public Key Cryptography code based on QCA as QDbus is secure enough
Summary: QDbus already provides enough security to the calls made by the application to the helper. Hence no need to encrypt, sign the requests of the application and verify their integrity at the helper side.

Reviewers: stikonas, cjlcarvalho

Reviewed By: stikonas

Subscribers: #kde_partition_manager

Tags: #kde_partition_manager

Differential Revision: https://phabricator.kde.org/D21275
2019-05-19 22:53:13 +05:30
Shubham Jangra 07b2ce3054 Remove superflous variables
Reviewers: stikonas

Reviewed By: stikonas

Subscribers: #kde_partition_manager

Tags: #kde_partition_manager

Differential Revision: https://phabricator.kde.org/D21272
2019-05-18 18:54:20 +05:30
Shubham Jangra 73a21e6739 Simplify test conditions
Reviewers: stikonas, cjlcarvalho

Reviewed By: stikonas

Subscribers: #kde_partition_manager

Tags: #kde_partition_manager

Differential Revision: https://phabricator.kde.org/D21241
2019-05-17 23:03:15 +05:30
Shubham Jangra 997f425030 Remove redundant include
Reviewers: stikonas, cjlcarvalho

Reviewed By: stikonas

Subscribers: #kde_partition_manager

Tags: #kde_partition_manager

Differential Revision: https://phabricator.kde.org/D21251
2019-05-17 23:00:58 +05:30
Antonio Rojas 8238c94447 Don't hardcode dbus policy install dir
Install the policy files to the cmake provided locations instead of hardcoding the path to /etc/dbus-1

Differential Revision: https://phabricator.kde.org/D21162
2019-05-12 22:32:58 +02:00
Andrius Štikonas 4b6a26f0f8 Fix setting partition path when restoring partitions.
BUG: 399791
2019-05-10 02:12:07 +01:00