2 * The new sysinstall program.
4 * This is probably the last program in the `sysinstall' line - the next
5 * generation being essentially a complete rewrite.
10 * Jordan Hubbard. All rights reserved.
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer,
17 * verbatim and that no modifications are made prior to this
19 * 2. Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the distribution.
23 * THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND
24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 #include "sysinstall.h"
41 #include <sys/disklabel.h>
43 enum size_units_t { UNIT_BLOCKS, UNIT_KILO, UNIT_MEG, UNIT_SIZE };
46 #define SUBTYPE_FREEBSD 50324
47 #define SUBTYPE_FAT 37218
49 #define SUBTYPE_FREEBSD 165
53 /* Where we start displaying chunk information on the screen */
54 #define CHUNK_START_ROW 5
56 /* Where we keep track of MBR chunks */
57 static struct chunk *chunk_info[16];
58 static int current_chunk;
60 static void diskPartitionNonInteractive(Device *dev);
63 record_chunks(Disk *d)
65 struct chunk *c1 = NULL;
70 msgFatal("No chunk list found for %s!", d->name);
72 for (c1 = d->chunks->part; c1; c1 = c1->next) {
73 if (c1->type == unused && c1->size > last_free) {
80 if (current_chunk >= i)
81 current_chunk = i - 1;
87 print_chunks(Disk *d, int u)
94 szstr = (u == UNIT_MEG ? "MB" : (u == UNIT_KILO ? "KB" : "ST"));
96 for (i = Total = 0; chunk_info[i]; i++)
97 Total += chunk_info[i]->size;
99 if (d->bios_cyl > 65536 || d->bios_hd > 256 || d->bios_sect >= 64) {
100 dialog_clear_norefresh();
101 msgConfirm("WARNING: A geometry of %lu/%lu/%lu for %s is incorrect. Using\n"
102 "a more likely geometry. If this geometry is incorrect or you\n"
103 "are unsure as to whether or not it's correct, please consult\n"
104 "the Hardware Guide in the Documentation submenu or use the\n"
105 "(G)eometry command to change it now.\n\n"
106 "Remember: you need to enter whatever your BIOS thinks the\n"
107 "geometry is! For IDE, it's what you were told in the BIOS\n"
108 "setup. For SCSI, it's the translation mode your controller is\n"
109 "using. Do NOT use a ``physical geometry''.",
110 d->bios_cyl, d->bios_hd, d->bios_sect, d->name);
111 Sanitize_Bios_Geom(d);
115 mvaddstr(0, 0, "Disk name:\t");
117 attrset(A_REVERSE); addstr(d->name); attrset(A_NORMAL);
118 attrset(A_REVERSE); mvaddstr(0, 55, "FDISK Partition Editor"); attrset(A_NORMAL);
120 "DISK Geometry:\t%lu cyls/%lu heads/%lu sectors = %lu sectors (%luMB)",
121 d->bios_cyl, d->bios_hd, d->bios_sect,
122 d->bios_cyl * d->bios_hd * d->bios_sect,
123 d->bios_cyl * d->bios_hd * d->bios_sect * 512 / 1024 / 1024);
124 mvprintw(3, 0, "%6s %10s(%s) %10s %8s %6s %10s %8s %8s",
125 "Offset", "Size", szstr, "End", "Name", "PType", "Desc",
127 for (i = 0, row = CHUNK_START_ROW; chunk_info[i]; i++, row++) {
129 default: /* fall thru */
131 sz = chunk_info[i]->size;
134 sz = chunk_info[i]->size * 512 / 1024;
137 sz = chunk_info[i]->size * 512 / 1024 / 1024;
140 if (i == current_chunk)
141 attrset(ATTR_SELECTED);
142 mvprintw(row, 0, "%10ld %10lu %10lu %8s %6d %10s %8d\t%-6s",
143 chunk_info[i]->offset, sz,
144 chunk_info[i]->end, chunk_info[i]->name,
146 slice_type_name(chunk_info[i]->type, chunk_info[i]->subtype),
147 chunk_info[i]->subtype, ShowChunkFlags(chunk_info[i]));
148 if (i == current_chunk)
154 print_command_summary()
156 mvprintw(14, 0, "The following commands are supported (in upper or lower case):");
157 mvprintw(16, 0, "A = Use Entire Disk G = set Drive Geometry C = Create Slice F = `DD' mode");
158 mvprintw(17, 0, "D = Delete Slice Z = Toggle Size Units S = Set Bootable | = Wizard m.");
159 mvprintw(18, 0, "T = Change Type U = Undo All Changes Q = Finish");
161 mvprintw(18, 47, "W = Write Changes");
162 mvprintw(21, 0, "Use F1 or ? to get more help, arrow keys to select.");
168 getBootMgr(char *dname, u_char **bootipl, size_t *bootipl_size,
169 u_char **bootmenu, size_t *bootmenu_size)
171 extern u_char boot0[];
172 extern size_t boot0_size;
173 extern u_char boot05[];
174 extern size_t boot05_size;
180 cp = variable_get(VAR_BOOTMGR);
182 /* Figure out what kind of MBR the user wants */
183 sprintf(str, "Install Boot Manager for drive %s?", dname);
184 MenuMBRType.title = str;
185 i = dmenuOpenSimple(&MenuMBRType, FALSE);
187 if (!strncmp(cp, "boot", 4))
196 *bootipl_size = boot0_size;
198 *bootmenu_size = boot05_size;
212 getBootMgr(char *dname, u_char **bootCode, size_t *bootCodeSize)
214 #ifndef __alpha__ /* only meaningful on x86 */
215 extern u_char mbr[], boot0[];
216 extern size_t mbr_size, boot0_size;
221 cp = variable_get(VAR_BOOTMGR);
223 /* Figure out what kind of MBR the user wants */
224 sprintf(str, "Install Boot Manager for drive %s?", dname);
225 MenuMBRType.title = str;
226 i = dmenuOpenSimple(&MenuMBRType, FALSE);
229 if (!strncmp(cp, "boot", 4))
231 else if (!strcmp(cp, "standard"))
240 *bootCodeSize = boot0_size;
244 *bootCodeSize = mbr_size;
258 diskGetSelectCount(Device ***devs)
264 cp = variable_get(VAR_DISK);
265 dp = *devs = deviceFind(cp, DEVICE_TYPE_DISK);
266 cnt = deviceCount(dp);
269 for (i = 0, enabled = 0; i < cnt; i++) {
277 diskPartition(Device *dev)
287 size_t bootmenu_size;
292 WINDOW *w = savescr();
293 Disk *d = (Disk *)dev->private;
296 size_unit = UNIT_BLOCKS;
298 keypad(stdscr, TRUE);
300 /* Flush both the dialog and curses library views of the screen
301 since we don't always know who called us */
302 dialog_clear_norefresh(), clear();
305 /* Set up the chunk array */
309 char *val, geometry[80];
311 /* Now print our overall state */
313 print_chunks(d, size_unit);
314 print_command_summary();
316 attrset(title_attr); mvprintw(23, 0, msg); attrset(A_NORMAL);
325 /* Get command character */
327 switch (toupper(key)) {
328 case '\014': /* ^L (redraw) */
333 case '\020': /* ^P */
336 if (current_chunk != 0)
340 case '\016': /* ^N */
345 if (chunk_info[current_chunk + 1])
354 while (chunk_info[current_chunk + 1])
360 systemDisplayHelp("slice");
365 case 'F': /* Undocumented magic Dangerously Dedicated mode */
368 #else /* The rest is only relevant on x86 */
369 cp = variable_get(VAR_DEDICATE_DISK);
370 if (cp && !strcasecmp(cp, "always"))
372 else if (toupper(key) == 'A')
375 rv = msgYesNo("Do you want to do this with a true partition entry\n"
376 "so as to remain cooperative with any future possible\n"
377 "operating systems on the drive(s)?\n"
378 "(See also the section about ``dangerously dedicated''\n"
379 "disks in the FreeBSD FAQ.)");
385 variable_set2(DISK_PARTITIONED, "yes", 0);
391 if (chunk_info[current_chunk]->type != unused)
392 msg = "Slice in use, delete it first or move to an unused one.";
394 char *val, tmp[20], *cp;
399 snprintf(name, 16, "%s", "FreeBSD");
400 val = msgGetInput(name,
401 "Please specify the name for new FreeBSD slice.");
403 strncpy(name, val, 16);
406 chunk_e partitiontype;
408 snprintf(tmp, 20, "%lu", chunk_info[current_chunk]->size);
409 val = msgGetInput(tmp, "Please specify the size for new FreeBSD slice in blocks\n"
410 "or append a trailing `M' for megabytes (e.g. 20M).");
411 if (val && (size = strtol(val, &cp, 0)) > 0) {
412 if (*cp && toupper(*cp) == 'M')
414 else if (*cp && toupper(*cp) == 'G')
417 Create_Chunk(d, chunk_info[current_chunk]->offset, size,
419 (chunk_info[current_chunk]->flags & CHUNK_ALIGN),
421 variable_set2(DISK_PARTITIONED, "yes", 0);
424 sprintf(tmp, "%d", SUBTYPE_FREEBSD);
425 val = msgGetInput(tmp, "Enter type of partition to create:\n\n"
426 "Pressing Enter will choose the default, a native FreeBSD\n"
427 "slice (type 165). You can choose other types, 6 for a\n"
428 "DOS partition or 131 for a Linux partition, for example.\n\n"
429 "Note: If you choose a non-FreeBSD partition type, it will not\n"
430 "be formatted or otherwise prepared, it will simply reserve space\n"
431 "for you to use another tool, such as DOS FORMAT, to later format\n"
432 "and use the partition.");
433 if (val && (subtype = strtol(val, NULL, 0)) > 0) {
434 if (subtype == SUBTYPE_FREEBSD)
435 partitiontype = freebsd;
436 else if (subtype == SUBTYPE_FAT)
439 partitiontype = unknown;
441 if (partitiontype == freebsd && size == chunk_info[current_chunk]->size)
445 Create_Chunk(d, chunk_info[current_chunk]->offset, size, partitiontype, subtype,
446 (chunk_info[current_chunk]->flags & CHUNK_ALIGN));
447 variable_set2(DISK_PARTITIONED, "yes", 0);
458 if (chunk_info[current_chunk]->type == unused)
459 msg = "Slice is already unused!";
461 Delete_Chunk(d, chunk_info[current_chunk]);
462 variable_set2(DISK_PARTITIONED, "yes", 0);
468 if (chunk_info[current_chunk]->type == unused)
469 msg = "Slice is currently unused (use create instead)";
473 chunk_e partitiontype;
475 sprintf(tmp, "%d", SUBTYPE_FREEBSD);
477 val = msgGetInput(tmp, "New partition type:\n\n"
478 "Pressing Enter will choose the default, a native FreeBSD\n"
479 "slice (type 50324). Other popular values are 37218 for\n"
480 "DOS FAT partition.\n\n"
481 "Note: If you choose a non-FreeBSD partition type, it will not\n"
482 "be formatted or otherwise prepared, it will simply reserve space\n"
483 "for you to use another tool, such as DOS format, to later format\n"
484 "and actually use the partition.");
486 val = msgGetInput(tmp, "New partition type:\n\n"
487 "Pressing Enter will choose the default, a native FreeBSD\n"
488 "slice (type 165). Other popular values are 6 for\n"
489 "DOS FAT partition, 131 for a Linux ext2fs partition or\n"
490 "130 for a Linux swap partition.\n\n"
491 "Note: If you choose a non-FreeBSD partition type, it will not\n"
492 "be formatted or otherwise prepared, it will simply reserve space\n"
493 "for you to use another tool, such as DOS format, to later format\n"
494 "and actually use the partition.");
496 if (val && (subtype = strtol(val, NULL, 0)) > 0) {
497 if (subtype == SUBTYPE_FREEBSD)
498 partitiontype = freebsd;
499 else if (subtype == SUBTYPE_FAT)
502 partitiontype = unknown;
503 chunk_info[current_chunk]->type = partitiontype;
504 chunk_info[current_chunk]->subtype = subtype;
510 snprintf(geometry, 80, "%lu/%lu/%lu", d->bios_cyl, d->bios_hd, d->bios_sect);
511 val = msgGetInput(geometry, "Please specify the new geometry in cyl/hd/sect format.\n"
512 "Don't forget to use the two slash (/) separator characters!\n"
513 "It's not possible to parse the field without them.");
516 nc = strtol(val, &val, 0);
517 nh = strtol(val + 1, &val, 0);
518 ns = strtol(val + 1, 0, 0);
519 Set_Bios_Geom(d, nc, nh, ns);
526 chunk_info[current_chunk]->flags |= CHUNK_ACTIVE;
530 if (!variable_cmp(DISK_LABELLED, "written")) {
531 msgConfirm("You've already written this information out - you\n"
534 else if (!msgNoYes("Are you SURE you want to Undo everything?")) {
537 sstrncpy(cp, d->name, sizeof cp);
538 Free_Disk(dev->private);
541 msgConfirm("Can't reopen disk %s! Internal state is probably corrupted", cp);
543 variable_unset(DISK_PARTITIONED);
544 variable_unset(DISK_LABELLED);
552 if (!msgNoYes("WARNING: This should only be used when modifying an EXISTING\n"
553 "installation. If you are installing FreeBSD for the first time\n"
554 "then you should simply type Q when you're finished here and your\n"
555 "changes will be committed in one batch automatically at the end of\n"
556 "these questions. If you're adding a disk, you should NOT write\n"
557 "from this screen, you should do it from the label editor.\n\n"
558 "Are you absolutely sure you want to do this now?")) {
559 variable_set2(DISK_PARTITIONED, "yes", 0);
562 * Don't trash the MBR if the first (and therefore only) chunk
563 * is marked for a truly dedicated disk (i.e., the disklabel
564 * starts at sector 0), even in cases where the user has
565 * requested booteasy or a "standard" MBR -- both would be
566 * fatal in this case.
569 * Don't offer to update the MBR on this disk if the first
570 * "real" chunk looks like a FreeBSD "all disk" partition,
571 * or the disk is entirely FreeBSD.
574 if ((d->chunks->part->type != freebsd) ||
575 (d->chunks->part->offset > 1))
576 getBootMgr(d->name, &bootipl, &bootipl_size,
577 &bootmenu, &bootmenu_size);
584 Set_Boot_Mgr(d, bootipl, bootipl_size, bootmenu, bootmenu_size);
586 if ((d->chunks->part->type != freebsd) ||
587 (d->chunks->part->offset > 1))
588 getBootMgr(d->name, &mbrContents, &mbrSize);
593 Set_Boot_Mgr(d, mbrContents, mbrSize);
596 if (DITEM_STATUS(diskPartitionWrite(NULL)) != DITEM_SUCCESS)
597 msgConfirm("Disk partition write returned an error status!");
599 msgConfirm("Wrote FDISK partition information out successfully.");
605 if (!msgNoYes("Are you SURE you want to go into Wizard mode?\n"
606 "No seat belts whatsoever are provided!")) {
610 variable_set2(DISK_PARTITIONED, "yes", 0);
614 msg = "Wise choice!";
618 case '\033': /* ESC */
622 * Don't trash the MBR if the first (and therefore only) chunk
623 * is marked for a truly dedicated disk (i.e., the disklabel
624 * starts at sector 0), even in cases where the user has requested
625 * booteasy or a "standard" MBR -- both would be fatal in this case.
628 * Don't offer to update the MBR on this disk if the first "real"
629 * chunk looks like a FreeBSD "all disk" partition, or the disk is
632 if ((d->chunks->part->type != freebsd) ||
633 (d->chunks->part->offset > 1)) {
634 if (variable_cmp(DISK_PARTITIONED, "written")) {
636 getBootMgr(d->name, &bootipl, &bootipl_size,
637 &bootmenu, &bootmenu_size);
638 if (bootipl != NULL && bootmenu != NULL)
639 Set_Boot_Mgr(d, bootipl, bootipl_size,
640 bootmenu, bootmenu_size);
642 getBootMgr(d->name, &mbrContents, &mbrSize);
643 if (mbrContents != NULL)
644 Set_Boot_Mgr(d, mbrContents, mbrSize);
651 size_unit = (size_unit + 1) % UNIT_SIZE;
656 msg = "Type F1 or ? for help";
662 char buf[FILENAME_MAX];
664 use_helpline("Press F1 to read more about disk slices.");
665 use_helpfile(systemHelpFile("partition", buf));
666 if (!variable_get(VAR_NO_WARN))
667 dialog_mesgbox("Disk slicing warning:", p, -1, -1);
674 bootalloc(char *name)
676 char buf[FILENAME_MAX];
679 snprintf(buf, sizeof buf, "/boot/%s", name);
680 if (stat(buf, &sb) != -1) {
683 fd = open(buf, O_RDONLY);
687 cp = malloc(sb.st_size);
688 if (read(fd, cp, sb.st_size) != sb.st_size) {
691 msgDebug("bootalloc: couldn't read %ld bytes from %s\n", (long)sb.st_size, buf);
697 msgDebug("bootalloc: couldn't open %s\n", buf);
700 msgDebug("bootalloc: can't stat %s\n", buf);
705 partitionHook(dialogMenuItem *selected)
707 Device **devs = NULL;
709 devs = deviceFind(selected->prompt, DEVICE_TYPE_DISK);
711 msgConfirm("Unable to find disk %s!", selected->prompt);
712 return DITEM_FAILURE;
714 /* Toggle enabled status? */
715 if (!devs[0]->enabled) {
716 devs[0]->enabled = TRUE;
717 diskPartition(devs[0]);
720 devs[0]->enabled = FALSE;
721 return DITEM_SUCCESS;
725 partitionCheck(dialogMenuItem *selected)
727 Device **devs = NULL;
729 devs = deviceFind(selected->prompt, DEVICE_TYPE_DISK);
730 if (!devs || devs[0]->enabled == FALSE)
736 diskPartitionEditor(dialogMenuItem *self)
742 cnt = diskGetSelectCount(&devs);
743 devcnt = deviceCount(devs);
745 msgConfirm("No disks found! Please verify that your disk controller is being\n"
746 "properly probed at boot time. See the Hardware Guide on the\n"
747 "Documentation menu for clues on diagnosing this type of problem.");
748 return DITEM_FAILURE;
751 /* Some are already selected */
752 for (i = 0; i < devcnt; i++) {
753 if (devs[i]->enabled) {
754 if (variable_get(VAR_NONINTERACTIVE))
755 diskPartitionNonInteractive(devs[i]);
757 diskPartition(devs[i]);
762 /* No disks are selected, fall-back case now */
764 devs[0]->enabled = TRUE;
765 if (variable_get(VAR_NONINTERACTIVE))
766 diskPartitionNonInteractive(devs[0]);
768 diskPartition(devs[0]);
769 return DITEM_SUCCESS;
772 menu = deviceCreateMenu(&MenuDiskDevices, DEVICE_TYPE_DISK, partitionHook, partitionCheck);
774 msgConfirm("No devices suitable for installation found!\n\n"
775 "Please verify that your disk controller (and attached drives)\n"
776 "were detected properly. This can be done by pressing the\n"
777 "[Scroll Lock] key and using the Arrow keys to move back to\n"
778 "the boot messages. Press [Scroll Lock] again to return.");
779 return DITEM_FAILURE;
782 i = dmenuOpenSimple(menu, FALSE) ? DITEM_SUCCESS : DITEM_FAILURE;
788 return DITEM_SUCCESS;
792 diskPartitionWrite(dialogMenuItem *self)
797 if (!variable_cmp(DISK_PARTITIONED, "written"))
798 return DITEM_SUCCESS;
800 devs = deviceFind(NULL, DEVICE_TYPE_DISK);
802 msgConfirm("Unable to find any disks to write to??");
803 return DITEM_FAILURE;
806 msgDebug("diskPartitionWrite: Examining %d devices\n", deviceCount(devs));
807 for (i = 0; devs[i]; i++) {
808 Disk *d = (Disk *)devs[i]->private;
809 static u_char *boot1;
811 static u_char *boot2;
814 if (!devs[i]->enabled)
818 if (!boot1) boot1 = bootalloc("boot1");
819 Set_Boot_Blocks(d, boot1, NULL);
821 if (!boot1) boot1 = bootalloc("boot1");
822 if (!boot2) boot2 = bootalloc("boot2");
823 Set_Boot_Blocks(d, boot1, boot2);
826 msgNotify("Writing partition information to drive %s", d->name);
827 if (!Fake && Write_Disk(d)) {
828 msgConfirm("ERROR: Unable to write data to disk %s!", d->name);
829 return DITEM_FAILURE;
832 /* Now it's not "yes", but "written" */
833 variable_set2(DISK_PARTITIONED, "written", 0);
834 return DITEM_SUCCESS | DITEM_RESTORE;
837 /* Partition a disk based wholly on which variables are set */
839 diskPartitionNonInteractive(Device *dev)
842 int i, sz, all_disk = 0;
847 size_t bootmenu_size;
852 Disk *d = (Disk *)dev->private;
855 cp = variable_get(VAR_GEOMETRY);
857 msgDebug("Setting geometry from script to: %s\n", cp);
858 d->bios_cyl = strtol(cp, &cp, 0);
859 d->bios_hd = strtol(cp + 1, &cp, 0);
860 d->bios_sect = strtol(cp + 1, 0, 0);
863 cp = variable_get(VAR_PARTITION);
865 if (!strcmp(cp, "free")) {
866 /* Do free disk space case */
867 for (i = 0; chunk_info[i]; i++) {
868 /* If a chunk is at least 10MB in size, use it. */
869 if (chunk_info[i]->type == unused && chunk_info[i]->size > (10 * ONE_MEG)) {
871 Create_Chunk(d, chunk_info[i]->offset, chunk_info[i]->size,
873 (chunk_info[i]->flags & CHUNK_ALIGN),
876 Create_Chunk(d, chunk_info[i]->offset, chunk_info[i]->size,
878 (chunk_info[i]->flags & CHUNK_ALIGN));
880 variable_set2(DISK_PARTITIONED, "yes", 0);
884 if (!chunk_info[i]) {
885 msgConfirm("Unable to find any free space on this disk!");
889 else if (!strcmp(cp, "all")) {
890 /* Do all disk space case */
891 msgDebug("Warning: Devoting all of disk %s to FreeBSD.\n", d->name);
893 All_FreeBSD(d, FALSE);
895 else if (!strcmp(cp, "exclusive")) {
896 /* Do really-all-the-disk-space case */
897 msgDebug("Warning: Devoting all of disk %s to FreeBSD.\n", d->name);
899 All_FreeBSD(d, all_disk = TRUE);
901 else if ((sz = strtol(cp, &cp, 0))) {
902 /* Look for sz bytes free */
903 if (*cp && toupper(*cp) == 'M')
905 else if (*cp && toupper(*cp) == 'G')
907 for (i = 0; chunk_info[i]; i++) {
908 /* If a chunk is at least sz MB, use it. */
909 if (chunk_info[i]->type == unused && chunk_info[i]->size >= sz) {
911 Create_Chunk(d, chunk_info[i]->offset, sz, freebsd, 3,
912 (chunk_info[i]->flags & CHUNK_ALIGN),
915 Create_Chunk(d, chunk_info[i]->offset, sz, freebsd, 3,
916 (chunk_info[i]->flags & CHUNK_ALIGN));
918 variable_set2(DISK_PARTITIONED, "yes", 0);
922 if (!chunk_info[i]) {
923 msgConfirm("Unable to find %d free blocks on this disk!", sz);
927 else if (!strcmp(cp, "existing")) {
928 /* Do existing FreeBSD case */
929 for (i = 0; chunk_info[i]; i++) {
930 if (chunk_info[i]->type == freebsd)
933 if (!chunk_info[i]) {
934 msgConfirm("Unable to find any existing FreeBSD partitions on this disk!");
939 msgConfirm("`%s' is an invalid value for %s - is config file valid?", cp, VAR_PARTITION);
944 getBootMgr(d->name, &bootipl, &bootipl_size,
945 &bootmenu, &bootmenu_size);
946 Set_Boot_Mgr(d, bootipl, bootipl_size, bootmenu, bootmenu_size);
948 getBootMgr(d->name, &mbrContents, &mbrSize);
949 Set_Boot_Mgr(d, mbrContents, mbrSize);
952 variable_set2(DISK_PARTITIONED, "yes", 0);