summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2008-01-07 21:42:45 +1100
committerJeremy Kerr <jk@ozlabs.org>2008-01-07 21:42:45 +1100
commitbcabb75250c6562ecdf20fdd0c73cbb590a1dd7f (patch)
tree2c91237c9e5f57eb6ce00a85268f0fe680b32b07
parente8a3e2b1629824cb01c95e2a49b8f31152c0edd2 (diff)
downloadtalos-petitboot-bcabb75250c6562ecdf20fdd0c73cbb590a1dd7f.tar.gz
talos-petitboot-bcabb75250c6562ecdf20fdd0c73cbb590a1dd7f.zip
Add kexec argument logging
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
-rw-r--r--devices.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/devices.c b/devices.c
index e4d6913..3779810 100644
--- a/devices.c
+++ b/devices.c
@@ -282,9 +282,9 @@ void pboot_exec_option(void *data)
{
struct boot_option *opt = data;
char *kexec_opts[10];
- int nr_opts = 2;
+ int i, nr_opts = 2;
- kexec_opts[0] = "/sbin/kexec";
+ kexec_opts[0] = "/usr/sbin/kexec";
kexec_opts[1] = "-f";
if (opt->initrd_file) {
kexec_opts[nr_opts] = malloc(10 + strlen(opt->initrd_file));
@@ -300,5 +300,14 @@ void pboot_exec_option(void *data)
kexec_opts[nr_opts++] = opt->boot_image_file;
kexec_opts[nr_opts] = NULL;
+
+ LOG("calling kexec:\n");
+ for (i = 0; i < nr_opts; i++) {
+ LOG("\t'%s'\n", kexec_opts[i]);
+ }
+ fflush(stdout);
+
execv(kexec_opts[0], kexec_opts);
+
+ LOG("kexec failed: %s", strerror(errno));
}
OpenPOWER on IntegriCloud