]> git.ozlabs.org Git - petitboot/commitdiff
ui: callback & boot actions: kexec -> boot
authorJeremy Kerr <jk@ozlabs.org>
Wed, 27 Feb 2013 06:28:55 +0000 (14:28 +0800)
committerJeremy Kerr <jk@ozlabs.org>
Mon, 15 Apr 2013 06:54:21 +0000 (14:54 +0800)
find ui/ -type f |
xargs sed -i -e s/kexec_cb/boot_cb/g \
-e s/on_kexec/on_boot/g \
-e s/run_kexec/boot/g

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
ui/common/ui-system.c
ui/common/ui-system.h
ui/ncurses/generic-main.c
ui/ncurses/nc-cui.c
ui/ncurses/nc-cui.h
ui/ncurses/ps3-main.c
ui/twin/main-generic.c
ui/twin/pbt-client.c
ui/twin/pbt-client.h

index a828e2ee3b92a3b881ea5d3b5e04bf38f8523d29..157c6db7797c30ec286ed010094b920e98772b63 100644 (file)
@@ -142,10 +142,10 @@ static int kexec_reboot(int dry_run)
 }
 
 /**
- * pb_run_kexec - Run kexec with the supplied boot options.
+ * pb_boot - Run kexec with the supplied boot options.
  */
 
-int pb_run_kexec(const struct pb_boot_data *bd, int dry_run)
+int pb_boot(const struct pb_boot_data *bd, int dry_run)
 {
        int result;
        char *l_image = NULL;
index 82f630ea62397a6503bcbefe12bbfc83af02057d..bf4f4e9e115a8de9efdcbf567306275f41cba776 100644 (file)
@@ -33,7 +33,7 @@ struct pb_boot_data {
        char *args;
 };
 
-int pb_run_kexec(const struct pb_boot_data *bd, int dry_run);
+int pb_boot(const struct pb_boot_data *bd, int dry_run);
 int pb_start_daemon(void);
 
 unsigned int pb_elf_hash(const char *str);
index 983ba474917ab629a47b2c36b61398c31125452c..8cb876f4ea4229522bc55b87b08a0ac7a251b9f7 100644 (file)
@@ -142,10 +142,10 @@ static struct pb_cui *pb_from_cui(struct cui *cui)
 }
 
 /**
- * pb_kexec_cb - The kexec callback.
+ * pb_boot_cb - The kexec callback.
  */
 
-static int pb_kexec_cb(struct cui *cui, struct cui_opt_data *cod)
+static int pb_boot_cb(struct cui *cui, struct cui_opt_data *cod)
 {
        struct pb_cui *pb = pb_from_cui(cui);
 
@@ -153,7 +153,7 @@ static int pb_kexec_cb(struct cui *cui, struct cui_opt_data *cod)
 
        assert(pb->cui->current == &pb->cui->main->scr);
 
-       return pb_run_kexec(cod->bd, pb->cui->dry_run);
+       return pb_boot(cod->bd, pb->cui->dry_run);
 }
 
 /**
@@ -285,7 +285,7 @@ int main(int argc, char *argv[])
                return EXIT_FAILURE;
        }
 
-       pb.cui = cui_init(&pb, pb_kexec_cb, NULL, opts.start_daemon,
+       pb.cui = cui_init(&pb, pb_boot_cb, NULL, opts.start_daemon,
                opts.dry_run);
 
        if (!pb.cui)
index f47e3243de0aa12a48e432ab68507639f2f23cd7..ae3d7c6d9741da102655850700b7b534b894fd94 100644 (file)
@@ -125,24 +125,24 @@ int cui_run_cmd(struct pmenu_item *item)
 }
 
 /**
- * cui_run_kexec - A generic cb to run kexec.
+ * cui_boot - A generic cb to run kexec.
  */
 
