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.
master
Alejandro Sirgo Rica 2024-10-21 16:56:05 +02:00
parent b3659a30fc
commit 2fcdf89606
1 changed files with 1 additions and 1 deletions

View File

@ -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...')