Changes between Initial Version and Version 1 of Ticket #296


Ignore:
Timestamp:
Sep 5, 2012, 4:33:34 PM (12 years ago)
Author:
ezyang
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #296 – Description

    initial v1  
    11Xen needs this patch series ​http://old-list-archives.xen.org/archives/html/xen-devel/2011-10/msg01404.html unfortunately they haven't been backported to Xen 4.0 or Xen 4.1 yet. (We specifically need only patches 2, 4 and 5). The pygrub executable patch is fuzzy, but easy to manually apply. Otherwise you won't be able to boot because the bootloader returns no data. Currently c-o has had its pygrub manually patched with these patches; we should talk to backports or package up these changes ourselves. The idea is to just install another pygrub, and then ask Xen to use it instead.
     2
     3{{{
     4--- /usr/lib/xen-4.0/lib/python/grub/GrubConf.py.orig   2012-08-14 10:28:54.000000000 -0400
     5+++ /usr/lib/xen-4.0/lib/python/grub/GrubConf.py        2012-09-05 16:24:37.061357415 -0400
     6@@ -414,6 +414,8 @@
     7
     8             if self.commands.has_key(com):
     9                 if self.commands[com] is not None:
     10+                    if arg.strip() == "${saved_entry}":
     11+                        arg = "0"
     12                     setattr(self, self.commands[com], arg.strip())
     13                 else:
     14                     logging.info("Ignored directive %s" %(com,))
     15--- /usr/lib/xen-4.0/lib/python/grub/GrubConf.py.orig
     16+++ /usr/lib/xen-4.0/lib/python/grub/GrubConf.py
     17@@ -368,6 +368,7 @@
     18         in_function = False
     19         img = None
     20         title = ""
     21+        menu_level=0
     22         for l in lines:
     23             l = l.strip()
     24             # skip blank lines
     25@@ -394,10 +395,18 @@
     26                 img = []
     27                 title = title_match.group(1)
     28                 continue
     29-
     30+
     31+            if l.startswith("submenu"):
     32+                menu_level += 1
     33+                continue
     34+
     35             if l.startswith("}"):
     36                 if img is None:
     37-                    raise RuntimeError, "syntax error: closing brace without menuentry"
     38+                    if menu_level > 0:
     39+                        menu_level -= 1
     40+                        continue
     41+                    else:
     42+                        raise RuntimeError, "syntax error: closing brace without menuentry"
     43
     44                 self.add_image(Grub2Image(title, img))
     45                 img = None
     46--- /usr/lib/xen-4.0/bin/pygrub.orig    2012-09-05 16:28:03.105813164 -0400
     47+++ /usr/lib/xen-4.0/bin/pygrub 2012-09-05 16:29:57.168849770 -0400
     48@@ -386,7 +386,8 @@
     49                            ["/boot/grub/menu.lst", "/boot/grub/grub.conf",
     50                             "/grub/menu.lst", "/grub/grub.conf"]) + \
     51                        map(lambda x: (x,grub.GrubConf.Grub2ConfigFile),
     52-                           ["/boot/grub/grub.cfg", "/grub/grub.cfg"]) + \
     53+                           ["/boot/grub/grub.cfg", "/grub/grub.cfg",
     54+                            "/boot/grub2/grub.cfg", "/grub2/grub.cfg"]) + \
     55                        map(lambda x: (x,grub.ExtLinuxConf.ExtLinuxConfigFile),
     56                            ["/boot/isolinux/isolinux.cfg",
     57                             "/boot/extlinux.conf"])
     58}}}