Commit Graph

1162 Commits

Author SHA1 Message Date
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 5cfa8343fe Bump kpmcore version to 4.2.0 in preparation for future release. 2020-10-01 23:56:45 +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 0cb3c79726 REUSE: add licensing info for the remaining files to .reuse/dep5. 2020-10-01 01:04:09 +01:00
Andrius Štikonas 884389ccd9 REUSE: licensing information for misc files. 2020-10-01 00:51:30 +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 9254ab9b9d Remove .arcconfig. 2020-09-28 01:11:41 +01:00
Andrius Štikonas 8534265421 REUSE: SPDX headers for src/fs/*. 2020-09-28 00:51:18 +01:00
Andrius Štikonas 20ea28b4b5 GPL-3.0-or-later.txt file was empty. 2020-09-22 20:54:14 +01:00
Andrius Štikonas 11bb5799ec REUSE: SPDX license headers for backend and core folders. 2020-09-20 20:33:16 +01:00
Andrius Štikonas bdd9467725 Add gitignore file. 2020-09-19 23:58:04 +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 6d110ca6a5 Move GPL3 license to LICENSES folder. 2020-09-17 01:32:54 +01:00
Andrius Štikonas 37d373cfe0 Fix missing parenthesis in README. 2020-09-15 18:22:08 +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
Andrius Štikonas 9dd118c58b Merge branch 'partition-uuid' into 'master'
Partition uuid

See merge request kde/kpmcore!8
2020-05-15 16:52:23 +00: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
Andrius Štikonas df4e2332f4 Merge branch 'fix-typos' into 'master'
Fix typos

See merge request kde/kpmcore!7
2020-05-15 15:51:06 +00:00