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.",