--- xen-4.1.2/tools/pygrub/src/pygrub.orig 2011-10-13 18:56:41.000000000 +0100 +++ xen-4.1.2/tools/pygrub/src/pygrub 2011-10-13 20:46:58.000000000 +0100 @@ -78,9 +78,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("0: + buf = os.read(fd, partsize) + offsets.append(struct.unpack(" 0: + menu_level -= 1 + continue + else: + raise RuntimeError, "syntax error: closing brace without menuentry" self.add_image(Grub2Image(title, img)) img = None @@ -414,6 +425,8 @@ if self.commands.has_key(com): if self.commands[com] is not None: + if arg.strip() == "${saved_entry}": + arg = "0" setattr(self, self.commands[com], arg.strip()) else: logging.info("Ignored directive %s" %(com,))