summaryrefslogtreecommitdiff
path: root/kexec/arch/i386/kexec-elf-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-elf-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-elf-x86.c')
-rw-r--r--kexec/arch/i386/kexec-elf-x86.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/kexec/arch/i386/kexec-elf-x86.c b/kexec/arch/i386/kexec-elf-x86.c
index 1e523f9..ddd4a10 100644
--- a/kexec/arch/i386/kexec-elf-x86.c
+++ b/kexec/arch/i386/kexec-elf-x86.c
@@ -73,6 +73,7 @@ void elf_x86_usage(void)
{
printf( " --command-line=STRING Set the kernel command line to STRING\n"
" --append=STRING Set the kernel command line to STRING\n"
+ " --reuse-cmdline Use kernel command line from running system.\n"
" --initrd=FILE Use FILE as the kernel's initial ramdisk.\n"
" --ramdisk=FILE Use FILE as the kernel's initial ramdisk.\n"
" --args-linux Pass linux kernel style options\n"
@@ -97,16 +98,18 @@ int elf_x86_load(int argc, char **argv, const char *buf, off_t len,
#define ARG_STYLE_LINUX 1
#define ARG_STYLE_NONE 2
int opt;
-#define OPT_APPEND (OPT_ARCH_MAX+0)
-#define OPT_RAMDISK (OPT_ARCH_MAX+1)
-#define OPT_ARGS_ELF (OPT_ARCH_MAX+2)
-#define OPT_ARGS_LINUX (OPT_ARCH_MAX+3)
-#define OPT_ARGS_NONE (OPT_ARCH_MAX+4)
+#define OPT_APPEND (OPT_ARCH_MAX+0)
+#define OPT_REUSE_CMDLINE (OPT_ARCH_MAX+1)
+#define OPT_RAMDISK (OPT_ARCH_MAX+2)
+#define OPT_ARGS_ELF (OPT_ARCH_MAX+3)
+#define OPT_ARGS_LINUX (OPT_ARCH_MAX+4)
+#define OPT_ARGS_NONE (OPT_ARCH_MAX+5)
static const struct option options[] = {
KEXEC_ARCH_OPTIONS
{ "command-line", 1, NULL, OPT_APPEND },
{ "append", 1, NULL, OPT_APPEND },
+ { "reuse-cmdline", 1, NULL, OPT_REUSE_CMDLINE },
{ "initrd", 1, NULL, OPT_RAMDISK },
{ "ramdisk", 1, NULL, OPT_RAMDISK },
{ "args-elf", 0, NULL, OPT_ARGS_ELF },
@@ -138,6 +141,9 @@ int elf_x86_load(int argc, char **argv, const char *buf, off_t len,
case OPT_APPEND:
command_line = optarg;
break;
+ case OPT_REUSE_CMDLINE:
+ command_line = get_command_line();
+ break;
case OPT_RAMDISK:
ramdisk = optarg;
break;