summaryrefslogtreecommitdiff
path: root/kexec/arch/i386/kexec-multiboot-x86.c
diff options
context:
space:
mode:
authorBernhard Walle <bwalle@suse.de>2008-05-08 22:49:43 +0200
committerSimon Horman <horms@verge.net.au>2008-05-21 16:05:35 +1000
commit3c5bb06948881b3e31c783c19edef74275794280 (patch)
tree6c7de84de120c2899622207f85bcb889605fdab4 /kexec/arch/i386/kexec-multiboot-x86.c
parent3bf0213789d56054f601c5a06372f78567aacdd9 (diff)
Add --reuse-cmdline
This patch adds an option "--reuse-cmdline" for people that are lazy in typing --append="$(cat /proc/cmdline)". The advantage of "--reuse-cmdline" is also that it strips off BOOT_IMAGE (since it may not be correct any more) from lilo and other boot loaders, and, more important, the crashkernel option in case a panic kernel is loaded. If you like the option I can also add it for really all architectures. Tested only with x86-bzImage both the kexec and kdump case. Signed-off-by: Bernhard Walle <bwalle@suse.de> Signed-off-by: Simon Horman <horms@verge.net.au>
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;