SHA256
1
0
forked from pool/xen

- 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
This commit is contained in:
Charles Arnold 2012-06-12 20:47:00 +00:00 committed by Git OBS Bridge
parent 81501c15a5
commit be167619bc
5 changed files with 124 additions and 0 deletions

26
24000-pygrub-grub2.patch Normal file
View File

@ -0,0 +1,26 @@
# HG changeset patch
# User Michael Young <m.a.young@durham.ac.uk>
# 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 <m.a.young@durham.ac.uk>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
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)

55
24001-pygrub-grub2.patch Normal file
View File

@ -0,0 +1,55 @@
# HG changeset patch
# User Michael Young <m.a.young@durham.ac.uk>
# 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 <m.a.young@durham.ac.uk>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
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

28
24002-pygrub-grub2.patch Normal file
View File

@ -0,0 +1,28 @@
# HG changeset patch
# User Michael Young <m.a.young@durham.ac.uk>
# 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 <m.a.young@durham.ac.uk>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
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,))

View File

@ -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 Mon Jun 11 10:32:42 MDT 2012 - carnold@novell.com

View File

@ -15,6 +15,7 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/ # Please submit bugfixes or comments via http://bugs.opensuse.org/
# #
Name: xen Name: xen
ExclusiveArch: %ix86 x86_64 ExclusiveArch: %ix86 x86_64
%define xvers 4.1 %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 Patch23993: 23993-x86-microcode-amd-fix-23871.patch
Patch23998: 23998-pygrub-GPT.patch Patch23998: 23998-pygrub-GPT.patch
Patch23999: 23999-pygrub-grub2.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 Patch24064: 24064-pygrub-HybridISO.patch
Patch24104: 24104-waitqueue_Double_size_of_x86_shadow_stack..patch Patch24104: 24104-waitqueue_Double_size_of_x86_shadow_stack..patch
Patch24105: 24105-xenpaging_compare_domain_pointer_in_p2m_mem_paging_populate.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 %patch23993 -p1
%patch23998 -p1 %patch23998 -p1
%patch23999 -p1 %patch23999 -p1
%patch24000 -p1
%patch24001 -p1
%patch24002 -p1
%patch24064 -p1 %patch24064 -p1
%patch24104 -p1 %patch24104 -p1
%patch24105 -p1 %patch24105 -p1