summaryrefslogtreecommitdiff
path: root/kexec/arch/i386/kexec-multiboot-x86.c
diff options
context:
space:
mode:
Diffstat (limited to 'kexec/arch/i386/kexec-multiboot-x86.c')
-rw-r--r--kexec/arch/i386/kexec-multiboot-x86.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/kexec/arch/i386/kexec-multiboot-x86.c b/kexec/arch/i386/kexec-multiboot-x86.c
index ec65860..9b41698 100644
--- a/kexec/arch/i386/kexec-multiboot-x86.c
+++ b/kexec/arch/i386/kexec-multiboot-x86.c
@@ -129,6 +129,7 @@ void multiboot_x86_usage(void)
/* Multiboot-specific options */
{
printf(" --command-line=STRING Set the kernel command line to STRING.\n");
+ printf(" --reuse-cmdline Use kernel command line from running system.\n");
printf(" --module=\"MOD arg1 arg2...\" Load module MOD with command-line \"arg1...\"\n");
printf(" (can be used multiple times).\n");
}
@@ -155,13 +156,15 @@ int multiboot_x86_load(int argc, char **argv, const char *buf, off_t len,
int i;
int opt;
int modules, mod_command_line_space;
-#define OPT_CL (OPT_ARCH_MAX+0)
-#define OPT_MOD (OPT_ARCH_MAX+1)
-#define OPT_VGA (OPT_ARCH_MAX+2)
+#define OPT_CL (OPT_ARCH_MAX+0)
+#define OPT_REUSE_CMDLINE (OPT_ARCH_MAX+1)
+#define OPT_MOD (OPT_ARCH_MAX+2)
+#define OPT_VGA (OPT_ARCH_MAX+3)
static const struct option options[] = {
KEXEC_ARCH_OPTIONS
{ "command-line", 1, 0, OPT_CL },
{ "append", 1, 0, OPT_CL },
+ { "reuse-cmdline", 1, 0, OPT_REUSE_CMDLINE },
{ "module", 1, 0, OPT_MOD },
{ 0, 0, 0, 0 },
};
@@ -194,6 +197,9 @@ int multiboot_x86_load(int argc, char **argv, const char *buf, off_t len,
case OPT_CL:
command_line = optarg;
break;
+ case OPT_REUSE_CMDLINE:
+ command_line = get_command_line();
+ break;
case OPT_MOD:
modules++;
mod_command_line_space += strlen(optarg) + 1;