Merge branch 'calamares' of https://github.com/LordTermor/calamares into pr-1667
This commit is contained in:
commit
9ef22f4168
@ -207,6 +207,15 @@ Config::setSwapChoice( Config::SwapChoice c )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Config::setEraseFsTypeChoice(const QString& choice)
|
||||||
|
{
|
||||||
|
if(choice != m_eraseFsTypeChoice){
|
||||||
|
m_eraseFsTypeChoice = choice;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Config::allowManualPartitioning() const
|
Config::allowManualPartitioning() const
|
||||||
{
|
{
|
||||||
@ -240,6 +249,17 @@ Config::setConfigurationMap( const QVariantMap& configurationMap )
|
|||||||
gs->insert( "allowManualPartitioning",
|
gs->insert( "allowManualPartitioning",
|
||||||
CalamaresUtils::getBool( configurationMap, "allowManualPartitioning", true ) );
|
CalamaresUtils::getBool( configurationMap, "allowManualPartitioning", true ) );
|
||||||
|
|
||||||
|
if ( configurationMap.contains( "availableFileSystemTypes" ) ) {
|
||||||
|
if(configurationMap.value( "availableFileSystemTypes" ).type() == QVariant::List ){
|
||||||
|
m_eraseFsTypes.clear();
|
||||||
|
m_eraseFsTypes.append(configurationMap.value( "availableFileSystemTypes" ).toStringList());
|
||||||
|
m_eraseFsTypeChoice = m_eraseFsTypes[0];
|
||||||
|
} else if ( configurationMap.value( "availableFileSystemTypes" ).type() == QVariant::String ){
|
||||||
|
m_eraseFsTypes.append(configurationMap.value( "availableFileSystemTypes" ).toString());
|
||||||
|
m_eraseFsTypeChoice = m_eraseFsTypes[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ( configurationMap.contains( "requiredPartitionTableType" )
|
if ( configurationMap.contains( "requiredPartitionTableType" )
|
||||||
&& configurationMap.value( "requiredPartitionTableType" ).type() == QVariant::List )
|
&& configurationMap.value( "requiredPartitionTableType" ).type() == QVariant::List )
|
||||||
{
|
{
|
||||||
|
@ -54,6 +54,8 @@ public:
|
|||||||
static const NamedEnumTable< SwapChoice >& swapChoiceNames();
|
static const NamedEnumTable< SwapChoice >& swapChoiceNames();
|
||||||
using SwapChoiceSet = QSet< SwapChoice >;
|
using SwapChoiceSet = QSet< SwapChoice >;
|
||||||
|
|
||||||
|
using EraseFsTypesSet = QStringList;
|
||||||
|
|
||||||
void setConfigurationMap( const QVariantMap& );
|
void setConfigurationMap( const QVariantMap& );
|
||||||
void updateGlobalStorage() const;
|
void updateGlobalStorage() const;
|
||||||
|
|
||||||
@ -94,6 +96,11 @@ public:
|
|||||||
*/
|
*/
|
||||||
SwapChoice swapChoice() const { return m_swapChoice; }
|
SwapChoice swapChoice() const { return m_swapChoice; }
|
||||||
|
|
||||||
|
EraseFsTypesSet eraseFsTypes() const {return m_eraseFsTypes; }
|
||||||
|
|
||||||
|
QString eraseFsType() const {return m_eraseFsTypeChoice; }
|
||||||
|
|
||||||
|
|
||||||
///@brief Is manual partitioning allowed (not explicitly disnabled in the config file)?
|
///@brief Is manual partitioning allowed (not explicitly disnabled in the config file)?
|
||||||
bool allowManualPartitioning() const;
|
bool allowManualPartitioning() const;
|
||||||
|
|
||||||
@ -102,6 +109,7 @@ public Q_SLOTS:
|
|||||||
void setInstallChoice( InstallChoice );
|
void setInstallChoice( InstallChoice );
|
||||||
void setSwapChoice( int ); ///< Translates a button ID or so to SwapChoice
|
void setSwapChoice( int ); ///< Translates a button ID or so to SwapChoice
|
||||||
void setSwapChoice( SwapChoice );
|
void setSwapChoice( SwapChoice );
|
||||||
|
void setEraseFsTypeChoice( const QString& );
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void installChoiceChanged( InstallChoice );
|
void installChoiceChanged( InstallChoice );
|
||||||
@ -109,6 +117,8 @@ Q_SIGNALS:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
SwapChoiceSet m_swapChoices;
|
SwapChoiceSet m_swapChoices;
|
||||||
|
EraseFsTypesSet m_eraseFsTypes;
|
||||||
|
QString m_eraseFsTypeChoice;
|
||||||
SwapChoice m_initialSwapChoice = NoSwap;
|
SwapChoice m_initialSwapChoice = NoSwap;
|
||||||
SwapChoice m_swapChoice = NoSwap;
|
SwapChoice m_swapChoice = NoSwap;
|
||||||
InstallChoice m_initialInstallChoice = NoChoice;
|
InstallChoice m_initialInstallChoice = NoChoice;
|
||||||
|
@ -109,6 +109,10 @@ doAutopartition( PartitionCoreModule* core, Device* dev, Choices::AutoPartitionO
|
|||||||
partType = isEfi ? PartitionTable::gpt : PartitionTable::msdos;
|
partType = isEfi ? PartitionTable::gpt : PartitionTable::msdos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FileSystem::Type type;
|
||||||
|
PartUtils::findFS(o.defaultFsType, &type);
|
||||||
|
core->initLayout( type == FileSystem::Unknown ? FileSystem::Ext4 : type);
|
||||||
|
|
||||||
core->createPartitionTable( dev, partType );
|
core->createPartitionTable( dev, partType );
|
||||||
|
|
||||||
if ( isEfi )
|
if ( isEfi )
|
||||||
|
@ -390,6 +390,7 @@ PartitionCoreModule::createPartitionTable( Device* device, PartitionTable::Table
|
|||||||
|
|
||||||
OperationHelper helper( partitionModelForDevice( device ), this );
|
OperationHelper helper( partitionModelForDevice( device ), this );
|
||||||
deviceInfo->makeJob< CreatePartitionTableJob >( type );
|
deviceInfo->makeJob< CreatePartitionTableJob >( type );
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -268,6 +268,14 @@ ChoicePage::setupChoices()
|
|||||||
m_eraseButton->addOptionsComboBox( m_eraseSwapChoiceComboBox );
|
m_eraseButton->addOptionsComboBox( m_eraseSwapChoiceComboBox );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( m_config->eraseFsTypes().count() > 1)
|
||||||
|
{
|
||||||
|
m_eraseFsTypesChoiceComboBox = new QComboBox;
|
||||||
|
m_eraseFsTypesChoiceComboBox->addItems(m_config->eraseFsTypes());
|
||||||
|
connect(m_eraseFsTypesChoiceComboBox, &QComboBox::currentTextChanged, [this](const auto& currentString){m_config->setEraseFsTypeChoice(currentString); onActionChanged();});
|
||||||
|
m_eraseButton->addOptionsComboBox( m_eraseFsTypesChoiceComboBox );
|
||||||
|
}
|
||||||
|
|
||||||
m_itemsLayout->addWidget( m_alongsideButton );
|
m_itemsLayout->addWidget( m_alongsideButton );
|
||||||
m_itemsLayout->addWidget( m_replaceButton );
|
m_itemsLayout->addWidget( m_replaceButton );
|
||||||
m_itemsLayout->addWidget( m_eraseButton );
|
m_itemsLayout->addWidget( m_eraseButton );
|
||||||
@ -464,9 +472,8 @@ ChoicePage::applyActionChoice( InstallChoice choice )
|
|||||||
case InstallChoice::Erase:
|
case InstallChoice::Erase:
|
||||||
{
|
{
|
||||||
auto gs = Calamares::JobQueue::instance()->globalStorage();
|
auto gs = Calamares::JobQueue::instance()->globalStorage();
|
||||||
|
|
||||||
PartitionActions::Choices::AutoPartitionOptions options { gs->value( "defaultPartitionTableType" ).toString(),
|
PartitionActions::Choices::AutoPartitionOptions options { gs->value( "defaultPartitionTableType" ).toString(),
|
||||||
gs->value( "defaultFileSystemType" ).toString(),
|
m_config->eraseFsType(),
|
||||||
m_encryptWidget->passphrase(),
|
m_encryptWidget->passphrase(),
|
||||||
gs->value( "efiSystemPartition" ).toString(),
|
gs->value( "efiSystemPartition" ).toString(),
|
||||||
CalamaresUtils::GiBtoBytes(
|
CalamaresUtils::GiBtoBytes(
|
||||||
|
@ -139,6 +139,8 @@ private:
|
|||||||
Calamares::PrettyRadioButton* m_replaceButton;
|
Calamares::PrettyRadioButton* m_replaceButton;
|
||||||
Calamares::PrettyRadioButton* m_somethingElseButton;
|
Calamares::PrettyRadioButton* m_somethingElseButton;
|
||||||
QComboBox* m_eraseSwapChoiceComboBox; // UI, see also m_eraseSwapChoice
|
QComboBox* m_eraseSwapChoiceComboBox; // UI, see also m_eraseSwapChoice
|
||||||
|
QComboBox* m_eraseFsTypesChoiceComboBox; // UI, see also m_eraseSwapChoice
|
||||||
|
|
||||||
|
|
||||||
DeviceInfoWidget* m_deviceInfoWidget;
|
DeviceInfoWidget* m_deviceInfoWidget;
|
||||||
|
|
||||||
|
@ -137,7 +137,7 @@ initialSwapChoice: none
|
|||||||
# If nothing is specified, Calamares defaults to "ext4".
|
# If nothing is specified, Calamares defaults to "ext4".
|
||||||
#
|
#
|
||||||
# Names are case-sensitive and defined by KPMCore.
|
# Names are case-sensitive and defined by KPMCore.
|
||||||
defaultFileSystemType: "ext4"
|
availableFileSystemTypes: ["ext4", "btrfs", "f2fs"]
|
||||||
|
|
||||||
# Show/hide LUKS related functionality in automated partitioning modes.
|
# Show/hide LUKS related functionality in automated partitioning modes.
|
||||||
# Disable this if you choose not to deploy early unlocking support in GRUB2
|
# Disable this if you choose not to deploy early unlocking support in GRUB2
|
||||||
|
Loading…
Reference in New Issue
Block a user