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

@ -109,8 +109,6 @@ PartitionCoreModule::init()
CoreBackend* backend = CoreBackendManager::self()->backend(); CoreBackend* backend = CoreBackendManager::self()->backend();
auto devices = backend->scanDevices( true ); auto devices = backend->scanDevices( true );
m_osproberLines = PartUtils::runOsprober( this );
// Remove the device which contains / from the list // Remove the device which contains / from the list
for ( auto it = devices.begin(); it != devices.end(); ) for ( auto it = devices.begin(); it != devices.end(); )
if ( hasRootPartition( *it ) ) if ( hasRootPartition( *it ) )
@ -122,11 +120,18 @@ PartitionCoreModule::init()
{ {
auto deviceInfo = new DeviceInfo( device ); auto deviceInfo = new DeviceInfo( device );
m_deviceInfos << deviceInfo; m_deviceInfos << deviceInfo;
deviceInfo->partitionModel->init( device, m_osproberLines );
} }
m_deviceModel->init( devices ); 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 ); m_bootLoaderModel->init( devices );
if ( QDir( "/sys/firmware/efi/efivars" ).exists() ) if ( QDir( "/sys/firmware/efi/efivars" ).exists() )

Loading…
Cancel
Save