]> git.pld-linux.org Git - packages/xen.git/blob - pygrubfix.patch
- make pygrub work better with GPT partitions and grub2 on guest
[packages/xen.git] / pygrubfix.patch
1 --- xen-4.1.0/tools/pygrub/src/pygrub.orig      2010-12-31 15:24:11.000000000 +0000
2 +++ xen-4.1.0/tools/pygrub/src/pygrub   2011-01-30 18:58:17.000000000 +0000
3 @@ -96,6 +96,7 @@
4  
5      fd = os.open(file, os.O_RDONLY)
6      buf = os.read(fd, 512)
7 +    offzerocount = 0
8      for poff in (446, 462, 478, 494): # partition offsets
9  
10          # MBR contains a 16 byte descriptor per partition
11 @@ -105,6 +106,7 @@
12          
13          # offset == 0 implies this partition is not enabled
14          if offset == 0:
15 +            offzerocount += 1
16              continue
17  
18          if type == FDISK_PART_SOLARIS or type == FDISK_PART_SOLARIS_OLD:
19 @@ -123,6 +125,9 @@
20          else:
21              part_offs.append(offset)
22  
23 +    if offzerocount == 4:
24 +        # Might be a grub boot sector pretending to be an MBR
25 +        part_offs.append(0)
26      return part_offs
27  
28  class GrubLineEditor(curses.textpad.Textbox):
This page took 0.062304 seconds and 4 git commands to generate.