The grub2 configuration file in Fedora 16 can have one or menuentrys in a submenu, with configuration of the form submenu "Xen 4.1" { menuentry ... { ... } } (this example occurs when the xen hypervisor is installed on the guest) Ignore the submenu line and the corresponding } Signed-off-by: Michael Young --- a/tools/pygrub/src/GrubConf.py 2011-10-17 21:26:48.000000000 +0100 +++ b/tools/pygrub/src/GrubConf.py 2011-10-17 21:46:00.000000000 +0100 @@ -368,6 +368,7 @@ in_function = False img = None title = "" + menu_level=0 for l in lines: l = l.strip() # skip blank lines @@ -394,10 +395,18 @@ img = [] title = title_match.group(1) continue - + + if l.startswith("submenu"): + menu_level += 1 + continue + if l.startswith("}"): if img is None: - raise RuntimeError, "syntax error: closing brace without menuentry" + if menu_level > 0: + menu_level -= 1 + continue + else: + raise RuntimeError, "syntax error: closing brace without menuentry" self.add_image(Grub2Image(title, img)) img = None