Changeset View
Changeset View
Standalone View
Standalone View
head/usr.sbin/bsdinstall/partedit/part_wizard.c
Show First 20 Lines • Show All 251 Lines • ▼ Show 20 Lines | sprintf(warning, "The existing partition scheme on this " | ||||
"FreeBSD, it must be repartitioned. This will destroy all " | "FreeBSD, it must be repartitioned. This will destroy all " | ||||
"data on the disk. Are you sure you want to proceed?", | "data on the disk. Are you sure you want to proceed?", | ||||
scheme); | scheme); | ||||
subchoice = dialog_yesno("Non-bootable Disk", warning, 0, 0); | subchoice = dialog_yesno("Non-bootable Disk", warning, 0, 0); | ||||
if (subchoice != 0) | if (subchoice != 0) | ||||
goto query; | goto query; | ||||
gpart_destroy(gpart); | gpart_destroy(gpart); | ||||
gpart_partition(disk, default_scheme()); | scheme = choose_part_type(default_scheme()); | ||||
scheme = default_scheme(); | if (scheme == NULL) | ||||
return NULL; | |||||
gpart_partition(disk, scheme); | |||||
} | } | ||||
if (scheme == NULL || choice == 0) { | if (scheme == NULL || choice == 0) { | ||||
if (gpart != NULL && scheme != NULL) { | if (gpart != NULL && scheme != NULL) { | ||||
/* Erase partitioned disk */ | /* Erase partitioned disk */ | ||||
choice = dialog_yesno("Confirmation", "This will erase " | choice = dialog_yesno("Confirmation", "This will erase " | ||||
"the disk. Are you sure you want to proceed?", 0, 0); | "the disk. Are you sure you want to proceed?", 0, 0); | ||||
if (choice != 0) | if (choice != 0) | ||||
goto query; | goto query; | ||||
gpart_destroy(gpart); | gpart_destroy(gpart); | ||||
} | } | ||||
gpart_partition(disk, default_scheme()); | scheme = choose_part_type(default_scheme()); | ||||
scheme = default_scheme(); | if (scheme == NULL) | ||||
return NULL; | |||||
gpart_partition(disk, scheme); | |||||
} | } | ||||
if (strcmp(scheme, "PC98") == 0 || strcmp(scheme, "MBR") == 0) { | if (strcmp(scheme, "PC98") == 0 || strcmp(scheme, "MBR") == 0) { | ||||
struct gmesh submesh; | struct gmesh submesh; | ||||
geom_gettree(&submesh); | geom_gettree(&submesh); | ||||
gpart_create(provider_for_name(&submesh, disk), | gpart_create(provider_for_name(&submesh, disk), | ||||
"freebsd", NULL, NULL, &retval, | "freebsd", NULL, NULL, &retval, | ||||
choice /* Non-interactive for "Entire Disk" */); | choice /* Non-interactive for "Entire Disk" */); | ||||
▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines |