X-Git-Url: https://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=devices.c;h=37798105d58d87528b252833955df332324de04c;hp=0a0645096c0a30dcd4830ec210c0a82324215ef7;hb=bcabb75250c6562ecdf20fdd0c73cbb590a1dd7f;hpb=bd803b47266f399c41c7e560b8769ef172f0fca9 diff --git a/devices.c b/devices.c index 0a06450..3779810 100644 --- a/devices.c +++ b/devices.c @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -12,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); @@ -237,7 +238,7 @@ static twin_bool_t pboot_proc_server_sock(int sock, twin_file_op_t ops, return TWIN_TRUE; } -int pboot_start_device_discovery(void) +int pboot_start_device_discovery(int udev_trigger) { int sock; struct sockaddr_un addr; @@ -268,6 +269,12 @@ int pboot_start_device_discovery(void) twin_set_file(pboot_proc_server_sock, sock, TWIN_READ, &_ctx); + if (udev_trigger) { + int rc = system("udevtrigger"); + if (rc) + LOG("udevtrigger failed, rc %d\n", rc); + } + return TWIN_TRUE; } @@ -275,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)); @@ -293,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)); }