mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-27 09:25:36 -04:00
[partition] Apply custom partition layout for Erase and Replace choices
This patches add new methods to both PartitionLayout and PartitionCoreModule classes which apply the partition layout to the available drive space. In addition, the partition creation code from PartitioinActions is removed to call the newly created methods instead, thus applying the custom partition layout when the "Erase whole disk" and "Replace partition" choices are selected. Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
This commit is contained in:
parent
f863912a2f
commit
0d284759f5
5 changed files with 138 additions and 63 deletions
|
@ -787,6 +787,30 @@ PartitionCoreModule::initLayout( const QVariantList& config )
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
PartitionCoreModule::layoutApply( Device *dev,
|
||||
qint64 firstSector,
|
||||
qint64 lastSector,
|
||||
QString luksPassphrase )
|
||||
{
|
||||
bool isEfi = PartUtils::isEfiSystem();
|
||||
QList< Partition* > partList = m_partLayout->execute( dev, firstSector, lastSector, luksPassphrase );
|
||||
|
||||
foreach ( Partition *part, partList )
|
||||
{
|
||||
if ( part->mountPoint() == "/" )
|
||||
{
|
||||
createPartition( dev, part,
|
||||
part->activeFlags() | ( isEfi ? PartitionTable::FlagNone : PartitionTable::FlagBoot )
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
createPartition( dev, part );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
PartitionCoreModule::revert()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue