[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] pygrub: parse xen module option in grub


  • To: John Levon <levon@xxxxxxxxxxxxxxxxx>
  • From: Wei Kong <weikong.cn@xxxxxxxxx>
  • Date: Fri, 20 Feb 2009 12:15:30 +0800
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
  • Delivery-date: Thu, 19 Feb 2009 20:16:02 -0800
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=XdRaRrdgEnY79nRXmuFwia7YTLwdbg0Yev6dHQ1iEkqEqOOwzij/tfMQFmdTbAT+ki /TKiYATre56FGXhmFNHDnTLMzp9MM0fS4k9vYKU0QHCw8+EObzW74CQ6K/fSTHdqJT1x Al91DT3tgZnRHOiAoURcVd5wpCzq5lnUC2Pu4=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>



2009/2/20 John Levon <levon@xxxxxxxxxxxxxxxxx>
On Fri, Feb 20, 2009 at 11:20:38AM +0800, Wei Kong wrote:

> > The patch is wrong anyway, you can't just add on the incoming args for
> > Solaris at least. At the very least you need to add the args only when
> > run_grub() is called.
> >
> No, I didn't add any args for solaris.
> Because I don't want to add args for Solaris, so I add args here, not in
> run_grub().

Please read the code more closely: again, you cannot just pass inargs
out again, you must only do so if run_grub() is called. Presuming it
even makes sense -

thanks, john

Sorry for I not think about Solaris carefully.

Current run_grub() doesn't get any kernel args from user.
We could add another argument for this function and return args back,
whatever, it's hard for run_grub() to pass this args to GRUB() entry to let the user see it again.

> why can't the user edit the grub entry?
Yes, but if you could write it in configuration file, why do it by hand.

Do you like the below modify?

--- xen-unstable.hg.changeset_19232/tools/pygrub/src/pygrub    2009-02-20 12:07:34.000000000 +0800
+++ xen-unstable.hg/tools/pygrub/src/pygrub    2009-02-20 12:07:40.000000000 +0800
@@ -501,7 +501,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
 
@@ -534,7 +534,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
 
@@ -659,7 +659,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 = "">     (tfd, bootcfg["kernel"]) = tempfile.mkstemp(prefix="boot_kernel.",
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.