mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-28 01:45:36 -04:00
[partition] Simplify code for sizing
This commit is contained in:
parent
12b668f4ee
commit
1cbfa9d693
1 changed files with 5 additions and 13 deletions
|
@ -114,19 +114,11 @@ doAutopartition( PartitionCoreModule* core, Device* dev, const QString& luksPass
|
||||||
defaultFsType = "ext4";
|
defaultFsType = "ext4";
|
||||||
|
|
||||||
// Partition sizes are expressed in MiB, should be multiples of
|
// Partition sizes are expressed in MiB, should be multiples of
|
||||||
// the logical sector size (usually 512B).
|
// the logical sector size (usually 512B). EFI starts with 2MiB
|
||||||
int uefisys_part_size = 0;
|
// empty and a 300MiB EFI boot partition, while BIOS starts at
|
||||||
int empty_space_size = 0;
|
// the 1MiB boundary (usually sector 2048).
|
||||||
if ( isEfi )
|
int uefisys_part_size = isEfi ? 300 : 0;
|
||||||
{
|
int empty_space_size = isEfi ? 2 : 1;
|
||||||
uefisys_part_size = 300;
|
|
||||||
empty_space_size = 2;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// we start with a 1MiB offset before the first partition
|
|
||||||
empty_space_size = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
qint64 firstFreeSector = MiBtoBytes(empty_space_size) / dev->logicalSize() + 1;
|
qint64 firstFreeSector = MiBtoBytes(empty_space_size) / dev->logicalSize() + 1;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue