Move detect_firmware_type to the prepare module.

This avoids the duplication between the bootloader and grub modules.
This commit is contained in:
Kevin Kofler 2014-11-19 13:58:18 +01:00
parent 930a49677a
commit 4df754ef29
4 changed files with 12 additions and 24 deletions

View file

@ -32,6 +32,7 @@
#include <QDBusConnection>
#include <QDBusInterface>
#include <QDir>
#include <QFile>
#include <QFileInfo>
#include <QLabel>
#include <QProcess>
@ -133,6 +134,9 @@ PrepareViewStep::PrepareViewStep( QObject* parent )
m_nextEnabled = canGoNext;
emit nextStatusChanged( m_nextEnabled );
if ( canGoNext )
detectFirmwareType();
timer->deleteLater();
} );
timer->start( 0 );
@ -363,3 +367,10 @@ PrepareViewStep::checkHasInternet()
return nmState == NM_STATE_CONNECTED_GLOBAL;
}
void
PrepareViewStep::detectFirmwareType()
{
QString fwType = QFile::exists( "/sys/firmware/efi/efivars" ) ? "efi" : "bios";
Calamares::JobQueue::instance()->globalStorage()->insert( "firmwareType", fwType );
}