diff --git a/src/modules/partition/gui/ChoicePage.cpp b/src/modules/partition/gui/ChoicePage.cpp index 1538d2f72..ec1ae5c55 100644 --- a/src/modules/partition/gui/ChoicePage.cpp +++ b/src/modules/partition/gui/ChoicePage.cpp @@ -82,12 +82,16 @@ ChoicePage::ChoicePage( QWidget* parent ) , m_beforePartitionLabelsView( nullptr ) , m_bootloaderComboBox( nullptr ) , m_lastSelectedDeviceIndex( -1 ) + , m_enableEncryptionWidget( true ) { setupUi( this ); m_defaultFsType = Calamares::JobQueue::instance()-> globalStorage()-> value( "defaultFileSystemType" ).toString(); + m_enableEncryptionWidget = Calamares::JobQueue::instance()-> + globalStorage()-> + value( "enableLuksAutomatedPartitioning" ).toBool(); if ( FileSystem::typeForName( m_defaultFsType ) == FileSystem::Unknown ) m_defaultFsType = "ext4"; @@ -884,7 +888,8 @@ ChoicePage::updateActionChoicePreview( ChoicePage::Choice choice ) { case Alongside: { - m_encryptWidget->show(); + if ( m_enableEncryptionWidget ) + m_encryptWidget->show(); m_previewBeforeLabel->setText( tr( "Current:" ) ); m_selectLabel->setText( tr( "Select a partition to shrink, " "then drag the bottom bar to resize" ) ); @@ -930,7 +935,8 @@ ChoicePage::updateActionChoicePreview( ChoicePage::Choice choice ) case Erase: case Replace: { - m_encryptWidget->show(); + if ( m_enableEncryptionWidget ) + m_encryptWidget->show(); m_previewBeforeLabel->setText( tr( "Current:" ) ); m_afterPartitionBarsView = new PartitionBarsView( m_previewAfterFrame ); m_afterPartitionBarsView->setNestedPartitionsMode( mode ); diff --git a/src/modules/partition/gui/ChoicePage.h b/src/modules/partition/gui/ChoicePage.h index 92f9c14a0..0c3f0b5a8 100644 --- a/src/modules/partition/gui/ChoicePage.h +++ b/src/modules/partition/gui/ChoicePage.h @@ -123,6 +123,7 @@ private: int m_lastSelectedDeviceIndex; QString m_defaultFsType; + bool m_enableEncryptionWidget; QMutex m_coreMutex; }; diff --git a/src/modules/partition/gui/PartitionViewStep.cpp b/src/modules/partition/gui/PartitionViewStep.cpp index 0362c357b..d0dddff23 100644 --- a/src/modules/partition/gui/PartitionViewStep.cpp +++ b/src/modules/partition/gui/PartitionViewStep.cpp @@ -508,6 +508,17 @@ PartitionViewStep::setConfigurationMap( const QVariantMap& configurationMap ) gs->insert( "defaultFileSystemType", QStringLiteral( "ext4" ) ); } + if ( configurationMap.contains( "enableLuksAutomatedPartitioning" ) && + configurationMap.value( "enableLuksAutomatedPartitioning" ).type() == QVariant::Bool ) + { + gs->insert( "enableLuksAutomatedPartitioning", + configurationMap.value( "enableLuksAutomatedPartitioning" ).toBool() ); + } + else + { + gs->insert( "enableLuksAutomatedPartitioning", true ); + } + // Now that we have the config, we load the PartitionCoreModule in the background // because it could take a while. Then when it's done, we can set up the widgets diff --git a/src/modules/partition/partition.conf b/src/modules/partition/partition.conf index 93cca18e8..7420aaf54 100644 --- a/src/modules/partition/partition.conf +++ b/src/modules/partition/partition.conf @@ -18,3 +18,23 @@ alwaysShowPartitionLabels: true # Suggested values: ext2, ext3, ext4, reiser, xfs, jfs, btrfs # If nothing is specified, Calamares defaults to "ext4". defaultFileSystemType: "ext4" + +# Show/hide LUKS related functionality in automated partitioning modes. +# Disable this if you choose not to deploy early unlocking support in GRUB2 +# and/or your distribution's initramfs solution. +# +# BIG FAT WARNING: +# This option is unsupported, as it cuts out a crucial security feature. +# Disabling LUKS and shipping Calamares without a correctly configured GRUB2 +# and initramfs is considered suboptimal use of the Calamares software. The +# Calamares team will not provide user support for any potential issue that +# may arise as a consequence of setting this option to false. +# It is strongly recommended that system integrators put in the work to support +# LUKS unlocking support in GRUB2 and initramfs/dracut/mkinitcpio/etc. +# Support is offered to system integrators that wish to do so, through the +# Calamares bug tracker, as well as in #calamares on Freenode. +# For more information on setting up GRUB2 for Calamares with LUKS, see +# https://github.com/calamares/calamares/wiki/LUKS-Deployment +# +# If nothing is specified, LUKS is enabled in automated modes. +#enableLuksAutomatedPartitioning: true