Move ESP check to onLeave().

This commit is contained in:
Teo Mrnjavac 2016-03-09 13:21:07 +01:00
parent 0c7b7ed089
commit fb5b48528b

View file

@ -294,54 +294,6 @@ PartitionViewStep::next()
cDebug() << "Choice applied: " << m_choicePage->currentChoice();
return;
}
else if ( m_manualPartitionPage == m_widget->currentWidget() )
{
if ( QDir( "/sys/firmware/efi/efivars" ).exists() )
{
QString espMountPoint = Calamares::JobQueue::instance()->globalStorage()->
value( "efiSystemPartition").toString();
Partition* esp = m_core->findPartitionByMountPoint( espMountPoint );
QString message;
QString description;
if ( !esp )
{
message = tr( "No EFI system partition configured" );
description = tr( "An EFI system partition is necessary to start %1. "
"To configure an EFI system partition, go back and "
"select or create a FAT32 filesystem with the "
"<strong>esp</strong> flag enabled and mount point "
"%2.<br/>"
"You can continue without setting up an EFI system "
"partition but your system may fail to start." )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ShortProductName ) )
.arg( espMountPoint );
}
else if ( esp && !esp->activeFlags().testFlag( PartitionTable::FlagEsp ) )
{
message = tr( "EFI system partition flag not set" );
description = tr( "An EFI system partition is necessary to start %1. "
"A partition was configured with mount point "
"%2 but its <strong>esp</strong> flag is not set. "
"To set the flag, go back and edit the partition.<br/>"
"You can continue without setting the flag but your "
"system may fail to start." )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ShortProductName ) )
.arg( espMountPoint );
}
if ( !message.isEmpty() )
{
QMessageBox::warning( m_manualPartitionPage,
message,
description );
emit done();
return;
}
}
}
emit done();
}
@ -414,7 +366,58 @@ void
PartitionViewStep::onLeave()
{
if ( m_widget->currentWidget() == m_choicePage )
{
m_choicePage->onLeave();
return;
}
if ( m_widget->currentWidget() == m_manualPartitionPage )
{
if ( QDir( "/sys/firmware/efi/efivars" ).exists() )
{
QString espMountPoint = Calamares::JobQueue::instance()->globalStorage()->
value( "efiSystemPartition").toString();
Partition* esp = m_core->findPartitionByMountPoint( espMountPoint );
QString message;
QString description;
if ( !esp )
{
message = tr( "No EFI system partition configured" );
description = tr( "An EFI system partition is necessary to start %1. "
"To configure an EFI system partition, go back and "
"select or create a FAT32 filesystem with the "
"<strong>esp</strong> flag enabled and mount point "
"%2.<br/>"
"You can continue without setting up an EFI system "
"partition but your system may fail to start." )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ShortProductName ) )
.arg( espMountPoint );
}
else if ( esp && !esp->activeFlags().testFlag( PartitionTable::FlagEsp ) )
{
message = tr( "EFI system partition flag not set" );
description = tr( "An EFI system partition is necessary to start %1. "
"A partition was configured with mount point "
"%2 but its <strong>esp</strong> flag is not set. "
"To set the flag, go back and edit the partition.<br/>"
"You can continue without setting the flag but your "
"system may fail to start." )
.arg( Calamares::Branding::instance()->
string( Calamares::Branding::ShortProductName ) )
.arg( espMountPoint );
}
if ( !message.isEmpty() )
{
QMessageBox::warning( m_manualPartitionPage,
message,
description );
return;
}
}
}
}