diff options
Diffstat (limited to 'ui/ncurses')
-rw-r--r-- | ui/ncurses/generic-main.c | 2 | ||||
-rw-r--r-- | ui/ncurses/nc-boot-editor.c | 38 | ||||
-rw-r--r-- | ui/ncurses/nc-boot-editor.h | 6 | ||||
-rw-r--r-- | ui/ncurses/nc-cui.c | 52 | ||||
-rw-r--r-- | ui/ncurses/nc-cui.h | 2 | ||||
-rw-r--r-- | ui/ncurses/ps3-main.c | 16 |
6 files changed, 58 insertions, 58 deletions
diff --git a/ui/ncurses/generic-main.c b/ui/ncurses/generic-main.c index dfeb1ba..983ba47 100644 --- a/ui/ncurses/generic-main.c +++ b/ui/ncurses/generic-main.c @@ -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->kd, pb->cui->dry_run); + return pb_run_kexec(cod->bd, pb->cui->dry_run); } /** diff --git a/ui/ncurses/nc-boot-editor.c b/ui/ncurses/nc-boot-editor.c index a9256ff..38d29f8 100644 --- a/ui/ncurses/nc-boot-editor.c +++ b/ui/ncurses/nc-boot-editor.c @@ -167,27 +167,27 @@ static char *boot_editor_chomp(char *s) return start; } -static struct pb_kexec_data *boot_editor_prepare_data( +static struct pb_boot_data *boot_editor_prepare_data( struct boot_editor *boot_editor) { - struct pb_kexec_data *kd; + struct pb_boot_data *bd; char *s; - kd = talloc(boot_editor, struct pb_kexec_data); + bd = talloc(boot_editor, struct pb_boot_data); - if (!kd) + if (!bd) return NULL; s = boot_editor_chomp(field_buffer(boot_editor->fields[0], 0)); - kd->image = *s ? talloc_strdup(kd, s) : NULL; + bd->image = *s ? talloc_strdup(bd, s) : NULL; s = boot_editor_chomp(field_buffer(boot_editor->fields[1], 0)); - kd->initrd = *s ? talloc_strdup(kd, s) : NULL; + bd->initrd = *s ? talloc_strdup(bd, s) : NULL; s = boot_editor_chomp(field_buffer(boot_editor->fields[2], 0)); - kd->args = *s ? talloc_strdup(kd, s) : NULL; + bd->args = *s ? talloc_strdup(bd, s) : NULL; - return kd; + return bd; } /** @@ -199,7 +199,7 @@ static struct pb_kexec_data *boot_editor_prepare_data( static void boot_editor_process_key(struct nc_scr *scr) { struct boot_editor *boot_editor = boot_editor_from_scr(scr); - struct pb_kexec_data *kd; + struct pb_boot_data *bd; while (1) { int c = getch(); @@ -223,9 +223,9 @@ static void boot_editor_process_key(struct nc_scr *scr) case '\n': case '\r': form_driver(boot_editor->ncf, REQ_VALIDATION); - kd = boot_editor_prepare_data(boot_editor); + bd = boot_editor_prepare_data(boot_editor); boot_editor->on_exit(boot_editor, - boot_editor_update, kd); + boot_editor_update, bd); nc_flush_keys(); return; @@ -315,16 +315,16 @@ static FIELD *boot_editor_setup_label(unsigned int y, unsigned int x, char *str) } struct boot_editor *boot_editor_init(void *ui_ctx, - const struct pb_kexec_data *kd, + const struct pb_boot_data *bd, void (*on_exit)(struct boot_editor *, enum boot_editor_result, - struct pb_kexec_data *)) + struct pb_boot_data *)) { struct boot_editor *boot_editor; - pb_log("%s: image: '%s'\n", __func__, kd->image); - pb_log("%s: initrd: '%s'\n", __func__, kd->initrd); - pb_log("%s: args: '%s'\n", __func__, kd->args); + pb_log("%s: image: '%s'\n", __func__, bd->image); + pb_log("%s: initrd: '%s'\n", __func__, bd->initrd); + pb_log("%s: args: '%s'\n", __func__, bd->args); assert(on_exit); @@ -348,9 +348,9 @@ struct boot_editor *boot_editor_init(void *ui_ctx, boot_editor->fields = talloc_array(boot_editor, FIELD *, 7); - boot_editor->fields[0] = boot_editor_setup_field(0, 9, kd->image); - boot_editor->fields[1] = boot_editor_setup_field(1, 9, kd->initrd); - boot_editor->fields[2] = boot_editor_setup_field(2, 9, kd->args); + boot_editor->fields[0] = boot_editor_setup_field(0, 9, bd->image); + boot_editor->fields[1] = boot_editor_setup_field(1, 9, bd->initrd); + boot_editor->fields[2] = boot_editor_setup_field(2, 9, bd->args); boot_editor->fields[3] = boot_editor_setup_label(0, 1, "image:"); boot_editor->fields[4] = boot_editor_setup_label(1, 1, "initrd:"); boot_editor->fields[5] = boot_editor_setup_label(2, 1, "args:"); diff --git a/ui/ncurses/nc-boot-editor.h b/ui/ncurses/nc-boot-editor.h index 650c316..bdcc560 100644 --- a/ui/ncurses/nc-boot-editor.h +++ b/ui/ncurses/nc-boot-editor.h @@ -59,13 +59,13 @@ struct boot_editor { enum boot_editor_attr_cursor attr_cursor; void (*on_exit)(struct boot_editor *boot_editor, enum boot_editor_result result, - struct pb_kexec_data *kd); + struct pb_boot_data *bd); }; struct boot_editor *boot_editor_init(void *ui_ctx, - const struct pb_kexec_data *kd, + const struct pb_boot_data *bd, void (*on_exit)(struct boot_editor *, enum boot_editor_result, - struct pb_kexec_data *)); + struct pb_boot_data *)); #endif diff --git a/ui/ncurses/nc-cui.c b/ui/ncurses/nc-cui.c index 51c1472..f47e324 100644 --- a/ui/ncurses/nc-cui.c +++ b/ui/ncurses/nc-cui.c @@ -70,19 +70,19 @@ static char *cui_make_item_name(struct pmenu_item *i, struct cui_opt_data *cod) char *name; assert(cod->name); - assert(cod->kd); + assert(cod->bd); name = talloc_asprintf(i, "%s:", cod->name); - if (cod->kd->image) - name = talloc_asprintf_append(name, " %s", cod->kd->image); + if (cod->bd->image) + name = talloc_asprintf_append(name, " %s", cod->bd->image); - if (cod->kd->initrd) + if (cod->bd->initrd) name = talloc_asprintf_append(name, " initrd=%s", - cod->kd->initrd); + cod->bd->initrd); - if (cod->kd->args) - name = talloc_asprintf_append(name, " %s", cod->kd->args); + if (cod->bd->args) + name = talloc_asprintf_append(name, " %s", cod->bd->args); DBGS("@%s@\n", name); return name; @@ -154,8 +154,8 @@ static int cui_run_kexec(struct pmenu_item *item) sleep(cui->dry_run ? 1 : 60); } - pb_log("%s: failed: %s\n", __func__, cod->kd->image); - nc_scr_status_printf(cui->current, "Failed: kexec %s", cod->kd->image); + pb_log("%s: failed: %s\n", __func__, cod->bd->image); + nc_scr_status_printf(cui->current, "Failed: kexec %s", cod->bd->image); return 0; } @@ -165,7 +165,7 @@ static int cui_run_kexec(struct pmenu_item *item) */ static void cui_boot_editor_on_exit(struct boot_editor *boot_editor, enum boot_editor_result boot_editor_result, - struct pb_kexec_data *kd) + struct pb_boot_data *bd) { struct cui *cui = cui_from_arg(boot_editor->scr.ui_ctx); @@ -174,11 +174,11 @@ static void cui_boot_editor_on_exit(struct boot_editor *boot_editor, enum boot_e struct cui_opt_data *cod = cod_from_item(i); char *name; - assert(kd); + assert(bd); - talloc_steal(i, kd); - talloc_free(cod->kd); - cod->kd = kd; + talloc_steal(i, bd); + talloc_free(cod->bd); + cod->bd = bd; name = cui_make_item_name(i, cod); pmenu_item_replace(i, name); @@ -187,9 +187,9 @@ static void cui_boot_editor_on_exit(struct boot_editor *boot_editor, enum boot_e set_current_item(cui->main->ncm, i->nci); pb_log("%s: updating opt '%s'\n", __func__, cod->name); - pb_log(" image '%s'\n", cod->kd->image); - pb_log(" initrd '%s'\n", cod->kd->initrd); - pb_log(" args '%s'\n", cod->kd->args); + pb_log(" image '%s'\n", cod->bd->image); + pb_log(" initrd '%s'\n", cod->bd->initrd); + pb_log(" args '%s'\n", cod->bd->args); } cui_set_current(cui, &cui->main->scr); @@ -203,7 +203,7 @@ int cui_boot_editor_run(struct pmenu_item *item) struct cui_opt_data *cod = cod_from_item(item); struct boot_editor *boot_editor; - boot_editor = boot_editor_init(cui, cod->kd, cui_boot_editor_on_exit); + boot_editor = boot_editor_init(cui, cod->bd, cui_boot_editor_on_exit); cui_set_current(cui, &boot_editor->scr); return 0; @@ -345,7 +345,7 @@ void cui_on_open(struct pmenu *menu) i->data = cod = talloc_zero(i, struct cui_opt_data); cod->name = talloc_asprintf(i, "User item %u:", insert_pt); - cod->kd = talloc_zero(i, struct pb_kexec_data); + cod->bd = talloc_zero(i, struct pb_boot_data); pmenu_item_setup(menu, i, insert_pt, talloc_strdup(i, cod->name)); @@ -414,11 +414,11 @@ static int cui_device_add(struct device *dev, void *arg) cod->opt = opt; cod->opt_hash = pb_opt_hash(dev, opt); cod->name = opt->name; - cod->kd = talloc(i, struct pb_kexec_data); + cod->bd = talloc(i, struct pb_boot_data); - cod->kd->image = talloc_strdup(cod->kd, opt->boot_image_file); - cod->kd->initrd = talloc_strdup(cod->kd, opt->initrd_file); - cod->kd->args = talloc_strdup(cod->kd, opt->boot_args); + cod->bd->image = talloc_strdup(cod->bd, opt->boot_image_file); + cod->bd->initrd = talloc_strdup(cod->bd, opt->initrd_file); + cod->bd->args = talloc_strdup(cod->bd, opt->boot_args); name = cui_make_item_name(i, cod); pmenu_item_setup(cui->main, i, insert_pt, name); @@ -426,9 +426,9 @@ static int cui_device_add(struct device *dev, void *arg) insert_pt++; pb_log("%s: adding opt '%s'\n", __func__, cod->name); - pb_log(" image '%s'\n", cod->kd->image); - pb_log(" initrd '%s'\n", cod->kd->initrd); - pb_log(" args '%s'\n", cod->kd->args); + pb_log(" image '%s'\n", cod->bd->image); + pb_log(" initrd '%s'\n", cod->bd->initrd); + pb_log(" args '%s'\n", cod->bd->args); /* If this is the default_item select it and start timer. */ diff --git a/ui/ncurses/nc-cui.h b/ui/ncurses/nc-cui.h index 4470ef4..3bdbcfc 100644 --- a/ui/ncurses/nc-cui.h +++ b/ui/ncurses/nc-cui.h @@ -28,7 +28,7 @@ struct cui_opt_data { const char *name; - struct pb_kexec_data *kd; + struct pb_boot_data *bd; /* optional data */ const struct device *dev; diff --git a/ui/ncurses/ps3-main.c b/ui/ncurses/ps3-main.c index 26d2591..8744145 100644 --- a/ui/ncurses/ps3-main.c +++ b/ui/ncurses/ps3-main.c @@ -294,24 +294,24 @@ static int ps3_kexec_cb(struct cui *cui, struct cui_opt_data *cod) /* Add a default kernel video mode. */ - if (!cod->kd->args) { + if (!cod->bd->args) { altered_args = 1; orig_args = NULL; - cod->kd->args = talloc_asprintf(NULL, "video=ps3fb:mode:%u", + cod->bd->args = talloc_asprintf(NULL, "video=ps3fb:mode:%u", (unsigned int)ps3->values.video_mode); - } else if (!strstr(cod->kd->args, "video=")) { + } else if (!strstr(cod->bd->args, "video=")) { altered_args = 1; - orig_args = cod->kd->args; - cod->kd->args = talloc_asprintf(NULL, "%s video=ps3fb:mode:%u", + orig_args = cod->bd->args; + cod->bd->args = talloc_asprintf(NULL, "%s video=ps3fb:mode:%u", orig_args, (unsigned int)ps3->values.video_mode); } else altered_args = 0; - result = pb_run_kexec(cod->kd, ps3->cui->dry_run); + result = pb_run_kexec(cod->bd, ps3->cui->dry_run); if (altered_args) { - talloc_free(cod->kd->args); - cod->kd->args = orig_args; + talloc_free(cod->bd->args); + cod->bd->args = orig_args; } return result; |