From c474b173ae8883c6beb2b8ea90694d594a5b1677 Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Tue, 25 Sep 2012 11:03:51 +0100 Subject: 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 Acked-by: Ian Campbell Committed-by: Ian Campbell --- tools/pygrub/src/pygrub | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tools/pygrub') 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 -- cgit v1.2.3