Skip to content

Commit

Permalink
installer: For bootblocks, only offer the disk that was installed to.
Browse files Browse the repository at this point in the history
In the "Disk Utilities" menu, we still offer all disks.

Requested-by: dillon
  • Loading branch information
Sascha Wildner committed Apr 23, 2011
1 parent f3dbdf8 commit fe702e4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
5 changes: 3 additions & 2 deletions usr.sbin/installer/dfuibe_installer/flow.c
Expand Up @@ -796,7 +796,7 @@ state_diskutil_menu(struct i_fn_args *a)
a->short_desc = _("Select the disks on which "
"you wish to install bootblocks.");
a->cancel_desc = _("Return to Utilities Menu");
fn_install_bootblocks(a);
fn_install_bootblocks(a, NULL);
} else if (strcmp(dfui_response_get_action_id(r), "format_msdos_floppy") == 0) {
fn_format_msdos_floppy(a);
} else if (strcmp(dfui_response_get_action_id(r), "create_cdboot_floppy") == 0) {
Expand Down Expand Up @@ -1251,7 +1251,8 @@ state_install_bootstrap(struct i_fn_args *a)

a->short_desc = msg_buf[0];
a->cancel_desc = _("Skip this Step");
fn_install_bootblocks(a);
fn_install_bootblocks(a,
disk_get_device_name(storage_get_selected_disk(a->s)));
state = state_finish_install;
}

Expand Down
2 changes: 1 addition & 1 deletion usr.sbin/installer/dfuibe_installer/fn.h
Expand Up @@ -88,7 +88,7 @@ char *fn_select_file(const char *, const char *, const char *,
const struct i_fn_args *);

void fn_format_disk(struct i_fn_args *);
void fn_install_bootblocks(struct i_fn_args *);
void fn_install_bootblocks(struct i_fn_args *, const char *device);
void fn_wipe_start_of_disk(struct i_fn_args *);
void fn_wipe_start_of_slice(struct i_fn_args *);
void fn_format_msdos_floppy(struct i_fn_args *);
Expand Down
16 changes: 12 additions & 4 deletions usr.sbin/installer/dfuibe_installer/fn_disk.c
Expand Up @@ -401,7 +401,7 @@ ask_to_wipe_boot_sector(struct i_fn_args *a, struct commands *fcmds)
}

void
fn_install_bootblocks(struct i_fn_args *a)
fn_install_bootblocks(struct i_fn_args *a, const char *device)
{
struct dfui_form *f;
struct dfui_response *r;
Expand Down Expand Up @@ -450,13 +450,21 @@ fn_install_bootblocks(struct i_fn_args *a)

dfui_form_set_multiple(f, 1);

for (d = storage_disk_first(a->s); d != NULL; d = disk_next(d)) {
if (device != NULL) {
ds = dfui_dataset_new();
/* XXX need to see how this is handled in OpenBSD/NetBSD */
dfui_dataset_celldata_add(ds, "disk", disk_get_device_name(d));
dfui_dataset_celldata_add(ds, "disk", device);
dfui_dataset_celldata_add(ds, "boot0cfg", "Y");
dfui_dataset_celldata_add(ds, "packet", "Y");
dfui_form_dataset_add(f, ds);
} else {
for (d = storage_disk_first(a->s); d != NULL; d = disk_next(d)) {
ds = dfui_dataset_new();
dfui_dataset_celldata_add(ds, "disk",
disk_get_device_name(d));
dfui_dataset_celldata_add(ds, "boot0cfg", "Y");
dfui_dataset_celldata_add(ds, "packet", "Y");
dfui_form_dataset_add(f, ds);
}
}

if (!dfui_be_present(a->c, f, &r))
Expand Down

0 comments on commit fe702e4

Please sign in to comment.