diff options
author | Olaf Hering <olaf@aepfle.de> | 2012-11-13 18:09:07 +0000 |
---|---|---|
committer | Olaf Hering <olaf@aepfle.de> | 2012-11-13 18:09:07 +0000 |
commit | 319857ac71770e017b4bcf4a034dfaca61eb9365 (patch) | |
tree | 20e6cfbfdc9379d2182dc86c32400ad675791938 /tools | |
parent | e218baf76a2dbe7b973c9ef30775ab7d112d5336 (diff) | |
download | xen-319857ac71770e017b4bcf4a034dfaca61eb9365.tar.gz xen-319857ac71770e017b4bcf4a034dfaca61eb9365.tar.bz2 xen-319857ac71770e017b4bcf4a034dfaca61eb9365.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>
xen-unstable changeset: 25941:795c493fe561
Backport-requested-by: Ian Campbell <Ian.Campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-4.2-testing changeset: 25891:7e91c668bae2
Backport-requested-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools')
-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 1a3c1c3879..3d994b60d2 100644 --- a/tools/pygrub/src/pygrub +++ b/tools/pygrub/src/pygrub @@ -585,13 +585,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 |