mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-28 09:55:37 -04:00
[partition] Add max size parameter
When using a custom partition layout with partition sizes in %, it can be useful to set an upper limit to the partition size. For instance, using a 20% size for the `/` partition will create a 24G partition on a 120GB drive, but a 200GB partition on a 1TB drive, which is not useful, and could be avoided by setting a maximum partition size. This commit adds the `maxSize` parameter (with a default value of 100%). Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
This commit is contained in:
parent
fdb4311a70
commit
5358e2314d
4 changed files with 27 additions and 11 deletions
|
@ -774,6 +774,7 @@ PartitionCoreModule::initLayout( const QVariantList& config )
|
|||
{
|
||||
QString sizeString;
|
||||
QString minSizeString;
|
||||
QString maxSizeString;
|
||||
|
||||
m_partLayout = new PartitionLayout();
|
||||
|
||||
|
@ -791,11 +792,17 @@ PartitionCoreModule::initLayout( const QVariantList& config )
|
|||
else
|
||||
minSizeString = CalamaresUtils::getString( pentry, "minSize" );
|
||||
|
||||
if ( pentry.contains("maxSize") && CalamaresUtils::getString( pentry, "maxSize" ).isEmpty() )
|
||||
maxSizeString.setNum( CalamaresUtils::getInteger( pentry, "maxSize", 100 ) );
|
||||
else
|
||||
maxSizeString = CalamaresUtils::getString( pentry, "maxSize" );
|
||||
|
||||
m_partLayout->addEntry( CalamaresUtils::getString( pentry, "name" ),
|
||||
CalamaresUtils::getString( pentry, "mountPoint" ),
|
||||
CalamaresUtils::getString( pentry, "filesystem" ),
|
||||
sizeString,
|
||||
minSizeString
|
||||
minSizeString,
|
||||
maxSizeString
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue