]> git.ozlabs.org Git - petitboot/blobdiff - ui/twin/main-generic.c
lib/waiter: Add timeout waiters
[petitboot] / ui / twin / main-generic.c
index 5020fa2f345ff8319a8805f07de400fc3b073379..c9cb4923863c06b96807514e1ab46eb709ae406d 100644 (file)
@@ -71,7 +71,7 @@ static struct pbt_item *setup_system_item(struct pbt_menu *menu,
        struct pbt_quad q;
 
        top_item = pbt_item_create_reduced(menu, "system", 0,
-               PB_ARTWORK_PATH "/system.png");
+               PB_ARTWORK_PATH "/applications-system.png");
 
        if (!top_item)
                goto fail_top_item_create;
@@ -90,7 +90,7 @@ static struct pbt_item *setup_system_item(struct pbt_menu *menu,
                goto fail_sub_menu_create;
 
        sub_item = pbt_item_create(top_item->sub_menu, "Preferences", 0,
-               PB_ARTWORK_PATH "/system.png", "Preferences",
+               PB_ARTWORK_PATH "/configure.png", "Preferences",
                "Edit petitboot preferences");
 
        if (!sub_item)
@@ -101,7 +101,7 @@ static struct pbt_item *setup_system_item(struct pbt_menu *menu,
        pbt_menu_set_selected(top_item->sub_menu, sub_item);
 
        sub_item = pbt_item_create(top_item->sub_menu, "Exit to Shell", 1,
-               PB_ARTWORK_PATH "/system.png", "Exit to Shell",
+               PB_ARTWORK_PATH "/utilities-terminal.png", "Exit to Shell",
                "Exit to a system shell prompt");
 
        if (!sub_item)
@@ -199,23 +199,10 @@ fail_menu:
        return NULL;
 }
 
-static int kexec_cb(__attribute__((unused)) struct pbt_client *client, struct pb_opt_data *opt_data)
-{
-       int result;
-
-       assert(opt_data);
-
-       pb_log("%s: %s\n", __func__, opt_data->name);
-
-       result = pb_run_kexec(opt_data->kd);
-
-       return result;
-}
-
 static int run(struct pbt_client *client)
 {
        while (1) {
-               int result = waiter_poll();
+               int result = waiter_poll(client->waitset);
 
                if (result < 0 && errno != EINTR) {
                        pb_log("%s: poll: %s\n", __func__, strerror(errno));
@@ -285,7 +272,6 @@ int main(int argc, char *argv[])
        static struct pbt_opts opts;
        int result;
        int ui_result;
-       FILE *log;
        struct pbt_client *client;
 
        result = pbt_opts_parse(&opts, argc, argv);
@@ -305,9 +291,13 @@ int main(int argc, char *argv[])
                return EXIT_SUCCESS;
        }
 
-       log = fopen(opts.log_file, "a");
-       assert(log);
-       pb_log_set_stream(log);
+       if (strcmp(opts.log_file, "-")) {
+               FILE *log = fopen(opts.log_file, "a");
+
+               assert(log);
+               pb_log_set_stream(log);
+       } else
+               pb_log_set_stream(stderr);
 
 #if defined(DEBUG)
        pb_log_always_flush(1);
@@ -327,7 +317,7 @@ int main(int argc, char *argv[])
                return EXIT_FAILURE;
        }
 
-       client = pbt_client_init(opts.backend, 900, 300, kexec_cb);
+       client = pbt_client_init(opts.backend, 1024, 640, opts.start_daemon);
 
        if (!client) {
                ui_result = EXIT_FAILURE;