diff -dur xen-4.2.0.orig/tools/pygrub/src/pygrub xen-4.2.0/tools/pygrub/src/pygrub --- xen-4.2.0.orig/tools/pygrub/src/pygrub 2012-09-17 12:21:18.000000000 +0200 +++ xen-4.2.0/tools/pygrub/src/pygrub 2012-10-22 10:57:09.000000000 +0200 @@ -119,6 +119,7 @@ fd = os.open(file, os.O_RDONLY) buf = os.read(fd, 512) os.close(fd) + offzerocount = 0 for poff in (446, 462, 478, 494): # partition offsets # MBR contains a 16 byte descriptor per partition @@ -128,6 +129,7 @@ # offset == 0 implies this partition is not enabled if offset == 0: + offzerocount += 1 continue if type == FDISK_PART_SOLARIS or type == FDISK_PART_SOLARIS_OLD: @@ -148,6 +150,9 @@ else: part_offs.append(offset) + if offzerocount == 4: + # Might be a grub boot sector pretending to be an MBR + part_offs.append(0) return part_offs class GrubLineEditor(curses.textpad.Textbox):