mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-26 00:48:22 -04:00
Try to find a more reliable way to read new partition UUIDs.
This commit is contained in:
parent
fff0f6f023
commit
30408d34a1
1 changed files with 11 additions and 7 deletions
|
@ -42,16 +42,20 @@ typedef QHash<QString, QString> UuidForPartitionHash;
|
||||||
static const char* UUID_DIR = "/dev/disk/by-uuid";
|
static const char* UUID_DIR = "/dev/disk/by-uuid";
|
||||||
|
|
||||||
static UuidForPartitionHash
|
static UuidForPartitionHash
|
||||||
findPartitionUuids()
|
findPartitionUuids( QList < Device* > devices )
|
||||||
{
|
{
|
||||||
cDebug() << "Gathering UUIDs for partitions that exist now.";
|
cDebug() << "Gathering UUIDs for partitions that exist now.";
|
||||||
QDir dir( UUID_DIR );
|
|
||||||
UuidForPartitionHash hash;
|
UuidForPartitionHash hash;
|
||||||
for ( auto info : dir.entryInfoList( QDir::Files ) )
|
foreach ( Device* device, devices )
|
||||||
{
|
{
|
||||||
QString uuid = info.fileName();
|
for ( auto it = PartitionIterator::begin( device );
|
||||||
QString path = info.canonicalFilePath();
|
it != PartitionIterator::end( device ); ++it )
|
||||||
hash.insert( path, uuid );
|
{
|
||||||
|
Partition* p = *it;
|
||||||
|
QString path = p->partitionPath();
|
||||||
|
QString uuid = p->fileSystem().readUUID( p->partitionPath() );
|
||||||
|
hash.insert( path, uuid );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
cDebug() << hash;
|
cDebug() << hash;
|
||||||
return hash;
|
return hash;
|
||||||
|
@ -156,7 +160,7 @@ FillGlobalStorageJob::exec()
|
||||||
QVariant
|
QVariant
|
||||||
FillGlobalStorageJob::createPartitionList() const
|
FillGlobalStorageJob::createPartitionList() const
|
||||||
{
|
{
|
||||||
UuidForPartitionHash hash = findPartitionUuids();
|
UuidForPartitionHash hash = findPartitionUuids( m_devices );
|
||||||
QVariantList lst;
|
QVariantList lst;
|
||||||
cDebug() << "Writing to GlobalStorage[\"partitions\"]";
|
cDebug() << "Writing to GlobalStorage[\"partitions\"]";
|
||||||
for ( auto device : m_devices )
|
for ( auto device : m_devices )
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue