diff options
author | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-10-21 16:56:05 +0200 |
---|---|---|
committer | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-10-21 16:56:05 +0200 |
commit | 2fcdf896061fd3dfdde9ea42c58a76dd3f42f3fa (patch) | |
tree | 3a6c3fa9b2fc7b4e98533145639512a02c2c446d | |
parent | b3659a30fc3b8f5b09d14869aa33b09d720dabe4 (diff) |
disk: use cxt.label.name to dtect disk type in get_efi_partition
Use cxt.label.name instead of cxt.label to identify if the disk is
GPT or MBR. This way is more used in other parts of the codebase.
-rw-r--r-- | src/utils/disk.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/utils/disk.py b/src/utils/disk.py index 94bbc65..2af1462 100644 --- a/src/utils/disk.py +++ b/src/utils/disk.py @@ -105,7 +105,7 @@ def get_efi_partition(disknum, enforce_gpt): disk = get_disks()[disk_index] cxt = fdisk.Context(f'/dev/{disk}') - if enforce_gpt and cxt.label == fdisk.FDISK_DISKLABEL_DOS: + if enforce_gpt and cxt.label.name == 'dos': raise OgError(f'Windows EFI partition requires GPT partition scheme, but /dev/{disk} has DOS partition scheme') logging.info('Searching EFI partition...') |