|
|
|
@ -18,6 +18,7 @@
|
|
|
|
|
#include "GlobalStorage.h"
|
|
|
|
|
#include "JobQueue.h"
|
|
|
|
|
#include "partition/FileSystem.h"
|
|
|
|
|
#include "partition/Global.h"
|
|
|
|
|
#include "partition/PartitionIterator.h"
|
|
|
|
|
#include "utils/Logger.h"
|
|
|
|
|
|
|
|
|
@ -291,35 +292,29 @@ FillGlobalStorageJob::prettyStatusMessage() const
|
|
|
|
|
* .. mark as "1" if it's on the system, somewhere
|
|
|
|
|
* .. mark as "2" if it's one of the claimed / in-use FSses
|
|
|
|
|
*
|
|
|
|
|
* Stores a GS key called "filesystems_use" with this mapping.
|
|
|
|
|
* Stores a GS key called "filesystem_use" with this mapping.
|
|
|
|
|
* @see CalamaresUtils::Partition::useFilesystemGS()
|
|
|
|
|
*/
|
|
|
|
|
static void
|
|
|
|
|
storeFSUse( Calamares::GlobalStorage* storage, const QVariantList& partitions )
|
|
|
|
|
{
|
|
|
|
|
QMap< QString, int > fsUses;
|
|
|
|
|
for ( const auto& p : partitions )
|
|
|
|
|
if ( storage )
|
|
|
|
|
{
|
|
|
|
|
const auto pmap = p.toMap();
|
|
|
|
|
|
|
|
|
|
QString fs = pmap.value( "fs" ).toString();
|
|
|
|
|
int thisUse = pmap.value( "claimed" ).toBool() ? 2 : 1;
|
|
|
|
|
|
|
|
|
|
if ( fs.isEmpty() )
|
|
|
|
|
CalamaresUtils::Partition::clearFilesystemGS( storage );
|
|
|
|
|
for ( const auto& p : partitions )
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
const auto pmap = p.toMap();
|
|
|
|
|
|
|
|
|
|
int newUse = qMax( fsUses.value( fs ), thisUse ); // value() is 0 if not present
|
|
|
|
|
fsUses.insert( fs, newUse );
|
|
|
|
|
}
|
|
|
|
|
QString fs = pmap.value( "fs" ).toString();
|
|
|
|
|
|
|
|
|
|
QVariantMap fsUsesVariant;
|
|
|
|
|
for ( auto it = fsUses.cbegin(); it != fsUses.cend(); ++it )
|
|
|
|
|
{
|
|
|
|
|
fsUsesVariant.insert( it.key(), it.value() );
|
|
|
|
|
}
|
|
|
|
|
if ( fs.isEmpty() )
|
|
|
|
|
{
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
storage->insert( "filesystems_use", fsUsesVariant );
|
|
|
|
|
CalamaresUtils::Partition::useFilesystemGS( storage, fs, true );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Calamares::JobResult
|
|
|
|
|