mirror of https://git.48k.eu/ogclient
utils: refine log when booting windows UEFI from DOS partition
Refine 97647c32aa
utils: add enforce_gpt argument to get_efi_partition()
to provide more explicit error when trying to boot Windows UEFI from DOS
partition.
master
parent
1aba9d0923
commit
4712941828
|
@ -61,7 +61,7 @@ def get_efi_partition(disknum, enforce_gpt):
|
||||||
cxt = fdisk.Context(f'/dev/{disk}')
|
cxt = fdisk.Context(f'/dev/{disk}')
|
||||||
|
|
||||||
if enforce_gpt and cxt.label == fdisk.FDISK_DISKLABEL_DOS:
|
if enforce_gpt and cxt.label == fdisk.FDISK_DISKLABEL_DOS:
|
||||||
raise RuntimeError(f'Disk has DOS partition scheme, cannot find ESP at /dev/{disk}')
|
raise RuntimeError(f'Windows EFI System requires GPT partition scheme, but /dev/{disk} has DOS partition scheme')
|
||||||
|
|
||||||
for pa in cxt.partitions:
|
for pa in cxt.partitions:
|
||||||
logging.info(f'Checking partition "{pa.type.name}"...')
|
logging.info(f'Checking partition "{pa.type.name}"...')
|
||||||
|
|
Loading…
Reference in New Issue