From: Wang YanQing <udknight@gmail.com>
To: horms@verge.net.au
Cc: jbarnes@sgi.com, tjd21@cl.cam.ac.uk, khalid.aziz@hp.com,
kexec@lists.infradead.org, ebiederm@xmission.com,
hari@in.ibm.com
Subject: [PATCH] i386:kexec-bzImage: Use "\0" as command line instead of empty command line
Date: Wed, 3 Apr 2013 17:43:56 +0800 [thread overview]
Message-ID: <20130403094356.GA7259@udknight> (raw)
I get garbage output of /proc/cmdline and in dmesg when I
use kexec to load new kernel bzImage without append command
line like below:
kexec -l bzImage --initrd=initramfs.
This patch fix it.
Signed-off-by: Wang YanQing <udknight@gmail.com>
---
kexec/arch/i386/kexec-bzImage.c | 3 +++
kexec/arch/i386/kexec-elf-x86.c | 3 +++
2 files changed, 6 insertions(+)
diff --git a/kexec/arch/i386/kexec-bzImage.c b/kexec/arch/i386/kexec-bzImage.c
index 99fd790..29f280d 100644
--- a/kexec/arch/i386/kexec-bzImage.c
+++ b/kexec/arch/i386/kexec-bzImage.c
@@ -435,6 +435,9 @@ int bzImage_load(int argc, char **argv, const char *buf, off_t len,
command_line_len = 0;
if (command_line) {
command_line_len = strlen(command_line) +1;
+ } else {
+ command_line = strdup("\0");
+ command_line_len = 1;
}
ramdisk_buf = 0;
if (ramdisk) {
diff --git a/kexec/arch/i386/kexec-elf-x86.c b/kexec/arch/i386/kexec-elf-x86.c
index e62ebcb..788a209 100644
--- a/kexec/arch/i386/kexec-elf-x86.c
+++ b/kexec/arch/i386/kexec-elf-x86.c
@@ -161,6 +161,9 @@ int elf_x86_load(int argc, char **argv, const char *buf, off_t len,
command_line_len = 0;
if (command_line) {
command_line_len = strlen(command_line) +1;
+ } else {
+ command_line = strdup("\0");
+ command_line_len = 1;
}
/* Need to append some command line parameters internally in case of
--
1.7.12.4.dirty
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next reply other threads:[~2013-04-03 9:44 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-03 9:43 Wang YanQing [this message]
2013-04-06 5:52 ` [PATCH] i386:kexec-bzImage: Use "\0" as command line instead of empty command line Zhang Yanfei
2013-04-07 1:01 ` Wang YanQing
2013-04-07 5:54 ` Zhang Yanfei
2013-04-07 9:35 ` Wang YanQing
2013-04-08 1:08 ` Wang YanQing
2013-04-08 3:35 ` Zhang Yanfei
2013-04-08 3:53 ` Wang YanQing
2013-04-08 4:33 ` Zhang Yanfei
2013-04-08 6:07 ` Wang YanQing
2013-04-08 6:43 ` Zhang Yanfei
2013-04-08 4:18 ` Wang YanQing
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=20130403094356.GA7259@udknight \
--to=udknight@gmail.com \
--cc=ebiederm@xmission.com \
--cc=hari@in.ibm.com \
--cc=horms@verge.net.au \
--cc=jbarnes@sgi.com \
--cc=kexec@lists.infradead.org \
--cc=khalid.aziz@hp.com \
--cc=tjd21@cl.cam.ac.uk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox