diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/live/ogOperations.py | 2 | ||||
-rw-r--r-- | src/utils/boot.py | 2 | ||||
-rw-r--r-- | src/utils/uefi.py | 14 |
3 files changed, 14 insertions, 4 deletions
diff --git a/src/live/ogOperations.py b/src/live/ogOperations.py index d5f22a9..5d9e898 100644 --- a/src/live/ogOperations.py +++ b/src/live/ogOperations.py @@ -262,7 +262,7 @@ class OgLiveOperations: disk = request.getDisk() partition = request.getPartition() - if is_uefi_supported(): + if is_uefi_supported(disk): logging.info('UEFI support detected') logging.info(f'Booting disk={disk} partition={partition}') boot_os_at(int(disk), int(partition)) diff --git a/src/utils/boot.py b/src/utils/boot.py index cd66357..4de20b9 100644 --- a/src/utils/boot.py +++ b/src/utils/boot.py @@ -69,7 +69,7 @@ def _boot_uefi_linux(disk, part, mountpoint): umount(esp_mountpoint) def boot_os_at(disk, part): - if not is_uefi_supported(): + if not is_uefi_supported(disk): raise NotImplementedError('BIOS booting is not implemented yet') device = get_partition_device(disk, part) diff --git a/src/utils/uefi.py b/src/utils/uefi.py index 753cc0b..67f1354 100644 --- a/src/utils/uefi.py +++ b/src/utils/uefi.py @@ -11,6 +11,7 @@ import logging import os import shlex import subprocess +from src.utils.disk import get_efi_partition import fdisk @@ -46,8 +47,17 @@ def _check_efibootmgr_json(): return supported -def is_uefi_supported(): - return True if os.path.exists("/sys/firmware/efi") else False +def is_uefi_supported(disknum): + is_supported = os.path.exists("/sys/firmware/efi") + + if is_supported: + try: + get_efi_partition(disknum) + except Exception as e: + logging.info(e) + is_supported = False + + return is_supported def run_efibootmgr_json(): |