]> git.pld-linux.org Git - packages/xen.git/blob - pygrubfix.patch
- updated to 4.18.1; new sonames, ocaml libxenlight and libxentoollog are gone
[packages/xen.git] / pygrubfix.patch
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)
5      buf = os.read(fd, 512)
6      os.close(fd)
7 +    offzerocount = 0
8      for poff in (446, 462, 478, 494): # partition offsets
9  
10          # MBR contains a 16 byte descriptor per partition
11 @@ -265,6 +266,7 @@ def get_partition_offsets(file):
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 @@ -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]
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.0397 seconds and 4 git commands to generate.