From 2fcdf896061fd3dfdde9ea42c58a76dd3f42f3fa Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Mon, 21 Oct 2024 16:56:05 +0200 Subject: 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. --- src/utils/disk.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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...') -- cgit v1.2.3-18-g5258