mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-25 16:38:21 -04:00
[partition] Document intention of new-style swap config
This commit is contained in:
parent
779542a5d1
commit
caa4b8ab53
2 changed files with 49 additions and 29 deletions
|
@ -487,25 +487,36 @@ PartitionViewStep::setConfigurationMap( const QVariantMap& configurationMap )
|
|||
gs->insert( "efiSystemPartition", QStringLiteral( "/boot/efi" ) );
|
||||
}
|
||||
|
||||
// SWAP SETTINGS
|
||||
//
|
||||
// This is a bit convoluted because there's legacy settings to handle as well
|
||||
// as the new-style list of choices, with mapping back-and-forth.
|
||||
if ( configurationMap.contains( "userSwapChoices" ) &&
|
||||
( configurationMap.contains( "ensureSuspendToDisk" ) || configurationMap.contains( "neverCreateSwap" ) ) )
|
||||
cError() << "Partition-module configuration mixes old- and new-style swap settings.";
|
||||
|
||||
bool ensureSuspendToDisk = true;
|
||||
if ( configurationMap.contains( "ensureSuspendToDisk" ) )
|
||||
cWarning() << "Partition-module setting *ensureSuspendToDisk* is deprecated.";
|
||||
if ( configurationMap.contains( "ensureSuspendToDisk" ) &&
|
||||
configurationMap.value( "ensureSuspendToDisk" ).type() == QVariant::Bool )
|
||||
{
|
||||
gs->insert( "ensureSuspendToDisk", configurationMap.value( "ensureSuspendToDisk" ).toBool() );
|
||||
}
|
||||
ensureSuspendToDisk = configurationMap.value( "ensureSuspendToDisk" ).toBool();
|
||||
else
|
||||
{
|
||||
gs->insert( "ensureSuspendToDisk", true );
|
||||
}
|
||||
ensureSuspendToDisk = true;
|
||||
|
||||
bool neverCreateSwap = false;
|
||||
if ( configurationMap.contains( "neverCreateSwap" ) )
|
||||
cWarning() << "Partition-module setting *neverCreateSwap* is deprecated.";
|
||||
if ( configurationMap.contains( "neverCreateSwap" ) &&
|
||||
configurationMap.value( "neverCreateSwap" ).type() == QVariant::Bool )
|
||||
{
|
||||
gs->insert( "neverCreateSwap", configurationMap.value( "neverCreateSwap" ).toBool() );
|
||||
}
|
||||
neverCreateSwap = configurationMap.value( "neverCreateSwap" ).toBool();
|
||||
else
|
||||
{
|
||||
gs->insert( "neverCreateSwap", false );
|
||||
}
|
||||
neverCreateSwap = false;
|
||||
|
||||
// These gs settings seem to be unused (in upstream Calamares) outside of
|
||||
// the partition module itself.
|
||||
gs->insert( "ensureSuspendToDisk", ensureSuspendToDisk );
|
||||
gs->insert( "neverCreateSwap", neverCreateSwap );
|
||||
|
||||
if ( configurationMap.contains( "drawNestedPartitions" ) &&
|
||||
configurationMap.value( "drawNestedPartitions" ).type() == QVariant::Bool )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue