From: Jeremy Kerr Date: Wed, 27 Feb 2013 06:28:55 +0000 (+0800) Subject: ui: callback & boot actions: kexec -> boot X-Git-Tag: v1.0.0~728 X-Git-Url: https://git.ozlabs.org/?p=petitboot;a=commitdiff_plain;h=1b0b59295d0500764c5096753f7cd11bf3ab5df4 ui: callback & boot actions: kexec -> boot 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 --- diff --git a/ui/common/ui-system.c b/ui/common/ui-system.c index a828e2e..157c6db 100644 --- a/ui/common/ui-system.c +++ b/ui/common/ui-system.c @@ -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; diff --git a/ui/common/ui-system.h b/ui/common/ui-system.h index 82f630e..bf4f4e9 100644 --- a/ui/common/ui-system.h +++ b/ui/common/ui-system.h @@ -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); diff --git a/ui/ncurses/generic-main.c b/ui/ncurses/generic-main.c index 983ba47..8cb876f 100644 --- a/ui/ncurses/generic-main.c +++ b/ui/ncurses/generic-main.c @@ -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) diff --git a/ui/ncurses/nc-cui.c b/ui/ncurses/nc-cui.c index f47e324..ae3d7c6 100644 --- a/ui/ncurses/nc-cui.c +++ b/ui/ncurses/nc-cui.c @@ -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); diff --git a/ui/ncurses/nc-cui.h b/ui/ncurses/nc-cui.h index 3bdbcfc..abe22a8 100644 --- a/ui/ncurses/nc-cui.h +++ b/ui/ncurses/nc-cui.h @@ -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); diff --git a/ui/ncurses/ps3-main.c b/ui/ncurses/ps3-main.c index 8744145..3b9fab1 100644 --- a/ui/ncurses/ps3-main.c +++ b/ui/ncurses/ps3-main.c @@ -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; diff --git a/ui/twin/main-generic.c b/ui/twin/main-generic.c index 28a96e4..517422e 100644 --- a/ui/twin/main-generic.c +++ b/ui/twin/main-generic.c @@ -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) { diff --git a/ui/twin/pbt-client.c b/ui/twin/pbt-client.c index 39facf5..ad418a3 100644 --- a/ui/twin/pbt-client.c +++ b/ui/twin/pbt-client.c @@ -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); diff --git a/ui/twin/pbt-client.h b/ui/twin/pbt-client.h index 6c35920..7e74e4e 100644 --- a/ui/twin/pbt-client.h +++ b/ui/twin/pbt-client.h @@ -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);