[PATCH 3/3] s390: add support for --reuse-cmdline
Philipp Rudo
prudo at redhat.com
Tue Dec 7 06:34:04 PST 2021
Hi Sven,
makes absolutely sense to have this option. One problem though...
On Mon, 22 Nov 2021 08:14:01 +0100
Sven Schnelle <svens at linux.ibm.com> wrote:
> --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 at linux.ibm.com>
> Reviewed-by: Alexander Egorenkov <egorenar at linux.ibm.com>
> ---
> kexec/arch/s390/include/arch/options.h | 10 ++++++----
> kexec/arch/s390/kexec-image.c | 9 +++++++++
> 2 files changed, 15 insertions(+), 4 deletions(-)
>
> diff --git a/kexec/arch/s390/include/arch/options.h b/kexec/arch/s390/include/arch/options.h
> index 76044a301ceb..b030b61d61be 100644
[...]
> diff --git a/kexec/arch/s390/kexec-image.c b/kexec/arch/s390/kexec-image.c
> index dbeb689b830a..310d967ea331 100644
> --- a/kexec/arch/s390/kexec-image.c
> +++ b/kexec/arch/s390/kexec-image.c
> @@ -72,6 +72,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(command_line);
> + command_line = get_command_line();
get_command_line reads a maximum of 2048 bytes from /prc/cmdline. With
the configurable size on s390 defaulting to 4096 bytes this will
ultimately cause problems. So you need to make get_command_line more
flexible first.
Thanks
Philipp
> + break;
> }
> }
>
> @@ -123,6 +127,10 @@ image_s390_load(int argc, char **argv, const char *kernel_buf,
> if (command_line_add(optarg))
> return -1;
> break;
> + case OPT_REUSE_CMDLINE:
> + free(command_line);
> + 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"
> );
> }
More information about the kexec
mailing list