X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=devices.c;h=77860d0546a8dcc967da4a71a2e803f91db6f836;hp=37798105d58d87528b252833955df332324de04c;hb=e518d1d16c16781d6824ece2ee0ddd1ac2339703;hpb=bcabb75250c6562ecdf20fdd0c73cbb590a1dd7f diff --git a/devices.c b/devices.c index 3779810..77860d0 100644 --- a/devices.c +++ b/devices.c @@ -286,12 +286,12 @@ void pboot_exec_option(void *data) kexec_opts[0] = "/usr/sbin/kexec"; kexec_opts[1] = "-f"; - if (opt->initrd_file) { + if (opt->initrd_file && *opt->initrd_file) { kexec_opts[nr_opts] = malloc(10 + strlen(opt->initrd_file)); sprintf(kexec_opts[nr_opts], "--initrd=%s", opt->initrd_file); nr_opts++; } - if (opt->boot_args) { + if (opt->boot_args && *opt->boot_args) { kexec_opts[nr_opts] = malloc(10 + strlen(opt->boot_args)); sprintf(kexec_opts[nr_opts], "--command-line=%s", opt->boot_args); @@ -308,6 +308,6 @@ void pboot_exec_option(void *data) fflush(stdout); execv(kexec_opts[0], kexec_opts); - - LOG("kexec failed: %s", strerror(errno)); + pboot_message("kexec failed: %s", strerror(errno)); + LOG("execv() failed: %s", strerror(errno)); }