From 66b1787ae57c27be62f31902e4d5d510610b8dc6 Mon Sep 17 00:00:00 2001 From: Michael Young Date: Tue, 25 Oct 2011 19:15:54 +0100 Subject: 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 Tested-by: Paolo Bonzini Signed-off-by: Ian Jackson Committed-by: Ian Jackson --- tools/pygrub/src/pygrub | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'tools/pygrub') diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub index 5dc9405cf6..4dc42f7f3a 100644 --- a/tools/pygrub/src/pygrub +++ b/tools/pygrub/src/pygrub @@ -77,10 +77,17 @@ def get_solaris_slice(file, offset): 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("0: + buf = os.read(fd, partsize) + offsets.append(struct.unpack("