mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-28 09:55:37 -04:00
[partition] Including new LVM PVs in LVM VG creation GUI.
This commit is contained in:
parent
e5351cdf3c
commit
f8897e0e0b
2 changed files with 26 additions and 2 deletions
|
@ -25,7 +25,6 @@
|
||||||
|
|
||||||
// KPMcore
|
// KPMcore
|
||||||
#include <kpmcore/core/device.h>
|
#include <kpmcore/core/device.h>
|
||||||
#include <kpmcore/core/lvmdevice.h>
|
|
||||||
|
|
||||||
// KF5
|
// KF5
|
||||||
#include <KFormat>
|
#include <KFormat>
|
||||||
|
@ -80,7 +79,7 @@ DeviceModel::data( const QModelIndex& index, int role ) const
|
||||||
return device->deviceNode();
|
return device->deviceNode();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ( device->capacity() != 1 )
|
if ( device->logicalSize() >= 0 && device->totalLogical() >= 0 )
|
||||||
return tr( "%1 - %2 (%3)" )
|
return tr( "%1 - %2 (%3)" )
|
||||||
.arg( device->name() )
|
.arg( device->name() )
|
||||||
.arg( KFormat().formatByteSize( device->capacity() ) )
|
.arg( KFormat().formatByteSize( device->capacity() ) )
|
||||||
|
|
|
@ -50,6 +50,7 @@
|
||||||
#include <kpmcore/backend/corebackend.h>
|
#include <kpmcore/backend/corebackend.h>
|
||||||
#include <kpmcore/backend/corebackendmanager.h>
|
#include <kpmcore/backend/corebackendmanager.h>
|
||||||
#include <kpmcore/fs/filesystemfactory.h>
|
#include <kpmcore/fs/filesystemfactory.h>
|
||||||
|
#include <kpmcore/fs/luks.h>
|
||||||
#include <kpmcore/fs/lvm2_pv.h>
|
#include <kpmcore/fs/lvm2_pv.h>
|
||||||
|
|
||||||
// Qt
|
// Qt
|
||||||
|
@ -604,6 +605,30 @@ PartitionCoreModule::scanForLVMPVs()
|
||||||
|
|
||||||
for ( auto p : LVM::pvList )
|
for ( auto p : LVM::pvList )
|
||||||
m_lvmPVs << p.partition().data();
|
m_lvmPVs << p.partition().data();
|
||||||
|
|
||||||
|
for ( DeviceInfo* d : m_deviceInfos )
|
||||||
|
{
|
||||||
|
for ( auto job : d->jobs )
|
||||||
|
{
|
||||||
|
// Including new LVM PVs
|
||||||
|
CreatePartitionJob* partJob = dynamic_cast<CreatePartitionJob*>( job.data() );
|
||||||
|
if ( partJob )
|
||||||
|
{
|
||||||
|
Partition* p = partJob->partition();
|
||||||
|
|
||||||
|
if ( p->fileSystem().type() == FileSystem::Type::Lvm2_PV )
|
||||||
|
m_lvmPVs << p;
|
||||||
|
else if ( p->fileSystem().type() == FileSystem::Type::Luks || p->fileSystem().type() == FileSystem::Type::Luks2 )
|
||||||
|
{
|
||||||
|
// Encrypted LVM PVs
|
||||||
|
FileSystem* innerFS = static_cast<const FS::luks*>(&p->fileSystem())->innerFS();
|
||||||
|
|
||||||
|
if ( innerFS && innerFS->type() == FileSystem::Type::Lvm2_PV )
|
||||||
|
m_lvmPVs << p;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PartitionCoreModule::DeviceInfo*
|
PartitionCoreModule::DeviceInfo*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue