File 19234_pygrub.patch of Package xen

# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1235128111 0
# Node ID 596f21d901f3867f535027066532f8ce7330a129
# Parent  4771bceb188997073b5b93271f31064cd2610dbe
pygrub: parse xen module option in grub

Add function for GrubConf to parse xen module option in grub.
Pygrub should pass args as domUloader did.

Signed-off-by: Wei Kong <weikong.cn@gmail.com>

Index: xen-3.3.1-testing/tools/pygrub/src/pygrub
===================================================================
--- xen-3.3.1-testing.orig/tools/pygrub/src/pygrub
+++ xen-3.3.1-testing/tools/pygrub/src/pygrub
@@ -499,7 +499,7 @@ def get_entry_idx(cf, entry):
 
     return None
 
-def run_grub(file, entry, fs):
+def run_grub(file, entry, fs, arg):
     global g
     global sel
 
@@ -532,7 +532,7 @@ def run_grub(file, entry, fs):
     if img.initrd:
         grubcfg["ramdisk"] = img.initrd[1]
     if img.args:
-        grubcfg["args"] = img.args
+        grubcfg["args"] = img.args + " " + arg
 
     return grubcfg
 
@@ -657,7 +657,7 @@ if __name__ == "__main__":
     chosencfg = sniff_solaris(fs, incfg)
 
     if not chosencfg["kernel"]:
-        chosencfg = run_grub(file, entry, fs)
+        chosencfg = run_grub(file, entry, fs, incfg["args"])
 
     data = fs.open_file(chosencfg["kernel"]).read()
     (tfd, bootcfg["kernel"]) = tempfile.mkstemp(prefix="boot_kernel.",
openSUSE Build Service is sponsored by