summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlejandro Sirgo Rica <asirgo@soleta.eu>2024-10-21 16:56:05 +0200
committerAlejandro Sirgo Rica <asirgo@soleta.eu>2024-10-21 16:56:05 +0200
commit2fcdf896061fd3dfdde9ea42c58a76dd3f42f3fa (patch)
tree3a6c3fa9b2fc7b4e98533145639512a02c2c446d /src
parentb3659a30fc3b8f5b09d14869aa33b09d720dabe4 (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.
Diffstat (limited to 'src')
-rw-r--r--src/utils/disk.py2
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...')