summaryrefslogtreecommitdiff
path: root/kexec/arch/s390/kexec-image.c
diff options
context:
space:
mode:
authorSven Schnelle <svens@linux.ibm.com>2021-12-16 12:43:56 +0100
committerSimon Horman <horms@verge.net.au>2022-01-14 16:02:57 +0100
commit2e1ec106dc5aac951ba884ebe4cca036e9a2d45f (patch)
tree3732e4058c05807594e7abb56ac1f8a40b5276c7 /kexec/arch/s390/kexec-image.c
parentd6516ba4c88f217fe14455db92c60cd0e9af18f8 (diff)
s390: add support for --reuse-cmdline
--reuse-cmdline reads the command line of the currently running kernel from /proc/cmdline and uses that for the kernel that should be kexec'd. Signed-off-by: Sven Schnelle <svens@linux.ibm.com> Reviewed-by: Alexander Egorenkov <egorenar@linux.ibm.com> Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'kexec/arch/s390/kexec-image.c')
-rw-r--r--kexec/arch/s390/kexec-image.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/kexec/arch/s390/kexec-image.c b/kexec/arch/s390/kexec-image.c
index 209ab77..69aaf96 100644
--- a/kexec/arch/s390/kexec-image.c
+++ b/kexec/arch/s390/kexec-image.c
@@ -71,6 +71,10 @@ int image_s390_load_file(int argc, char **argv, struct kexec_info *info)
case OPT_RAMDISK:
ramdisk = optarg;
break;
+ case OPT_REUSE_CMDLINE:
+ free(info->command_line);
+ info->command_line = get_command_line();
+ break;
}
}
@@ -123,6 +127,10 @@ image_s390_load(int argc, char **argv, const char *kernel_buf,
if (command_line_add(info, optarg))
return -1;
break;
+ case OPT_REUSE_CMDLINE:
+ free(info->command_line);
+ info->command_line = get_command_line();
+ break;
case OPT_RAMDISK:
ramdisk = optarg;
break;
@@ -223,5 +231,6 @@ image_s390_usage(void)
printf("--command-line=STRING Set the kernel command line to STRING.\n"
"--append=STRING Set the kernel command line to STRING.\n"
"--initrd=FILENAME Use the file FILENAME as a ramdisk.\n"
+ "--reuse-cmdline Use kernel command line from running system.\n"
);
}