summaryrefslogtreecommitdiff
path: root/kexec/arch/i386/kexec-multiboot-x86.c
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2010-01-19 00:05:03 -0800
committerSimon Horman <horms@verge.net.au>2010-02-02 14:42:02 +1100
commit8b42c99aa3bc59b877732a82e6db6380e4958b54 (patch)
tree7ce24a95b77bd5802bd877be772fb99d9198c352 /kexec/arch/i386/kexec-multiboot-x86.c
parent1875419755e36ac49c53c166c033ed5c181287b6 (diff)
Fix --reuse-cmdline so it is usable.
A colleague of mine implemented kdump and it used --reuse-cmdline with some rather interesting and unexpected results. Update the getopt specification so that --reuse-cmdline does not attempt to take an argument that it will not use. Update the processing of --append so that --reuse-cmdline followed by --append actually appends the parameters specified by --reuse-cmdline. Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Diffstat (limited to 'kexec/arch/i386/kexec-multiboot-x86.c')
-rw-r--r--kexec/arch/i386/kexec-multiboot-x86.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/kexec/arch/i386/kexec-multiboot-x86.c b/kexec/arch/i386/kexec-multiboot-x86.c
index 9b41698..9817ba9 100644
--- a/kexec/arch/i386/kexec-multiboot-x86.c
+++ b/kexec/arch/i386/kexec-multiboot-x86.c
@@ -147,7 +147,7 @@ int multiboot_x86_load(int argc, char **argv, const char *buf, off_t len,
unsigned long mbi_base;
struct entry32_regs regs;
size_t mbi_bytes, mbi_offset;
- const char *command_line=NULL;
+ const char *command_line=NULL, *append=NULL;
char *imagename, *cp;
struct memory_range *range;
int ranges;
@@ -164,7 +164,7 @@ int multiboot_x86_load(int argc, char **argv, const char *buf, off_t len,
KEXEC_ARCH_OPTIONS
{ "command-line", 1, 0, OPT_CL },
{ "append", 1, 0, OPT_CL },
- { "reuse-cmdline", 1, 0, OPT_REUSE_CMDLINE },
+ { "reuse-cmdline", 0, 0, OPT_REUSE_CMDLINE },
{ "module", 1, 0, OPT_MOD },
{ 0, 0, 0, 0 },
};
@@ -195,7 +195,7 @@ int multiboot_x86_load(int argc, char **argv, const char *buf, off_t len,
usage();
return -1;
case OPT_CL:
- command_line = optarg;
+ append = optarg;
break;
case OPT_REUSE_CMDLINE:
command_line = get_command_line();
@@ -207,6 +207,7 @@ int multiboot_x86_load(int argc, char **argv, const char *buf, off_t len,
}
}
imagename = argv[optind];
+ command_line = concat_cmdline(command_line, append);
command_line_len = strlen(command_line) + strlen(imagename) + 2;