-static int cui_run_kexec(struct pmenu_item *item)
+static int cui_boot(struct pmenu_item *item)
 {
        int result;
        struct cui *cui = cui_from_item(item);
        struct cui_opt_data *cod = cod_from_item(item);
 
        assert(cui->current == &cui->main->scr);
-       assert(cui->on_kexec);
+       assert(cui->on_boot);
 
        pb_log("%s: %s\n", __func__, cod->name);
        nc_scr_status_printf(cui->current, "Booting %s...", cod->name);
 
        def_prog_mode();
 
-       result = cui->on_kexec(cui, cod);
+       result = cui->on_boot(cui, cod);
 
        reset_prog_mode();
        redrawwin(cui->current->main_ncw);
@@ -341,7 +341,7 @@ void cui_on_open(struct pmenu *menu)
        i = pmenu_item_alloc(menu);
 
        i->on_edit = cui_boot_editor_run;
-       i->on_execute = cui_run_kexec;
+       i->on_execute = cui_boot;
        i->data = cod = talloc_zero(i, struct cui_opt_data);
 
        cod->name = talloc_asprintf(i, "User item %u:", insert_pt);
@@ -407,7 +407,7 @@ static int cui_device_add(struct device *dev, void *arg)
                opt->ui_info = i = pmenu_item_alloc(cui->main);
 
                i->on_edit = cui_boot_editor_run;
-               i->on_execute = cui_run_kexec;
+               i->on_execute = cui_boot;
                i->data = cod = talloc(i, struct cui_opt_data);
 
                cod->dev = dev;
@@ -533,7 +533,7 @@ static struct discover_client_ops cui_client_ops = {
  */
 
 struct cui *cui_init(void* platform_info,
-       int (*on_kexec)(struct cui *, struct cui_opt_data *),
+       int (*on_boot)(struct cui *, struct cui_opt_data *),
        int (*js_map)(const struct js_event *e), int start_deamon, int dry_run)
 {
        struct cui *cui;
@@ -550,7 +550,7 @@ struct cui *cui_init(void* platform_info,
 
        cui->c_sig = pb_cui_sig;
        cui->platform_info = platform_info;
-       cui->on_kexec = on_kexec;
+       cui->on_boot = on_boot;
        cui->timer.handle_timeout = cui_handle_timeout;
        cui->dry_run = dry_run;
        cui->waitset = waitset_create(cui);
index 3bdbcfca2eaf8e4423aa6ec218d3f336d1f19398..abe22a8ad3fc61569398ea51069836f69bb43b0e 100644 (file)
@@ -59,11 +59,11 @@ struct cui {
        struct pjs *pjs;
        void *platform_info;
        unsigned int default_item;
-       int (*on_kexec)(struct cui *cui, struct cui_opt_data *cod);
+       int (*on_boot)(struct cui *cui, struct cui_opt_data *cod);
 };
 
 struct cui *cui_init(void* platform_info,
-       int (*on_kexec)(struct cui *, struct cui_opt_data *),
+       int (*on_boot)(struct cui *, struct cui_opt_data *),
        int (*js_map)(const struct js_event *e), int start_deamon, int dry_run);
 struct nc_scr *cui_set_current(struct cui *cui, struct nc_scr *scr);
 int cui_run(struct cui *cui, struct pmenu *main, unsigned int default_item);
index 87441456ad9ee9e25486d8ea21a43f3fdfc6628f..3b9fab167af22e444e4a3f67e1fc68240dbea32e 100644 (file)
@@ -267,13 +267,13 @@ static int ps3_svm_cb(struct pmenu_item *item)
 }
 
 /**
- * ps3_kexec_cb - The kexec callback.
+ * ps3_boot_cb - The kexec callback.
  *
- * Writes config data to PS3 flash then calls pb_run_kexec().
+ * Writes config data to PS3 flash then calls pb_boot().
  * Adds a video mode arg to the kernel command line if needed.
  */
 
-static int ps3_kexec_cb(struct cui *cui, struct cui_opt_data *cod)
+static int ps3_boot_cb(struct cui *cui, struct cui_opt_data *cod)
 {
        struct ps3_cui *ps3 = ps3_from_cui(cui);
        int result;
@@ -307,7 +307,7 @@ static int ps3_kexec_cb(struct cui *cui, struct cui_opt_data *cod)
        } else
                altered_args = 0;
 
-       result = pb_run_kexec(cod->bd, ps3->cui->dry_run);
+       result = pb_boot(cod->bd, ps3->cui->dry_run);
 
        if (altered_args) {
                talloc_free(cod->bd->args);
@@ -658,7 +658,7 @@ int main(int argc, char *argv[])
        if (!result && (ps3.values.video_mode != (uint16_t)mode))
                ps3_set_video_mode(ps3.values.video_mode);
 
-       ps3.cui = cui_init(&ps3, ps3_kexec_cb, ps3_sixaxis_map);
+       ps3.cui = cui_init(&ps3, ps3_boot_cb, ps3_sixaxis_map);
 
        if (!ps3.cui)
                return EXIT_FAILURE;
index 28a96e461f1223b1db244578c25790b37844591e..517422e4da9285ded2c1dfb8ec5d1d593bfd149a 100644 (file)
@@ -199,7 +199,7 @@ fail_menu:
        return NULL;
 }
 
-static int kexec_cb(struct pbt_client *client, struct pb_opt_data *opt_data)
+static int boot_cb(struct pbt_client *client, struct pb_opt_data *opt_data)
 {
        int result;
 
@@ -207,7 +207,7 @@ static int kexec_cb(struct pbt_client *client, struct pb_opt_data *opt_data)
 
        pb_log("%s: %s\n", __func__, opt_data->name);
 
-       result = pb_run_kexec(opt_data->bd, client->dry_run);
+       result = pb_boot(opt_data->bd, client->dry_run);
 
        return result;
 }
@@ -330,7 +330,7 @@ int main(int argc, char *argv[])
                return EXIT_FAILURE;
        }
 
-       client = pbt_client_init(opts.backend, 1024, 640, kexec_cb,
+       client = pbt_client_init(opts.backend, 1024, 640, boot_cb,
                opts.start_daemon, opts.dry_run);
 
        if (!client) {
index 39facf5fe73094b16dc8759086c43708daa2b6f3..ad418a32e2e95941c9d7186471890f070da3f815 100644 (file)
@@ -52,7 +52,7 @@ void pbt_frame_status_printf(struct pbt_frame *frame, const char *format, ...)
        va_end(ap);
 }
 
-static int pbt_client_run_kexec(struct pbt_item *item)
+static int pbt_client_boot(struct pbt_item *item)
 {
        int result;
        struct pb_opt_data *opt_data = pbt_opt_data_from_item(item);
@@ -62,8 +62,8 @@ static int pbt_client_run_kexec(struct pbt_item *item)
        pbt_frame_status_printf(&item->pbt_client->frame, "Booting %s...",
                pbt_item_name(item));
 
-       assert(item->pbt_client->kexec_cb);
-       result = item->pbt_client->kexec_cb(item->pbt_client, opt_data);
+       assert(item->pbt_client->boot_cb);
+       result = item->pbt_client->boot_cb(item->pbt_client, opt_data);
 
        if (!result) {
                sleep(item->pbt_client->dry_run ? 1 : 60);
@@ -140,7 +140,7 @@ static int pbt_device_add(struct device *dev, struct pbt_client *client)
 
                i->pb_opt = opt;
                i->pbt_client = client;
-               i->on_execute = pbt_client_run_kexec;
+               i->on_execute = pbt_client_boot;
                i->on_edit = pbt_client_on_edit;
 
                i->data = opt_data = talloc(i, struct pb_opt_data);
@@ -265,7 +265,7 @@ static void pbt_client_destructor(struct pbt_client *client)
 
 struct pbt_client *pbt_client_init(enum pbt_twin_backend backend,
        unsigned int width, unsigned int height,
-       int (*kexec_cb)(struct pbt_client *, struct pb_opt_data *),
+       int (*boot_cb)(struct pbt_client *, struct pb_opt_data *),
        int start_deamon, int dry_run)
 {
        struct pbt_client *pbt_client;
@@ -284,7 +284,7 @@ struct pbt_client *pbt_client_init(enum pbt_twin_backend backend,
        pbt_client->waitset = waitset_create(pbt_client);
 
        pbt_client->sig = "pbt_client";
-       pbt_client->kexec_cb = kexec_cb;
+       pbt_client->boot_cb = boot_cb;
        pbt_client->dry_run = dry_run;
        pbt_client->frame.scr = pbt_scr_init(pbt_client, pbt_client->waitset,
                        backend, width, height, NULL, NULL);
index 6c359208a312fc146b67387c8cae39bef5f2eab4..7e74e4ec5cf822acecc6e6b0db84c96fb825439d 100644 (file)
@@ -45,7 +45,7 @@ struct pbt_client {
        int dry_run;
        struct pb_signal_data signal_data;
        void *client_data;
-       int (*kexec_cb)(struct pbt_client *pbt_client, struct pb_opt_data *pod);
+       int (*boot_cb)(struct pbt_client *pbt_client, struct pb_opt_data *pod);
 
        struct pbt_frame frame;
        struct discover_client *discover_client;
@@ -54,7 +54,7 @@ struct pbt_client {
 
 struct pbt_client *pbt_client_init(enum pbt_twin_backend backend,
        unsigned int width, unsigned int height,
-       int (*kexec_cb)(struct pbt_client *, struct pb_opt_data *),
+       int (*boot_cb)(struct pbt_client *, struct pb_opt_data *),
        int start_deamon, int dry_run);
 void pbt_client_destroy(struct pbt_client *client);
 void pbt_client_resize(struct pbt_client *client);