1 diff -urNp -x '*.orig' xen-4.13.1.org/tools/pygrub/src/pygrub xen-4.13.1/tools/pygrub/src/pygrub
2 --- xen-4.13.1.org/tools/pygrub/src/pygrub 2021-03-25 22:42:14.797689878 +0100
3 +++ xen-4.13.1/tools/pygrub/src/pygrub 2021-03-25 22:42:15.517685792 +0100
4 @@ -129,6 +129,7 @@ def get_partition_offsets(file):
5 fd = os.open(file, os.O_RDONLY)
9 for poff in (446, 462, 478, 494): # partition offsets
11 # MBR contains a 16 byte descriptor per partition
12 @@ -138,6 +139,7 @@ def get_partition_offsets(file):
14 # offset == 0 implies this partition is not enabled
19 if type == FDISK_PART_SOLARIS or type == FDISK_PART_SOLARIS_OLD:
20 @@ -163,6 +165,9 @@ def get_partition_offsets(file):
21 # (e.g. grubs) may contain the same signature.
22 if not part_offs: part_offs = [0]
24 + if offzerocount == 4:
25 + # Might be a grub boot sector pretending to be an MBR
29 class GrubLineEditor(curses.textpad.Textbox):