Move detect_firmware_type to the prepare module.
This avoids the duplication between the bootloader and grub modules.
This commit is contained in:
parent
930a49677a
commit
4df754ef29
@ -29,17 +29,6 @@ import subprocess
|
||||
from libcalamares.utils import check_chroot_call
|
||||
|
||||
|
||||
def detect_firmware_type():
|
||||
# Check for EFI variables support
|
||||
if(os.path.exists("/sys/firmware/efi/efivars")):
|
||||
fw_type = 'efi'
|
||||
else:
|
||||
fw_type = 'bios'
|
||||
|
||||
libcalamares.globalstorage.insert("firmwareType", fw_type)
|
||||
libcalamares.utils.debug("Firmware type: {!s}".format(fw_type))
|
||||
|
||||
|
||||
def get_uuid():
|
||||
root_mount_point = libcalamares.globalstorage.value("rootMountPoint")
|
||||
print(root_mount_point)
|
||||
@ -158,7 +147,6 @@ def install_bootloader(boot_loader, fw_type):
|
||||
|
||||
|
||||
def run():
|
||||
detect_firmware_type()
|
||||
boot_loader = libcalamares.globalstorage.value("bootLoader")
|
||||
fw_type = libcalamares.globalstorage.value("firmwareType")
|
||||
install_bootloader(boot_loader, fw_type)
|
||||
|
@ -23,17 +23,6 @@ import libcalamares
|
||||
from libcalamares.utils import check_chroot_call
|
||||
|
||||
|
||||
def detect_firmware_type():
|
||||
# Check for EFI variables support
|
||||
if(os.path.exists("/sys/firmware/efi/efivars")):
|
||||
fw_type = 'efi'
|
||||
else:
|
||||
fw_type = 'bios'
|
||||
|
||||
libcalamares.globalstorage.insert("firmwareType", fw_type)
|
||||
libcalamares.utils.debug("Firmware type: {!s}".format(fw_type))
|
||||
|
||||
|
||||
def install_grub(boot_loader, fw_type):
|
||||
if fw_type == 'efi':
|
||||
efi_directory = "/boot/efi"
|
||||
@ -49,7 +38,6 @@ def install_grub(boot_loader, fw_type):
|
||||
|
||||
|
||||
def run():
|
||||
detect_firmware_type()
|
||||
boot_loader = libcalamares.globalstorage.value("bootLoader")
|
||||
fw_type = libcalamares.globalstorage.value("firmwareType")
|
||||
install_grub(boot_loader, fw_type)
|
||||
|
@ -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 );
|
||||
}
|
||||
|
@ -75,6 +75,7 @@ private:
|
||||
bool checkBatteryExists();
|
||||
bool checkHasPower();
|
||||
bool checkHasInternet();
|
||||
void detectFirmwareType();
|
||||
|
||||
QWidget* m_widget;
|
||||
qreal m_requiredStorageGB;
|
||||
|
Loading…
Reference in New Issue
Block a user