1 --- xen-4.18.1/tools/pygrub/src/pygrub.orig 2024-03-18 09:27:49.000000000 +0100
2 +++ xen-4.18.1/tools/pygrub/src/pygrub 2024-04-22 20:02:33.313097814 +0200
3 @@ -256,6 +256,7 @@ def get_partition_offsets(file):
4 fd = os.open(file, os.O_RDONLY)
8 for poff in (446, 462, 478, 494): # partition offsets
10 # MBR contains a 16 byte descriptor per partition
11 @@ -265,6 +266,7 @@ def get_partition_offsets(file):
13 # offset == 0 implies this partition is not enabled
18 if type == FDISK_PART_SOLARIS or type == FDISK_PART_SOLARIS_OLD:
19 @@ -290,6 +292,9 @@ def get_partition_offsets(file):
20 # (e.g. grubs) may contain the same signature.
21 if not part_offs: part_offs = [0]
23 + if offzerocount == 4:
24 + # Might be a grub boot sector pretending to be an MBR
28 class GrubLineEditor(curses.textpad.Textbox):