public inbox for kexec@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] i386:kexec-bzImage: Use "\0" as command line instead of empty command line
@ 2013-04-03  9:43 Wang YanQing
  2013-04-06  5:52 ` Zhang Yanfei
  0 siblings, 1 reply; 12+ messages in thread
From: Wang YanQing @ 2013-04-03  9:43 UTC (permalink / raw)
  To: horms; +Cc: jbarnes, tjd21, khalid.aziz, kexec, ebiederm, hari

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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-04-08  6:45 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-03  9:43 [PATCH] i386:kexec-bzImage: Use "\0" as command line instead of empty command line Wang YanQing
2013-04-06  5:52 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox