Make everything obey the default filesystem type setting.

This commit is contained in:
Teo Mrnjavac 2016-06-10 15:22:21 +02:00
parent 6fa467715c
commit f5ff716369
3 changed files with 28 additions and 8 deletions

View File

@ -104,6 +104,12 @@ doAutopartition( PartitionCoreModule* core, Device* dev, const QString& luksPass
if ( QDir( "/sys/firmware/efi/efivars" ).exists() ) if ( QDir( "/sys/firmware/efi/efivars" ).exists() )
isEfi = true; isEfi = true;
QString defaultFsType = Calamares::JobQueue::instance()->
globalStorage()->
value( "defaultFileSystemType" ).toString();
if ( FileSystem::typeForName( defaultFsType ) == FileSystem::Unknown )
defaultFsType = "ext4";
#define MiB * static_cast< qint64 >( 1024 ) * 1024 #define MiB * static_cast< qint64 >( 1024 ) * 1024
#define GiB * static_cast< qint64 >( 1024 ) * 1024 * 1024 #define GiB * static_cast< qint64 >( 1024 ) * 1024 * 1024
@ -174,7 +180,7 @@ doAutopartition( PartitionCoreModule* core, Device* dev, const QString& luksPass
dev->partitionTable(), dev->partitionTable(),
*dev, *dev,
PartitionRole( PartitionRole::Primary ), PartitionRole( PartitionRole::Primary ),
FileSystem::Ext4, FileSystem::typeForName( defaultFsType ),
firstFreeSector, firstFreeSector,
lastSectorForRoot lastSectorForRoot
); );
@ -185,7 +191,7 @@ doAutopartition( PartitionCoreModule* core, Device* dev, const QString& luksPass
dev->partitionTable(), dev->partitionTable(),
*dev, *dev,
PartitionRole( PartitionRole::Primary ), PartitionRole( PartitionRole::Primary ),
FileSystem::Ext4, FileSystem::typeForName( defaultFsType ),
firstFreeSector, firstFreeSector,
lastSectorForRoot, lastSectorForRoot,
luksPassphrase luksPassphrase
@ -237,6 +243,12 @@ doReplacePartition( PartitionCoreModule* core,
{ {
cDebug() << "doReplacePartition for device" << partition->partitionPath(); cDebug() << "doReplacePartition for device" << partition->partitionPath();
QString defaultFsType = Calamares::JobQueue::instance()->
globalStorage()->
value( "defaultFileSystemType" ).toString();
if ( FileSystem::typeForName( defaultFsType ) == FileSystem::Unknown )
defaultFsType = "ext4";
PartitionRole newRoles( partition->roles() ); PartitionRole newRoles( partition->roles() );
if ( partition->roles().has( PartitionRole::Extended ) ) if ( partition->roles().has( PartitionRole::Extended ) )
newRoles = PartitionRole( PartitionRole::Primary ); newRoles = PartitionRole( PartitionRole::Primary );
@ -260,7 +272,7 @@ doReplacePartition( PartitionCoreModule* core,
partition->parent(), partition->parent(),
*dev, *dev,
newRoles, newRoles,
FileSystem::Ext4, FileSystem::typeForName( defaultFsType ),
partition->firstSector(), partition->firstSector(),
partition->lastSector() partition->lastSector()
); );
@ -271,7 +283,7 @@ doReplacePartition( PartitionCoreModule* core,
partition->parent(), partition->parent(),
*dev, *dev,
newRoles, newRoles,
FileSystem::Ext4, FileSystem::typeForName( defaultFsType ),
partition->firstSector(), partition->firstSector(),
partition->lastSector(), partition->lastSector(),
luksPassphrase luksPassphrase

View File

@ -85,6 +85,12 @@ ChoicePage::ChoicePage( QWidget* parent )
{ {
setupUi( this ); setupUi( this );
m_defaultFsType = Calamares::JobQueue::instance()->
globalStorage()->
value( "defaultFileSystemType" ).toString();
if ( FileSystem::typeForName( m_defaultFsType ) == FileSystem::Unknown )
m_defaultFsType = "ext4";
// Set up drives combo // Set up drives combo
m_mainLayout->setDirection( QBoxLayout::TopToBottom ); m_mainLayout->setDirection( QBoxLayout::TopToBottom );
m_drivesLayout->setDirection( QBoxLayout::LeftToRight ); m_drivesLayout->setDirection( QBoxLayout::LeftToRight );
@ -574,7 +580,7 @@ ChoicePage::doAlongsideApply()
candidate->parent(), candidate->parent(),
*dev, *dev,
candidate->roles(), candidate->roles(),
FileSystem::Ext4, FileSystem::typeForName( m_defaultFsType ),
newLastSector + 2, // * newLastSector + 2, // *
oldLastSector oldLastSector
); );
@ -585,7 +591,7 @@ ChoicePage::doAlongsideApply()
candidate->parent(), candidate->parent(),
*dev, *dev,
candidate->roles(), candidate->roles(),
FileSystem::Ext4, FileSystem::typeForName( m_defaultFsType ),
newLastSector + 2, // * newLastSector + 2, // *
oldLastSector, oldLastSector,
luksPassphrase luksPassphrase
@ -649,7 +655,7 @@ ChoicePage::doReplaceSelectedPartition( const QModelIndex& current,
newParent, newParent,
*selectedDevice(), *selectedDevice(),
newRoles, newRoles,
FileSystem::Ext4, FileSystem::typeForName( m_defaultFsType ),
selectedPartition->firstSector(), selectedPartition->firstSector(),
selectedPartition->lastSector(), selectedPartition->lastSector(),
m_encryptWidget->passphrase() ); m_encryptWidget->passphrase() );
@ -660,7 +666,7 @@ ChoicePage::doReplaceSelectedPartition( const QModelIndex& current,
newParent, newParent,
*selectedDevice(), *selectedDevice(),
newRoles, newRoles,
FileSystem::Ext4, FileSystem::typeForName( m_defaultFsType ),
selectedPartition->firstSector(), selectedPartition->firstSector(),
selectedPartition->lastSector() ); selectedPartition->lastSector() );
} }

View File

@ -120,6 +120,8 @@ private:
int m_lastSelectedDeviceIndex; int m_lastSelectedDeviceIndex;
QString m_defaultFsType;
QMutex m_coreMutex; QMutex m_coreMutex;
}; };