From 8726b70574dc9f3fb5003d39155d58e83338f7f0 Mon Sep 17 00:00:00 2001 From: Caio Carvalho Date: Mon, 30 Apr 2018 00:40:54 -0300 Subject: [PATCH 1/3] [partition] Ignoring LVM devices in PartUtils::getDevices to prevent installing bootloader in LVM VG. --- src/modules/partition/core/DeviceList.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/partition/core/DeviceList.cpp b/src/modules/partition/core/DeviceList.cpp index d7e6bab29..1a070773e 100644 --- a/src/modules/partition/core/DeviceList.cpp +++ b/src/modules/partition/core/DeviceList.cpp @@ -152,6 +152,11 @@ QList< Device* > getDevices( DeviceType which, qint64 minimumSize ) cDebug() << " .. Removing too-small" << it; it = erase(devices, it ); } + else if ( (*it)->type() == Device::LVM_Device ) + { + cDebug() << " .. Removing LVM device from list " << it; + it = erase(devices, it ); + } else ++it; From f561f0459174f98af80e43da6b2b96b8c202f86c Mon Sep 17 00:00:00 2001 From: Caio Carvalho Date: Thu, 3 May 2018 14:50:13 -0300 Subject: [PATCH 2/3] [partition] Changing PartUtils::getDevices to ignore devices that aren't of Disk_Device type. --- src/modules/partition/core/DeviceList.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/modules/partition/core/DeviceList.cpp b/src/modules/partition/core/DeviceList.cpp index 1a070773e..3695193b4 100644 --- a/src/modules/partition/core/DeviceList.cpp +++ b/src/modules/partition/core/DeviceList.cpp @@ -129,7 +129,12 @@ QList< Device* > getDevices( DeviceType which, qint64 minimumSize ) // Remove the device which contains / from the list for ( DeviceList::iterator it = devices.begin(); it != devices.end(); ) - if ( ! ( *it ) || + if ( (*it)->type() != Device::Type::Disk_Device ) + { + cDebug() << " .. Removing device that is not a Disk_Device from list " << it; + it = erase(devices, it ); + } + else if ( ! ( *it ) || ( *it )->deviceNode().startsWith( "/dev/zram" ) ) { @@ -152,11 +157,6 @@ QList< Device* > getDevices( DeviceType which, qint64 minimumSize ) cDebug() << " .. Removing too-small" << it; it = erase(devices, it ); } - else if ( (*it)->type() == Device::LVM_Device ) - { - cDebug() << " .. Removing LVM device from list " << it; - it = erase(devices, it ); - } else ++it; From 77d2667b53c063c75cc0d1501eccbeec0e94c6b3 Mon Sep 17 00:00:00 2001 From: Caio Carvalho Date: Tue, 8 May 2018 01:30:41 -0300 Subject: [PATCH 3/3] [partition] Checking if there is LUKS creation support and if partition is not Extended before enabling encryption in CreatePartitionDialog. --- src/modules/partition/gui/CreatePartitionDialog.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/partition/gui/CreatePartitionDialog.cpp b/src/modules/partition/gui/CreatePartitionDialog.cpp index 8804eb177..5952a61a1 100644 --- a/src/modules/partition/gui/CreatePartitionDialog.cpp +++ b/src/modules/partition/gui/CreatePartitionDialog.cpp @@ -261,7 +261,9 @@ CreatePartitionDialog::updateMountPointUi() FileSystem::Type type = FileSystem::typeForName( m_ui->fsComboBox->currentText() ); enabled = !s_unmountableFS.contains( type ); - if ( FS::luks::canEncryptType( type ) ) + if ( FileSystemFactory::map()[FileSystem::Type::Luks]->supportCreate() && + FS::luks::canEncryptType( type ) && + !m_role.has( PartitionRole::Extended ) ) { m_ui->encryptWidget->show(); m_ui->encryptWidget->reset();