Index: stable/2.1/release/sysinstall/disks.c =================================================================== --- stable/2.1/release/sysinstall/disks.c (revision 10968) +++ stable/2.1/release/sysinstall/disks.c (revision 10969) @@ -1,448 +1,448 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: disks.c,v 1.31.2.3 1995/09/18 17:00:17 peter Exp $ + * $Id: disks.c,v 1.31.2.4 1995/09/20 10:43:11 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer, * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by Jordan Hubbard * for the FreeBSD Project. * 4. The name of Jordan Hubbard or the FreeBSD project may not be used to * endorse or promote products derived from this software without specific * prior written permission. * * THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * */ #include "sysinstall.h" #include #include /* Where we start displaying chunk information on the screen */ #define CHUNK_START_ROW 5 /* Where we keep track of MBR chunks */ static struct chunk *chunk_info[10]; static int current_chunk; static void record_chunks(Disk *d) { struct chunk *c1; int i = 0; int last_free = 0; if (!d->chunks) msgFatal("No chunk list found for %s!", d->name); c1 = d->chunks->part; current_chunk = 0; while (c1) { if (c1->type == unused && c1->size > last_free) { last_free = c1->size; current_chunk = i; } chunk_info[i++] = c1; c1 = c1->next; } chunk_info[i] = NULL; } static void print_chunks(Disk *d) { int row; int i; if ((!d->bios_cyl || d->bios_cyl > 65536) || (!d->bios_hd || d->bios_hd > 256) || (!d->bios_sect || d->bios_sect >= 64)) msgConfirm("WARNING: The detected geometry is incorrect! Please adjust it to\nthe correct values manually with the (G)eometry command. If you are\nunsure about the correct geometry (which may be \"translated\"), please\nconsult the Hardware Guide in the Documentation submenu."); attrset(A_NORMAL); mvaddstr(0, 0, "Disk name:\t"); clrtobot(); attrset(A_REVERSE); addstr(d->name); attrset(A_NORMAL); attrset(A_REVERSE); mvaddstr(0, 55, "FDISK Partition Editor"); attrset(A_NORMAL); mvprintw(1, 0, "BIOS Geometry:\t%lu cyls/%lu heads/%lu sectors", d->bios_cyl, d->bios_hd, d->bios_sect); mvprintw(3, 1, "%10s %10s %10s %8s %8s %8s %8s %8s", "Offset", "Size", "End", "Name", "PType", "Desc", "Subtype", "Flags"); for (i = 0, row = CHUNK_START_ROW; chunk_info[i]; i++, row++) { if (i == current_chunk) attrset(A_REVERSE); mvprintw(row, 2, "%10ld %10lu %10lu %8s %8d %8s %8d\t%-6s", chunk_info[i]->offset, chunk_info[i]->size, chunk_info[i]->end, chunk_info[i]->name, chunk_info[i]->type, chunk_n[chunk_info[i]->type], chunk_info[i]->subtype, ShowChunkFlags(chunk_info[i])); if (i == current_chunk) attrset(A_NORMAL); } } static void print_command_summary() { mvprintw(14, 0, "The following commands are supported (in upper or lower case):"); mvprintw(16, 0, "A = Use Entire Disk B = Bad Block Scan C = Create Partition"); mvprintw(17, 0, "D = Delete Partition G = Set BIOS Geometry S = Set Bootable"); mvprintw(18, 0, "U = Undo All Changes Q = Finish W = Write Changes"); mvprintw(20, 0, "The currently selected partition is displayed in "); attrset(A_REVERSE); addstr("reverse"); attrset(A_NORMAL); addstr(" video."); mvprintw(21, 0, "Use F1 or ? to get more help, arrow keys to move."); move(0, 0); } static Disk * diskPartition(Disk *d) { char *p; int key = 0; Boolean chunking; char *msg = NULL; char name[40]; chunking = TRUE; strncpy(name, d->name, 40); keypad(stdscr, TRUE); clear(); record_chunks(d); while (chunking) { print_chunks(d); print_command_summary(); if (msg) { standout(); mvprintw(23, 0, msg); standend(); beep(); msg = NULL; } key = toupper(getch()); switch (key) { case '\014': /* ^L */ clear(); continue; case KEY_UP: case '-': if (current_chunk != 0) --current_chunk; break; case KEY_DOWN: case '+': case '\r': case '\n': if (chunk_info[current_chunk + 1]) ++current_chunk; break; case KEY_HOME: current_chunk = 0; break; case KEY_END: while (chunk_info[current_chunk + 1]) ++current_chunk; break; case KEY_F(1): case '?': - systemDisplayFile("slice.hlp"); + systemDisplayFile("slice"); break; case 'A': if(!msgYesNo("Do you want to use the regular way to keep the disk\n" "cooperative with the usual BIOS partitioning schemes?")) All_FreeBSD(d, 0); else { int rv; rv = !msgYesNo("This is dangerous in that it will make the drive absolutely\n" "uncooperative to other potential operating systems on the\n" "same disk. It will rather lead to a totally dedicated disk,\n" "starting at the very first sector, bypassing all BIOS geometry\n" "considerations.\n" "You will run into serious troubles for ST-506 and ESDI drives,\n" "and you might suffer a great pain when applying this to some\n" "IDE drives (e.g. drives running under control of some sort of\n" "a disk manager). SCSI drives are considered less harmful.\n" "Whenever you'll get this disk within the reach of some DOS\n" "\"fdisk\" utility, little red daemons will jump out of your\n" "drive and eat you up!\n\n" "Do you insist on dedicating the entire disk this way?"); if(rv) msgInfo("You can't say you haven't been warned!"); All_FreeBSD(d, rv); } record_chunks(d); break; case 'B': if (chunk_info[current_chunk]->type != freebsd) msg = "Can only scan for bad blocks in FreeBSD partition."; else if (strncmp(name, "sd", 2) || !msgYesNo("This typically makes sense only for ESDI, IDE or MFM drives.\nAre you sure you want to do this on a SCSI disk?")) if (chunk_info[current_chunk]->flags & CHUNK_BAD144) chunk_info[current_chunk]->flags &= ~CHUNK_BAD144; else chunk_info[current_chunk]->flags |= CHUNK_BAD144; break; case 'C': if (chunk_info[current_chunk]->type != unused) msg = "Partition in use, delete it first or move to an unused one."; else { char *val, tmp[20], *cp; int size; snprintf(tmp, 20, "%d", chunk_info[current_chunk]->size); val = msgGetInput(tmp, "Please specify the size for new FreeBSD partition in blocks, or append\na trailing `M' for megabytes (e.g. 20M)."); if (val && (size = strtol(val, &cp, 0)) > 0) { if (*cp && toupper(*cp) == 'M') size *= 2048; Create_Chunk(d, chunk_info[current_chunk]->offset, size, freebsd, 3, (chunk_info[current_chunk]->flags & CHUNK_ALIGN)); record_chunks(d); } } break; case 'D': if (chunk_info[current_chunk]->type == unused) msg = "Partition is already unused!"; else { Delete_Chunk(d, chunk_info[current_chunk]); record_chunks(d); } break; case 'G': { char *val, geometry[80]; snprintf(geometry, 80, "%lu/%lu/%lu", d->bios_cyl, d->bios_hd, d->bios_sect); val = msgGetInput(geometry, "Please specify the new geometry in cyl/hd/sect format.\nDon't forget to use the two slash (/) separator characters!\nIt's not possible to parse the field without them."); if (val) { d->bios_cyl = strtol(val, &val, 0); d->bios_hd = strtol(val + 1, &val, 0); d->bios_sect = strtol(val + 1, 0, 0); } } break; case 'S': /* Set Bootable */ chunk_info[current_chunk]->flags |= CHUNK_ACTIVE; break; case 'U': Free_Disk(d); d = Open_Disk(name); if (!d) msgFatal("Can't reopen disk %s!", name); record_chunks(d); break; case 'W': if (!msgYesNo("Are you sure you want to write this now? You do also\nhave the option of not modifying the disk until *all*\nconfiguration information has been entered, at which\npoint you can do it all at once. If you're unsure, then\nchoose No at this dialog.")) diskPartitionWrite(NULL); break; case '|': if (!msgYesNo("Are you sure you want to go into Wizard mode?\nNo seat belts whatsoever are provided!")) { dialog_clear(); end_dialog(); DialogActive = FALSE; slice_wizard(d); dialog_clear(); DialogActive = TRUE; record_chunks(d); } else msg = "Wise choice!"; break; case 'Q': chunking = FALSE; break; default: beep(); msg = "Type F1 or ? for help"; break; } } p = CheckRules(d); if (p) { msgConfirm(p); free(p); } dialog_clear(); variable_set2(DISK_PARTITIONED, "yes"); return d; } static int partitionHook(char *str) { Device **devs = NULL; /* Clip garbage off the ends */ string_prune(str); str = string_skipwhite(str); /* Try and open all the disks */ while (str) { char *cp; cp = index(str, '\n'); if (cp) *cp++ = 0; if (!*str) { beep(); return 0; } devs = deviceFind(str, DEVICE_TYPE_DISK); if (!devs) { msgConfirm("Unable to find disk %s!", str); return 0; } else if (devs[1]) msgConfirm("Bizarre multiple match for %s!", str); devs[0]->private = diskPartition((Disk *)devs[0]->private); devs[0]->enabled = TRUE; str = cp; } return devs ? 1 : 0; } int diskPartitionEditor(char *str) { DMenu *menu; Device **devs; int cnt; devs = deviceFind(NULL, DEVICE_TYPE_DISK); cnt = deviceCount(devs); if (!cnt) { msgConfirm("No disks found! Please verify that your disk controller is being\nproperly probed at boot time. See the Hardware Guide on the Documentation menu\nfor clues on diagnosing this type of problem."); return 0; } else if (cnt == 1) { devs[0]->private = diskPartition((Disk *)devs[0]->private); devs[0]->enabled = TRUE; } else { menu = deviceCreateMenu(&MenuDiskDevices, DEVICE_TYPE_DISK, partitionHook); if (!menu) msgConfirm("No devices suitable for installation found!\n\nPlease verify that your disk controller (and attached drives) were detected properly. This can be done by selecting the ``Bootmsg'' option on the main menu and reviewing the boot messages carefully."); else { dmenuOpenSimple(menu); free(menu); } } return 0; } static u_char * getBootMgr(void) { extern u_char mbr[], bteasy17[]; /* Figure out what kind of MBR the user wants */ if (dmenuOpenSimple(&MenuMBRType)) { switch (BootMgr) { case 0: return bteasy17; case 1: return mbr; case 2: default: break; } } return NULL; } int diskPartitionWrite(char *str) { extern u_char boot1[], boot2[]; u_char *mbrContents; Device **devs; int i; mbrContents = getBootMgr(); devs = deviceFind(NULL, DEVICE_TYPE_DISK); if (!devs) { msgConfirm("Unable to find any disks to write to??"); return 0; } for (i = 0; devs[i]; i++) { Chunk *c1; Disk *d = (Disk *)devs[i]->private; if (!devs[i]->enabled) continue; /* Don't trash the MBR if the first (and therefore only) chunk is marked for a truly dedicated disk (i.e., the disklabel starts at sector 0), even in cases where the user has requested booteasy or a "standard" MBR -- both would be fatal in this case. */ if (mbrContents && (d->chunks->part->flags & CHUNK_FORCE_ALL) != CHUNK_FORCE_ALL) { Set_Boot_Mgr(d, mbrContents); mbrContents = NULL; } Set_Boot_Blocks(d, boot1, boot2); msgNotify("Writing partition information to drive %s", d->name); Write_Disk(d); /* Now scan for bad blocks, if necessary */ for (c1 = d->chunks->part; c1; c1 = c1->next) { if (c1->flags & CHUNK_BAD144) { int ret; msgNotify("Running bad block scan on partition %s", c1->name); ret = vsystem("bad144 -v /dev/r%s 1234", c1->name); if (ret) msgConfirm("Bad144 init on %s returned status of %d!", c1->name, ret); ret = vsystem("bad144 -v -s /dev/r%s", c1->name); if (ret) msgConfirm("Bad144 scan on %s returned status of %d!", c1->name, ret); } } } return 0; } Index: stable/2.1/release/sysinstall/help/partition.hlp =================================================================== --- stable/2.1/release/sysinstall/help/partition.hlp (revision 10968) +++ stable/2.1/release/sysinstall/help/partition.hlp (revision 10969) @@ -1,122 +1,124 @@ This is the FreeBSD DiskLabel Editor. +If you would like the label editor to do all of the following *for* you, +simply type `A' for automatic partitioning of the disk. + You should use this editor to create at least the following filesystems: Name Purpose Min Size? Optional? ---- ------- --------- --------- / Root filesystem 20MB No swap Swap space 2 * MEM No /usr System & user files 80MB or more Yes Note: If you do not create a /usr filesystem then your / filesystem will need to be bigger - at least 100MB. This is not recommended as any media errors that may occur during disk I/O to user files will corrupt the filesystem containing vital system files as well. It is for this reason that / is generally kept on its own filesystem, where it's basically considered "read only" by the system and hence a good deal safer. Swap space is a little tricker, and the rule of "2 * MEM" is simply a best-guess approximation and not necessarily accurate for your intended usage of the system. If you intend to use the system heavily in a server or multi-user application, you may be well advised to increase this size. You may also create swap space on multiple drives for a larger "total" swap and this is, in fact, recommended if you have multiple, fast drives for which such load-balancing can only help overall I/O performance. The /usr filesystem should be sized according to what kind of distributions you're trying to load and how many packages you intend to install in locations like /usr/local. You can also make /usr/local a separate filesystem if you don't want to risk filling up your /usr by mistake. Another useful filesystem to create is /var, which contains mail, news printer spool files and other temporary items. It is a popular candidate for a separate paritition and should be sized according to your estimates of the amount of mail, news or spooled print jobs that may be stored there. WARNING: If you do not create a separate filesystem for /var, space for such files will be allocated out of the root (/) filesystem instead. You may therefore wish to make the / partition bigger if you expect a lot of mail or news and do not want to make /var its own partition. - If you're new to this installation, you should also first understand how FreeBSD 2.0.5's new "slices" paradigm for looking at disk storage works. It's not very hard to grasp. A "fully qualified slice name", that is the name of the file we open in /dev to talk to the slice, is optionally broken into 3 parts: First you have the disk name. Assume we have two SCSI drives in our system, which gives us `sd0' and `sd1'. Next you have the "Slice" (or "FDISK Partition") number, as seen in the Partition Editor. Assume that our sd0 contains two slices, a FreeBSD slice and a DOS slice. This gives us sd0s1 and sd0s2. Let's also say that sd1 is completely devoted to FreeBSD, so we have only one slice there: sd1s1. Next, if a slice is a FreeBSD slice, you have a number of (confusingly named) "partitions" you can put inside of it. These FreeBSD partitions are where various filesystems or swap areas live, and using our hypothetical two-SCSI-disk machine again, we might have something like the following layout on sd0: Name Mountpoint ---- ---------- sd0s1a / sd0s1b sd0s1e /usr Because of historical convention, there is also a short-cut, or "compatibility slice", that is maintained for easy access to the first FreeBSD slice on a disk for those programs which still don't know how to deal with the new slice scheme. The compatibility slice names for our filesystem above would look like: Name Mountpoint ---- ---------- sd0a / sd0b sd0e /usr FreeBSD automatically maps the compatibility slice to the first FreeBSD slice it finds (in this case, sd0s1). You may have multiple FreeBSD slices on a drive, but only the first one may be the compatibility slice! The compatibility slice will eventually be phased out, but it is still important right now for several reasons: 1. Some programs, as mentioned before, still don't work with the slice paradigm and need time to catch up. 2. The FreeBSD boot blocks are unable to look for a root file system in anything but a compatibility slice right now. This means that our root will always show up on "sd0a" in the above scenario, even though it really lives over on sd0s1a and would otherwise be referred to by its full slice name. Once you understand all this, then the label editor becomes fairly simple. You're either carving up the FreeBSD slices displayed at the top of the screen into smaller pieces (displayed in the middle of the screen) and then putting FreeBSD file systems on them, Or you're just mounting existing partitions/slices into your filesystem hierarchy; this editor lets you do both. Since a DOS partition is also just another slice as far as FreeBSD is concerned, you can mount one into in your filesystem hierarchy just as easily with this editor. For FreeBSD partitions you can also toggle the "newfs" state so that the partitions are either (re)created from scratch or simply checked and mounted (the contents are preserved). When you're done, type `Q' to exit. No actual changes will be made to the disk until you (C)ommit from the Install menu! You're working with what is essentially a copy of the disk label(s), both here and in the FDISK Partition Editor. Index: stable/2.1/release/sysinstall/label.c =================================================================== --- stable/2.1/release/sysinstall/label.c (revision 10968) +++ stable/2.1/release/sysinstall/label.c (revision 10969) @@ -1,780 +1,780 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: label.c,v 1.32.2.2 1995/07/21 11:45:39 rgrimes Exp $ + * $Id: label.c,v 1.32.2.3 1995/09/18 17:00:20 peter Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer, * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by Jordan Hubbard * for the FreeBSD Project. * 4. The name of Jordan Hubbard or the FreeBSD project may not be used to * endorse or promote products derived from this software without specific * prior written permission. * * THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * */ #include "sysinstall.h" #include #include #include #undef TRUE #undef FALSE #include /* * Everything to do with editing the contents of disk labels. */ /* A nice message we use a lot in the disklabel editor */ #define MSG_NOT_APPLICABLE "That option is not applicable here" /* Where to start printing the freebsd slices */ #define CHUNK_SLICE_START_ROW 2 #define CHUNK_PART_START_ROW 11 /* One MB worth of blocks */ #define ONE_MEG 2048 /* The smallest filesystem we're willing to create */ #define FS_MIN_SIZE ONE_MEG /* The smallest root filesystem we're willing to create */ #define ROOT_MIN_SIZE (20 * ONE_MEG) /* All the chunks currently displayed on the screen */ static struct { struct chunk *c; PartType type; } label_chunk_info[MAX_CHUNKS + 1]; static int here; /* See if we're already using a desired partition name */ static Boolean check_conflict(char *name) { int i; for (i = 0; label_chunk_info[i].c; i++) if (label_chunk_info[i].type == PART_FILESYSTEM && label_chunk_info[i].c->private && !strcmp(((PartInfo *)label_chunk_info[i].c->private)->mountpoint, name)) return TRUE; return FALSE; } /* How much space is in this FreeBSD slice? */ static int space_free(struct chunk *c) { struct chunk *c1 = c->part; int sz = c->size; while (c1) { if (c1->type != unused) sz -= c1->size; c1 = c1->next; } if (sz < 0) msgFatal("Partitions are larger than actual chunk??"); return sz; } /* Snapshot the current situation into the displayed chunks structure */ static void record_label_chunks() { int i, j, p; struct chunk *c1, *c2; Device **devs; Disk *d; devs = deviceFind(NULL, DEVICE_TYPE_DISK); if (!devs) { msgConfirm("No disks found!"); return; } j = p = 0; /* First buzz through and pick up the FreeBSD slices */ for (i = 0; devs[i]; i++) { if (!devs[i]->enabled) continue; d = (Disk *)devs[i]->private; if (!d->chunks) msgFatal("No chunk list found for %s!", d->name); /* Put the slice entries first */ for (c1 = d->chunks->part; c1; c1 = c1->next) { if (c1->type == freebsd) { label_chunk_info[j].type = PART_SLICE; label_chunk_info[j].c = c1; ++j; } } } /* Now run through again and get the FreeBSD partition entries */ for (i = 0; devs[i]; i++) { if (!devs[i]->enabled) continue; d = (Disk *)devs[i]->private; /* Then buzz through and pick up the partitions */ for (c1 = d->chunks->part; c1; c1 = c1->next) { if (c1->type == freebsd) { for (c2 = c1->part; c2; c2 = c2->next) { if (c2->type == part) { if (c2->subtype == FS_SWAP) label_chunk_info[j].type = PART_SWAP; else label_chunk_info[j].type = PART_FILESYSTEM; label_chunk_info[j].c = c2; ++j; } } } else if (c1->type == fat) { label_chunk_info[j].type = PART_FAT; label_chunk_info[j].c = c1; ++j; } } } label_chunk_info[j].c = NULL; if (here >= j) here = j ? j - 1 : 0; } /* A new partition entry */ static PartInfo * new_part(char *mpoint, Boolean newfs, u_long size) { PartInfo *ret; u_long target, divisor; if (!mpoint) mpoint = "/change_me"; ret = (PartInfo *)safe_malloc(sizeof(PartInfo)); strncpy(ret->mountpoint, mpoint, FILENAME_MAX); strcpy(ret->newfs_cmd, "newfs -b 8192 -f 2048"); ret->newfs = newfs; if (!size) return ret; for (target = size; target; target--) { for (divisor = 4096 ; divisor > 1023; divisor--) { if (!(target % divisor)) { sprintf(ret->newfs_cmd + strlen(ret->newfs_cmd), " -u %ld",divisor); return ret; } } } return ret; } /* Get the mountpoint for a partition and save it away */ PartInfo * get_mountpoint(struct chunk *old) { char *val; PartInfo *tmp; if (old && old->private) tmp = old->private; else tmp = NULL; val = msgGetInput(tmp ? tmp->mountpoint : NULL, "Please specify a mount point for the partition"); if (!val || !*val) { if (!old) return NULL; else { free(old->private); old->private = NULL; } return NULL; } /* Is it just the same value? */ if (tmp && !strcmp(tmp->mountpoint, val)) return NULL; /* Did we use it already? */ if (check_conflict(val)) { msgConfirm("You already have a mount point for %s assigned!", val); return NULL; } /* Is it bogus? */ if (*val != '/') { msgConfirm("Mount point must start with a / character"); return NULL; } /* Is it going to be mounted on root? */ if (!strcmp(val, "/")) { if (old) old->flags |= CHUNK_IS_ROOT; } else if (old) old->flags &= ~CHUNK_IS_ROOT; safe_free(tmp); tmp = new_part(val, TRUE, 0); if (old) { old->private = tmp; old->private_free = safe_free; } return tmp; } /* Get the type of the new partiton */ static PartType get_partition_type(void) { char selection[20]; int i; static unsigned char *fs_types[] = { "FS", "A file system", "Swap", "A swap partition.", }; i = dialog_menu("Please choose a partition type", "If you want to use this partition for swap space, select Swap.\nIf you want to put a filesystem on it, choose FS.", -1, -1, 2, 2, fs_types, selection, NULL, NULL); if (!i) { if (!strcmp(selection, "FS")) return PART_FILESYSTEM; else if (!strcmp(selection, "Swap")) return PART_SWAP; } return PART_NONE; } /* If the user wants a special newfs command for this, set it */ static void getNewfsCmd(PartInfo *p) { char *val; val = msgGetInput(p->newfs_cmd, "Please enter the newfs command and options you'd like to use in\ncreating this file system."); if (val) strncpy(p->newfs_cmd, val, NEWFS_CMD_MAX); } #define MAX_MOUNT_NAME 12 #define PART_PART_COL 0 #define PART_MOUNT_COL 8 #define PART_SIZE_COL (PART_MOUNT_COL + MAX_MOUNT_NAME + 3) #define PART_NEWFS_COL (PART_SIZE_COL + 7) #define PART_OFF 38 /* How many mounted partitions to display in column before going to next */ #define CHUNK_COLUMN_MAX 5 /* stick this all up on the screen */ static void print_label_chunks(void) { int i, j, srow, prow, pcol; int sz; attrset(A_REVERSE); mvaddstr(0, 25, "FreeBSD Disklabel Editor"); clrtobot(); attrset(A_NORMAL); for (i = 0; i < 2; i++) { mvaddstr(CHUNK_PART_START_ROW - 2, PART_PART_COL + (i * PART_OFF), "Part"); mvaddstr(CHUNK_PART_START_ROW - 1, PART_PART_COL + (i * PART_OFF), "----"); mvaddstr(CHUNK_PART_START_ROW - 2, PART_MOUNT_COL + (i * PART_OFF), "Mount"); mvaddstr(CHUNK_PART_START_ROW - 1, PART_MOUNT_COL + (i * PART_OFF), "-----"); mvaddstr(CHUNK_PART_START_ROW - 2, PART_SIZE_COL + (i * PART_OFF) + 2, "Size"); mvaddstr(CHUNK_PART_START_ROW - 1, PART_SIZE_COL + (i * PART_OFF) + 2, "----"); mvaddstr(CHUNK_PART_START_ROW - 2, PART_NEWFS_COL + (i * PART_OFF), "Newfs"); mvaddstr(CHUNK_PART_START_ROW - 1, PART_NEWFS_COL + (i * PART_OFF), "-----"); } srow = CHUNK_SLICE_START_ROW; prow = CHUNK_PART_START_ROW; pcol = 0; for (i = 0; label_chunk_info[i].c; i++) { if (i == here) attrset(A_REVERSE); /* Is it a slice entry displayed at the top? */ if (label_chunk_info[i].type == PART_SLICE) { sz = space_free(label_chunk_info[i].c); mvprintw(srow++, 0, "Disk: %s\tPartition name: %s\tFree: %d blocks (%dMB)", label_chunk_info[i].c->disk->name, label_chunk_info[i].c->name, sz, (sz / ONE_MEG)); } /* Otherwise it's a DOS, swap or filesystem entry, at the bottom */ else { char onestr[PART_OFF], num[10], *mountpoint, *newfs; /* * We copy this into a blank-padded string so that it looks like * a solid bar in reverse-video */ memset(onestr, ' ', PART_OFF - 1); onestr[PART_OFF - 1] = '\0'; /* Go for two columns */ if (prow == (CHUNK_PART_START_ROW + CHUNK_COLUMN_MAX)) { pcol = PART_OFF; prow = CHUNK_PART_START_ROW; } memcpy(onestr + PART_PART_COL, label_chunk_info[i].c->name, strlen(label_chunk_info[i].c->name)); /* If it's a filesystem, display the mountpoint */ if (label_chunk_info[i].c->private && (label_chunk_info[i].type == PART_FILESYSTEM || label_chunk_info[i].type == PART_FAT)) mountpoint = ((PartInfo *)label_chunk_info[i].c->private)->mountpoint; else mountpoint = ""; /* Now display the newfs field */ if (label_chunk_info[i].type == PART_FAT) newfs = "DOS"; else if (label_chunk_info[i].c->private && label_chunk_info[i].type == PART_FILESYSTEM) newfs = ((PartInfo *)label_chunk_info[i].c->private)->newfs ? "UFS Y" : "UFS N"; else if (label_chunk_info[i].type == PART_SWAP) newfs = "SWAP"; else newfs = "*"; for (j = 0; j < MAX_MOUNT_NAME && mountpoint[j]; j++) onestr[PART_MOUNT_COL + j] = mountpoint[j]; snprintf(num, 10, "%4ldMB", label_chunk_info[i].c->size ? label_chunk_info[i].c->size / ONE_MEG : 0); memcpy(onestr + PART_SIZE_COL, num, strlen(num)); memcpy(onestr + PART_NEWFS_COL, newfs, strlen(newfs)); onestr[PART_NEWFS_COL + strlen(newfs)] = '\0'; mvaddstr(prow, pcol, onestr); ++prow; } if (i == here) attrset(A_NORMAL); } } static void print_command_summary() { mvprintw(17, 0, "The following commands are valid here (upper or lower case):"); mvprintw(18, 0, "C = Create D = Delete M = Mount W = Write"); mvprintw(19, 0, "N = Newfs Opts T = Newfs Toggle U = Undo Q = Finish"); mvprintw(20, 0, "A = Auto Defaults for all!"); mvprintw(22, 0, "The default target will be displayed in "); attrset(A_REVERSE); addstr("reverse"); attrset(A_NORMAL); addstr(" video."); mvprintw(23, 0, "Use F1 or ? to get more help, arrow keys to move."); move(0, 0); } int diskLabelEditor(char *str) { int sz, key = 0; Boolean labeling; char *msg = NULL; PartInfo *p, *oldp; PartType type; Device **devs; labeling = TRUE; keypad(stdscr, TRUE); record_label_chunks(); if (!getenv(DISK_PARTITIONED)) { msgConfirm("You need to partition your disk(s) before you can assign disk labels."); return 0; } dialog_clear(); clear(); while (labeling) { clear(); print_label_chunks(); print_command_summary(); if (msg) { attrset(A_REVERSE); mvprintw(23, 0, msg); attrset(A_NORMAL); beep(); msg = NULL; } refresh(); key = toupper(getch()); switch (key) { int i, cnt; case '\014': /* ^L */ continue; case KEY_UP: case '-': if (here != 0) --here; else while (label_chunk_info[here + 1].c) ++here; break; case KEY_DOWN: case '+': case '\r': case '\n': if (label_chunk_info[here + 1].c) ++here; else here = 0; break; case KEY_HOME: here = 0; break; case KEY_END: while (label_chunk_info[here + 1].c) ++here; break; case KEY_F(1): case '?': - systemDisplayFile("partition.hlp"); + systemDisplayFile("partition"); break; case 'A': if (label_chunk_info[here].type != PART_SLICE) { msg = "You can only do this in a master partition (see top of screen)"; break; } cnt = i = 0; while (label_chunk_info[i].c) if (label_chunk_info[i++].type != PART_SLICE) cnt++; if (cnt == (CHUNK_COLUMN_MAX * 2) + 4) { msgConfirm("Sorry, I can't fit any more partitions on the screen! You can get around\nthis limitation by partitioning your disks individually rather than all\nat once. This will be fixed just as soon as we get a scrolling partition\nbox written. Sorry for the inconvenience!"); break; } sz = space_free(label_chunk_info[here].c); if (sz <= FS_MIN_SIZE) { msg = "Not enough space to create additional FreeBSD partition"; break; } { struct chunk *tmp; int mib[2]; int physmem; size_t size; tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk, label_chunk_info[here].c, 32 * ONE_MEG, part, FS_BSDFFS, CHUNK_IS_ROOT); if (!tmp) { msgConfirm("Unable to create the root partition. Too big?"); break; } tmp->private = new_part("/", TRUE, tmp->size); tmp->private_free = safe_free; record_label_chunks(); mib[0] = CTL_HW; mib[1] = HW_PHYSMEM; size = sizeof physmem; sysctl(mib, 2, &physmem, &size, (void *)0, (size_t)0); tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk, label_chunk_info[here].c, physmem * 2 / 512, part, FS_SWAP, 0); if (!tmp) { msgConfirm("Unable to create the swap partition. Too big?"); break; } tmp->private = 0; tmp->private_free = safe_free; record_label_chunks(); tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk, label_chunk_info[here].c, 16 * ONE_MEG, part, FS_BSDFFS, 0); if (!tmp) { msgConfirm("Unable to create the /var partition. Too big?"); break; } tmp->private = new_part("/var", TRUE, tmp->size); tmp->private_free = safe_free; record_label_chunks(); sz = space_free(label_chunk_info[here].c); tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk, label_chunk_info[here].c, sz, part, FS_BSDFFS, 0); if (!tmp) { msgConfirm("Unable to create the /usr partition. Too big?"); break; } tmp->private = new_part("/usr", TRUE, tmp->size); tmp->private_free = safe_free; record_label_chunks(); } break; case 'C': if (label_chunk_info[here].type != PART_SLICE) { msg = "You can only do this in a master partition (see top of screen)"; break; } else { int i, cnt; cnt = i = 0; while (label_chunk_info[i].c) if (label_chunk_info[i++].type != PART_SLICE) cnt++; if (cnt == (CHUNK_COLUMN_MAX * 2)) { msgConfirm("Sorry, I can't fit any more partitions on the screen! You can get around\nthis limitation by partitioning your disks individually rather than all\nat once. This will be fixed just as soon as we get a scrolling partition\nbox written. Sorry for the inconvenience!"); break; } } sz = space_free(label_chunk_info[here].c); if (sz <= FS_MIN_SIZE) { msg = "Not enough space to create additional FreeBSD partition"; break; } { char *val, *cp; int size; struct chunk *tmp; char osize[80]; u_long flags = 0; sprintf(osize, "%d", sz); val = msgGetInput(osize, "Please specify the size for new FreeBSD partition in blocks, or\nappend a trailing `M' for megabytes (e.g. 20M) or `C' for cylinders.\n\nSpace free is %d blocks (%dMB)", sz, sz / ONE_MEG); if (!val || (size = strtol(val, &cp, 0)) <= 0) break; if (*cp) { if (toupper(*cp) == 'M') size *= ONE_MEG; else if (toupper(*cp) == 'C') size *= (label_chunk_info[here].c->disk->bios_hd * label_chunk_info[here].c->disk->bios_sect); } if (size <= FS_MIN_SIZE) { msgConfirm("The minimum filesystem size is %dMB", FS_MIN_SIZE / ONE_MEG); break; } type = get_partition_type(); if (type == PART_NONE) break; if (type == PART_FILESYSTEM) { if ((p = get_mountpoint(NULL)) == NULL) break; else if (!strcmp(p->mountpoint, "/")) flags |= CHUNK_IS_ROOT; else flags &= ~CHUNK_IS_ROOT; } else p = NULL; if ((flags & CHUNK_IS_ROOT)) { if (!(label_chunk_info[here].c->flags & CHUNK_BSD_COMPAT)) { msgConfirm("This region cannot be used for your root partition as\nthe FreeBSD boot code cannot deal with a root partition created in\nsuch a location. Please choose another location for your root\npartition and try again!"); break; } if (size < ROOT_MIN_SIZE) msgConfirm("Warning: This is smaller than the recommended size for a\nroot partition. For a variety of reasons, root\npartitions should usually be at least %dMB in size", ROOT_MIN_SIZE / ONE_MEG); } tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk, label_chunk_info[here].c, size, part, (type == PART_SWAP) ? FS_SWAP : FS_BSDFFS, flags); if (!tmp) { msgConfirm("Unable to create the partition. Too big?"); break; } if ((flags & CHUNK_IS_ROOT) && (tmp->flags & CHUNK_PAST_1024)) { msgConfirm("This region cannot be used for your root partition as it starts\nor extends past the 1024'th cylinder mark and is thus a\npoor location to boot from. Please choose another\nlocation for your root partition and try again!"); Delete_Chunk(label_chunk_info[here].c->disk, tmp); break; } if (type != PART_SWAP) { /* This is needed to tell the newfs -u about the size */ tmp->private = new_part(p->mountpoint, p->newfs, tmp->size); tmp->private_free = safe_free; safe_free(p); } else { tmp->private = p; } tmp->private_free = safe_free; record_label_chunks(); } break; case 'D': /* delete */ if (label_chunk_info[here].type == PART_SLICE) { msg = MSG_NOT_APPLICABLE; break; } else if (label_chunk_info[here].type == PART_FAT) { msg = "Use the Disk Partition Editor to delete DOS partitions"; break; } Delete_Chunk(label_chunk_info[here].c->disk, label_chunk_info[here].c); record_label_chunks(); break; case 'M': /* mount */ switch(label_chunk_info[here].type) { case PART_SLICE: msg = MSG_NOT_APPLICABLE; break; case PART_SWAP: msg = "You don't need to specify a mountpoint for a swap partition."; break; case PART_FAT: case PART_FILESYSTEM: oldp = label_chunk_info[here].c->private; p = get_mountpoint(label_chunk_info[here].c); if (p) { if (!oldp) p->newfs = FALSE; if (label_chunk_info[here].type == PART_FAT && (!strcmp(p->mountpoint, "/") || !strcmp(p->mountpoint, "/usr") || !strcmp(p->mountpoint, "/var"))) { msgConfirm("%s is an invalid mount point for a DOS partition!", p->mountpoint); strcpy(p->mountpoint, "/bogus"); } } record_label_chunks(); break; default: msgFatal("Bogus partition under cursor???"); break; } break; case 'N': /* Set newfs options */ if (label_chunk_info[here].c->private && ((PartInfo *)label_chunk_info[here].c->private)->newfs) getNewfsCmd(label_chunk_info[here].c->private); else msg = MSG_NOT_APPLICABLE; break; case 'T': /* Toggle newfs state */ if (label_chunk_info[here].type == PART_FILESYSTEM) { PartInfo *pi = ((PartInfo *)label_chunk_info[here].c->private); label_chunk_info[here].c->private = new_part(pi ? pi->mountpoint : NULL, pi ? !pi->newfs : TRUE, label_chunk_info[here].c->size); safe_free(pi); label_chunk_info[here].c->private_free = safe_free; } else msg = MSG_NOT_APPLICABLE; break; case 'U': devs = deviceFind(NULL, DEVICE_TYPE_DISK); for (i = 0; devs[i]; i++) { if (!devs[i]->enabled) continue; else { char *cp = devs[i]->name; Free_Disk(devs[i]->private); devs[i]->private = Open_Disk(cp); } } record_label_chunks(); break; case 'W': if (!msgYesNo("Are you sure that you wish to make and mount all filesystems\nat this time? You also have the option of doing it later in\none final 'commit' operation, and if you're at all unsure as\nto which option to chose, then chose No.")) diskLabelCommit(NULL); break; case '|': if (!msgYesNo("Are you sure you want to go into Wizard mode?\n\nThis is an entirely undocumented feature which you are not\nexpected to understand!")) { int i; Device **devs; dialog_clear(); end_dialog(); DialogActive = FALSE; devs = deviceFind(NULL, DEVICE_TYPE_DISK); if (!devs) { msgConfirm("Can't find any disk devicse!"); break; } for (i = 0; devs[i] && ((Disk *)devs[i]->private); i++) { if (devs[i]->enabled) slice_wizard(((Disk *)devs[i]->private)); } DialogActive = TRUE; dialog_clear(); record_label_chunks(); } else msg = "A most prudent choice!"; break; case 'Q': labeling = FALSE; break; default: beep(); msg = "Type F1 or ? for help"; break; } } variable_set2(DISK_LABELLED, "yes"); dialog_clear(); return 0; } int diskLabelCommit(char *str) { if (!getenv(DISK_LABELLED)) msgConfirm("You must assign disk labels before this option can be used."); else if (!installFilesystems()) msgConfirm("Failed to make/mount all filesystems. Please correct\nwhatever went wrong and try again."); return 0; } Index: stable/2.1/release/sysinstall/menus.c =================================================================== --- stable/2.1/release/sysinstall/menus.c (revision 10968) +++ stable/2.1/release/sysinstall/menus.c (revision 10969) @@ -1,916 +1,916 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: menus.c,v 1.42.2.4 1995/09/18 17:00:22 peter Exp $ + * $Id: menus.c,v 1.42.2.5 1995/09/22 23:22:22 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer, * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by Jordan Hubbard * for the FreeBSD Project. * 4. The name of Jordan Hubbard or the FreeBSD project may not be used to * endorse or promote products derived from this software without specific * prior written permission. * * THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * */ #include "sysinstall.h" /* All the system menus go here. * * Hardcoded things like version number strings will disappear from * these menus just as soon as I add the code for doing inline variable * expansion. */ /* The initial installation menu */ DMenu MenuInitial = { DMENU_NORMAL_TYPE, "Welcome to FreeBSD RELEASE_NAME!", /* title */ "This is the main menu of the FreeBSD installation system. Please\n\ select one of the options below by using the arrow keys or typing the\n\ first character of the option name you're interested in. Invoke an\n\ option by pressing [ENTER].", /* prompt */ "Press F1 for usage instructions", /* help line */ - "usage.hlp", /* help file */ + "usage", /* help file */ { { "Usage", "Quick start - How to use this menu system.", /* U */ - DMENU_DISPLAY_FILE, "usage.hlp", 0, 0 }, + DMENU_DISPLAY_FILE, "usage", 0, 0 }, { "Doc", "More detailed documentation on FreeBSD.", /* D */ DMENU_SUBMENU, &MenuDocumentation, 0, 0 }, { "Options", "Select various options for this utility.", /* O */ DMENU_SUBMENU, &MenuOptions, 0, 0 }, { "Custom", "Begin a custom installation", /* C */ DMENU_SUBMENU, &MenuInstallCustom, 0, 0 }, { "Express", "Begin a quick installation", /* E */ DMENU_CALL, &installExpress, 0, 0 }, { "Shell", "Go to a shell for debugging or repair", DMENU_SYSTEM_COMMAND, "/stand/sh", 0, 0 }, { "Quit", "Exit this menu (and the installation)", /* Q */ DMENU_CANCEL, NULL, 0, 0 }, { NULL } }, }; /* The main documentation menu */ DMenu MenuDocumentation = { DMENU_NORMAL_TYPE, "Documentation for FreeBSD RELEASE_NAME", /* Title */ "If you are at all unsure about the configuration of your hardware\n\ or are looking to build a system specifically for FreeBSD, read the\n\ Hardware guide! New users should also read the Install document for\n\ a step-by-step tutorial on installing FreeBSD. For general information,\n\ consult the README file.", "Confused? Press F1 for help.", - "usage.hlp", + "usage", { { "README", "Read this for a general description of FreeBSD", DMENU_DISPLAY_FILE, "README", 0, 0 }, { "Hardware", "The FreeBSD survival guide for PC hardware.", - DMENU_DISPLAY_FILE, "hardware.hlp", 0, 0 }, + DMENU_DISPLAY_FILE, "hardware", 0, 0 }, { "Install", "A step-by-step guide to installing FreeBSD.", - DMENU_DISPLAY_FILE, "install.hlp", 0, 0 }, + DMENU_DISPLAY_FILE, "install", 0, 0 }, { "Copyright", "The FreeBSD Copyright notices.", DMENU_DISPLAY_FILE, "COPYRIGHT", 0, 0 }, { "Release", "The release notes for this version of FreeBSD.", DMENU_DISPLAY_FILE, "RELNOTES", 0, 0 }, { "Exit", "Exit this menu (returning to previous)", DMENU_CANCEL, NULL, 0, 0 }, { NULL } }, }; DMenu MenuMediaCDROM = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Choose a CDROM type", "FreeBSD can be installed directly from a CDROM containing a valid\n\ FreeBSD RELEASE_NAME distribution. If you are seeing this menu it is because\n\ more than one CDROM drive was found on your system. Please select one\n\ of the following CDROM drives as your installation drive.", "Press F1 to read the installation guide", - "install.hlp", + "install", { { NULL } }, }; DMenu MenuMediaFloppy = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Choose a Floppy drive", "You have more than one floppy drive. Please chose the drive\n\ you would like to use for this operation", NULL, NULL, { { NULL } }, }; DMenu MenuMediaDOS = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Choose a DOS partition", "FreeBSD can be installed directly from a DOS partition\n\ assuming, of course, that you have copied the relevant\n\ distributions into your DOS partition before starting this\n\ installation. If this is not the case then you should reboot\n\ DOS at this time and copy the distributions you wish to install\n\ into a \"FREEBSD\" subdirectory on one of your DOS partitions.\n\ Otherwise, please select the DOS partition containing the FreeBSD\n\ distribution files.", "Press F1 to read the installation guide", - "install.hlp", + "install", { { NULL } }, }; DMenu MenuMediaFTP = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Please specify an FTP site", "FreeBSD is distributed from a number of sites on the Internet. Please\n\ select the site closest to you or \"other\" if you'd like to specify another\n\ choice. Also note that not all sites carry every possible distribution!\n\ Distributions other than the basic user set are only guaranteed to be\n\ available from the Primary site.\n\n\ If the first site selected doesn't respond, try one of the alternates.\n\ You may also wish to investigate the options menu in case of trouble.\n\ To specify a URL not in this list, chose \"other\".", "Select a site that's close!", - "install.hlp", + "install", { { "Primary Site", "ftp.freebsd.org", DMENU_SET_VARIABLE, "ftp=ftp://ftp.freebsd.org/pub/FreeBSD/RELEASE_NAME", 0, 0 }, { "Secondary Site", "freefall.cdrom.com", DMENU_SET_VARIABLE, "ftp=ftp://freefall.cdrom.com/pub/FreeBSD/RELEASE_NAME", 0, 0 }, { "Other", "Specify some other ftp site by URL", DMENU_SET_VARIABLE, "ftp=other", 0, 0 }, { "Australia", "ftp.physics.usyd.edu.au", DMENU_SET_VARIABLE, "ftp=ftp://ftp.physics.usyd.edu.au/FreeBSD/RELEASE_NAME", 0, 0 }, { "Finland", "nic.funet.fi", DMENU_SET_VARIABLE, "ftp=ftp://nic.funet.fi/pub/unix/FreeBSD/RELEASE_NAME", 0, 0 }, { "France", "ftp.ibp.fr", DMENU_SET_VARIABLE, "ftp=ftp://ftp.ibp.fr/pub/FreeBSD/RELEASE_NAME", 0, 0 }, { "Germany", "ftp.fb9dv.uni-duisburg.de", DMENU_SET_VARIABLE, "ftp=ftp://ftp.fb9dv.uni-duisburg.de/pub/unix/FreeBSD/RELEASE_NAME", 0, 0 }, { "Germany #2", "gil.physik.rwth-aachen.de", DMENU_SET_VARIABLE, "ftp=ftp://gil.physik.rwth-aachen.de/pub/FreeBSD/RELEASE_NAME", 0, 0 }, { "Germany #3", "ftp.uni-paderborn.de", DMENU_SET_VARIABLE, "ftp=ftp://ftp.uni-paderborn.de/freebsd/RELEASE_NAME", 0, 0 }, { "Hong Kong", "ftp.hk.super.net", DMENU_SET_VARIABLE, "ftp=ftp://ftp.hk.super.net/pub/FreeBSD/RELEASE_NAME", 0, 0 }, { "Israel", "orgchem.weizmann.ac.il", DMENU_SET_VARIABLE, "ftp=ftp://orgchem.weizmann.ac.il/pub/FreeBSD-RELEASE_NAME", 0, 0 }, { "Japan", "ftp.sra.co.jp", DMENU_SET_VARIABLE, "ftp=ftp://ftp.sra.co.jp/pub/os/FreeBSD/RELEASE_NAME", 0, 0 }, { "Japan #2", "ftp.mei.co.jp", DMENU_SET_VARIABLE, "ftp=ftp://ftp.mei.co.jp/free/PC-UNIX/FreeBSD/RELEASE_NAME", 0, 0 }, { "Japan #3", "ftp.waseda.ac.jp", DMENU_SET_VARIABLE, "ftp=ftp://ftp.waseda.ac.jp/pub/FreeBSD/RELEASE_NAME", 0, 0 }, { "Japan #4", "ftp.pu-toyama.ac.jp", DMENU_SET_VARIABLE, "ftp=ftp://ftp.pu-toyama.ac.jp/pub/FreeBSD/RELEASE_NAME", 0, 0 }, { "Japan #5", "ftpsv1.u-aizu.ac.jp", DMENU_SET_VARIABLE, "ftp=ftp://ftpsv1.u-aizu.ac.jp/pub/os/FreeBSD/RELEASE_NAME", 0, 0 }, { "Japan #6", "ftp.tut.ac.jp", DMENU_SET_VARIABLE, "ftp://ftp.tut.ac.jp/FreeBSD/RELEASE_NAME", 0, 0 }, { "Japan #7", "ftp.ee.uec.ac.jp", DMENU_SET_VARIABLE, "ftp=ftp://ftp.ee.uec.ac.jp/pub/os/mirror/ftp.freebsd.org/RELEASE_NAME", 0, 0 }, { "Japan #8", "ftp.tokyonet.ad.jp", DMENU_SET_VARIABLE, "ftp://ftp.tokyonet.ad.jp/pub/FreeBSD/RELEASE_NAME", 0, 0 }, { "Korea", "ftp.cau.ac.kr", DMENU_SET_VARIABLE, "ftp=ftp://ftp.cau.ac.kr/pub/FreeBSD/RELEASE_NAME", 0, 0 }, { "Netherlands", "ftp.nl.net", DMENU_SET_VARIABLE, "ftp=ftp://ftp.nl.net/pub/os/FreeBSD/RELEASE_NAME", 0, 0 }, { "Russia", "ftp.kiae.su", DMENU_SET_VARIABLE, "ftp=ftp://ftp.kiae.su/FreeBSD/RELEASE_NAME", 0, 0 }, { "Sweden", "ftp.luth.se", DMENU_SET_VARIABLE, "ftp=ftp://ftp.luth.se/pub/FreeBSD/RELEASE_NAME", 0, 0 }, { "Taiwan", "netbsd.csie.nctu.edu.tw", DMENU_SET_VARIABLE, "ftp=ftp://netbsd.csie.nctu.edu.tw/pub/FreeBSD/RELEASE_NAME", 0, 0 }, { "Thailand", "ftp.nectec.or.th", DMENU_SET_VARIABLE, "ftp=ftp://ftp.nectec.or.th/pub/FreeBSD/RELEASE_NAME", 0, 0 }, { "UK", "ftp.demon.co.uk", DMENU_SET_VARIABLE, "ftp=ftp://ftp.demon.co.uk/pub/BSD/FreeBSD/RELEASE_NAME", 0, 0 }, { "UK #2", "src.doc.ic.ac.uk", DMENU_SET_VARIABLE, "ftp=ftp://src.doc.ic.ac.uk/packages/unix/FreeBSD/RELEASE_NAME", 0, 0 }, { "UK #3", "unix.hensa.ac.uk", DMENU_SET_VARIABLE, "ftp=ftp://unix.hensa.ac.uk/mirrors/walnut.creek/FreeBSD/RELEASE_NAME", 0, 0 }, { "USA", "ref.tfs.com", DMENU_SET_VARIABLE, "ftp=ftp://ref.tfs.com/pub/FreeBSD/RELEASE_NAME", 0, 0 }, { "USA #2", "ftp.dataplex.net", DMENU_SET_VARIABLE, "ftp=ftp://ftp.dataplex.net/pub/FreeBSD/RELEASE_NAME", 0, 0 }, { "USA #3", "kryten.atinc.com", DMENU_SET_VARIABLE, "ftp=ftp://kryten.atinc.com/pub/FreeBSD/RELEASE_NAME", 0, 0 }, { "USA #4", "ftp.neosoft.com", DMENU_SET_VARIABLE, "ftp=ftp://ftp.neosoft.com/systems/FreeBSD/RELEASE_NAME", 0, 0 }, { NULL } } }; DMenu MenuMediaTape = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Choose a tape drive type", "FreeBSD can be installed from tape drive, though this installation\n\ method requires a certain amount of temporary storage in addition\n\ to the space required by the distribution itself (tape drives make\n\ poor random-access devices, so we extract _everything_ on the tape\n\ in one pass). If you have sufficient space for this, then you should\n\ select one of the following tape devices detected on your system.", "Press F1 to read the installation guide", - "install.hlp", + "install", { { NULL } }, }; DMenu MenuNetworkDevice = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Choose a network interface type", "FreeBSD can be installed directly over a network, using NFS or FTP.\n If you are using PPP over a serial device (cuaa0 or cuaa1) as opposed\n\ to a direct ethernet connection, then you may first need to dial your\n\ service provider using the ppp utility we provide for that purpose.\n\ You can also install over a parallel port using a special \"laplink\"\n\ cable, though this only works if you have another FreeBSD machine running\n\ a fairly recent (2.0R or later) release to talk to.\n\n\ To use PPP select one of the serial devices, otherwise select lp0 for\n\ the parallel port or one of the ethernet controllers (if you have one)\n\ for an ethernet installation.", "Press F1 to read network configuration manual", - "network_device.hlp", + "network_device", { { NULL } }, }; /* The media selection menu */ DMenu MenuMedia = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Choose Installation Media", "FreeBSD can be installed from a variety of different installation\n\ media, ranging from floppies to the Internet. If you're installing\n\ FreeBSD from a supported CDROM drive then this is generally the best\n\ media to use, unless you have some overriding reason for using another\n\ media.", "Press F1 for more information on the various media types", - "media.hlp", + "media", { { "CDROM", "Install from a FreeBSD CDROM", DMENU_CALL, mediaSetCDROM, 0, 0 }, { "DOS", "Install from a DOS partition", DMENU_CALL, mediaSetDOS, 0, 0 }, { "File System", "Install from a mounted filesystem", DMENU_CALL, mediaSetUFS, 0, 0 }, { "Floppy", "Install from a floppy disk set", DMENU_CALL, mediaSetFloppy, 0, 0 }, { "FTP Active", "Install from an FTP server in active mode", DMENU_CALL, mediaSetFTPActive, 0, 0 }, { "FTP Passive", "Install from an FTP server in passive mode", DMENU_CALL, mediaSetFTPPassive, 0, 0 }, { "NFS", "Install over NFS", DMENU_CALL, mediaSetNFS, 0, 0 }, { "Tape", "Install from SCSI or QIC tape", DMENU_CALL, mediaSetTape, 0, 0 }, { NULL } }, }; /* The installation type menu */ DMenu MenuInstallType = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Choose Installation Type", "As a convenience, we provide several \"canned\" installation types.\n\ These select what we consider to be the most reasonable defaults for the\n\ type of system in question. If you would prefer to pick and choose\n\ the list of distributions yourself, simply select \"custom\".", "Press F1 for more information on these options.", - "distributions.hlp", + "distributions", { { "Developer", "Full sources, binaries and doc but no games [171MB]", DMENU_CALL, distSetDeveloper, 0, 0 }, { "X-Developer", "Same as above, but includes XFree86 [196MB]", DMENU_CALL, distSetXDeveloper, 0, 0 }, { "Kern-Developer", "Full binaries and doc, kernel sources only [35MB]", DMENU_CALL, distSetKernDeveloper, 0, 0 }, { "User", "Average user - binaries and doc but no sources [19MB]", DMENU_CALL, distSetUser, 0, 0 }, { "X-User", "Same as above, but includes XFree86 [45MB]", DMENU_CALL, distSetXUser, 0, 0 }, { "Minimal", "The smallest configuration possible [15MB]", DMENU_CALL, distSetMinimum, 0, 0 }, - { "Everything", "All sources, binaries and XFree86 binaries [203MB]", + { "Everything", "All sources, binaries and XFree86 binaries [700MB]", DMENU_CALL, distSetEverything, 0, 0 }, { "Custom", "Specify your own distribution set [?]", DMENU_SUBMENU, &MenuDistributions, 0, 0 }, { "Clear", "Reset selected distribution list to None", DMENU_CALL, distReset, 0, 0 }, { NULL } }, }; static char * DESFlagCheck(DMenuItem *item) { return (Dists & DIST_DES) ? "ON" : "OFF"; } static char * srcFlagCheck(DMenuItem *item) { return (Dists & DIST_SRC) ? "ON" : "OFF"; } static char * x11FlagCheck(DMenuItem *item) { return (Dists & DIST_XF86) ? "ON" : "OFF"; } DMenu MenuDistributions = { DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS, "Select the distributions you wish to install.", "Please check off the distributions you wish to install. At the\n\ very minimum, this should be \"bin\". WARNING: Do not export the\n\ DES distribution out of the U.S.! It is for U.S. customers only.", NULL, NULL, { { "bin", "Binary base distribution (required) [36MB]", DMENU_SET_FLAG, &Dists, DIST_BIN, 0, dmenuFlagCheck }, { "commercial", "Commercial demos and shareware [10MB]", DMENU_SET_FLAG, &Dists, DIST_COMMERCIAL, 0, dmenuFlagCheck }, { "compat1x", "FreeBSD 1.x binary compatibility package [2MB]", DMENU_SET_FLAG, &Dists, DIST_COMPAT1X, 0, dmenuFlagCheck }, { "compat20", "FreeBSD 2.0 binary compatibility package [2MB]", DMENU_SET_FLAG, &Dists, DIST_COMPAT20, 0, dmenuFlagCheck }, { "DES", "DES encryption code - NOT FOR EXPORT! [.3MB]", DMENU_CALL, distSetDES, 0, 0, DESFlagCheck }, { "dict", "Spelling checker dictionary files [4.2MB]", DMENU_SET_FLAG, &Dists, DIST_DICT, 0, dmenuFlagCheck }, { "games", "Games (non-commercial) [6.4MB]", DMENU_SET_FLAG, &Dists, DIST_GAMES, 0, dmenuFlagCheck }, { "info", "GNU info files [4.1MB]", DMENU_SET_FLAG, &Dists, DIST_INFO, 0, dmenuFlagCheck }, { "man", "System manual pages - recommended [3.3MB]", DMENU_SET_FLAG, &Dists, DIST_MANPAGES, 0, dmenuFlagCheck }, { "proflibs", "Profiled versions of the libraries [3.3MB]", DMENU_SET_FLAG, &Dists, DIST_PROFLIBS, 0, dmenuFlagCheck }, { "src", "Sources for everything but DES [120MB]", DMENU_CALL, distSetSrc, 0, 0, srcFlagCheck }, { "XFree86", "The XFree86 3.1.1u1 distribution [?]", DMENU_CALL, distSetXF86, 0, 0, x11FlagCheck }, { "Experimental", "Work in progress!", DMENU_SET_FLAG, &Dists, DIST_EXPERIMENTAL, 0, dmenuFlagCheck }, { NULL } }, }; DMenu MenuDESDistributions = { DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS, "Select the encryption facilities you wish to install.", "Please check off any special DES-based encryption distributions\n\ you would like to install. Please note that these services are NOT FOR\n\ EXPORT from the United States, nor are they available on CDROM (for the\n\ same reason). For information on non-U.S. FTP distributions of this\n\ software, please consult the release notes.", NULL, NULL, { { "des", "Basic DES services (rlogin, init, etc) [1MB]", DMENU_SET_FLAG, &DESDists, DIST_DES_DES, 0, dmenuFlagCheck }, { "krb", "Kerberos encryption services [2MB]", DMENU_SET_FLAG, &DESDists, DIST_DES_KERBEROS, 0, dmenuFlagCheck }, { "sebones", "Sources for eBones (Kerberos) [1MB]", DMENU_SET_FLAG, &DESDists, DIST_DES_SEBONES, 0, dmenuFlagCheck }, { "ssecure", "Sources for DES libs and utilities [1MB]", DMENU_SET_FLAG, &DESDists, DIST_DES_SSECURE, 0, dmenuFlagCheck }, { NULL } }, }; DMenu MenuSrcDistributions = { DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS, "Select the sub-components of src you wish to install.", "Please check off those portions of the FreeBSD source tree\n\ you wish to install.", NULL, NULL, { { "base", "top-level files in /usr/src [300K]", DMENU_SET_FLAG, &SrcDists, DIST_SRC_BASE, 0, dmenuFlagCheck }, { "gnu", "/usr/src/gnu (software from the GNU Project) [42MB]", DMENU_SET_FLAG, &SrcDists, DIST_SRC_GNU, 0, dmenuFlagCheck }, { "etc", "/usr/src/etc (miscellaneous system files) [460K]", DMENU_SET_FLAG, &SrcDists, DIST_SRC_ETC, 0, dmenuFlagCheck }, { "games", "/usr/src/games (diversions) [7.8MB]", DMENU_SET_FLAG, &SrcDists, DIST_SRC_GAMES, 0, dmenuFlagCheck }, { "include", "/usr/src/include (header files) [467K]", DMENU_SET_FLAG, &SrcDists, DIST_SRC_INCLUDE, 0, dmenuFlagCheck }, { "lib", "/usr/src/lib (system libraries) [9.2MB]", DMENU_SET_FLAG, &SrcDists, DIST_SRC_LIB, 0, dmenuFlagCheck }, { "libexec", "/usr/src/libexec (system programs) [1.2MB]", DMENU_SET_FLAG, &SrcDists, DIST_SRC_LIBEXEC, 0, dmenuFlagCheck }, { "lkm", "/usr/src/lkm (Loadable Kernel Modules) [193K]", DMENU_SET_FLAG, &SrcDists, DIST_SRC_LKM, 0, dmenuFlagCheck }, { "release", "/usr/src/release (release-generation tools) [533K]", DMENU_SET_FLAG, &SrcDists, DIST_SRC_RELEASE, 0, dmenuFlagCheck }, { "bin", "/usr/src/bin (system binaries) [2.5MB]", DMENU_SET_FLAG, &SrcDists, DIST_SRC_BIN, 0, dmenuFlagCheck }, { "sbin", "/usr/src/sbin (system binaries) [1.3MB]", DMENU_SET_FLAG, &SrcDists, DIST_SRC_SBIN, 0, dmenuFlagCheck }, { "share", "/usr/src/share (documents and shared files) [10MB]", DMENU_SET_FLAG, &SrcDists, DIST_SRC_SHARE, 0, dmenuFlagCheck }, { "sys", "/usr/src/sys (FreeBSD kernel) [13MB]", DMENU_SET_FLAG, &SrcDists, DIST_SRC_SYS, 0, dmenuFlagCheck }, { "ubin", "/usr/src/usr.bin (user binaries) [13MB]", DMENU_SET_FLAG, &SrcDists, DIST_SRC_UBIN, 0, dmenuFlagCheck }, { "usbin", "/usr/src/usr.sbin (aux system binaries) [14MB]", DMENU_SET_FLAG, &SrcDists, DIST_SRC_USBIN, 0, dmenuFlagCheck }, { NULL } }, }; static int clearx11(char *str) { XF86Dists = 0; XF86ServerDists = 0; XF86FontDists = 0; Dists &= ~DIST_XF86; return 0; } DMenu MenuXF86Select = { DMENU_NORMAL_TYPE, "XFree86 3.1.1u1 Distribution", "Please select the components you need from the XFree86 3.1.1u1\n\ distribution. We recommend that you select what you need from the basic\n\ components set and at least one entry from the Server and Font set menus.", "Press F1 to read the XFree86 release notes for FreeBSD", - "XF86.hlp", + "XF86", { { "Basic", "Basic component menu (required)", DMENU_SUBMENU, &MenuXF86SelectCore, 0, 0 }, { "Server", "X server menu", DMENU_SUBMENU, &MenuXF86SelectServer, 0, 0 }, { "Fonts", "Font set menu", DMENU_SUBMENU, &MenuXF86SelectFonts, 0, 0 }, { "Clear", "Reset XFree86 distribution list", DMENU_CALL, clearx11, 0, 0, 0 }, { "Exit", "Exit this menu (returning to previous)", DMENU_CANCEL, NULL, 0, 0 }, { NULL } }, }; DMenu MenuXF86SelectCore = { DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS, "XFree86 3.1.1 base distribution types", "Please check off the basic XFree86 components you wish to install.", "Press F1 to read the XFree86 release notes for FreeBSD", - "XF86.hlp", + "XF86", { { "bin", "X client applications and shared libs [4MB].", DMENU_SET_FLAG, &XF86Dists, DIST_XF86_BIN, 0, dmenuFlagCheck }, { "lib", "Data files needed at runtime [600K]", DMENU_SET_FLAG, &XF86Dists, DIST_XF86_LIB, 0, dmenuFlagCheck }, { "xicf", "Customizable xinit runtime configuration file [100K]", DMENU_SET_FLAG, &XF86Dists, DIST_XF86_XINIT, 0, dmenuFlagCheck }, { "xdcf", "Customizable xdm runtime configuration file [100K]", DMENU_SET_FLAG, &XF86Dists, DIST_XF86_XDMCF, 0, dmenuFlagCheck }, { "doc", "READMEs and XFree86 specific man pages [500K]", DMENU_SET_FLAG, &XF86Dists, DIST_XF86_DOC, 0, dmenuFlagCheck }, { "man", "Man pages (except XFree86 specific ones) [1.2MB]", DMENU_SET_FLAG, &XF86Dists, DIST_XF86_MAN, 0, dmenuFlagCheck }, { "prog", "Programmer's header and library files [4MB]", DMENU_SET_FLAG, &XF86Dists, DIST_XF86_PROG, 0, dmenuFlagCheck }, { "link", "X Server reconfiguration kit [7.8MB]", DMENU_SET_FLAG, &XF86Dists, DIST_XF86_LINK, 0, dmenuFlagCheck }, { "pex", "PEX fonts and libs needed by PEX apps [500K]", DMENU_SET_FLAG, &XF86Dists, DIST_XF86_PEX, 0, dmenuFlagCheck }, { "sources", "XFree86 3.1.1u1 standard + contrib sources [200MB]", DMENU_SET_FLAG, &XF86Dists, DIST_XF86_SRC, 0, dmenuFlagCheck }, { NULL } }, }; DMenu MenuXF86SelectFonts = { DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS, "Font distribution selection.", "Please check off the individual font distributions you wish to\n\ install. At the minimum, you should install the standard\n\ 75 DPI and misc fonts if you're also installing a server\n\ (these are selected by default).", "Press F1 to read the XFree86 release notes for FreeBSD", - "XF86.hlp", + "XF86", { { "fnts", "Standard 75 DPI and miscellaneous fonts [3.6MB]", DMENU_SET_FLAG, &XF86FontDists, DIST_XF86_FONTS_MISC, 0, dmenuFlagCheck }, { "f100", "100 DPI fonts [1.8MB]", DMENU_SET_FLAG, &XF86FontDists, DIST_XF86_FONTS_100, 0, dmenuFlagCheck }, { "fscl", "Speedo and Type scalable fonts [1.6MB]", DMENU_SET_FLAG, &XF86FontDists, DIST_XF86_FONTS_SCALE, 0, dmenuFlagCheck }, { "non", "Japanese, Chinese and other non-english fonts [3.3MB]", DMENU_SET_FLAG, &XF86FontDists, DIST_XF86_FONTS_NON, 0, dmenuFlagCheck }, { "server", "Font server [0.3MB]", DMENU_SET_FLAG, &XF86FontDists, DIST_XF86_FONTS_SERVER, 0, dmenuFlagCheck }, { NULL } }, }; DMenu MenuXF86SelectServer = { DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS, "X Server selection.", "Please check off the types of X servers you wish to install.\n\ If you are unsure as to which server will work for your graphics card,\n\ it is recommended that try the SVGA or VGA16 servers (the VGA16 and\n\ Mono servers are particularly well-suited to most LCD displays).", "Press F1 to read the XFree86 release notes for FreeBSD", - "XF86.hlp", + "XF86", { { "SVGA", "Standard VGA or Super VGA display [1MB]", DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_SVGA, 0, dmenuFlagCheck }, { "VGA16", "Standard 16 color VGA display [1MB]", DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_VGA16, 0, dmenuFlagCheck }, { "Mono", "Standard Monochrome display [1MB]", DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_MONO, 0, dmenuFlagCheck }, { "8514", "8-bit (256 color) IBM 8514 or compatible card [1MB]", DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_8514, 0, dmenuFlagCheck }, { "AGX", "8-bit AGX card [1MB]", DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_AGX, 0, dmenuFlagCheck }, { "Ma8", "8-bit ATI Mach8 card [1MB]", DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_MACH8, 0, dmenuFlagCheck }, { "Ma32", "8 and 16-bit (65K color) for ATI Mach32 card [1MB]", DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_MACH32, 0, dmenuFlagCheck }, { "Ma64", "8 and 16-bit (65K color) for ATI Mach64 card [1MB]", DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_MACH64, 0, dmenuFlagCheck }, { "P9K", "8, 16, and 24-bit color for Weitek P9000 based boards [1MB]", DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_P9000, 0, dmenuFlagCheck }, { "S3", "8, 16 and 24-bit color for S3 based boards [1MB]", DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_S3, 0, dmenuFlagCheck }, { "W32", "8-bit Color for ET4000/W32, /W32i and /W32p cards [1MB]", DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_W32, 0, dmenuFlagCheck }, { "nest", "A nested server for testing purposes [1MB]", DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_NEST, 0, dmenuFlagCheck }, { NULL } }, }; DMenu MenuDiskDevices = { DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS, "Select Drive(s)", "Please select the drive, or drives, on which you wish to install\n\ FreeBSD. You need to select at least one drive containing some free\n\ space, though FreeBSD can be installed across several drives if you do\n\ not have the required space on a single drive. If you wish to boot\n\ off a drive that's not a `zero drive', or have multiple operating\n\ systems on your machine, you will have the option to install a boot\n\ manager later. To select a drive, use the arrow keys to move to it\n\ and press [SPACE].", "Press F1 for important information regarding geometry!", - "drives.hlp", + "drives", { { NULL } }, }; /* Local work func for MenuOptions */ static int clearFlags(char *str) { OptFlags = 0; return 1; /* Gross, but forces menu rebuild */ } static char * userPassCheck(DMenuItem *item) { char *cp = getenv(FTP_USER); return (cp && *cp) ? "ON" : "OFF"; } static char * ftpFlagCheck(DMenuItem *item) { /* Verify that everything's sane */ if ((OptFlags & (OPT_FTP_ABORT + OPT_FTP_RESELECT)) == (OPT_FTP_ABORT + OPT_FTP_RESELECT)) OptFlags &= ~OPT_FTP_RESELECT; if (!(OptFlags & (OPT_FTP_ABORT + OPT_FTP_RESELECT))) OptFlags |= OPT_FTP_ABORT; if (*((unsigned int *)item->ptr) & item->parm) return "ON"; return "OFF"; } /* The installation options menu */ DMenu MenuOptions = { DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS, "Choose Installation Options", "The following options control how this utility will deal\n\ with various possible error conditions and how verbose it will\n\ be at various stages.", "Press F1 for more help on these options", - "options.hlp", + "options", { { "FTP Options", "Set FTP specific options", DMENU_SUBMENU, &MenuFTPOptions, 0, 0, 0 }, { "NFS Secure", "NFS server talks only on a secure port", DMENU_SET_FLAG, &OptFlags, OPT_NFS_SECURE, 0, dmenuFlagCheck }, { "NFS Slow", "User is using a slow PC or ethernet card", DMENU_SET_FLAG, &OptFlags, OPT_SLOW_ETHER, 0, dmenuFlagCheck }, { "Debugging", "Turn on the extra debugging flag", DMENU_SET_FLAG, &OptFlags, OPT_DEBUG, 0, dmenuFlagCheck }, { "Yes To All", "Assume \"Yes\" answers to all non-critical dialogs", DMENU_SET_FLAG, &OptFlags, OPT_NO_CONFIRM, 0, dmenuFlagCheck }, { "Clear", "Clear All Option Flags", DMENU_CALL, clearFlags, 0, 0 }, { "Exit", "Exit this menu (returning to previous)", DMENU_CANCEL, NULL, 0, 0 }, { NULL } }, }; DMenu MenuFTPOptions = { DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS, "Choose FTP Options", "This menu allows you to customize the behavior of FTP transfers\n\ for an FTP installation. To select \"Active\" or \"Passive\" mode\n\ FTP, see the Media menu.", NULL, NULL, { { "FTP Abort", "On transfer failure, abort", DMENU_SET_FLAG, &OptFlags, OPT_FTP_ABORT, 0, ftpFlagCheck }, { "FTP Reselect", "On transfer failure, ask for another host", DMENU_SET_FLAG, &OptFlags, OPT_FTP_RESELECT, 0, ftpFlagCheck }, { "FTP userpass", "Specify username and password instead of anonymous", DMENU_CALL, mediaSetFtpUserPass, 0, 0, userPassCheck }, { NULL } }, }; /* The main installation menu */ DMenu MenuInstallCustom = { DMENU_NORMAL_TYPE, "Choose Custom Installation Options", "This is the custom installation menu. You may use this menu to specify\n\ details on the type of distribution you wish to have, where you wish\n\ to install it from and how you wish to allocate disk storage to FreeBSD.", "Press F1 to read the installation guide", - "install.hlp", + "install", { { "Partition", "Allocate disk space for FreeBSD", DMENU_CALL, diskPartitionEditor, 0, 0 }, { "Label", "Label allocated disk partitions", DMENU_CALL, diskLabelEditor, 0, 0 }, { "Distributions", "Choose the type of installation you want", DMENU_SUBMENU, &MenuInstallType, 0, 0 }, { "Media", "Choose the installation media type", DMENU_SUBMENU, &MenuMedia, 0, 0 }, { "Extract", "Extract distributions from selected media", DMENU_CALL, distExtractAll, 0, 0 }, { "Options", "Go to Options submenu", DMENU_SUBMENU, &MenuOptions, 0, 0 }, { "Commit", "Do Write/Make/Extract options in one step", DMENU_CALL, installCommit, 0, 0 }, { "Configure", "Do post-install configuration of FreeBSD", DMENU_SUBMENU, &MenuConfigure, 0, 0 }, { "Exit", "Exit this menu (returning to previous)", DMENU_CANCEL, NULL, 0, 0 }, { NULL } }, }; /* MBR type menu */ DMenu MenuMBRType = { DMENU_RADIO_TYPE | DMENU_SELECTION_RETURNS, "Chose boot manager type", /* title */ "FreeBSD comes with a boot selector that allows you to easily\n\ select between FreeBSD and other operating systems on your machine\n\ at boot time. If you have more than one drive and wish to boot\n\ from other than the first, the boot selector will also allow you\n\ to do so (limitations in the PC BIOS usually prevent this otherwise).\n\ If you do not want a boot selector, or wish to replace an existing\n\ one, select \"standard\". If you would prefer your Master Boot\n\ Record to remain untouched, then select \"none\".", "Press F1 to read the installation guide", - "install.hlp", + "install", { { "BootMgr", "Install the FreeBSD Boot Manager (\"Booteasy\")", DMENU_SET_VALUE, &BootMgr, 0, 0, dmenuRadioCheck }, { "Standard", "Use a standard MBR (no boot manager)", DMENU_SET_VALUE, &BootMgr, 1, 0, dmenuRadioCheck }, { "None", "Leave the Master Boot Record untouched", DMENU_SET_VALUE, &BootMgr, 2, 0, dmenuRadioCheck }, { NULL } }, }; /* Final configuration menu */ DMenu MenuConfigure = { DMENU_NORMAL_TYPE, "FreeBSD Configuration Menu", /* title */ "If you've already installed FreeBSD, you may use this menu to\n\ customize it somewhat to suit your particular configuration. Most\n\ importantly, you can use the Packages utility to load extra \"3rd party\"\n\ software not provided in the base distributions.", "Press F1 for more information on these options", - "configure.hlp", + "configure", { { "Add User", "Add users to the system", DMENU_SYSTEM_COMMAND, "adduser -silent", 0, 0 }, { "Console", "Customize system console behavior", DMENU_SUBMENU, &MenuSyscons, 0, 0 }, { "Networking", "Configure additional network services", DMENU_SUBMENU, &MenuNetworking, 0, 0 }, { "Time Zone", "Set which time zone you're in", DMENU_SYSTEM_COMMAND, "rm -f /etc/wall_cmos_clock /etc/localtime; tzsetup", 0, 0 }, { "Packages", "Install extra FreeBSD packaged software", DMENU_CALL, configPackages, 0, 0 }, { "Ports", "Enable the FreeBSD Ports Collection from CD", DMENU_CALL, configPorts, 0, 1 }, { "Root Password", "Set the system manager's password", DMENU_SYSTEM_COMMAND, "passwd root", 0, 0 }, { "XFree86", "Configure XFree86 (if installed)", DMENU_SYSTEM_COMMAND, "/usr/X11R6/bin/xf86config", 0, 0 }, { "Exit", "Exit this menu (returning to previous)", DMENU_CANCEL, NULL, 0, 0 }, { NULL } }, }; static char * menuCheckNTP(DMenuItem *item) { return getenv("ntpdate") ? "ON" : "OFF"; } static char * menuCheckRouted(DMenuItem *item) { return getenv("routedflags") ? "ON" : "OFF"; } DMenu MenuNetworking = { DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS, "Network Services Menu", "You may have already configured one network device (and the\n\ other various hostname/gateway/name server parameters) in the process\n\ of installing FreeBSD. This menu allows you to configure other\n\ aspects of your system's network configuration.", NULL, NULL, { { "NFS client", "This machine will be an NFS client", DMENU_SET_VARIABLE, "nfs_client=YES", 0, 0, dmenuVarCheck }, { "NFS server", "This machine will be an NFS server", DMENU_SET_VARIABLE, "nfs_server=YES", 0, 0, dmenuVarCheck }, { "Interfaces", "Configure network interfaces", DMENU_CALL, tcpMenuSelect, 0, 0 }, { "ntpdate", "Select a clock-syncronization server", DMENU_SUBMENU, &MenuNTP, 0, 0, menuCheckNTP }, { "routed", "Set flags for routed (default: -q)", DMENU_CALL, configRoutedFlags, 0, 0, menuCheckRouted }, { "rwhod", "This machine wants to run the rwho daemon", DMENU_SET_VARIABLE, "rwhod=YES", 0, 0, dmenuVarCheck }, { "Exit", "Exit this menu (returning to previous)", DMENU_CANCEL, NULL, 0, 0 }, { NULL } }, }; DMenu MenuNTP = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "NTPDATE Server Selection", "There are a number of time syncronization servers available\n\ for public use around the Internet. Please select one reasonably\n\ close to you to have your system time syncronized accordingly.", "These are the primary open-access NTP servers", NULL, { { "Other", "Select a site not on this list", DMENU_CALL, configNTP, 0, 0 }, { "Australia", "ntp.syd.dms.csiro.au (HP 5061 Cesium Beam)", DMENU_SET_VARIABLE, "ntpdate=ntp.syd.dms.csiro.au", 0, 0 }, { "Canada", "tick.usask.ca (GOES clock)", DMENU_SET_VARIABLE, "ntpdate=tick.usask.ca", 0, 0 }, { "France", "canon.inria.fr (TDF clock)", DMENU_SET_VARIABLE, "ntpdate=canon.inria.fr", 0, 0 }, { "Germany", "ntps1-{0,1,2}.uni-erlangen.de (GPS)", DMENU_SET_VARIABLE, "ntpdate=ntps1-0.uni-erlangen.de", 0, 0 }, { "Germany #2", "ntps1-0.cs.tu-berlin.de (GPS)", DMENU_SET_VARIABLE, "ntpdate=ntps1-0.cs.tu-berlin.de", 0, 0 }, { "Japan", "clock.nc.fukuoka-u.ac.jp (GPS clock)", DMENU_SET_VARIABLE, "ntpdate=clock.nc.fukuoka-u.ac.jp", 0, 0}, { "Japan #2", "clock.tl.fukuoka-u.ac.jp (GPS clock)", DMENU_SET_VARIABLE, "ntpdate=clock.tl.fukuoka-u.ac.jp", 0, 0}, { "Netherlands", "ntp0.nl.net (GPS clock)", DMENU_SET_VARIABLE, "ntpdate=ntp0.nl.net", 0, 0 }, { "Norway", "timer.unik.no (NTP clock)", DMENU_SET_VARIABLE, "ntpdate=timer.unik.no", 0, 0 }, { "Sweden", "Time1.Stupi.SE (Cesium/GPS)", DMENU_SET_VARIABLE, "ntpdate=Time1.Stupi.SE", 0, 0 }, { "Switzerland", "swisstime.ethz.ch (DCF77 clock)", DMENU_SET_VARIABLE, "ntpdate=swisstime.ethz.ch", 0, 0 }, { "U.S. East Coast", "bitsy.mit.edu (WWV clock)", DMENU_SET_VARIABLE, "ntpdate=bitsy.mit.edu", 0, 0 }, { "U.S. East Coast #2", "otc1.psu.edu (WWV clock)", DMENU_SET_VARIABLE, "ntpdate=otc1.psu.edu", 0, 0 }, { "U.S. West Coast", "apple.com (WWV clock)", DMENU_SET_VARIABLE, "ntpdate=apple.com", 0, 0 }, { "U.S. West Coast #2", "clepsydra.dec.com (GOES clock)", DMENU_SET_VARIABLE, "ntpdate=clepsydra.dec.com", 0, 0 }, { "U.S. West Coast #3", "clock.llnl.gov (WWVB clock)", DMENU_SET_VARIABLE, "ntpdate=clock.llnl.gov", 0, 0 }, { "U.S. Midwest", "ncar.ucar.edu (WWVB clock)", DMENU_SET_VARIABLE, "ntpdate=ncar.ucar.edu", 0, 0 }, { "U.S. Pacific", "chantry.hawaii.net (WWV/H clock)", DMENU_SET_VARIABLE, "ntpdate=chantry.hawaii.net", 0, 0 }, { "U.S. Southwest", "shorty.chpc.utexas.edu (WWV clock)", DMENU_SET_VARIABLE, "ntpdate=shorty.chpc.utexas.edu", 0, 0 }, { NULL } }, }; DMenu MenuSyscons = { DMENU_NORMAL_TYPE, "System Console Configuration", "The default system console driver for FreeBSD (syscons) has a\n\ number of configuration options which may be set according to\n\ your preference.\n\n\ When you are done setting configuration options, select Cancel.", "Configure your system console settings", NULL, { { "Keymap", "Choose an alternate keyboard map", DMENU_SUBMENU, &MenuSysconsKeymap, 0, 0 }, { "Repeat", "Set the rate at which keys repeat", DMENU_SUBMENU, &MenuSysconsKeyrate, 0, 0 }, { "Saver", "Configure the screen saver", DMENU_SUBMENU, &MenuSysconsSaver, 0, 0 }, { "Exit", "Exit this menu (returning to previous)", DMENU_CANCEL, NULL, 0, 0 }, { NULL } }, }; DMenu MenuSysconsKeymap = { DMENU_RADIO_TYPE | DMENU_SELECTION_RETURNS, "System Console Keymap", "The default system console driver for FreeBSD (syscons) defaults\n\ to a standard \"American\" keyboard map. Users in other countries\n\ (or with different keyboard preferences) may wish to choose one of\n\ the other keymaps below.", "Choose a keyboard map", NULL, { { "Danish CP865", "Danish Code Page 865 keymap", DMENU_SET_VARIABLE, "keymap=danish.cp865", 0, 0, dmenuVarCheck }, { "Danish ISO", "Danish ISO keymap", DMENU_SET_VARIABLE, "keymap=danish.iso", 0, 0, dmenuVarCheck }, { "French ISO", "French ISO keymap", DMENU_SET_VARIABLE, "keymap=fr.iso", 0, 0, dmenuVarCheck }, { "German CP850", "German Code Page 850 keymap", DMENU_SET_VARIABLE, "keymap=german.cp850", 0, 0, dmenuVarCheck }, { "German ISO", "German ISO keymap", DMENU_SET_VARIABLE, "keymap=german.iso", 0, 0, dmenuVarCheck }, { "Russian CP866", "Russian Code Page 866 keymap", DMENU_SET_VARIABLE, "keymap=ru.cp866", 0, 0, dmenuVarCheck }, { "Russian KOI8", "Russian koi8 keymap", DMENU_SET_VARIABLE, "keymap=ru.koi8-r", 0, 0, dmenuVarCheck }, { "Russian s-KOI8", "Russian shifted koi8 keymap", DMENU_SET_VARIABLE, "keymap=ru.koi8-r.shift", 0, 0, dmenuVarCheck }, { "Swedish CP850", "Swedish Code Page 850 keymap", DMENU_SET_VARIABLE, "keymap=swedish.cp850", 0, 0, dmenuVarCheck }, { "Swedish ISO", "Swedish ISO keymap", DMENU_SET_VARIABLE, "keymap=swedish.iso", 0, 0, dmenuVarCheck }, { "U.K. CP850", "United Kingdom Code Page 850 keymap", DMENU_SET_VARIABLE, "keymap=uk.cp850", 0, 0, dmenuVarCheck }, { "U.K. ISO", "United Kingdom ISO keymap", DMENU_SET_VARIABLE, "keymap=uk.iso", 0, 0, dmenuVarCheck }, { "U.S. ISO", "United States ISO keymap", DMENU_SET_VARIABLE, "keymap=us.iso", 0, 0, dmenuVarCheck }, { NULL } }, }; DMenu MenuSysconsKeyrate = { DMENU_RADIO_TYPE | DMENU_SELECTION_RETURNS, "System Console Keyboard Repeat Rate", "This menu allows you to set the speed at which keys repeat\n\ when held down.", "Choose a keyboard repeat rate", NULL, { { "Slow", "Slow keyboard repeat rate", DMENU_SET_VARIABLE, "keyrate=slow", 0, 0, dmenuVarCheck }, { "Normal", "\"Normal\" keyboard repeat rate", DMENU_SET_VARIABLE, "keyrate=normal", 0, 0, dmenuVarCheck }, { "Fast", "Fast keyboard repeat rate", DMENU_SET_VARIABLE, "keyrate=fast", 0, 0, dmenuVarCheck }, { "Default", "Use default keyboard repeat rate", DMENU_SET_VARIABLE, "keyrate=NO", 0, 0, dmenuVarCheck }, { NULL } }, }; static char * menuSaverTimeoutCheck(DMenuItem *item) { return getenv("blanktime") ? "ON" : "OFF"; } DMenu MenuSysconsSaver = { DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS, "System Console Screen Saver", "By default, the console driver will not attempt to do anything\n\ special with your screen when it's idle. If you expect to leave your\n\ monitor switched on and idle for long periods of time then you should\n\ probably enable one of these screen savers to prevent phosphor burn-in.", "Choose a nifty-looking screen saver", NULL, { { "blank", "Simply blank the screen", DMENU_SET_VARIABLE, "saver=blank", 0, 0, dmenuVarCheck }, { "Green", "\"Green\" power saving mode (if supported by monitor)", DMENU_SET_VARIABLE, "saver=green", 0, 0, dmenuVarCheck }, { "Snake", "Draw a FreeBSD \"snake\" on your screen", DMENU_SET_VARIABLE, "saver=snake", 0, 0, dmenuVarCheck }, { "Star", "A \"twinkling stars\" effect", DMENU_SET_VARIABLE, "saver=star", 0, 0, dmenuVarCheck }, { "Timeout", "Set the screen saver timeout interval", DMENU_CALL, configSaverTimeout, 0, 0, menuSaverTimeoutCheck }, { "Exit", "Exit this menu (returning to previous)", DMENU_CANCEL, NULL, 0, 0 }, { NULL } }, };