diff options
author | Olaf Hering <olaf@aepfle.de> | 2012-09-25 11:03:51 +0100 |
---|---|---|
committer | Olaf Hering <olaf@aepfle.de> | 2012-09-25 11:03:51 +0100 |
commit | c474b173ae8883c6beb2b8ea90694d594a5b1677 (patch) | |
tree | b22b9b0b6283a2ddf1c543dfc7964211f7f5e1be /tools/pygrub/src | |
parent | ca71bdf62e7e96579415fce6b562f3a956d94cc9 (diff) | |
download | xen-c474b173ae8883c6beb2b8ea90694d594a5b1677.tar.gz xen-c474b173ae8883c6beb2b8ea90694d594a5b1677.tar.bz2 xen-c474b173ae8883c6beb2b8ea90694d594a5b1677.zip |
pygrub: always append --args
If a bootloader entry in menu.lst has no additional kernel command line
options listed and the domU.cfg has 'bootargs="--args=something"' the
additional arguments from the config file are not passed to the kernel.
The reason for that incorrect behaviour is that run_grub appends arg
only if the parsed config file has arguments listed.
Fix this by appending args from image section and the config file separatly.
To avoid adding to a NoneType initialize grubcfg['args'] to an empty string.
This does not change behaviour but simplifies the code which appends the
string.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools/pygrub/src')
-rw-r--r-- | tools/pygrub/src/pygrub | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub index ad78c22de0..fc55d903e1 100644 --- a/tools/pygrub/src/pygrub +++ b/tools/pygrub/src/pygrub @@ -615,13 +615,15 @@ def run_grub(file, entry, fs, arg): except IndexError: img = g.cf.images[0] - grubcfg = { "kernel": None, "ramdisk": None, "args": None } + grubcfg = { "kernel": None, "ramdisk": None, "args": "" } grubcfg["kernel"] = img.kernel[1] if img.initrd: grubcfg["ramdisk"] = img.initrd[1] if img.args: - grubcfg["args"] = img.args + " " + arg + grubcfg["args"] += img.args + if arg: + grubcfg["args"] += " " + args return grubcfg |