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));
}
+
+#define _GNU_SOURCE
+
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
pboot_option_t *opt = &dev->options[pboot_rpane->focus_curindex];
LOG("Selected device %s\n", opt->title);
+ pboot_message("booting %s...", opt->title);
/* Give user feedback, make sure errors and panics will be seen */
pboot_exec_option(opt->data);
/* Another gross hack for booting back to gameos */
case KEY_BACKSPACE:
case KEY_DELETE:
+ pboot_message("booting to GameOS");
system(BOOT_GAMEOS_BIN);
pboot_quit();
}
twin_path_destroy(path);
}
-void pboot_message(const char *message)
+void pboot_message(const char *fmt, ...)
{
+ va_list ap;
+ char *msg;
+
if (pboot_spane->text)
free(pboot_spane->text);
- pboot_spane->text = strdup(message);
+
+ va_start(ap, fmt);
+ vasprintf(&msg, fmt, ap);
+ va_end(ap);
+
+ pboot_spane->text = msg;
twin_window_damage(pboot_spane->window,
0, 0,
pboot_spane->window->pixmap->width,
#include <libtwin/twin.h>
+#include <stdarg.h>
#define LOG(fmt...) printf(fmt)
int pboot_start_device_discovery(int udev_trigger);
void pboot_exec_option(void *data);
-void pboot_message(const char *message);
+void pboot_message(const char *fmt, ...);