]> git.pld-linux.org Git - packages/xen.git/blob - pygrubfix.patch
- rediff patches
[packages/xen.git] / pygrubfix.patch
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)
6      buf = os.read(fd, 512)
7      os.close(fd)
8 +    offzerocount = 0
9      for poff in (446, 462, 478, 494): # partition offsets
10  
11          # MBR contains a 16 byte descriptor per partition
12 @@ -138,6 +139,7 @@ def get_partition_offsets(file):
13          
14          # offset == 0 implies this partition is not enabled
15          if offset == 0:
16 +            offzerocount += 1
17              continue
18  
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]
23  
24 +    if offzerocount == 4:
25 +        # Might be a grub boot sector pretending to be an MBR
26 +        part_offs.append(0)
27      return part_offs
28  
29  class GrubLineEditor(curses.textpad.Textbox):
This page took 0.062122 seconds and 3 git commands to generate.