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 struct dfui_form *make_create_subpartitions_form(struct i_fn_args *);
77 static int show_create_subpartitions_form(struct dfui_form *, struct i_fn_args *);
79 const char *def_mountpt[7] = {"/", "swap", "/var", "/tmp", "/usr", "/home", NULL};
80 long def_capacity[7] = {128, 128, 128, 128, 256, -1, 0};
85 * Given a set of subpartitions-to-be in the selected slice,
89 create_subpartitions(struct i_fn_args *a)
91 struct subpartition *sp;
92 struct commands *cmds;
94 int copied_original = 0;
97 cmds = commands_new();
98 if (!is_file("%sinstall.disklabel.%s",
100 slice_get_device_name(storage_get_selected_slice(a->s)))) {
102 * Get a copy of the 'virgin' disklabel.
103 * XXX It might make more sense for this to
104 * happen right after format_slice() instead.
106 command_add(cmds, "%s%s -r %s >%sinstall.disklabel.%s",
107 a->os_root, cmd_name(a, "DISKLABEL"),
108 slice_get_device_name(storage_get_selected_slice(a->s)),
110 slice_get_device_name(storage_get_selected_slice(a->s)));
114 * Weave together a new disklabel out the of the 'virgin'
115 * disklabel, and the user's subpartition choices.
119 * Take everything from the 'virgin' disklabel up until the
120 * '8 or 16 partitions' line.
123 command_add(cmds, "%s%s '$2==\"partitions:\" || cut { cut = 1 } !cut { print $0 }' <%sinstall.disklabel.%s >%sinstall.disklabel",
124 a->os_root, cmd_name(a, "AWK"),
126 slice_get_device_name(storage_get_selected_slice(a->s)),
130 * 8 or 16 partitions:
131 * # size offset fstype [fsize bsize bps/cpg]
132 * c: 2128833 0 unused 0 0 # (Cyl. 0 - 2111*)
135 #if defined(__FreeBSD__) && !defined(__DragonFly__)
139 command_add(cmds, "%s%s '%d partitions:' >>%sinstall.disklabel",
140 a->os_root, cmd_name(a, "ECHO"), num_partitions ,a->tmp);
141 command_add(cmds, "%s%s '%s' >>%sinstall.disklabel",
142 a->os_root, cmd_name(a, "ECHO"),
143 "# size offset fstype [fsize bsize bps/cpg]",
147 for (sp = slice_subpartition_first(storage_get_selected_slice(a->s));
148 sp != NULL; sp = subpartition_next(sp)) {
149 command_add(cmds, "%s%s 'mountpoint: %s device: %s'",
150 a->os_root, cmd_name(a, "ECHO"),
151 subpartition_get_mountpoint(sp),
152 subpartition_get_device_name(sp));
157 * Write a line for each subpartition the user wants.
159 for (sp = slice_subpartition_first(storage_get_selected_slice(a->s));
160 sp != NULL; sp = subpartition_next(sp)) {
161 if (subpartition_is_mfsbacked(sp)) {
164 if (subpartition_get_letter(sp) > 'c' && !copied_original) {
166 * Copy the 'c' line from the 'virgin' disklabel.
168 command_add(cmds, "%s%s '^ c:' %sinstall.disklabel.%s >>%sinstall.disklabel",
169 a->os_root, cmd_name(a, "GREP"),
171 slice_get_device_name(storage_get_selected_slice(a->s)),
175 if (subpartition_is_swap(sp)) {
176 command_add(cmds, "%s%s ' %c:\t%s\t*\tswap' >>%sinstall.disklabel",
177 a->os_root, cmd_name(a, "ECHO"),
178 subpartition_get_letter(sp),
179 capacity_to_string(subpartition_get_capacity(sp)),
182 command_add(cmds, "%s%s ' %c:\t%s\t%s\t4.2BSD\t%ld\t%ld\t99' >>%sinstall.disklabel",
183 a->os_root, cmd_name(a, "ECHO"),
184 subpartition_get_letter(sp),
185 capacity_to_string(subpartition_get_capacity(sp)),
186 subpartition_get_letter(sp) == 'a' ? "0" : "*",
187 subpartition_get_fsize(sp),
188 subpartition_get_bsize(sp),
192 if (!copied_original) {
194 * Copy the 'c' line from the 'virgin' disklabel,
195 * if we haven't yet (less than 2 subpartitions.)
197 command_add(cmds, "%s%s '^ c:' %sinstall.disklabel.%s >>%sinstall.disklabel",
198 a->os_root, cmd_name(a, "GREP"),
200 slice_get_device_name(storage_get_selected_slice(a->s)),
203 temp_file_add(a, "install.disklabel");
206 * Label the slice from the disklabel we just wove together.
208 command_add(cmds, "%s%s -R -B -r %s %sinstall.disklabel",
209 a->os_root, cmd_name(a, "DISKLABEL"),
210 slice_get_device_name(storage_get_selected_slice(a->s)),
214 * Create a snapshot of the disklabel we just created
215 * for debugging inspection in the log.
217 command_add(cmds, "%s%s %s",
218 a->os_root, cmd_name(a, "DISKLABEL"),
219 slice_get_device_name(storage_get_selected_slice(a->s)));
222 * Create filesystems on the newly-created subpartitions.
224 for (sp = slice_subpartition_first(storage_get_selected_slice(a->s));
225 sp != NULL; sp = subpartition_next(sp)) {
226 if (subpartition_is_swap(sp) || subpartition_is_mfsbacked(sp))
230 * Ensure that all the needed device nodes exist.
232 command_add_ensure_dev(a, cmds,
233 disk_get_device_name(storage_get_selected_disk(a->s)));
234 command_add_ensure_dev(a, cmds,
235 slice_get_device_name(storage_get_selected_slice(a->s)));
236 command_add_ensure_dev(a, cmds,
237 subpartition_get_device_name(sp));
239 command_add(cmds, "%s%s%s %sdev/%s",
240 a->os_root, cmd_name(a, "NEWFS"),
241 subpartition_is_softupdated(sp) ? " -U" : "",
243 subpartition_get_device_name(sp));
246 result = commands_execute(a, cmds);
252 * +-------+------------+--------------+-----------------+-----------------+
253 * | Mtpt | Matt says | FreeBSD says | I got away with | A tiny system |
254 * +-------+------------+--------------+-----------------+-----------------+
255 * | / | 256M | 100M | 256M | 64M |
256 * | swap | 1G | 2 or 3 * mem | (4 * mem) 256M | (1 * mem) 64M |
257 * | /var | 256M | 50M | 256M | 12M |
258 * | /tmp | 256M | --- | 256M | --- |
259 * | /usr | [4G to] 8G | (>160M) rest | 5G | 160M |
260 * | /home | rest | --- | 3.5G | --- |
261 * +-------+------------+--------------+-----------------+-----------------+
262 * | total | 10G+ | ~430M+ | 9.5G | 300M |
263 * +-------+------------+--------------+-----------------+-----------------+
267 default_capacity(struct storage *s, int mtpt)
270 unsigned long capacity;
272 if (mtpt == MTPT_HOME)
275 capacity = slice_get_capacity(storage_get_selected_slice(s));
276 swap = 2 * storage_get_memsize(s);
277 if (storage_get_memsize(s) > (capacity / 2) || capacity < 4096)
278 swap = storage_get_memsize(s);
280 if (capacity < DISK_MIN) {
282 * For the purposes of this installer:
283 * can't be done. Sorry.
286 } else if (capacity < 523) {
288 case MTPT_ROOT: return(70);
289 case MTPT_SWAP: return(swap);
290 case MTPT_VAR: return(32);
291 case MTPT_TMP: return(32);
292 case MTPT_USR: return(174);
294 } else if (capacity < 1024) {
296 case MTPT_ROOT: return(96);
297 case MTPT_SWAP: return(swap);
298 case MTPT_VAR: return(64);
299 case MTPT_TMP: return(64);
300 case MTPT_USR: return(256);
302 } else if (capacity < 4096) {
304 case MTPT_ROOT: return(128);
305 case MTPT_SWAP: return(swap);
306 case MTPT_VAR: return(128);
307 case MTPT_TMP: return(128);
308 case MTPT_USR: return(512);
310 } else if (capacity < 10240) {
312 case MTPT_ROOT: return(256);
313 case MTPT_SWAP: return(swap);
314 case MTPT_VAR: return(256);
315 case MTPT_TMP: return(256);
316 case MTPT_USR: return(3072);
320 case MTPT_ROOT: return(256);
321 case MTPT_SWAP: return(swap);
322 case MTPT_VAR: return(256);
323 case MTPT_TMP: return(256);
324 case MTPT_USR: return(8192);
327 /* shouldn't ever happen */
332 check_capacity(struct i_fn_args *a)
334 struct subpartition *sp;
335 unsigned long min_capacity[7] = {70, 0, 8, 0, 174, 0, 0};
336 unsigned long total_capacity = 0;
339 if (subpartition_find(storage_get_selected_slice(a->s), "/usr") == NULL)
340 min_capacity[MTPT_ROOT] += min_capacity[MTPT_USR];
342 for (sp = slice_subpartition_first(storage_get_selected_slice(a->s));
343 sp != NULL; sp = subpartition_next(sp)) {
344 if (subpartition_get_capacity(sp) == -1)
347 total_capacity += subpartition_get_capacity(sp);
348 for (mtpt = 0; def_mountpt[mtpt] != NULL; mtpt++) {
349 if (strcmp(subpartition_get_mountpoint(sp), def_mountpt[mtpt]) == 0 &&
350 min_capacity[mtpt] > 0 &&
351 subpartition_get_capacity(sp) < min_capacity[mtpt]) {
352 inform(a->c, _("WARNING: the %s subpartition should "
353 "be at least %dM in size or you will "
354 "risk running out of space during "
355 "the installation."),
356 subpartition_get_mountpoint(sp), min_capacity[mtpt]);
361 if (total_capacity > slice_get_capacity(storage_get_selected_slice(a->s))) {
362 inform(a->c, _("The space allocated to all of your selected "
363 "subpartitions (%dM) exceeds the total "
364 "capacity of the selected primary partition "
365 "(%dM). Remove some subpartitions or choose "
366 "a smaller size for them and try again."),
367 total_capacity, slice_get_capacity(storage_get_selected_slice(a->s)));
375 check_subpartition_selections(struct dfui_response *r, struct i_fn_args *a)
377 struct dfui_dataset *ds;
378 struct dfui_dataset *star_ds = NULL;
380 const char *mountpoint, *capstring;
384 int softupdates, mfsbacked;
387 d = aura_dict_new(1, AURA_DICT_LIST);
389 if ((ds = dfui_response_dataset_get_first(r)) == NULL) {
390 inform(a->c, _("Please set up at least one subpartition."));
394 for (ds = dfui_response_dataset_get_first(r); valid && ds != NULL;
395 ds = dfui_dataset_get_next(ds)) {
397 dfui_dataset_dump(ds);
399 mountpoint = dfui_dataset_get_value(ds, "mountpoint");
400 capstring = dfui_dataset_get_value(ds, "capacity");
404 (strcmp(dfui_dataset_get_value(ds, "softupdates"), "Y") == 0);
405 fsize = atol(dfui_dataset_get_value(ds, "fsize"));
406 bsize = atol(dfui_dataset_get_value(ds, "bsize"));
407 mfsbacked = (strcmp(dfui_dataset_get_value(ds, "mfsbacked"), "Y") == 0);
409 softupdates = (strcmp(mountpoint, "/") == 0 ? 0 : 1);
410 mfsbacked = (strcmp(mountpoint, "/tmp") == 0 ? 0 : 1);
415 if (aura_dict_exists(d, mountpoint, strlen(mountpoint) + 1)) {
416 inform(a->c, _("The same mount point cannot be specified "
417 "for two different subpartitions."));
421 if (strcmp(mountpoint, "/") == 0)
424 if (strcmp(capstring, "*") == 0) {
425 if (star_ds != NULL) {
426 inform(a->c, _("You cannot have more than one subpartition "
427 "with a '*' capacity (meaning 'use the remainder "
428 "of the primary partition'.)"));
435 if (!(!strcasecmp(mountpoint, "swap") || mountpoint[0] == '/')) {
436 inform(a->c, _("Mount point must be either 'swap', or it must "
437 "start with a '/'."));
441 if (strpbrk(mountpoint, " \\\"'`") != NULL) {
442 inform(a->c, _("Mount point may not contain the following "
443 "characters: blank space, backslash, or "
444 "single, double, or back quotes."));
448 if (strlen(capstring) == 0) {
449 inform(a->c, _("A capacity must be specified."));
453 if (!string_to_capacity(capstring, &capacity)) {
454 inform(a->c, _("Capacity must be either a '*' symbol to indicate "
455 "'use the rest of the primary partition', or it "
456 "must be a series of decimal digits ending with a "
457 "'M' (indicating megabytes) or a 'G' (indicating "
463 * If we made it through that obstacle course, all is well.
467 aura_dict_store(d, mountpoint, strlen(mountpoint) + 1, "", 1);
471 inform(a->c, _("You must include a / (root) subpartition."));
475 if (aura_dict_size(d) > 16) {
476 inform(a->c, _("You cannot have more than 16 subpartitions "
477 "on a single primary partition. Remove some "
488 save_subpartition_selections(struct dfui_response *r, struct i_fn_args *a)
490 struct dfui_dataset *ds;
492 const char *mountpoint, *capstring;
498 subpartitions_free(storage_get_selected_slice(a->s));
500 for (ds = dfui_response_dataset_get_first(r); valid && ds != NULL;
501 ds = dfui_dataset_get_next(ds)) {
502 mountpoint = dfui_dataset_get_value(ds, "mountpoint");
503 capstring = dfui_dataset_get_value(ds, "capacity");
507 (strcmp(dfui_dataset_get_value(ds, "softupdates"), "Y") == 0);
508 fsize = atol(dfui_dataset_get_value(ds, "fsize"));
509 bsize = atol(dfui_dataset_get_value(ds, "bsize"));
510 mfsbacked = (strcmp(dfui_dataset_get_value(ds, "msfbacked"), "Y") == 0);
512 softupdates = (strcmp(mountpoint, "/") == 0 ? 0 : 1);
518 if (string_to_capacity(capstring, &capacity)) {
519 subpartition_new(storage_get_selected_slice(a->s), mountpoint, capacity,
520 softupdates, fsize, bsize, mfsbacked);
526 populate_create_subpartitions_form(struct dfui_form *f, struct i_fn_args *a)
528 struct subpartition *sp;
529 struct dfui_dataset *ds;
534 if (slice_subpartition_first(storage_get_selected_slice(a->s)) != NULL) {
536 * The user has already given us their subpartition
537 * preferences, so use them here.
539 for (sp = slice_subpartition_first(storage_get_selected_slice(a->s));
540 sp != NULL; sp = subpartition_next(sp)) {
541 ds = dfui_dataset_new();
542 dfui_dataset_celldata_add(ds, "mountpoint",
543 subpartition_get_mountpoint(sp));
544 dfui_dataset_celldata_add(ds, "capacity",
545 capacity_to_string(subpartition_get_capacity(sp)));
547 dfui_dataset_celldata_add(ds, "softupdates",
548 subpartition_is_softupdated(sp) ? "Y" : "N");
549 dfui_dataset_celldata_add(ds, "mfsbacked",
550 subpartition_is_mfsbacked(sp) ? "Y" : "N");
551 snprintf(temp, 32, "%ld", subpartition_get_fsize(sp));
552 dfui_dataset_celldata_add(ds, "fsize",
554 snprintf(temp, 32, "%ld", subpartition_get_bsize(sp));
555 dfui_dataset_celldata_add(ds, "bsize",
558 dfui_form_dataset_add(f, ds);
562 * Otherwise, populate the form with datasets representing
563 * reasonably-calculated defaults. The defaults are chosen
564 * based on the slice's total capacity and the machine's
565 * total physical memory (for swap.)
567 for (mtpt = 0; def_mountpt[mtpt] != NULL; mtpt++) {
568 capacity = default_capacity(a->s, mtpt);
569 ds = dfui_dataset_new();
570 dfui_dataset_celldata_add(ds, "mountpoint",
572 dfui_dataset_celldata_add(ds, "capacity",
573 capacity_to_string(capacity));
575 dfui_dataset_celldata_add(ds, "softupdates",
576 strcmp(def_mountpt[mtpt], "/") != 0 ? "Y" : "N");
577 dfui_dataset_celldata_add(ds, "mfsbacked",
579 dfui_dataset_celldata_add(ds, "fsize",
580 capacity < 1024 ? "1024" : "2048");
581 dfui_dataset_celldata_add(ds, "bsize",
582 capacity < 1024 ? "8192" : "16384");
584 dfui_form_dataset_add(f, ds);
590 warn_subpartition_selections(struct i_fn_args *a)
593 struct aura_buffer *omit, *consequences;
595 omit = aura_buffer_new(2048);
596 consequences = aura_buffer_new(2048);
598 valid = check_capacity(a);
599 if (subpartition_find(storage_get_selected_slice(a->s), "/var") == NULL) {
600 aura_buffer_cat(omit, "/var ");
601 aura_buffer_cat(consequences, _("/var will be a plain dir in /\n"));
603 if (subpartition_find(storage_get_selected_slice(a->s), "/usr") == NULL) {
604 aura_buffer_cat(omit, "/usr ");
605 aura_buffer_cat(consequences, _("/usr will be a plain dir in /\n"));
607 if (subpartition_find(storage_get_selected_slice(a->s), "/tmp") == NULL) {
608 aura_buffer_cat(omit, "/tmp ");
609 aura_buffer_cat(consequences, _("/tmp will be symlinked to /var/tmp\n"));
611 if (subpartition_find(storage_get_selected_slice(a->s), "/home") == NULL) {
612 aura_buffer_cat(omit, "/home ");
613 aura_buffer_cat(consequences, _("/home will be symlinked to /usr/home\n"));
616 if (valid && aura_buffer_len(omit) > 0) {
617 switch (dfui_be_present_dialog(a->c, _("Really omit?"),
618 _("Omit Subpartition(s)|Return to Create Subpartitions"),
619 _("You have elected to not have the following "
620 "subpartition(s):\n\n%s\n\n"
621 "The ramifications of these subpartition(s) being "
622 "missing will be:\n\n%s\n"
623 "Is this really what you want to do?"),
624 aura_buffer_buf(omit), aura_buffer_buf(consequences))) {
636 aura_buffer_free(omit);
637 aura_buffer_free(consequences);
642 static struct dfui_form *
643 make_create_subpartitions_form(struct i_fn_args *a)
645 struct dfui_field *fi;
647 char msg_buf[1][1024];
649 snprintf(msg_buf[0], sizeof(msg_buf[0]),
650 _("Subpartitions further divide a primary partition for "
651 "use with %s. Some reasons you may want "
652 "a set of subpartitions are:\n\n"
653 "- you want to restrict how much data can be written "
654 "to certain parts of the primary partition, to quell "
655 "denial-of-service attacks; and\n"
656 "- you want to speed up access to data on the disk."
657 ""), OPERATING_SYSTEM_NAME);
659 f = dfui_form_create(
660 "create_subpartitions",
661 _("Create Subpartitions"),
662 _("Set up the subpartitions (also known as just `partitions' "
663 "in BSD tradition) you want to have on this primary "
665 "For Capacity, use 'M' to indicate megabytes, 'G' to "
666 "indicate gigabytes, or a single '*' to indicate "
667 "'use the remaining space on the primary partition'."),
671 "p", "special", "dfinstaller_create_subpartitions",
672 "p", "minimum_width","64",
674 "f", "mountpoint", _("Mountpoint"), "", "",
675 "f", "capacity", _("Capacity"), "", "",
677 "a", "ok", _("Accept and Create"), "", "",
679 (disk_get_formatted(storage_get_selected_disk(a->s)) ?
680 _("Return to Select Disk") :
681 _("Return to Select Primary Partition")), "", "",
682 "p", "accelerator", "ESC",
687 dfui_form_set_multiple(f, 1);
688 dfui_form_set_extensible(f, 1);
691 fi = dfui_form_field_add(f, "softupdates",
692 dfui_info_new(_("Softupdates"), "", ""));
693 dfui_field_property_set(fi, "control", "checkbox");
695 fi = dfui_form_field_add(f, "mfsbacked",
696 dfui_info_new(_("MFS"), "", ""));
697 dfui_field_property_set(fi, "control", "checkbox");
699 fi = dfui_form_field_add(f, "fsize",
700 dfui_info_new(_("Frag Sz"), "", ""));
702 fi = dfui_form_field_add(f, "bsize",
703 dfui_info_new(_("Block Sz"), "", ""));
705 dfui_form_action_add(f, "switch",
706 dfui_info_new(_("Switch to Normal Mode"), "", ""));
708 dfui_form_action_add(f, "switch",
709 dfui_info_new(_("Switch to Expert Mode"), "", ""));
717 * -1 = the form should be redisplayed
718 * 0 = failure, function is over
719 * 1 = success, function is over
722 show_create_subpartitions_form(struct dfui_form *f, struct i_fn_args *a)
724 struct dfui_dataset *ds;
725 struct dfui_response *r;
728 if (dfui_form_dataset_get_first(f) == NULL)
729 populate_create_subpartitions_form(f, a);
731 if (!dfui_be_present(a->c, f, &r))
734 if (strcmp(dfui_response_get_action_id(r), "cancel") == 0) {
735 dfui_response_free(r);
737 } else if (strcmp(dfui_response_get_action_id(r), "switch") == 0) {
738 if (check_subpartition_selections(r, a)) {
739 save_subpartition_selections(r, a);
740 expert = expert ? 0 : 1;
741 dfui_response_free(r);
745 if (check_subpartition_selections(r, a)) {
746 save_subpartition_selections(r, a);
747 if (!warn_subpartition_selections(a)) {
748 if (!create_subpartitions(a)) {
749 inform(a->c, _("The subpartitions you chose were "
750 "not correctly created, and the "
751 "primary partition may "
752 "now be in an inconsistent state. "
753 "We recommend re-formatting it "
754 "before proceeding."));
755 dfui_response_free(r);
758 dfui_response_free(r);
765 dfui_form_datasets_free(f);
766 /* dfui_form_datasets_add_from_response(f, r); */
767 for (ds = dfui_response_dataset_get_first(r); ds != NULL;
768 ds = dfui_dataset_get_next(ds)) {
769 dfui_form_dataset_add(f, dfui_dataset_dup(ds));
775 * fn_create_subpartitions: let the user specify what subpartitions they
776 * want on the disk, how large each should be, and where it should be mounted.
779 fn_create_subpartitions(struct i_fn_args *a)
786 f = make_create_subpartitions_form(a);
787 switch (show_create_subpartitions_form(f, a)) {