2 * Copyright (c)2004 The DragonFly Project. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
8 * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
11 * Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in
13 * the documentation and/or other materials provided with the
16 * Neither the name of the DragonFly Project nor the names of its
17 * contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24 * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
25 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
29 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
31 * OF THE POSSIBILITY OF SUCH DAMAGE.
36 * Installer Function : Create Subpartitions.
37 * $Id: fn_subpart.c,v 1.50 2005/04/07 20:22:40 cpressey Exp $
46 #define _(String) gettext (String)
48 #define _(String) (String)
51 #include "libaura/mem.h"
52 #include "libaura/buffer.h"
53 #include "libaura/dict.h"
54 #include "libaura/fspred.h"
56 #include "libdfui/dfui.h"
57 #include "libdfui/dump.h"
58 #include "libdfui/system.h"
60 #include "libinstaller/commands.h"
61 #include "libinstaller/diskutil.h"
62 #include "libinstaller/functions.h"
63 #include "libinstaller/uiutil.h"
67 #include "pathnames.h"
69 static int create_subpartitions(struct i_fn_args *);
70 static long default_capacity(struct storage *, int);
71 static int check_capacity(struct i_fn_args *);
72 static int check_subpartition_selections(struct dfui_response *, struct i_fn_args *);
73 static void save_subpartition_selections(struct dfui_response *, struct i_fn_args *);
74 static void populate_create_subpartitions_form(struct dfui_form *, struct i_fn_args *);
75 static int warn_subpartition_selections(struct i_fn_args *);
76 static int warn_encrypted_root(struct i_fn_args *);
77 static struct dfui_form *make_create_subpartitions_form(struct i_fn_args *);
78 static int show_create_subpartitions_form(struct dfui_form *, struct i_fn_args *);
80 static const char *def_mountpt[] = {"/", "swap", "/var", "/tmp", "/usr", "/home", NULL};
81 static int expert = 0;
84 * Given a set of subpartitions-to-be in the selected slice,
88 create_subpartitions(struct i_fn_args *a)
90 struct subpartition *sp;
91 struct commands *cmds;
95 cmds = commands_new();
96 if (!is_file("%sinstall.disklabel.%s",
98 slice_get_device_name(storage_get_selected_slice(a->s)))) {
100 * Get a copy of the 'virgin' disklabel.
101 * XXX It might make more sense for this to
102 * happen right after format_slice() instead.
104 command_add(cmds, "%s%s -r %s >%sinstall.disklabel.%s",
105 a->os_root, cmd_name(a, "DISKLABEL64"),
106 slice_get_device_name(storage_get_selected_slice(a->s)),
108 slice_get_device_name(storage_get_selected_slice(a->s)));
112 * Weave together a new disklabel out the of the 'virgin'
113 * disklabel, and the user's subpartition choices.
117 * Take everything from the 'virgin' disklabel up until the
118 * '16 partitions' line.
121 command_add(cmds, "%s%s '$2==\"partitions:\" || cut { cut = 1 } !cut { print $0 }' <%sinstall.disklabel.%s >%sinstall.disklabel",
122 a->os_root, cmd_name(a, "AWK"),
124 slice_get_device_name(storage_get_selected_slice(a->s)),
129 * # size offset fstype
130 * c: 16383969 0 unused # 7999.985MB
133 command_add(cmds, "%s%s '%d partitions:' >>%sinstall.disklabel",
134 a->os_root, cmd_name(a, "ECHO"), num_partitions ,a->tmp);
135 command_add(cmds, "%s%s '%s' >>%sinstall.disklabel",
136 a->os_root, cmd_name(a, "ECHO"),
137 "# size offset fstype",
141 for (sp = slice_subpartition_first(storage_get_selected_slice(a->s));
142 sp != NULL; sp = subpartition_next(sp)) {
143 command_add(cmds, "%s%s 'mountpoint: %s device: %s'",
144 a->os_root, cmd_name(a, "ECHO"),
145 subpartition_get_mountpoint(sp),
146 subpartition_get_device_name(sp));
151 * Write a line for each subpartition the user wants.
153 for (sp = slice_subpartition_first(storage_get_selected_slice(a->s));
154 sp != NULL; sp = subpartition_next(sp)) {
155 if (subpartition_is_tmpfsbacked(sp)) {
158 if (subpartition_is_swap(sp)) {
159 command_add(cmds, "%s%s ' %c:\t%s\t*\tswap' >>%sinstall.disklabel",
160 a->os_root, cmd_name(a, "ECHO"),
161 subpartition_get_letter(sp),
162 capacity_to_string(subpartition_get_capacity(sp)),
165 command_add(cmds, "%s%s ' %c:\t%s\t%s\t4.2BSD' >>%sinstall.disklabel",
166 a->os_root, cmd_name(a, "ECHO"),
167 subpartition_get_letter(sp),
168 capacity_to_string(subpartition_get_capacity(sp)),
169 subpartition_get_letter(sp) == 'a' ? "0" : "*",
173 temp_file_add(a, "install.disklabel");
176 * Label the slice from the disklabel we just wove together.
178 command_add(cmds, "%s%s -R -B -r %s %sinstall.disklabel",
179 a->os_root, cmd_name(a, "DISKLABEL64"),
180 slice_get_device_name(storage_get_selected_slice(a->s)),
184 * Create a snapshot of the disklabel we just created
185 * for debugging inspection in the log.
187 command_add(cmds, "%s%s %s",
188 a->os_root, cmd_name(a, "DISKLABEL64"),
189 slice_get_device_name(storage_get_selected_slice(a->s)));
192 * If encryption was specified, load dm(4).
194 for (sp = slice_subpartition_first(storage_get_selected_slice(a->s));
195 sp != NULL; sp = subpartition_next(sp)) {
196 if (subpartition_is_encrypted(sp)) {
197 fn_get_passphrase(a);
203 * Create filesystems on the newly-created subpartitions.
205 for (sp = slice_subpartition_first(storage_get_selected_slice(a->s));
206 sp != NULL; sp = subpartition_next(sp)) {
207 if (subpartition_is_swap(sp) || subpartition_is_tmpfsbacked(sp)) {
208 if (subpartition_is_swap(sp) &&
209 subpartition_is_encrypted(sp)) {
211 "%s%s -d /tmp/t1 luksFormat %sdev/%s",
212 a->os_root, cmd_name(a, "CRYPTSETUP"),
214 subpartition_get_device_name(sp));
216 "%s%s -d /tmp/t1 luksOpen %sdev/%s swap",
217 a->os_root, cmd_name(a, "CRYPTSETUP"),
219 subpartition_get_device_name(sp));
224 if (subpartition_is_encrypted(sp) &&
225 strcmp(subpartition_get_mountpoint(sp), "/") != 0) {
227 "%s%s -d /tmp/t1 luksFormat %sdev/%s",
228 a->os_root, cmd_name(a, "CRYPTSETUP"),
230 subpartition_get_device_name(sp));
232 "%s%s -d /tmp/t1 luksOpen %sdev/%s %s",
233 a->os_root, cmd_name(a, "CRYPTSETUP"),
235 subpartition_get_device_name(sp),
236 subpartition_get_mountpoint(sp) + 1);
237 command_add(cmds, "%s%s%s -b %ld -f %ld %sdev/mapper/%s",
238 a->os_root, cmd_name(a, "NEWFS"),
239 subpartition_is_softupdated(sp) ? " -U" : "",
240 subpartition_get_bsize(sp),
241 subpartition_get_fsize(sp),
243 subpartition_get_mountpoint(sp) + 1);
245 command_add(cmds, "%s%s%s -b %ld -f %ld %sdev/%s",
246 a->os_root, cmd_name(a, "NEWFS"),
247 subpartition_is_softupdated(sp) ? " -U" : "",
248 subpartition_get_bsize(sp),
249 subpartition_get_fsize(sp),
251 subpartition_get_device_name(sp));
255 result = commands_execute(a, cmds);
261 default_capacity(struct storage *s, int mtpt)
264 unsigned long capacity;
267 if (mtpt == MTPT_HOME)
270 capacity = slice_get_capacity(storage_get_selected_slice(s));
271 mem = storage_get_memsize(s);
273 if (mem > (capacity / 2) || capacity < 4096)
280 if (capacity < DISK_MIN) {
282 * For the purposes of this installer:
283 * can't be done. Sorry.
286 } else if (capacity < 4096) {
288 case MTPT_ROOT: return(320);
289 case MTPT_SWAP: return(swap);
290 case MTPT_VAR: return(128);
291 case MTPT_TMP: return(128);
292 case MTPT_USR: return(1472);
294 } else if (capacity < 10240) {
296 case MTPT_ROOT: return(640);
297 case MTPT_SWAP: return(swap);
298 case MTPT_VAR: return(256);
299 case MTPT_TMP: return(256);
300 case MTPT_USR: return(2688);
304 case MTPT_ROOT: return(768);
305 case MTPT_SWAP: return(swap);
306 case MTPT_VAR: return(256);
307 case MTPT_TMP: return(256);
308 case MTPT_USR: return(7680);
311 /* shouldn't ever happen */
316 check_capacity(struct i_fn_args *a)
318 struct subpartition *sp;
319 long min_capacity[] = {320, 0, 16, 0, 1472, 0, 0};
320 unsigned long total_capacity = 0;
323 if (subpartition_find(storage_get_selected_slice(a->s), "/usr") == NULL)
324 min_capacity[MTPT_ROOT] += min_capacity[MTPT_USR];
326 for (sp = slice_subpartition_first(storage_get_selected_slice(a->s));
327 sp != NULL; sp = subpartition_next(sp)) {
328 long subpart_capacity = subpartition_get_capacity(sp);
329 const char *mountpt = subpartition_get_mountpoint(sp);
331 if (subpart_capacity == -1)
334 total_capacity += subpart_capacity;
335 for (mtpt = 0; def_mountpt[mtpt] != NULL; mtpt++) {
336 if (strcmp(mountpt, def_mountpt[mtpt]) == 0 &&
337 subpart_capacity < min_capacity[mtpt] &&
338 subpart_capacity != -1) {
339 inform(a->c, _("WARNING: The size (%ldM) specified for "
340 "the %s subpartition is too small. It "
341 "should be at least %ldM or you will "
342 "risk running out of space during "
343 "the installation."),
344 subpart_capacity, mountpt,
350 if (total_capacity > slice_get_capacity(storage_get_selected_slice(a->s))) {
351 inform(a->c, _("The space allocated to all of your selected "
352 "subpartitions (%luM) exceeds the total "
353 "capacity of the selected primary partition "
354 "(%luM). Remove some subpartitions or choose "
355 "a smaller size for them and try again."),
356 total_capacity, slice_get_capacity(storage_get_selected_slice(a->s)));
364 check_subpartition_selections(struct dfui_response *r, struct i_fn_args *a)
366 struct dfui_dataset *ds;
367 struct dfui_dataset *star_ds = NULL;
369 const char *mountpoint, *capstring;
374 d = aura_dict_new(1, AURA_DICT_LIST);
376 if ((ds = dfui_response_dataset_get_first(r)) == NULL) {
377 inform(a->c, _("Please set up at least one subpartition."));
381 for (ds = dfui_response_dataset_get_first(r); valid && ds != NULL;
382 ds = dfui_dataset_get_next(ds)) {
384 dfui_dataset_dump(ds);
386 mountpoint = dfui_dataset_get_value(ds, "mountpoint");
387 capstring = dfui_dataset_get_value(ds, "capacity");
392 tmpfsbacked = (strcmp(dfui_dataset_get_value(ds, "tmpfsbacked"), "Y") == 0);
393 if (tmpfsbacked && strcmp(mountpoint, "/") == 0) {
394 inform(a->c, _("/ cannot be TMPFS backed."));
399 if (aura_dict_exists(d, mountpoint, strlen(mountpoint) + 1)) {
400 inform(a->c, _("The same mount point cannot be specified "
401 "for two different subpartitions."));
405 if (strcmp(mountpoint, "/") == 0)
408 if (strcmp(capstring, "*") == 0) {
409 if (star_ds != NULL) {
410 inform(a->c, _("You cannot have more than one subpartition "
411 "with a '*' capacity (meaning 'use the remainder "
412 "of the primary partition'.)"));
419 if (!(!strcasecmp(mountpoint, "swap") || mountpoint[0] == '/')) {
420 inform(a->c, _("Mount point must be either 'swap', or it must "
421 "start with a '/'."));
425 if (strpbrk(mountpoint, " \\\"'`") != NULL) {
426 inform(a->c, _("Mount point may not contain the following "
427 "characters: blank space, backslash, or "
428 "single, double, or back quotes."));
432 if (strlen(capstring) == 0) {
433 inform(a->c, _("A capacity must be specified."));
437 if (!string_to_capacity(capstring, &capacity)) {
438 inform(a->c, _("Capacity must be either a '*' symbol to indicate "
439 "'use the rest of the primary partition', or it "
440 "must be a series of decimal digits ending with a "
441 "'M' (indicating megabytes) or a 'G' (indicating "
447 * Maybe remove this limit entirely?
449 if ((strcasecmp(mountpoint, "swap") == 0) &&
450 (capacity > SWAP_MAX)) {
451 inform(a->c, _("Swap capacity is limited to %dG."),
457 * If we made it through that obstacle course, all is well.
461 aura_dict_store(d, mountpoint, strlen(mountpoint) + 1, "", 1);
465 inform(a->c, _("You must include a / (root) subpartition."));
469 if (aura_dict_size(d) > 16) {
470 inform(a->c, _("You cannot have more than 16 subpartitions "
471 "on a single primary partition. Remove some "
482 save_subpartition_selections(struct dfui_response *r, struct i_fn_args *a)
484 struct dfui_dataset *ds;
486 const char *mountpoint, *capstring;
492 subpartitions_free(storage_get_selected_slice(a->s));
494 for (ds = dfui_response_dataset_get_first(r); valid && ds != NULL;
495 ds = dfui_dataset_get_next(ds)) {
496 mountpoint = dfui_dataset_get_value(ds, "mountpoint");
497 capstring = dfui_dataset_get_value(ds, "capacity");
501 (strcmp(dfui_dataset_get_value(ds, "softupdates"), "Y") == 0);
502 fsize = atol(dfui_dataset_get_value(ds, "fsize"));
503 bsize = atol(dfui_dataset_get_value(ds, "bsize"));
504 tmpfsbacked = (strcmp(dfui_dataset_get_value(ds, "tmpfsbacked"), "Y") == 0);
506 softupdates = (strcmp(mountpoint, "/") == 0 ? 0 : 1);
512 if (string_to_capacity(capstring, &capacity)) {
513 subpartition_new_ufs(storage_get_selected_slice(a->s),
514 mountpoint, capacity,
515 strcasecmp(dfui_dataset_get_value(ds, "encrypted"), "Y") == 0,
516 softupdates, fsize, bsize, tmpfsbacked);
522 populate_create_subpartitions_form(struct dfui_form *f, struct i_fn_args *a)
524 struct subpartition *sp;
525 struct dfui_dataset *ds;
530 if (slice_subpartition_first(storage_get_selected_slice(a->s)) != NULL) {
532 * The user has already given us their subpartition
533 * preferences, so use them here.
535 for (sp = slice_subpartition_first(storage_get_selected_slice(a->s));
536 sp != NULL; sp = subpartition_next(sp)) {
537 ds = dfui_dataset_new();
538 dfui_dataset_celldata_add(ds, "mountpoint",
539 subpartition_get_mountpoint(sp));
540 dfui_dataset_celldata_add(ds, "capacity",
541 capacity_to_string(subpartition_get_capacity(sp)));
542 dfui_dataset_celldata_add(ds, "encrypted",
543 subpartition_is_encrypted(sp) ? "Y" : "N");
545 dfui_dataset_celldata_add(ds, "softupdates",
546 subpartition_is_softupdated(sp) ? "Y" : "N");
547 dfui_dataset_celldata_add(ds, "tmpfsbacked",
548 subpartition_is_tmpfsbacked(sp) ? "Y" : "N");
549 snprintf(temp, 32, "%ld", subpartition_get_fsize(sp));
550 dfui_dataset_celldata_add(ds, "fsize",
552 snprintf(temp, 32, "%ld", subpartition_get_bsize(sp));
553 dfui_dataset_celldata_add(ds, "bsize",
556 dfui_form_dataset_add(f, ds);
560 * Otherwise, populate the form with datasets representing
561 * reasonably-calculated defaults. The defaults are chosen
562 * based on the slice's total capacity and the machine's
563 * total physical memory (for swap.)
565 for (mtpt = 0; def_mountpt[mtpt] != NULL; mtpt++) {
566 capacity = default_capacity(a->s, mtpt);
567 ds = dfui_dataset_new();
568 dfui_dataset_celldata_add(ds, "mountpoint",
570 dfui_dataset_celldata_add(ds, "capacity",
571 capacity_to_string(capacity));
572 dfui_dataset_celldata_add(ds, "encrypted", "N");
574 dfui_dataset_celldata_add(ds, "softupdates",
575 strcmp(def_mountpt[mtpt], "/") != 0 ? "Y" : "N");
576 dfui_dataset_celldata_add(ds, "tmpfsbacked",
578 dfui_dataset_celldata_add(ds, "fsize",
579 capacity < 1024 ? "1024" : "2048");
580 dfui_dataset_celldata_add(ds, "bsize",
581 capacity < 1024 ? "8192" : "16384");
583 dfui_form_dataset_add(f, ds);
589 warn_subpartition_selections(struct i_fn_args *a)
592 struct aura_buffer *omit, *consequences;
594 omit = aura_buffer_new(2048);
595 consequences = aura_buffer_new(2048);
597 valid = check_capacity(a);
598 if (subpartition_find(storage_get_selected_slice(a->s), "/var") == NULL) {
599 aura_buffer_cat(omit, "/var ");
600 aura_buffer_cat(consequences, _("/var will be a plain dir in /\n"));
602 if (subpartition_find(storage_get_selected_slice(a->s), "/usr") == NULL) {
603 aura_buffer_cat(omit, "/usr ");
604 aura_buffer_cat(consequences, _("/usr will be a plain dir in /\n"));
606 if (subpartition_find(storage_get_selected_slice(a->s), "/tmp") == NULL) {
607 aura_buffer_cat(omit, "/tmp ");
608 aura_buffer_cat(consequences, _("/tmp will be symlinked to /var/tmp\n"));
610 if (subpartition_find(storage_get_selected_slice(a->s), "/home") == NULL) {
611 aura_buffer_cat(omit, "/home ");
612 aura_buffer_cat(consequences, _("/home will be symlinked to /usr/home\n"));
615 if (valid && aura_buffer_len(omit) > 0) {
616 switch (dfui_be_present_dialog(a->c, _("Really omit?"),
617 _("Omit Subpartition(s)|Return to Create Subpartitions"),
618 _("You have elected to not have the following "
619 "subpartition(s):\n\n%s\n\n"
620 "The ramifications of these subpartition(s) being "
621 "missing will be:\n\n%s\n"
622 "Is this really what you want to do?"),
623 aura_buffer_buf(omit), aura_buffer_buf(consequences))) {
635 aura_buffer_free(omit);
636 aura_buffer_free(consequences);
642 warn_encrypted_root(struct i_fn_args *a)
645 struct subpartition *sp;
647 sp = subpartition_find(storage_get_selected_slice(a->s), "/");
651 if (subpartition_is_encrypted(sp)) {
652 switch (dfui_be_present_dialog(a->c, _("root cannot be encrypted"),
653 _("Leave root unencrypted|Return to Create Subpartitions"),
654 _("You have selected encryption for the root partition which "
655 "is not supported."))) {
657 subpartition_clr_encrypted(sp);
671 static struct dfui_form *
672 make_create_subpartitions_form(struct i_fn_args *a)
674 struct dfui_field *fi;
676 char msg_buf[1][1024];
678 snprintf(msg_buf[0], sizeof(msg_buf[0]),
679 _("Subpartitions further divide a primary partition for "
680 "use with %s. Some reasons you may want "
681 "a set of subpartitions are:\n\n"
682 "- you want to restrict how much data can be written "
683 "to certain parts of the primary partition, to quell "
684 "denial-of-service attacks; and\n"
685 "- you want to speed up access to data on the disk."
686 ""), OPERATING_SYSTEM_NAME);
688 f = dfui_form_create(
689 "create_subpartitions",
690 _("Create Subpartitions"),
691 _("Set up the subpartitions (also known as just `partitions' "
692 "in BSD tradition) you want to have on this primary "
694 "For Capacity, use 'M' to indicate megabytes, 'G' to "
695 "indicate gigabytes, or a single '*' to indicate "
696 "'use the remaining space on the primary partition'."),
700 "p", "special", "dfinstaller_create_subpartitions",
701 "p", "minimum_width","64",
703 "f", "mountpoint", _("Mountpoint"), "", "",
704 "f", "capacity", _("Capacity"), "", "",
706 "f", "encrypted", _("Encrypted"), "", "",
707 "p", "control", "checkbox",
709 "a", "ok", _("Accept and Create"), "", "",
711 (disk_get_formatted(storage_get_selected_disk(a->s)) ?
712 _("Return to Select Disk") :
713 _("Return to Select Primary Partition")), "", "",
714 "p", "accelerator", "ESC",
719 dfui_form_set_multiple(f, 1);
720 dfui_form_set_extensible(f, 1);
723 fi = dfui_form_field_add(f, "softupdates",
724 dfui_info_new(_("Softupdates"), "", ""));
725 dfui_field_property_set(fi, "control", "checkbox");
727 fi = dfui_form_field_add(f, "tmpfsbacked",
728 dfui_info_new(_("TMPFS"), "", ""));
729 dfui_field_property_set(fi, "control", "checkbox");
731 fi = dfui_form_field_add(f, "fsize",
732 dfui_info_new(_("Frag Sz"), "", ""));
734 fi = dfui_form_field_add(f, "bsize",
735 dfui_info_new(_("Block Sz"), "", ""));
737 dfui_form_action_add(f, "switch",
738 dfui_info_new(_("Switch to Normal Mode"), "", ""));
740 dfui_form_action_add(f, "switch",
741 dfui_info_new(_("Switch to Expert Mode"), "", ""));
749 * -1 = the form should be redisplayed
750 * 0 = failure, function is over
751 * 1 = success, function is over
754 show_create_subpartitions_form(struct dfui_form *f, struct i_fn_args *a)
756 struct dfui_dataset *ds;
757 struct dfui_response *r;
760 if (dfui_form_dataset_get_first(f) == NULL)
761 populate_create_subpartitions_form(f, a);
763 if (!dfui_be_present(a->c, f, &r))
766 if (strcmp(dfui_response_get_action_id(r), "cancel") == 0) {
767 dfui_response_free(r);
769 } else if (strcmp(dfui_response_get_action_id(r), "switch") == 0) {
770 if (check_subpartition_selections(r, a)) {
771 save_subpartition_selections(r, a);
772 expert = expert ? 0 : 1;
773 dfui_response_free(r);
777 if (check_subpartition_selections(r, a)) {
778 save_subpartition_selections(r, a);
779 if (!warn_subpartition_selections(a) &&
780 !warn_encrypted_root(a)) {
781 if (!create_subpartitions(a)) {
782 inform(a->c, _("The subpartitions you chose were "
783 "not correctly created, and the "
784 "primary partition may "
785 "now be in an inconsistent state. "
786 "We recommend re-formatting it "
787 "before proceeding."));
788 dfui_response_free(r);
791 dfui_response_free(r);
798 dfui_form_datasets_free(f);
799 /* dfui_form_datasets_add_from_response(f, r); */
800 for (ds = dfui_response_dataset_get_first(r); ds != NULL;
801 ds = dfui_dataset_get_next(ds)) {
802 dfui_form_dataset_add(f, dfui_dataset_dup(ds));
808 fn_create_subpartitions_ufs(struct i_fn_args *a)
815 f = make_create_subpartitions_form(a);
816 switch (show_create_subpartitions_form(f, a)) {