X-Git-Url: https://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=devices.c;h=77860d0546a8dcc967da4a71a2e803f91db6f836;hp=4936f9ab2adfc515c61ff30a990dcc7cdcfea369;hb=589623efd5361f5f3ee5a99013c2d11d96338e9f;hpb=d24e0892cd09e9d41793a59e66b7f86a99b40343 diff --git a/devices.c b/devices.c index 4936f9a..77860d0 100644 --- a/devices.c +++ b/devices.c @@ -13,7 +13,7 @@ #include "petitboot-paths.h" #include "devices/message.h" -#define PBOOT_DEFAULT_ICON "usbpen.png" +#define PBOOT_DEFAULT_ICON "tux.png" static const char *default_icon = artwork_pathname(PBOOT_DEFAULT_ICON); @@ -282,16 +282,16 @@ 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) { + 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); @@ -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); + pboot_message("kexec failed: %s", strerror(errno)); + LOG("execv() failed: %s", strerror(errno)); }