- if (!i) {
- assert(0);
- break;
- }
-
- i->pb_opt = opt;
- i->pbt_client = client;
- i->on_execute = pbt_client_run_kexec;
- i->on_edit = pbt_client_on_edit;
-
- i->data = opt_data = talloc(i, struct pb_opt_data);
- opt_data->name = opt->name;
- opt_data->kd = talloc(i, struct pb_kexec_data);
- opt_data->kd->image = talloc_strdup(opt_data->kd,
- opt->boot_image_file);
- opt_data->kd->initrd = talloc_strdup(opt_data->kd,
- opt->initrd_file);
- opt_data->kd->args = talloc_strdup(opt_data->kd,
- opt->boot_args);
- opt_data->dev = dev;
- opt_data->opt = opt;
- opt_data->opt_hash = pb_opt_hash(dev, opt);
-
- /* Select the first item as default. */
-
- if (!selected_item)
- selected_item = i;
-
- /* If this is the default_item select it and start timer. */
-
- if (opt_data->opt_hash
- == device_item->sub_menu->default_item_hash) {
- selected_item = i;
- ui_timer_kick(&client->signal_data.timer);
- }
+ opt_item->pb_opt = opt;
+ opt_item->pbt_client = client;
+ opt_item->on_execute = pbt_client_boot;
+ opt_item->on_edit = pbt_client_on_edit;
+
+ opt_item->data = opt_data = talloc(opt_item, struct pb_opt_data);
+ opt_data->name = opt->name;
+ opt_data->bd = talloc(opt_item, struct pb_boot_data);
+ opt_data->bd->image = talloc_strdup(opt_data->bd,
+ opt->boot_image_file);
+ opt_data->bd->initrd = talloc_strdup(opt_data->bd,
+ opt->initrd_file);
+ opt_data->bd->dtb = talloc_strdup(opt_data->bd,
+ opt->dtb_file);
+ opt_data->bd->args = talloc_strdup(opt_data->bd,
+ opt->boot_args);
+ opt_data->opt = opt;
+ opt_data->opt_hash = pb_opt_hash(dev, opt);
+
+ /* If this is the default_item select it and start timer. */
+ if (opt_data->opt_hash == device_item->sub_menu->default_item_hash) {
+ device_item->selected_item = opt_item;
+ pbt_menu_set_selected(device_item->sub_menu, opt_item);
+ ui_timer_kick(&client->signal_data.timer);