Run osprober after we have a working DeviceModel.

main
Teo Mrnjavac 9 years ago
parent fc54b9bf40
commit e277467ed4

@ -91,7 +91,6 @@ canBeResized( PartitionCoreModule* core, const QString& partitionPath )
OsproberEntryList
runOsprober( PartitionCoreModule* core )
{
cDebug() << "BEGIN" << Q_FUNC_INFO;
QString osproberOutput;
QProcess osprober;
osprober.setProgram( "os-prober" );
@ -142,7 +141,6 @@ runOsprober( PartitionCoreModule* core )
Calamares::JobQueue::instance()->globalStorage()->insert( "osproberLines", osproberCleanLines );
cDebug() << "END" << Q_FUNC_INFO;
return osproberEntries;
}

@ -109,8 +109,6 @@ PartitionCoreModule::init()
CoreBackend* backend = CoreBackendManager::self()->backend();
auto devices = backend->scanDevices( true );
m_osproberLines = PartUtils::runOsprober( this );
// Remove the device which contains / from the list
for ( auto it = devices.begin(); it != devices.end(); )
if ( hasRootPartition( *it ) )
@ -122,11 +120,18 @@ PartitionCoreModule::init()
{
auto deviceInfo = new DeviceInfo( device );
m_deviceInfos << deviceInfo;
deviceInfo->partitionModel->init( device, m_osproberLines );
}
m_deviceModel->init( devices );
// The following PartUtils::runOsprober call in turn calls PartUtils::canBeResized,
// which relies on a working DeviceModel.
m_osproberLines = PartUtils::runOsprober( this );
for ( auto deviceInfo : m_deviceInfos )
{
deviceInfo->partitionModel->init( deviceInfo->device.data(), m_osproberLines );
}
m_bootLoaderModel->init( devices );
if ( QDir( "/sys/firmware/efi/efivars" ).exists() )

Loading…
Cancel
Save