X-Git-Url: https://git.grml.org/?p=grml2usb.git;a=blobdiff_plain;f=grml2usb;h=376f6d51cae21e9d988f2699567641659f9f4e40;hp=bef2dc2b54fe3923d4c72843f5b59ee635a99e25;hb=refs%2Fheads%2Fmika%2Fdetect_gpt;hpb=fafa0d86e842217845ce314bec5199b0506d597c diff --git a/grml2usb b/grml2usb index bef2dc2..376f6d5 100755 --- a/grml2usb +++ b/grml2usb @@ -318,9 +318,14 @@ def check_boot_flag(device): boot_dev, x = get_device_from_partition(device) with open(boot_dev, 'r') as image: - data = image.read(512) + data = image.read(520) bootcode = data[440:] - if bootcode[6] == '\x80': + gpt_header = "\x55\xaa\x45\x46\x49\x20\x50\x41\x52\x54" # original GPT header + gpt_data = bootcode[70:80] + + if gpt_data == gpt_header: + logging.info("GPT detected, skipping bootflag check") + elif bootcode[6] == '\x80': logging.debug("bootflag is enabled") else: logging.debug("bootflag is NOT enabled")