[fsresizer] Add setting required
- If resize is required, fail if it doesn't happen.
This commit is contained in:
parent
7e88f637b1
commit
0b4c0f9c38
@ -33,6 +33,7 @@
|
|||||||
#include "JobQueue.h"
|
#include "JobQueue.h"
|
||||||
#include "GlobalStorage.h"
|
#include "GlobalStorage.h"
|
||||||
|
|
||||||
|
#include "utils/CalamaresUtils.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
#include "utils/Units.h"
|
#include "utils/Units.h"
|
||||||
|
|
||||||
@ -113,6 +114,7 @@ ResizeFSJob::RelativeSize::apply( Device* d )
|
|||||||
|
|
||||||
ResizeFSJob::ResizeFSJob( QObject* parent )
|
ResizeFSJob::ResizeFSJob( QObject* parent )
|
||||||
: Calamares::CppJob( parent )
|
: Calamares::CppJob( parent )
|
||||||
|
, m_required( false )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -334,6 +336,8 @@ ResizeFSJob::setConfigurationMap( const QVariantMap& configurationMap )
|
|||||||
|
|
||||||
m_size = RelativeSize( configurationMap["size"].toString() );
|
m_size = RelativeSize( configurationMap["size"].toString() );
|
||||||
m_atleast = RelativeSize( configurationMap["atleast"].toString() );
|
m_atleast = RelativeSize( configurationMap["atleast"].toString() );
|
||||||
|
|
||||||
|
m_required = CalamaresUtils::getBool( configurationMap, "required", false );
|
||||||
}
|
}
|
||||||
|
|
||||||
CALAMARES_PLUGIN_FACTORY_DEFINITION( ResizeFSJobFactory, registerPlugin<ResizeFSJob>(); )
|
CALAMARES_PLUGIN_FACTORY_DEFINITION( ResizeFSJobFactory, registerPlugin<ResizeFSJob>(); )
|
||||||
|
@ -107,6 +107,7 @@ private:
|
|||||||
RelativeSize m_atleast;
|
RelativeSize m_atleast;
|
||||||
QString m_fsname; // Either this, or devicename, is set, not both
|
QString m_fsname; // Either this, or devicename, is set, not both
|
||||||
QString m_devicename;
|
QString m_devicename;
|
||||||
|
bool m_required;
|
||||||
|
|
||||||
using PartitionMatch = QPair<Device*, Partition*>;
|
using PartitionMatch = QPair<Device*, Partition*>;
|
||||||
/** @brief Find the configured FS using KPMCore @p backend */
|
/** @brief Find the configured FS using KPMCore @p backend */
|
||||||
|
@ -33,5 +33,17 @@ size: 100%
|
|||||||
# size, as above. If missing, then it's assumed to be 0,
|
# size, as above. If missing, then it's assumed to be 0,
|
||||||
# which means resizing is always worthwhile.
|
# which means resizing is always worthwhile.
|
||||||
#
|
#
|
||||||
|
# If *atleast* is not zero, then the setting *required*,
|
||||||
|
# below, becomes relevant.
|
||||||
|
#
|
||||||
# Percentages apply to **total device size**.
|
# Percentages apply to **total device size**.
|
||||||
atleast: 1000MiB
|
#atleast: 1000MiB
|
||||||
|
|
||||||
|
# When *atleast* is not zero, then the resize may be
|
||||||
|
# recommended (the default) or **required**. If the
|
||||||
|
# resize is required and cannot be carried out (because
|
||||||
|
# there's not enough space), then that is a fatal
|
||||||
|
# error for the installer. By default, resize is only
|
||||||
|
# recommended and it is not an error for no resize to be
|
||||||
|
# carried out.
|
||||||
|
required: false
|
||||||
|
Loading…
Reference in New Issue
Block a user