Skip to contentSkip to conversation

kexec-tools: mips: Modify some code

PATCH New Tiezhu Yang 2 participants 4 messages Jan 26, 2022 – Feb 1, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover kexec-tools: mips: Modify some code

Tiezhu Yang (2):
kexec-tools: mips: Add some debug info
kexec-tools: mips: Concatenate --reuse-cmdline and --append

 kexec/arch/mips/kexec-mips.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
Signature · 1 line
2.1.0
#1 lore raw

PATCH 1/2 kexec-tools: mips: Add some debug info

Use dbgprintf() to print command_line, initrd and dtb in arch_process_options() for debugging.

---
 kexec/arch/mips/kexec-mips.c | 7 +++++++
 1 file changed, 7 insertions(+)
kexec/arch/mips/kexec-mips.c +7 -0
index 5866e24..10ae45b 100644
@@ -130,6 +130,13 @@ int arch_process_options(int argc, char **argv)
 		}
 	}
 
+	dbgprintf("%s:%d: command_line: %s\n", __func__, __LINE__,
+		arch_options.command_line);
+	dbgprintf("%s:%d: initrd: %s\n", __func__, __LINE__,
+		arch_options.initrd_file);
+	dbgprintf("%s:%d: dtb: %s\n", __func__, __LINE__,
+		arch_options.dtb_file);
+
 	return 0;
 }
 
Signature · 1 line
2.1.0
#2 lore raw

PATCH 2/2 kexec-tools: mips: Concatenate --reuse-cmdline and --append

In reply to Tiezhu Yang

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.").

---
 kexec/arch/mips/kexec-mips.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
kexec/arch/mips/kexec-mips.c +6 -2
index 10ae45b..d8cbea8 100644
@@ -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__,
Signature · 1 line
2.1.0
Applied
#3 lore raw

cover kexec-tools: mips: Modify some code

In reply to Tiezhu Yang
Quoted 6 lines · Tiezhu Yang

Tiezhu Yang (2):
kexec-tools: mips: Add some debug info
kexec-tools: mips: Concatenate --reuse-cmdline and --append

 kexec/arch/mips/kexec-mips.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

Thanks, applied.