WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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

To: John Levon <levon@xxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] pygrub: parse xen module option in grub
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
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=Sy9PLKirg377brTizAJUbxZZQV5oJiVN5nRWOyqRBhU=; b=qWJIigRFQMHvhs+6GCRks7hZweFmgjFoBitDoY/Jw+Za85kPvx1ELA5FQbxceXQqGK aYwV346ZUE3sxE/y5cyW6pQOZbuMDQc/zgem5qA/wJhjP426kIWsEzNMGGsKn1LsTSRG Bfj6urmvgEsptAO2GjSXraKWiBKMISCDFczHo=
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=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20090220032435.GB7709@xxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <fac556d20902191840j79bcb2ccwcb32e80b4369cf08@xxxxxxxxxxxxxx> <20090220025505.GA5452@xxxxxxxxxxxxxxxxx> <fac556d20902191920r541afefdi9fe63de85a95c26b@xxxxxxxxxxxxxx> <20090220032435.GB7709@xxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx


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