From be167619bcdc4ab6fadf78f1ce83e0b36b709c688fdc4972b0d3c22e3053857e Mon Sep 17 00:00:00 2001 From: Charles Arnold Date: Tue, 12 Jun 2012 20:47:00 +0000 Subject: [PATCH] - Upstream pygrub patches for grub2 support and fixes 24000-pygrub-grub2.patch 24001-pygrub-grub2.patch 24002-pygrub-grub2.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=191 --- 24000-pygrub-grub2.patch | 26 +++++++++++++++++++ 24001-pygrub-grub2.patch | 55 ++++++++++++++++++++++++++++++++++++++++ 24002-pygrub-grub2.patch | 28 ++++++++++++++++++++ xen.changes | 8 ++++++ xen.spec | 7 +++++ 5 files changed, 124 insertions(+) create mode 100644 24000-pygrub-grub2.patch create mode 100644 24001-pygrub-grub2.patch create mode 100644 24002-pygrub-grub2.patch diff --git a/24000-pygrub-grub2.patch b/24000-pygrub-grub2.patch new file mode 100644 index 0000000..69ff7ee --- /dev/null +++ b/24000-pygrub-grub2.patch @@ -0,0 +1,26 @@ +# HG changeset patch +# User Michael Young +# Date 1319566759 -3600 +# Node ID 65679fee01778aec2dbe9988959da6b57c52d6c9 +# Parent 138f707fa598340749a70a79748b01dff850b8f2 +pygrub: Allow GPT partition references + +The grub2 configuration file in Fedora 16 can have GPT partition +references like (hd0,gpt2) so remove the "gpt" string where necessary + +Signed-off-by: Michael Young +Acked-by: Ian Campbell + +Index: xen-4.1.2-testing/tools/pygrub/src/GrubConf.py +=================================================================== +--- xen-4.1.2-testing.orig/tools/pygrub/src/GrubConf.py ++++ xen-4.1.2-testing/tools/pygrub/src/GrubConf.py +@@ -79,6 +79,8 @@ class GrubDiskPart(object): + val = val.replace("(", "").replace(")", "") + if val[:5] == "msdos": + val = val[5:] ++ if val[:3] == "gpt": ++ val = val[3:] + self._part = int(val) + part = property(get_part, set_part) + diff --git a/24001-pygrub-grub2.patch b/24001-pygrub-grub2.patch new file mode 100644 index 0000000..9fc2197 --- /dev/null +++ b/24001-pygrub-grub2.patch @@ -0,0 +1,55 @@ +# HG changeset patch +# User Michael Young +# Date 1319566806 -3600 +# Node ID 152049468175f29a3792b3b60e09a841f9cd2c21 +# Parent 65679fee01778aec2dbe9988959da6b57c52d6c9 +pygrub: cope with configurations with submenus + +The grub2 configuration file in Fedora 16 can have one or more +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 +Acked-by: Ian Campbell + +Index: xen-4.1.2-testing/tools/pygrub/src/GrubConf.py +=================================================================== +--- xen-4.1.2-testing.orig/tools/pygrub/src/GrubConf.py ++++ xen-4.1.2-testing/tools/pygrub/src/GrubConf.py +@@ -370,6 +370,7 @@ class Grub2ConfigFile(_GrubConfigFile): + in_function = False + img = None + title = "" ++ menu_level=0 + for l in lines: + l = l.strip() + # skip blank lines +@@ -396,10 +397,18 @@ class Grub2ConfigFile(_GrubConfigFile): + 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 diff --git a/24002-pygrub-grub2.patch b/24002-pygrub-grub2.patch new file mode 100644 index 0000000..c9bd2d4 --- /dev/null +++ b/24002-pygrub-grub2.patch @@ -0,0 +1,28 @@ +# HG changeset patch +# User Michael Young +# Date 1319566865 -3600 +# Node ID 979bc34d0ad0369e42c70f66a39952e4b6b9b613 +# Parent 152049468175f29a3792b3b60e09a841f9cd2c21 +pyrgrub: cope with configurations with set default="${saved_entry}" line + +Fedora 16 grub2 configuration file can have lines like + set default="${saved_entry}" +and a string containing an integer is expected + +Signed-off-by: Michael Young +Acked-by: Ian Campbell +Committed-by: Ian Jackson + +Index: xen-4.1.2-testing/tools/pygrub/src/GrubConf.py +=================================================================== +--- xen-4.1.2-testing.orig/tools/pygrub/src/GrubConf.py ++++ xen-4.1.2-testing/tools/pygrub/src/GrubConf.py +@@ -425,6 +425,8 @@ class Grub2ConfigFile(_GrubConfigFile): + + 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,)) diff --git a/xen.changes b/xen.changes index ead092b..561efdc 100644 --- a/xen.changes +++ b/xen.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Jun 12 14:37:00 MDT 2012 - carnold@novell.com + +- Upstream pygrub patches for grub2 support and fixes + 24000-pygrub-grub2.patch + 24001-pygrub-grub2.patch + 24002-pygrub-grub2.patch + ------------------------------------------------------------------- Mon Jun 11 10:32:42 MDT 2012 - carnold@novell.com diff --git a/xen.spec b/xen.spec index b351f3d..412ab93 100644 --- a/xen.spec +++ b/xen.spec @@ -15,6 +15,7 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # + Name: xen ExclusiveArch: %ix86 x86_64 %define xvers 4.1 @@ -272,6 +273,9 @@ Patch23980: 23980-xenpaging_disallow_paging_in_a_PoD_guest.patch Patch23993: 23993-x86-microcode-amd-fix-23871.patch Patch23998: 23998-pygrub-GPT.patch Patch23999: 23999-pygrub-grub2.patch +Patch24000: 24000-pygrub-grub2.patch +Patch24001: 24001-pygrub-grub2.patch +Patch24002: 24002-pygrub-grub2.patch Patch24064: 24064-pygrub-HybridISO.patch Patch24104: 24104-waitqueue_Double_size_of_x86_shadow_stack..patch Patch24105: 24105-xenpaging_compare_domain_pointer_in_p2m_mem_paging_populate.patch @@ -1020,6 +1024,9 @@ tar xfj %{SOURCE2} -C $RPM_BUILD_DIR/%{xen_build_dir}/tools %patch23993 -p1 %patch23998 -p1 %patch23999 -p1 +%patch24000 -p1 +%patch24001 -p1 +%patch24002 -p1 %patch24064 -p1 %patch24104 -p1 %patch24105 -p1