[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.
main
Gaël PORTAY 4 years ago
parent 71e0081fce
commit dad9587c3e

@ -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 );
}

@ -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 ) );

@ -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

Loading…
Cancel
Save