]> git.ozlabs.org Git - petitboot/commitdiff
Add kexec argument logging
authorJeremy Kerr <jk@ozlabs.org>
Mon, 7 Jan 2008 10:42:45 +0000 (21:42 +1100)
committerJeremy Kerr <jk@ozlabs.org>
Mon, 7 Jan 2008 10:42:45 +0000 (21:42 +1100)
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
devices.c

index e4d6913875b6025f7f6a22ec685e861cb766c744..37798105d58d87528b252833955df332324de04c 100644 (file)
--- 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];
 {
        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));
        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;
 
        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);
        execv(kexec_opts[0], kexec_opts);
+
+       LOG("kexec failed: %s", strerror(errno));
 }
 }