- 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);
-
- name = cui_make_item_name(i, cod);
- pmenu_item_setup(cui->main, i, insert_pt, name);
-
- 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);
-
- /* If this is the default_item select it and start timer. */
-
- if (cod->opt_hash == cui->default_item) {
- selected = i->nci;
- ui_timer_kick(&cui->timer);
- }
+ i->on_edit = cui_boot_editor_run;
+ i->on_execute = cui_boot;
+ i->data = cod = talloc(i, struct cui_opt_data);
+
+ cod->opt = opt;
+ cod->dev = dev;
+ cod->opt_hash = pb_opt_hash(dev, opt);
+ cod->name = opt->name;
+ cod->bd = talloc(i, struct pb_boot_data);
+
+ 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);
+
+ pmenu_item_setup(cui->main, i, insert_pt, cod->name);
+
+ pb_log("%s: adding opt '%s'\n", __func__, cod->name);
+ 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. */
+ if (cod->opt_hash == cui->default_item) {
+ selected = i->nci;
+ ui_timer_kick(&cui->timer);