summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiezhu Yang <yangtiezhu@loongson.cn>2022-01-26 18:20:52 +0800
committerSimon Horman <horms@verge.net.au>2022-02-01 12:23:29 +0100
commit6effda061f75dc0ba9430c551eeaad0faf41f0ee (patch)
tree2a7d20acfa107c6920e8391b29c4b50756866a48
parent8dda434a05ff9105d2724cf51c452883fe97b4bc (diff)
downloadkexec-tools-6effda061f75dc0ba9430c551eeaad0faf41f0ee.tar.gz
kexec-tools: mips: Concatenate --reuse-cmdline and --append
Use concat_cmdline() to concatenate the --append string and the --reuse-cmdline string, otherwise only one of the two options is valid. This is similar with commit 8b42c99aa3bc ("Fix --reuse-cmdline so it is usable."). Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn> Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r--kexec/arch/mips/kexec-mips.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/kexec/arch/mips/kexec-mips.c b/kexec/arch/mips/kexec-mips.c
index 10ae45b..d8cbea8 100644
--- a/kexec/arch/mips/kexec-mips.c
+++ b/kexec/arch/mips/kexec-mips.c
@@ -109,15 +109,17 @@ int arch_process_options(int argc, char **argv)
};
static const char short_options[] = KEXEC_ARCH_OPT_STR;
int opt;
+ char *cmdline = NULL;
+ const char *append = NULL;
while ((opt = getopt_long(argc, argv, short_options,
options, 0)) != -1) {
switch (opt) {
case OPT_APPEND:
- arch_options.command_line = optarg;
+ append = optarg;
break;
case OPT_REUSE_CMDLINE:
- arch_options.command_line = get_command_line();
+ cmdline = get_command_line();
break;
case OPT_DTB:
arch_options.dtb_file = optarg;
@@ -130,6 +132,8 @@ int arch_process_options(int argc, char **argv)
}
}
+ arch_options.command_line = concat_cmdline(cmdline, append);
+
dbgprintf("%s:%d: command_line: %s\n", __func__, __LINE__,
arch_options.command_line);
dbgprintf("%s:%d: initrd: %s\n", __func__, __LINE__,