]>
Commit | Line | Data |
---|---|---|
bf4f47e8 JK |
1 | diff -dur xen-4.2.0.orig/tools/pygrub/src/pygrub xen-4.2.0/tools/pygrub/src/pygrub |
2 | --- xen-4.2.0.orig/tools/pygrub/src/pygrub 2012-09-17 12:21:18.000000000 +0200 | |
3 | +++ xen-4.2.0/tools/pygrub/src/pygrub 2012-10-22 10:57:09.000000000 +0200 | |
4 | @@ -119,6 +119,7 @@ | |
ed22e3b5 JR |
5 | fd = os.open(file, os.O_RDONLY) |
6 | buf = os.read(fd, 512) | |
bf4f47e8 | 7 | os.close(fd) |
ed22e3b5 JR |
8 | + offzerocount = 0 |
9 | for poff in (446, 462, 478, 494): # partition offsets | |
10 | ||
11 | # MBR contains a 16 byte descriptor per partition | |
bf4f47e8 | 12 | @@ -128,6 +129,7 @@ |
ed22e3b5 JR |
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: | |
bf4f47e8 | 20 | @@ -148,6 +150,9 @@ |
ed22e3b5 JR |
21 | else: |
22 | part_offs.append(offset) | |
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): |