From: Zhang Yanfei <zhangyanfei.yes@gmail.com>
To: Wang YanQing <udknight@gmail.com>
Cc: jbarnes@sgi.com, tjd21@cl.cam.ac.uk, khalid.aziz@hp.com,
kexec@lists.infradead.org, horms@verge.net.au,
ebiederm@xmission.com, hari@in.ibm.com
Subject: Re: [PATCH] i386:kexec-bzImage: Use "\0" as command line instead of empty command line
Date: Sat, 06 Apr 2013 13:52:09 +0800 [thread overview]
Message-ID: <515FB809.3020103@gmail.com> (raw)
In-Reply-To: <20130403094356.GA7259@udknight>
于 2013年04月03日 17:43, Wang YanQing 写道:
> 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.
Hello Wang
I tried this:
./build/sbin/kexec -l /boot/vmlinuz-2.6.32-279.el6.i686 --initrd=/boot/initramfs-2.6.32-279.el6.i686.img
But nothing happened and it seemed the command loaded the kernel successfully.
Can you describe your situation more concretely, please?
Thanks
Zhang
> 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
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2013-04-06 5:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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=515FB809.3020103@gmail.com \
--to=zhangyanfei.yes@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 \
--cc=udknight@gmail.com \
/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