summaryrefslogtreecommitdiff
path: root/kexec/arch/mips/kexec-elf-mips.c
diff options
context:
space:
mode:
Diffstat (limited to 'kexec/arch/mips/kexec-elf-mips.c')
-rw-r--r--kexec/arch/mips/kexec-elf-mips.c43
1 files changed, 5 insertions, 38 deletions
diff --git a/kexec/arch/mips/kexec-elf-mips.c b/kexec/arch/mips/kexec-elf-mips.c
index 8a6419a..7cb06f1 100644
--- a/kexec/arch/mips/kexec-elf-mips.c
+++ b/kexec/arch/mips/kexec-elf-mips.c
@@ -63,51 +63,18 @@ int elf_mips_probe(const char *buf, off_t len)
void elf_mips_usage(void)
{
- printf(" --command-line=STRING Set the kernel command line to "
- "STRING.\n"
- " --append=STRING Set the kernel command line to "
- "STRING.\n");
}
int elf_mips_load(int argc, char **argv, const char *buf, off_t len,
struct kexec_info *info)
{
struct mem_ehdr ehdr;
- const char *command_line;
- int command_line_len;
+ int command_line_len = 0;
char *crash_cmdline;
- int opt;
int result;
unsigned long cmdline_addr;
size_t i;
- /* See options.h if adding any more options. */
- static const struct option options[] = {
- KEXEC_ARCH_OPTIONS
- {"command-line", 1, 0, OPT_APPEND},
- {"append", 1, 0, OPT_APPEND},
- {0, 0, 0, 0},
- };
-
- static const char short_options[] = KEXEC_ARCH_OPT_STR "d";
-
- command_line = 0;
- while ((opt = getopt_long(argc, argv, short_options,
- options, 0)) != -1) {
- switch (opt) {
- default:
- /* Ignore core options */
- if (opt < OPT_ARCH_MAX) {
- break;
- }
- case OPT_APPEND:
- command_line = optarg;
- break;
- }
- }
-
- command_line_len = 0;
-
/* Need to append some command line parameters internally in case of
* taking crash dumps.
*/
@@ -136,8 +103,8 @@ int elf_mips_load(int argc, char **argv, const char *buf, off_t len,
info->entry = (void *)virt_to_phys(ehdr.e_entry);
- if (command_line)
- command_line_len = strlen(command_line) + 1;
+ if (arch_options.command_line)
+ command_line_len = strlen(arch_options.command_line) + 1;
if (info->kexec_flags & KEXEC_ON_CRASH) {
result = load_crashdump_segments(info, crash_cmdline,
@@ -148,8 +115,8 @@ int elf_mips_load(int argc, char **argv, const char *buf, off_t len,
}
}
- if (command_line)
- strncat(cmdline_buf, command_line, command_line_len);
+ if (arch_options.command_line)
+ strncat(cmdline_buf, arch_options.command_line, command_line_len);
if (crash_cmdline)
strncat(cmdline_buf, crash_cmdline,
sizeof(crash_cmdline) -