From: Olaf Hering <olaf@aepfle.de>
To: xen-devel@lists.xen.org
Subject: [PATCH] pygrub: always append --args
Date: Thu, 06 Sep 2012 17:29:06 +0200 [thread overview]
Message-ID: <8a2eef481d3ab3ca5692.1346945346@probook.site> (raw)
# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1346945306 -7200
# Node ID 8a2eef481d3ab3ca5692dd0083c95cf314fe1da3
# Parent 19d367bf07b7687b831c212a57a70e73ea14d3b7
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>
diff -r 19d367bf07b7 -r 8a2eef481d3a tools/pygrub/src/pygrub
--- 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
next reply other threads:[~2012-09-06 15:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-06 15:29 Olaf Hering [this message]
2012-09-07 8:32 ` [PATCH] pygrub: always append --args Ian Campbell
2012-09-07 9:14 ` Olaf Hering
2012-09-07 9:21 ` Ian Campbell
2012-09-25 10:09 ` Ian Campbell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8a2eef481d3ab3ca5692.1346945346@probook.site \
--to=olaf@aepfle.de \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.