[v2,2/3] boot/pb-discover: Use kexec_file config option to determine kexec syscall

Submitted by Eric Richter on March 30, 2017, 6:56 p.m.

Details

Message ID 1490900184-26327-3-git-send-email-erichte@linux.vnet.ibm.com
State New
Headers show

Commit Message

Eric Richter March 30, 2017, 6:56 p.m.
Adds a kexec_file boolean to the boot_task struct to control which
syscall is used for kexec loading. If set to true, the parameter for
kexec_file_load (-s) is passed to kexec-{tools,lite} instead of the default
parameter for kexec_load (-l).

Signed-off-by: Eric Richter <erichte@linux.vnet.ibm.com>
---
 discover/boot.c | 4 +++-
 discover/boot.h | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/discover/boot.c b/discover/boot.c
index fab4b61..cdfed96 100644
--- a/discover/boot.c
+++ b/discover/boot.c
@@ -105,7 +105,7 @@  static int kexec_load(struct boot_task *boot_task)
 
 	p = argv;
 	*p++ = pb_system_apps.kexec;	/* 1 */
-	*p++ = "-l";			/* 2 */
+	*p++ = (boot_task->kexec_file) ? "-s" : "-l";		/* 2 */
 
 	if (local_initrd) {
 		s_initrd = talloc_asprintf(boot_task, "--initrd=%s",
@@ -597,6 +597,8 @@  struct boot_task *boot(void *ctx, struct discover_boot_option *opt,
 		boot_task->args = NULL;
 	}
 
+	boot_task->kexec_file = config->kexec_file;
+
 	if (cmd && cmd->console && !config->manual_console)
 		boot_task->boot_console = talloc_strdup(boot_task, cmd->console);
 	else
diff --git a/discover/boot.h b/discover/boot.h
index 69643bf..7019208 100644
--- a/discover/boot.h
+++ b/discover/boot.h
@@ -33,6 +33,7 @@  struct boot_task {
 	bool cancelled;
 	bool verify_signature;
 	bool decrypt_files;
+	bool kexec_file;
 	struct load_url_result *image_signature;
 	struct load_url_result *initrd_signature;
 	struct load_url_result *dtb_signature;