Allow disabling automated LUKS modes.

This commit is contained in:
Teo Mrnjavac 2016-09-26 13:14:54 +02:00 committed by Philip
parent 36a96fedfb
commit 11dd15f123
4 changed files with 40 additions and 2 deletions

View File

@ -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,6 +888,7 @@ ChoicePage::updateActionChoicePreview( ChoicePage::Choice choice )
{
case Alongside:
{
if ( m_enableEncryptionWidget )
m_encryptWidget->show();
m_previewBeforeLabel->setText( tr( "Current:" ) );
m_selectLabel->setText( tr( "<strong>Select a partition to shrink, "
@ -930,6 +935,7 @@ ChoicePage::updateActionChoicePreview( ChoicePage::Choice choice )
case Erase:
case Replace:
{
if ( m_enableEncryptionWidget )
m_encryptWidget->show();
m_previewBeforeLabel->setText( tr( "Current:" ) );
m_afterPartitionBarsView = new PartitionBarsView( m_previewAfterFrame );

View File

@ -123,6 +123,7 @@ private:
int m_lastSelectedDeviceIndex;
QString m_defaultFsType;
bool m_enableEncryptionWidget;
QMutex m_coreMutex;
};

View File

@ -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

View File

@ -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