Skip to content
Snippets Groups Projects
Commit d3db2ba7 authored by Adriaan de Groot's avatar Adriaan de Groot
Browse files

[partition] Add a doNotClose setting to the configuration

parent c7d4a22c
No related branches found
No related tags found
No related merge requests found
......@@ -451,9 +451,11 @@ Config::setConfigurationMap( const QVariantMap& configurationMap )
{
bool bogus = true;
const auto lvmConfiguration = Calamares::getSubMap( configurationMap, "lvm", bogus );
m_isLVMEnabled = Calamares::getBool( lvmConfiguration, "enable", true);
m_isLVMEnabled = Calamares::getBool( lvmConfiguration, "enable", true );
}
m_doNotClose = Calamares::getStringList( configurationMap, "doNotClose" );
Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage();
gs->insert( "armInstall", Calamares::getBool( configurationMap, "armInstall", false ) );
fillGSConfigurationEFI( gs, configurationMap );
......
......@@ -40,6 +40,8 @@ class Config : public QObject
Q_PROPERTY( bool lvmEnabled READ isLVMEnabled CONSTANT FINAL )
Q_PROPERTY( QStringList doNotClose READ doNotClose CONSTANT FINAL )
public:
Config( QObject* parent );
~Config() override = default;
......@@ -178,6 +180,14 @@ public:
bool isLVMEnabled() const { return m_isLVMEnabled; }
/** @brief A list of names that can follow /dev/mapper/ that must not be closed
*
* These names (if any) are skipped by the ClearMountsJob.
* The names may contain a trailing '*' which acts as a wildcard.
* In any other position, '*' is interpreted literally.
*/
QStringList doNotClose() const { return m_doNotClose; }
public Q_SLOTS:
void setInstallChoice( int ); ///< Translates a button ID or so to InstallChoice
void setInstallChoice( InstallChoice );
......@@ -213,6 +223,7 @@ private:
bool m_preCheckEncryption = false;
bool m_showNotEncryptedBootMessage = true;
bool m_isLVMEnabled = true;
QStringList m_doNotClose;
};
/** @brief Given a set of swap choices, return a sensible value from it.
......
......@@ -670,7 +670,7 @@ PartitionCoreModule::jobs( const Config* config ) const
#ifdef DEBUG_PARTITION_SKIP
cWarning() << "Partitioning actions are skipped.";
#else
const QStringList doNotClose = findEssentialLVs( m_deviceInfos );
const QStringList doNotClose = findEssentialLVs( m_deviceInfos ) + config->doNotClose();
for ( const auto* info : m_deviceInfos )
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment