1 --- xen-4.1.2/tools/pygrub/src/pygrub.orig 2011-10-13 18:56:41.000000000 +0100
2 +++ xen-4.1.2/tools/pygrub/src/pygrub 2011-10-13 20:46:58.000000000 +0100
4 def get_fs_offset_gpt(file):
5 fd = os.open(file, os.O_RDONLY)
6 # assume the first partition is an EFI system partition.
7 - os.lseek(fd, SECTOR_SIZE * 2, 0)
8 + os.lseek(fd, SECTOR_SIZE, 0)
10 - return struct.unpack("<Q", buf[32:40])[0] * SECTOR_SIZE
11 + partcount = struct.unpack("<L", buf[80:84])[0]
12 + partsize = struct.unpack("<L", buf[84:88])[0]
16 + buf = os.read(fd, partsize)
17 + offsets.append(struct.unpack("<Q", buf[32:40])[0] * SECTOR_SIZE)
21 FDISK_PART_SOLARIS=0xbf
22 FDISK_PART_SOLARIS_OLD=0x82
24 continue # no solaris magic at that offset, ignore partition
26 if type == FDISK_PART_GPT:
27 - offset = get_fs_offset_gpt(file)
28 + for offset in get_fs_offset_gpt(file):
29 + part_offs.append(offset)
32 # Active partition has 0x80 as the first byte.
33 # If active, prepend to front of list, otherwise append to back.
35 ["/boot/grub/menu.lst", "/boot/grub/grub.conf",
36 "/grub/menu.lst", "/grub/grub.conf"]) + \
37 map(lambda x: (x,grub.GrubConf.Grub2ConfigFile),
38 - ["/boot/grub/grub.cfg", "/grub/grub.cfg"]) + \
39 + ["/boot/grub/grub.cfg", "/grub/grub.cfg",
40 + "/boot/grub2/grub.cfg", "/grub2/grub.cfg"]) + \
41 map(lambda x: (x,grub.ExtLinuxConf.ExtLinuxConfigFile),
42 ["/boot/isolinux/isolinux.cfg",
43 "/boot/extlinux.conf"])
44 --- xen-4.1.2/tools/pygrub/src/GrubConf.py.orig 2011-10-08 19:42:10.000000000 +0100
45 +++ xen-4.1.2/tools/pygrub/src/GrubConf.py 2011-10-14 21:08:44.000000000 +0100
47 val = val.replace("(", "").replace(")", "")
48 if val[:5] == "msdos":
50 + if val[:3] == "gpt":
53 part = property(get_part, set_part)
65 title = title_match.group(1)
69 + if l.startswith("submenu"):
75 - raise RuntimeError, "syntax error: closing brace without menuentry"
80 + raise RuntimeError, "syntax error: closing brace without menuentry"
82 self.add_image(Grub2Image(title, img))
86 if self.commands.has_key(com):
87 if self.commands[com] is not None:
88 + if arg.strip() == "${saved_entry}":
90 setattr(self, self.commands[com], arg.strip())
92 logging.info("Ignored directive %s" %(com,))