81501c15a5
23686-pygrub-solaris.patch 23697-pygrub-grub2.patch 23944-pygrub-debug.patch 23998-pygrub-GPT.patch 23999-pygrub-grub2.patch 24064-pygrub-HybridISO.patch 24401-pygrub-scrolling.patch 24402-pygrub-edit-fix.patch 24460-pygrub-extlinux.patch 24706-pygrub-extlinux.patch - Revised version of security patch and an additional patch for bnc#764077 x86_64-AMD-erratum-121.patch x86_64-allow-unsafe-adjust.patch - bnc#764077 - VUL-0: EMBARGOED: xen: XSA-9: denial of service on older AMD systems x86_64-AMD-erratum-121.patch - Revised version of security patch for bnc#757537 x86_64-sysret-canonical.patch - bnc#757537 - VUL-0: xen: CVE-2012-0217 PV guest escalation x86_64-sysret-canonical.patch - bnc#757970 - VUL-1: xen: guest denial of service on syscall GPF generation x86_64-trap-bounce-flags.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=190
54 lines
1.9 KiB
Diff
54 lines
1.9 KiB
Diff
# HG changeset patch
|
|
# User Michael Young <m.a.young@durham.ac.uk>
|
|
# Date 1319566554 -3600
|
|
# Node ID 85d7b207fabcd1cbda8f93e3937c5990f42a2cf9
|
|
# Parent f273bce1fc265b9f71879705639a0b14da03f6e1
|
|
pygrub: check all GPT partitions
|
|
|
|
On Fedora 16 the first GPT partition is a boot partition for grub2 with
|
|
the grub2 configuration in the second partition.
|
|
Check all GPT partitions for grub configuration, not just the first.
|
|
|
|
[ Also remove now-inaccurate comment. -iwj ]
|
|
|
|
Signed-off-by: Michael Young <m.a.young@durham.ac.uk>
|
|
Tested-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
|
|
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
|
|
|
|
diff -r f273bce1fc26 -r 85d7b207fabc tools/pygrub/src/pygrub
|
|
--- a/tools/pygrub/src/pygrub Tue Oct 25 17:04:41 2011 +0100
|
|
+++ b/tools/pygrub/src/pygrub Tue Oct 25 19:15:54 2011 +0100
|
|
@@ -77,10 +77,17 @@
|
|
|
|
def get_fs_offset_gpt(file):
|
|
fd = os.open(file, os.O_RDONLY)
|
|
- # assume the first partition is an EFI system partition.
|
|
- os.lseek(fd, SECTOR_SIZE * 2, 0)
|
|
+ os.lseek(fd, SECTOR_SIZE, 0)
|
|
buf = os.read(fd, 512)
|
|
- return struct.unpack("<Q", buf[32:40])[0] * SECTOR_SIZE
|
|
+ partcount = struct.unpack("<L", buf[80:84])[0]
|
|
+ partsize = struct.unpack("<L", buf[84:88])[0]
|
|
+ i = partcount
|
|
+ offsets = []
|
|
+ while i>0:
|
|
+ buf = os.read(fd, partsize)
|
|
+ offsets.append(struct.unpack("<Q", buf[32:40])[0] * SECTOR_SIZE)
|
|
+ i -= 1
|
|
+ return offsets
|
|
|
|
FDISK_PART_SOLARIS=0xbf
|
|
FDISK_PART_SOLARIS_OLD=0x82
|
|
@@ -114,7 +121,9 @@
|
|
continue # no solaris magic at that offset, ignore partition
|
|
|
|
if type == FDISK_PART_GPT:
|
|
- offset = get_fs_offset_gpt(file)
|
|
+ for offset in get_fs_offset_gpt(file):
|
|
+ part_offs.append(offset)
|
|
+ break
|
|
|
|
# Active partition has 0x80 as the first byte.
|
|
# If active, prepend to front of list, otherwise append to back.
|