[partition] Allow a configurable swap Partition name

This commit adds the new configuration `swapPartitionName` to the file
partition.conf.

This option sets the partition name to the swap partition that is
created. If this option is unset, the partition is left unnamed.
This commit is contained in:
Gaël PORTAY 2020-10-27 07:16:39 -04:00
parent 71e0081fce
commit dad9587c3e
3 changed files with 14 additions and 0 deletions

View File

@ -203,6 +203,10 @@ doAutopartition( PartitionCoreModule* core, Device* dev, Choices::AutoPartitionO
KPM_PARTITION_FLAG( None ) );
}
PartitionInfo::setFormat( swapPartition, true );
if ( gs->contains( "swapPartitionName" ))
{
swapPartition->setLabel( gs->value( "swapPartitionName" ).toString() );
}
core->createPartition( dev, swapPartition );
}

View File

@ -543,6 +543,12 @@ PartitionViewStep::setConfigurationMap( const QVariantMap& configurationMap )
gs->insert( "efiSystemPartitionName", CalamaresUtils::getString( configurationMap, "efiSystemPartitionName" ) );
}
// Read and parse key swapPartitionName
if ( configurationMap.contains( "swapPartitionName" ) )
{
gs->insert( "swapPartitionName", CalamaresUtils::getString( configurationMap, "swapPartitionName" ) );
}
// OTHER SETTINGS
//
gs->insert( "drawNestedPartitions", CalamaresUtils::getBool( configurationMap, "drawNestedPartitions", false ) );

View File

@ -48,6 +48,10 @@ userSwapChoices:
# - reuse # Re-use existing swap, but don't create any (unsupported right now)
- file # To swap file instead of partition
# This optional setting specifies the name of the swap partition.
# If nothing is specified, the partition name is left unset.
# swapPartitionName: swap
# LEGACY SETTINGS (these will generate a warning)
# ensureSuspendToDisk: true
# neverCreateSwap: false