Index: head/usr.sbin/sade/disks.c =================================================================== --- head/usr.sbin/sade/disks.c (revision 104939) +++ head/usr.sbin/sade/disks.c (revision 104940) @@ -1,964 +1,964 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * * $FreeBSD$ * * 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. * * 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 #include enum size_units_t { UNIT_BLOCKS, UNIT_KILO, UNIT_MEG, UNIT_SIZE }; #ifdef PC98 #define SUBTYPE_FREEBSD 50324 #define SUBTYPE_FAT 37218 #else #define SUBTYPE_FREEBSD 165 #define SUBTYPE_FAT 6 #endif /* 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[16]; static int current_chunk; static void diskPartitionNonInteractive(Device *dev); static u_char * bootalloc(char *name, size_t *size); static void record_chunks(Disk *d) { struct chunk *c1 = NULL; int i = 0; int last_free = 0; if (!d->chunks) msgFatal("No chunk list found for %s!", d->name); for (c1 = d->chunks->part; c1; c1 = c1->next) { if (c1->type == unused && c1->size > last_free) { last_free = c1->size; current_chunk = i; } chunk_info[i++] = c1; } chunk_info[i] = NULL; if (current_chunk >= i) current_chunk = i - 1; } static int Total; static void print_chunks(Disk *d, int u) { int row; int i; int sz; char *szstr; szstr = (u == UNIT_MEG ? "MB" : (u == UNIT_KILO ? "KB" : "ST")); for (i = Total = 0; chunk_info[i]; i++) Total += chunk_info[i]->size; #ifndef PC98 if (d->bios_cyl > 65536 || d->bios_hd > 256 || d->bios_sect >= 64) { dialog_clear_norefresh(); msgConfirm("WARNING: A geometry of %lu/%lu/%lu for %s is incorrect. Using\n" "a more likely geometry. If this geometry is incorrect or you\n" "are unsure as to whether or not it's correct, please consult\n" "the Hardware Guide in the Documentation submenu or use the\n" "(G)eometry command to change it now.\n\n" "Remember: you need to enter whatever your BIOS thinks the\n" "geometry is! For IDE, it's what you were told in the BIOS\n" "setup. For SCSI, it's the translation mode your controller is\n" "using. Do NOT use a ``physical geometry''.", d->bios_cyl, d->bios_hd, d->bios_sect, d->name); Sanitize_Bios_Geom(d); } #endif 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, "DISK Geometry:\t%lu cyls/%lu heads/%lu sectors = %lu sectors (%luMB)", d->bios_cyl, d->bios_hd, d->bios_sect, d->bios_cyl * d->bios_hd * d->bios_sect, d->bios_cyl * d->bios_hd * d->bios_sect / (1024/512) / 1024); mvprintw(3, 0, "%6s %10s(%s) %10s %8s %6s %10s %8s %8s", "Offset", "Size", szstr, "End", "Name", "PType", "Desc", "Subtype", "Flags"); for (i = 0, row = CHUNK_START_ROW; chunk_info[i]; i++, row++) { switch(u) { default: /* fall thru */ case UNIT_BLOCKS: sz = chunk_info[i]->size; break; case UNIT_KILO: sz = chunk_info[i]->size / (1024/512); break; case UNIT_MEG: sz = chunk_info[i]->size / (1024/512) / 1024; break; } if (i == current_chunk) attrset(ATTR_SELECTED); mvprintw(row, 0, "%10ld %10lu %10lu %8s %6d %10s %8d\t%-6s", chunk_info[i]->offset, sz, chunk_info[i]->end, chunk_info[i]->name, chunk_info[i]->type, slice_type_name(chunk_info[i]->type, chunk_info[i]->subtype), 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 G = set Drive Geometry C = Create Slice F = `DD' mode"); mvprintw(17, 0, "D = Delete Slice Z = Toggle Size Units S = Set Bootable | = Wizard m."); mvprintw(18, 0, "T = Change Type U = Undo All Changes Q = Finish"); if (!RunningAsInit) mvprintw(18, 47, "W = Write Changes"); mvprintw(21, 0, "Use F1 or ? to get more help, arrow keys to select."); move(0, 0); } #ifdef PC98 static void getBootMgr(char *dname, u_char **bootipl, size_t *bootipl_size, u_char **bootmenu, size_t *bootmenu_size) { static u_char *boot0; static size_t boot0_size; static u_char *boot05; static size_t boot05_size; char str[80]; char *cp; int i = 0; cp = variable_get(VAR_BOOTMGR); if (!cp) { /* Figure out what kind of MBR the user wants */ sprintf(str, "Install Boot Manager for drive %s?", dname); MenuMBRType.title = str; i = dmenuOpenSimple(&MenuMBRType, FALSE); } else { if (!strncmp(cp, "boot", 4)) BootMgr = 0; else BootMgr = 2; } if (cp || i) { switch (BootMgr) { case 0: if (!boot0) boot0 = bootalloc("boot0", &boot0_size); *bootipl = boot0; *bootipl_size = boot0_size; if (!boot05) boot05 = bootalloc("boot0.5", &boot05_size); *bootmenu = boot05; *bootmenu_size = boot05_size; return; case 2: default: break; } } *bootipl = NULL; *bootipl_size = 0; *bootmenu = NULL; *bootmenu_size = 0; } #else static void getBootMgr(char *dname, u_char **bootCode, size_t *bootCodeSize) { #ifdef __i386__ /* only meaningful on x86 */ static u_char *mbr, *boot0; static size_t mbr_size, boot0_size; char str[80]; char *cp; int i = 0; cp = variable_get(VAR_BOOTMGR); if (!cp) { /* Figure out what kind of MBR the user wants */ sprintf(str, "Install Boot Manager for drive %s?", dname); MenuMBRType.title = str; i = dmenuOpenSimple(&MenuMBRType, FALSE); } else { if (!strncmp(cp, "boot", 4)) BootMgr = 0; else if (!strcmp(cp, "standard")) BootMgr = 1; else BootMgr = 2; } if (cp || i) { switch (BootMgr) { case 0: if (!boot0) boot0 = bootalloc("boot0", &boot0_size); *bootCode = boot0; *bootCodeSize = boot0_size; return; case 1: if (!mbr) mbr = bootalloc("mbr", &mbr_size); *bootCode = mbr; *bootCodeSize = mbr_size; return; case 2: default: break; } } #endif *bootCode = NULL; *bootCodeSize = 0; } #endif int diskGetSelectCount(Device ***devs) { int i, cnt, enabled; char *cp; Device **dp; cp = variable_get(VAR_DISK); dp = *devs = deviceFind(cp, DEVICE_TYPE_DISK); cnt = deviceCount(dp); if (!cnt) return -1; for (i = 0, enabled = 0; i < cnt; i++) { if (dp[i]->enabled) ++enabled; } return enabled; } void diskPartition(Device *dev) { char *cp, *p; int rv, key = 0; Boolean chunking; char *msg = NULL; #ifdef PC98 u_char *bootipl; size_t bootipl_size; u_char *bootmenu; size_t bootmenu_size; #else u_char *mbrContents; size_t mbrSize; #endif WINDOW *w = savescr(); Disk *d = (Disk *)dev->private; int size_unit; size_unit = UNIT_BLOCKS; chunking = TRUE; keypad(stdscr, TRUE); /* Flush both the dialog and curses library views of the screen since we don't always know who called us */ dialog_clear_norefresh(), clear(); current_chunk = 0; /* Set up the chunk array */ record_chunks(d); while (chunking) { char *val, geometry[80]; /* Now print our overall state */ if (d) print_chunks(d, size_unit); print_command_summary(); if (msg) { attrset(title_attr); mvprintw(23, 0, msg); attrset(A_NORMAL); beep(); msg = NULL; } else { move(23, 0); clrtoeol(); } /* Get command character */ key = getch(); switch (toupper(key)) { case '\014': /* ^L (redraw) */ clear(); msg = NULL; break; case '\020': /* ^P */ case KEY_UP: case '-': if (current_chunk != 0) --current_chunk; break; case '\016': /* ^N */ 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 '?': systemDisplayHelp("slice"); clear(); break; case 'A': case 'F': /* Undocumented magic Dangerously Dedicated mode */ -#ifdef __alpha__ +#if defined(__alpha__) || defined(__sparc64__) rv = 1; #else /* The rest is only relevant on x86 */ cp = variable_get(VAR_DEDICATE_DISK); if (cp && !strcasecmp(cp, "always")) rv = 1; else if (toupper(key) == 'A') rv = 0; else { rv = msgYesNo("Do you want to do this with a true partition entry\n" "so as to remain cooperative with any future possible\n" "operating systems on the drive(s)?\n" "(See also the section about ``dangerously dedicated''\n" "disks in the FreeBSD FAQ.)"); if (rv == -1) rv = 0; } #endif All_FreeBSD(d, rv); variable_set2(DISK_PARTITIONED, "yes", 0); record_chunks(d); clear(); break; case 'C': if (chunk_info[current_chunk]->type != unused) msg = "Slice in use, delete it first or move to an unused one."; else { char *val, tmp[20], *cp; int size; #ifdef PC98 char name[16]; snprintf(name, 16, "%s", "FreeBSD"); val = msgGetInput(name, "Please specify the name for new FreeBSD slice."); if (val) strncpy(name, val, 16); #else int subtype; chunk_e partitiontype; #endif snprintf(tmp, 20, "%lu", chunk_info[current_chunk]->size); val = msgGetInput(tmp, "Please specify the size for new FreeBSD slice in blocks\n" "or append a trailing `M' for megabytes (e.g. 20M)."); if (val && (size = strtol(val, &cp, 0)) > 0) { if (*cp && toupper(*cp) == 'M') size *= ONE_MEG; else if (*cp && toupper(*cp) == 'G') size *= ONE_GIG; #ifdef PC98 Create_Chunk(d, chunk_info[current_chunk]->offset, size, freebsd, 3, (chunk_info[current_chunk]->flags & CHUNK_ALIGN), name); variable_set2(DISK_PARTITIONED, "yes", 0); record_chunks(d); #else sprintf(tmp, "%d", SUBTYPE_FREEBSD); val = msgGetInput(tmp, "Enter type of partition to create:\n\n" "Pressing Enter will choose the default, a native FreeBSD\n" "slice (type 165). You can choose other types, 6 for a\n" "DOS partition or 131 for a Linux partition, for example.\n\n" "Note: If you choose a non-FreeBSD partition type, it will not\n" "be formatted or otherwise prepared, it will simply reserve space\n" "for you to use another tool, such as DOS FORMAT, to later format\n" "and use the partition."); if (val && (subtype = strtol(val, NULL, 0)) > 0) { if (subtype == SUBTYPE_FREEBSD) partitiontype = freebsd; else if (subtype == SUBTYPE_FAT) partitiontype = fat; else partitiontype = unknown; -#ifdef __alpha__ +#if defined(__alpha__) || defined(__sparc64__) if (partitiontype == freebsd && size == chunk_info[current_chunk]->size) All_FreeBSD(d, 1); else #endif Create_Chunk(d, chunk_info[current_chunk]->offset, size, partitiontype, subtype, (chunk_info[current_chunk]->flags & CHUNK_ALIGN)); variable_set2(DISK_PARTITIONED, "yes", 0); record_chunks(d); } #endif /* PC98 */ } clear(); } break; case KEY_DC: case 'D': if (chunk_info[current_chunk]->type == unused) msg = "Slice is already unused!"; else { Delete_Chunk(d, chunk_info[current_chunk]); variable_set2(DISK_PARTITIONED, "yes", 0); record_chunks(d); } break; case 'T': if (chunk_info[current_chunk]->type == unused) msg = "Slice is currently unused (use create instead)"; else { char *val, tmp[20]; int subtype; chunk_e partitiontype; sprintf(tmp, "%d", SUBTYPE_FREEBSD); #ifdef PC98 val = msgGetInput(tmp, "New partition type:\n\n" "Pressing Enter will choose the default, a native FreeBSD\n" "slice (type 50324). Other popular values are 37218 for\n" "DOS FAT partition.\n\n" "Note: If you choose a non-FreeBSD partition type, it will not\n" "be formatted or otherwise prepared, it will simply reserve space\n" "for you to use another tool, such as DOS format, to later format\n" "and actually use the partition."); #else val = msgGetInput(tmp, "New partition type:\n\n" "Pressing Enter will choose the default, a native FreeBSD\n" "slice (type 165). Other popular values are 6 for\n" "DOS FAT partition, 131 for a Linux ext2fs partition or\n" "130 for a Linux swap partition.\n\n" "Note: If you choose a non-FreeBSD partition type, it will not\n" "be formatted or otherwise prepared, it will simply reserve space\n" "for you to use another tool, such as DOS format, to later format\n" "and actually use the partition."); #endif /* PC98 */ if (val && (subtype = strtol(val, NULL, 0)) > 0) { if (subtype == SUBTYPE_FREEBSD) partitiontype = freebsd; else if (subtype == SUBTYPE_FAT) partitiontype = fat; else partitiontype = unknown; chunk_info[current_chunk]->type = partitiontype; chunk_info[current_chunk]->subtype = subtype; } } break; case 'G': 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.\n" "Don't forget to use the two slash (/) separator characters!\n" "It's not possible to parse the field without them."); if (val) { long nc, nh, ns; nc = strtol(val, &val, 0); nh = strtol(val + 1, &val, 0); ns = strtol(val + 1, 0, 0); Set_Bios_Geom(d, nc, nh, ns); } clear(); break; case 'S': /* Set Bootable */ chunk_info[current_chunk]->flags |= CHUNK_ACTIVE; break; case 'U': if (!variable_cmp(DISK_LABELLED, "written")) { msgConfirm("You've already written this information out - you\n" "can't undo it."); } else if (!msgNoYes("Are you SURE you want to Undo everything?")) { char cp[BUFSIZ]; sstrncpy(cp, d->name, sizeof cp); Free_Disk(dev->private); d = Open_Disk(cp); if (!d) msgConfirm("Can't reopen disk %s! Internal state is probably corrupted", cp); dev->private = d; variable_unset(DISK_PARTITIONED); variable_unset(DISK_LABELLED); if (d) record_chunks(d); } clear(); break; case 'W': if (!msgNoYes("WARNING: This should only be used when modifying an EXISTING\n" "installation. If you are installing FreeBSD for the first time\n" "then you should simply type Q when you're finished here and your\n" "changes will be committed in one batch automatically at the end of\n" "these questions. If you're adding a disk, you should NOT write\n" "from this screen, you should do it from the label editor.\n\n" "Are you absolutely sure you want to do this now?")) { variable_set2(DISK_PARTITIONED, "yes", 0); /* * 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. */ /* * Don't offer to update the MBR on this disk if the first * "real" chunk looks like a FreeBSD "all disk" partition, * or the disk is entirely FreeBSD. */ #ifdef PC98 if ((d->chunks->part->type != freebsd) || (d->chunks->part->offset > 1)) getBootMgr(d->name, &bootipl, &bootipl_size, &bootmenu, &bootmenu_size); else { bootipl = NULL; bootipl_size = 0; bootmenu = NULL; bootmenu_size = 0; } Set_Boot_Mgr(d, bootipl, bootipl_size, bootmenu, bootmenu_size); #else if ((d->chunks->part->type != freebsd) || (d->chunks->part->offset > 1)) getBootMgr(d->name, &mbrContents, &mbrSize); else { mbrContents = NULL; mbrSize = 0; } Set_Boot_Mgr(d, mbrContents, mbrSize); #endif if (DITEM_STATUS(diskPartitionWrite(NULL)) != DITEM_SUCCESS) msgConfirm("Disk partition write returned an error status!"); else msgConfirm("Wrote FDISK partition information out successfully."); } clear(); break; case '|': if (!msgNoYes("Are you SURE you want to go into Wizard mode?\n" "No seat belts whatsoever are provided!")) { clear(); refresh(); slice_wizard(d); variable_set2(DISK_PARTITIONED, "yes", 0); record_chunks(d); } else msg = "Wise choice!"; clear(); break; case '\033': /* ESC */ case 'Q': chunking = FALSE; /* * 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. */ /* * Don't offer to update the MBR on this disk if the first "real" * chunk looks like a FreeBSD "all disk" partition, or the disk is * entirely FreeBSD. */ if ((d->chunks->part->type != freebsd) || (d->chunks->part->offset > 1)) { if (variable_cmp(DISK_PARTITIONED, "written")) { #ifdef PC98 getBootMgr(d->name, &bootipl, &bootipl_size, &bootmenu, &bootmenu_size); if (bootipl != NULL && bootmenu != NULL) Set_Boot_Mgr(d, bootipl, bootipl_size, bootmenu, bootmenu_size); #else getBootMgr(d->name, &mbrContents, &mbrSize); if (mbrContents != NULL) Set_Boot_Mgr(d, mbrContents, mbrSize); #endif } } break; case 'Z': size_unit = (size_unit + 1) % UNIT_SIZE; break; default: beep(); msg = "Type F1 or ? for help"; break; } } p = CheckRules(d); if (p) { char buf[FILENAME_MAX]; use_helpline("Press F1 to read more about disk slices."); use_helpfile(systemHelpFile("partition", buf)); if (!variable_get(VAR_NO_WARN)) dialog_mesgbox("Disk slicing warning:", p, -1, -1); free(p); } restorescr(w); } static u_char * bootalloc(char *name, size_t *size) { char buf[FILENAME_MAX]; struct stat sb; snprintf(buf, sizeof buf, "/boot/%s", name); if (stat(buf, &sb) != -1) { int fd; fd = open(buf, O_RDONLY); if (fd != -1) { u_char *cp; cp = malloc(sb.st_size); if (read(fd, cp, sb.st_size) != sb.st_size) { free(cp); close(fd); msgDebug("bootalloc: couldn't read %ld bytes from %s\n", (long)sb.st_size, buf); return NULL; } close(fd); if (size != NULL) *size = sb.st_size; return cp; } msgDebug("bootalloc: couldn't open %s\n", buf); } else msgDebug("bootalloc: can't stat %s\n", buf); return NULL; } static int partitionHook(dialogMenuItem *selected) { Device **devs = NULL; devs = deviceFind(selected->prompt, DEVICE_TYPE_DISK); if (!devs) { msgConfirm("Unable to find disk %s!", selected->prompt); return DITEM_FAILURE; } /* Toggle enabled status? */ if (!devs[0]->enabled) { devs[0]->enabled = TRUE; diskPartition(devs[0]); } else devs[0]->enabled = FALSE; return DITEM_SUCCESS; } static int partitionCheck(dialogMenuItem *selected) { Device **devs = NULL; devs = deviceFind(selected->prompt, DEVICE_TYPE_DISK); if (!devs || devs[0]->enabled == FALSE) return FALSE; return TRUE; } int diskPartitionEditor(dialogMenuItem *self) { DMenu *menu; Device **devs; int i, cnt, devcnt; cnt = diskGetSelectCount(&devs); devcnt = deviceCount(devs); if (cnt == -1) { msgConfirm("No disks found! Please verify that your disk controller is being\n" "properly probed at boot time. See the Hardware Guide on the\n" "Documentation menu for clues on diagnosing this type of problem."); return DITEM_FAILURE; } else if (cnt) { /* Some are already selected */ for (i = 0; i < devcnt; i++) { if (devs[i]->enabled) { if (variable_get(VAR_NONINTERACTIVE) && !variable_get(VAR_DISKINTERACTIVE)) diskPartitionNonInteractive(devs[i]); else diskPartition(devs[i]); } } } else { /* No disks are selected, fall-back case now */ if (devcnt == 1) { devs[0]->enabled = TRUE; if (variable_get(VAR_NONINTERACTIVE) && !variable_get(VAR_DISKINTERACTIVE)) diskPartitionNonInteractive(devs[0]); else diskPartition(devs[0]); return DITEM_SUCCESS; } else { menu = deviceCreateMenu(&MenuDiskDevices, DEVICE_TYPE_DISK, partitionHook, partitionCheck); if (!menu) { msgConfirm("No devices suitable for installation found!\n\n" "Please verify that your disk controller (and attached drives)\n" "were detected properly. This can be done by pressing the\n" "[Scroll Lock] key and using the Arrow keys to move back to\n" "the boot messages. Press [Scroll Lock] again to return."); return DITEM_FAILURE; } else { i = dmenuOpenSimple(menu, FALSE) ? DITEM_SUCCESS : DITEM_FAILURE; free(menu); } return i; } } return DITEM_SUCCESS; } int diskPartitionWrite(dialogMenuItem *self) { Device **devs; int i; if (!variable_cmp(DISK_PARTITIONED, "written")) return DITEM_SUCCESS; devs = deviceFind(NULL, DEVICE_TYPE_DISK); if (!devs) { msgConfirm("Unable to find any disks to write to??"); return DITEM_FAILURE; } if (isDebug()) msgDebug("diskPartitionWrite: Examining %d devices\n", deviceCount(devs)); for (i = 0; devs[i]; i++) { Disk *d = (Disk *)devs[i]->private; static u_char *boot1; -#ifndef __alpha__ +#if defined(__i386__) || defined(__ia64__) static u_char *boot2; #endif if (!devs[i]->enabled) continue; -#ifdef __alpha__ +#if defined(__i386__) || defined(__ia64__) if (!boot1) boot1 = bootalloc("boot1", NULL); - Set_Boot_Blocks(d, boot1, NULL); -#else - if (!boot1) boot1 = bootalloc("boot1", NULL); if (!boot2) boot2 = bootalloc("boot2", NULL); Set_Boot_Blocks(d, boot1, boot2); +#else + if (!boot1) boot1 = bootalloc("boot1", NULL); + Set_Boot_Blocks(d, boot1, NULL); #endif msgNotify("Writing partition information to drive %s", d->name); if (!Fake && Write_Disk(d)) { msgConfirm("ERROR: Unable to write data to disk %s!", d->name); return DITEM_FAILURE; } } /* Now it's not "yes", but "written" */ variable_set2(DISK_PARTITIONED, "written", 0); return DITEM_SUCCESS | DITEM_RESTORE; } /* Partition a disk based wholly on which variables are set */ static void diskPartitionNonInteractive(Device *dev) { char *cp; int i, sz, all_disk = 0; #ifdef PC98 u_char *bootipl; size_t bootipl_size; u_char *bootmenu; size_t bootmenu_size; #else u_char *mbrContents; size_t mbrSize; #endif Disk *d = (Disk *)dev->private; record_chunks(d); cp = variable_get(VAR_GEOMETRY); if (cp) { msgDebug("Setting geometry from script to: %s\n", cp); d->bios_cyl = strtol(cp, &cp, 0); d->bios_hd = strtol(cp + 1, &cp, 0); d->bios_sect = strtol(cp + 1, 0, 0); } cp = variable_get(VAR_PARTITION); if (cp) { if (!strcmp(cp, "free")) { /* Do free disk space case */ for (i = 0; chunk_info[i]; i++) { /* If a chunk is at least 10MB in size, use it. */ if (chunk_info[i]->type == unused && chunk_info[i]->size > (10 * ONE_MEG)) { #ifdef PC98 Create_Chunk(d, chunk_info[i]->offset, chunk_info[i]->size, freebsd, 3, (chunk_info[i]->flags & CHUNK_ALIGN), "FreeBSD"); #else Create_Chunk(d, chunk_info[i]->offset, chunk_info[i]->size, freebsd, 3, (chunk_info[i]->flags & CHUNK_ALIGN)); #endif variable_set2(DISK_PARTITIONED, "yes", 0); break; } } if (!chunk_info[i]) { msgConfirm("Unable to find any free space on this disk!"); return; } } else if (!strcmp(cp, "all")) { /* Do all disk space case */ msgDebug("Warning: Devoting all of disk %s to FreeBSD.\n", d->name); All_FreeBSD(d, FALSE); } else if (!strcmp(cp, "exclusive")) { /* Do really-all-the-disk-space case */ msgDebug("Warning: Devoting all of disk %s to FreeBSD.\n", d->name); All_FreeBSD(d, all_disk = TRUE); } else if ((sz = strtol(cp, &cp, 0))) { /* Look for sz bytes free */ if (*cp && toupper(*cp) == 'M') sz *= ONE_MEG; else if (*cp && toupper(*cp) == 'G') sz *= ONE_GIG; for (i = 0; chunk_info[i]; i++) { /* If a chunk is at least sz MB, use it. */ if (chunk_info[i]->type == unused && chunk_info[i]->size >= sz) { #ifdef PC98 Create_Chunk(d, chunk_info[i]->offset, sz, freebsd, 3, (chunk_info[i]->flags & CHUNK_ALIGN), "FreeBSD"); #else Create_Chunk(d, chunk_info[i]->offset, sz, freebsd, 3, (chunk_info[i]->flags & CHUNK_ALIGN)); #endif variable_set2(DISK_PARTITIONED, "yes", 0); break; } } if (!chunk_info[i]) { msgConfirm("Unable to find %d free blocks on this disk!", sz); return; } } else if (!strcmp(cp, "existing")) { /* Do existing FreeBSD case */ for (i = 0; chunk_info[i]; i++) { if (chunk_info[i]->type == freebsd) break; } if (!chunk_info[i]) { msgConfirm("Unable to find any existing FreeBSD partitions on this disk!"); return; } } else { msgConfirm("`%s' is an invalid value for %s - is config file valid?", cp, VAR_PARTITION); return; } if (!all_disk) { #ifdef PC98 getBootMgr(d->name, &bootipl, &bootipl_size, &bootmenu, &bootmenu_size); Set_Boot_Mgr(d, bootipl, bootipl_size, bootmenu, bootmenu_size); #else getBootMgr(d->name, &mbrContents, &mbrSize); Set_Boot_Mgr(d, mbrContents, mbrSize); #endif } variable_set2(DISK_PARTITIONED, "yes", 0); } } Index: head/usr.sbin/sade/install.c =================================================================== --- head/usr.sbin/sade/install.c (revision 104939) +++ head/usr.sbin/sade/install.c (revision 104940) @@ -1,1203 +1,1203 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * * $FreeBSD$ * * 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. * * 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 #include #include #include #include #define MSDOSFS #include #include #include #undef MSDOSFS #include #include #include #include /* Hack for rsaref package add, which displays interactive license. * Used by package.c */ int _interactiveHack; int FixItMode = 0; static void create_termcap(void); static void fixit_common(void); #define TERMCAP_FILE "/usr/share/misc/termcap" static void installConfigure(void); Boolean checkLabels(Boolean whinge, Chunk **rdev, Chunk **sdev, Chunk **udev, Chunk **vdev, Chunk **tdev, Chunk **hdev) { Device **devs; Boolean status; Disk *disk; Chunk *c1, *c2, *rootdev, *swapdev, *usrdev, *vardev, *tmpdev, *homedev; int i; /* Don't allow whinging if noWarn is set */ if (variable_get(VAR_NO_WARN)) whinge = FALSE; status = TRUE; if (rdev) *rdev = NULL; if (sdev) *sdev = NULL; if (udev) *udev = NULL; if (vdev) *vdev = NULL; if (tdev) *tdev = NULL; if (hdev) *hdev = NULL; rootdev = swapdev = usrdev = vardev = tmpdev = homedev = NULL; /* We don't need to worry about root/usr/swap if we're already multiuser */ if (!RunningAsInit) return status; devs = deviceFind(NULL, DEVICE_TYPE_DISK); /* First verify that we have a root device */ for (i = 0; devs[i]; i++) { if (!devs[i]->enabled) continue; disk = (Disk *)devs[i]->private; msgDebug("Scanning disk %s for root filesystem\n", disk->name); if (!disk->chunks) msgFatal("No chunk list found for %s!", disk->name); for (c1 = disk->chunks->part; c1; c1 = c1->next) { if (c1->type == freebsd) { for (c2 = c1->part; c2; c2 = c2->next) { if (c2->type == part && c2->subtype != FS_SWAP && c2->private_data) { if (!strcmp(((PartInfo *)c2->private_data)->mountpoint, "/")) { if (rootdev) { if (whinge) msgConfirm("WARNING: You have more than one root device set?!\n" "Using the first one found."); continue; } else { rootdev = c2; if (isDebug()) msgDebug("Found rootdev at %s!\n", rootdev->name); } } else if (!strcmp(((PartInfo *)c2->private_data)->mountpoint, "/usr")) { if (usrdev) { if (whinge) msgConfirm("WARNING: You have more than one /usr filesystem.\n" "Using the first one found."); continue; } else { usrdev = c2; if (isDebug()) msgDebug("Found usrdev at %s!\n", usrdev->name); } } else if (!strcmp(((PartInfo *)c2->private_data)->mountpoint, "/var")) { if (vardev) { if (whinge) msgConfirm("WARNING: You have more than one /var filesystem.\n" "Using the first one found."); continue; } else { vardev = c2; if (isDebug()) msgDebug("Found vardev at %s!\n", vardev->name); } } else if (!strcmp(((PartInfo *)c2->private_data)->mountpoint, "/tmp")) { if (tmpdev) { if (whinge) msgConfirm("WARNING: You have more than one /tmp filesystem.\n" "Using the first one found."); continue; } else { tmpdev = c2; if (isDebug()) msgDebug("Found tmpdev at %s!\n", tmpdev->name); } } else if (!strcmp(((PartInfo *)c2->private_data)->mountpoint, "/home")) { if (homedev) { if (whinge) msgConfirm("WARNING: You have more than one /home filesystem.\n" "Using the first one found."); continue; } else { homedev = c2; if (isDebug()) msgDebug("Found homedev at %s!\n", homedev->name); } } } } } } } /* Now check for swap devices */ for (i = 0; devs[i]; i++) { if (!devs[i]->enabled) continue; disk = (Disk *)devs[i]->private; msgDebug("Scanning disk %s for swap partitions\n", disk->name); if (!disk->chunks) msgFatal("No chunk list found for %s!", disk->name); for (c1 = disk->chunks->part; c1; c1 = c1->next) { if (c1->type == freebsd) { for (c2 = c1->part; c2; c2 = c2->next) { if (c2->type == part && c2->subtype == FS_SWAP && !swapdev) { swapdev = c2; if (isDebug()) msgDebug("Found swapdev at %s!\n", swapdev->name); break; } } } } } /* Copy our values over */ if (rdev) *rdev = rootdev; if (sdev) *sdev = swapdev; if (udev) *udev = usrdev; if (vdev) *vdev = vardev; if (tdev) *tdev = tmpdev; if (hdev) *hdev = homedev; if (!rootdev && whinge) { msgConfirm("No root device found - you must label a partition as /\n" "in the label editor."); status = FALSE; } if (!swapdev && whinge) { msgConfirm("No swap devices found - you must create at least one\n" "swap partition."); status = FALSE; } return status; } static int installInitial(void) { static Boolean alreadyDone = FALSE; int status = DITEM_SUCCESS; if (alreadyDone) return DITEM_SUCCESS; if (!variable_get(DISK_LABELLED)) { msgConfirm("You need to assign disk labels before you can proceed with\n" "the installation."); return DITEM_FAILURE; } /* If it's labelled, assume it's also partitioned */ if (!variable_get(DISK_PARTITIONED)) variable_set2(DISK_PARTITIONED, "yes", 0); /* If we refuse to proceed, bail. */ dialog_clear_norefresh(); if (!variable_get(VAR_NO_WARN)) { if (msgYesNo( "Last Chance! Are you SURE you want continue the installation?\n\n" "If you're running this on a disk with data you wish to save\n" "then WE STRONGLY ENCOURAGE YOU TO MAKE PROPER BACKUPS before\n" "proceeding!\n\n" "We can take no responsibility for lost disk contents!") != 0) return DITEM_FAILURE; } if (DITEM_STATUS(diskLabelCommit(NULL)) != DITEM_SUCCESS) { msgConfirm("Couldn't make filesystems properly. Aborting."); return DITEM_FAILURE; } if (!copySelf()) { msgConfirm("installInitial: Couldn't clone the boot floppy onto the\n" "root file system. Aborting!"); return DITEM_FAILURE; } if (!Restarting && chroot("/mnt") == -1) { msgConfirm("installInitial: Unable to chroot to %s - this is bad!", "/mnt"); return DITEM_FAILURE; } chdir("/"); variable_set2(RUNNING_ON_ROOT, "yes", 0); /* Configure various files in /etc */ if (DITEM_STATUS(configResolv(NULL)) == DITEM_FAILURE) status = DITEM_FAILURE; if (DITEM_STATUS(configFstab(NULL)) == DITEM_FAILURE) status = DITEM_FAILURE; /* stick a helpful shell over on the 4th VTY */ if (!variable_get(VAR_NO_HOLOSHELL)) systemCreateHoloshell(); alreadyDone = TRUE; return status; } int installFixitHoloShell(dialogMenuItem *self) { FixItMode = 1; systemCreateHoloshell(); return DITEM_SUCCESS; FixItMode = 0; } int installFixitCDROM(dialogMenuItem *self) { struct stat sb; if (!RunningAsInit) return DITEM_SUCCESS; variable_set2(SYSTEM_STATE, "fixit", 0); (void)unlink("/mnt2"); (void)rmdir("/mnt2"); while (1) { msgConfirm("Please insert a FreeBSD live filesystem CD/DVD and press return"); if (DITEM_STATUS(mediaSetCDROM(NULL)) != DITEM_SUCCESS || !DEVICE_INIT(mediaDevice)) { /* If we can't initialize it, it's probably not a FreeBSD CDROM so punt on it */ mediaClose(); if (msgYesNo("Unable to mount the disc - do you want to try again?") != 0) return DITEM_FAILURE; } else break; } /* Since the fixit code expects everything to be in /mnt2, and the CDROM mounting stuff /dist, do * a little kludge dance here.. */ if (symlink("/dist", "/mnt2")) { msgConfirm("Unable to symlink /mnt2 to the disc mount point. Please report this\n" "unexpected failure to freebsd-bugs@FreeBSD.org."); return DITEM_FAILURE; } /* * If /tmp points to /mnt2/tmp from a previous fixit floppy session, it's * not very good for us if we point it to the CDROM now. Rather make it * a directory in the root MFS then. Experienced admins will still be * able to mount their disk's /tmp over this if they need. */ if (lstat("/tmp", &sb) == 0 && (sb.st_mode & S_IFMT) == S_IFLNK) (void)unlink("/tmp"); Mkdir("/tmp"); /* * Since setuid binaries ignore LD_LIBRARY_PATH, we indeed need the * ld.so.hints file. Fortunately, it's fairly small (~ 3 KB). */ if (!file_readable("/var/run/ld.so.hints")) { Mkdir("/var/run"); if (vsystem("/mnt2/sbin/ldconfig -s /mnt2/usr/lib")) { msgConfirm("Warning: ldconfig could not create the ld.so hints file.\n" "Dynamic executables from the disc likely won't work."); } } /* Yet more iggly hardcoded pathnames. */ Mkdir("/usr/libexec"); if (!file_readable("/usr/libexec/ld.so") && file_readable("/mnt2/usr/libexec/ld.so")) { if (symlink("/mnt2/usr/libexec/ld.so", "/usr/libexec/ld.so")) msgDebug("Couldn't link to ld.so - not necessarily a problem for ELF\n"); } if (!file_readable("/usr/libexec/ld-elf.so.1")) { if (symlink("/mnt2/usr/libexec/ld-elf.so.1", "/usr/libexec/ld-elf.so.1")) { msgConfirm("Warning: could not create the symlink for ld-elf.so.1\n" "Dynamic executables from the disc likely won't work."); } } /* optional nicety */ if (!file_readable("/usr/bin/vi")) symlink("/mnt2/usr/bin/vi", "/usr/bin/vi"); fixit_common(); mediaClose(); msgConfirm("Please remove the FreeBSD fixit CDROM/DVD now."); return DITEM_SUCCESS; } int installFixitFloppy(dialogMenuItem *self) { struct ufs_args args; extern char *distWanted; if (!RunningAsInit) return DITEM_SUCCESS; /* Try to open the floppy drive */ if (DITEM_STATUS(mediaSetFloppy(NULL)) == DITEM_FAILURE || !mediaDevice) { msgConfirm("Unable to set media device to floppy."); mediaClose(); return DITEM_FAILURE; } memset(&args, 0, sizeof(args)); args.fspec = mediaDevice->devname; mediaDevice->private = "/mnt2"; distWanted = NULL; Mkdir("/mnt2"); variable_set2(SYSTEM_STATE, "fixit", 0); while (1) { if (!DEVICE_INIT(mediaDevice)) { if (msgYesNo("The attempt to mount the fixit floppy failed, bad floppy\n" "or unclean filesystem. Do you want to try again?")) return DITEM_FAILURE; } else break; } if (!directory_exists("/tmp")) (void)symlink("/mnt2/tmp", "/tmp"); fixit_common(); mediaClose(); msgConfirm("Please remove the fixit floppy now."); return DITEM_SUCCESS; } /* * The common code for both fixit variants. */ static void fixit_common(void) { pid_t child; int waitstatus; if (!directory_exists("/var/tmp/vi.recover")) { if (DITEM_STATUS(Mkdir("/var/tmp/vi.recover")) != DITEM_SUCCESS) { msgConfirm("Warning: Was unable to create a /var/tmp/vi.recover directory.\n" "vi will kvetch and moan about it as a result but should still\n" "be essentially usable."); } } if (!directory_exists("/bin")) (void)Mkdir("/bin"); (void)symlink("/stand/sh", "/bin/sh"); /* Link the /etc/ files */ if (DITEM_STATUS(Mkdir("/etc")) != DITEM_SUCCESS) msgConfirm("Unable to create an /etc directory! Things are weird on this floppy.."); else if ((symlink("/mnt2/etc/spwd.db", "/etc/spwd.db") == -1 && errno != EEXIST) || (symlink("/mnt2/etc/protocols", "/etc/protocols") == -1 && errno != EEXIST) || (symlink("/mnt2/etc/group", "/etc/group") == -1 && errno != EEXIST) || (symlink("/mnt2/etc/services", "/etc/services") == -1 && errno != EEXIST)) msgConfirm("Couldn't symlink the /etc/ files! I'm not sure I like this.."); if (!file_readable(TERMCAP_FILE)) create_termcap(); if (strcmp(variable_get(VAR_FIXIT_TTY), "serial") == 0) systemSuspendDialog(); /* must be before the fork() */ if (!(child = fork())) { int i, fd; struct termios foo; extern int login_tty(int); ioctl(0, TIOCNOTTY, NULL); for (i = getdtablesize(); i >= 0; --i) close(i); if (strcmp(variable_get(VAR_FIXIT_TTY), "serial") == 0) fd = open("/dev/console", O_RDWR); else fd = open("/dev/ttyv3", O_RDWR); ioctl(0, TIOCSCTTY, &fd); dup2(0, 1); dup2(0, 2); DebugFD = 2; if (login_tty(fd) == -1) msgDebug("fixit: I can't set the controlling terminal.\n"); signal(SIGTTOU, SIG_IGN); if (tcgetattr(0, &foo) != -1) { foo.c_cc[VERASE] = '\010'; if (tcsetattr(0, TCSANOW, &foo) == -1) msgDebug("fixit shell: Unable to set erase character.\n"); } else msgDebug("fixit shell: Unable to get terminal attributes!\n"); setenv("PATH", "/bin:/sbin:/usr/bin:/usr/sbin:/stand:" "/mnt2/stand:/mnt2/bin:/mnt2/sbin:/mnt2/usr/bin:/mnt2/usr/sbin", 1); setenv("MAKEDEVPATH", "/sbin:/bin:/stand:" "/mnt2/sbin:/mnt2/bin:/mnt2/stand", 1); if (strcmp(variable_get(VAR_FIXIT_TTY), "serial") == 0) { printf("Waiting for fixit shell to exit.\n" "When you are done, type ``exit'' to exit\n" "the fixit shell and be returned here.\n\n"); fflush(stdout); } /* use the .profile from the fixit medium */ setenv("HOME", "/mnt2", 1); chdir("/mnt2"); execlp("sh", "-sh", (char *)0); msgDebug("fixit shell: Failed to execute shell!\n"); _exit(1);; } else { if (strcmp(variable_get(VAR_FIXIT_TTY), "standard") == 0) { dialog_clear_norefresh(); msgNotify("Waiting for fixit shell to exit. Go to VTY4 now by\n" "typing ALT-F4. When you are done, type ``exit'' to exit\n" "the fixit shell and be returned here\n."); } (void)waitpid(child, &waitstatus, 0); if (strcmp(variable_get(VAR_FIXIT_TTY), "serial") == 0) systemResumeDialog(); } dialog_clear(); } int installExpress(dialogMenuItem *self) { int i; dialog_clear_norefresh(); variable_set2(SYSTEM_STATE, "express", 0); -#ifndef __alpha__ +#if defined(__i386__) || defined(__ia64__) if (DITEM_STATUS((i = diskPartitionEditor(self))) == DITEM_FAILURE) return i; #endif if (DITEM_STATUS((i = diskLabelEditor(self))) == DITEM_FAILURE) return i; if (DITEM_STATUS((i = installCommit(self))) == DITEM_SUCCESS) { i |= DITEM_LEAVE_MENU; /* Set default security level */ configSecurityModerate(NULL); /* Give user the option of one last configuration spree */ installConfigure(); } return i; } /* Standard mode installation */ int installStandard(dialogMenuItem *self) { int i, tries = 0; Device **devs; variable_set2(SYSTEM_STATE, "standard", 0); dialog_clear_norefresh(); -#ifndef __alpha__ +#if defined(__i386__) || defined(__ia64__) msgConfirm("In the next menu, you will need to set up a DOS-style (\"fdisk\") partitioning\n" "scheme for your hard disk. If you simply wish to devote all disk space\n" "to FreeBSD (overwriting anything else that might be on the disk(s) selected)\n" "then use the (A)ll command to select the default partitioning scheme followed\n" "by a (Q)uit. If you wish to allocate only free space to FreeBSD, move to a\n" "partition marked \"unused\" and use the (C)reate command."); nodisks: if (DITEM_STATUS(diskPartitionEditor(self)) == DITEM_FAILURE) return DITEM_FAILURE; if (diskGetSelectCount(&devs) <= 0 && tries < 3) { msgConfirm("You need to select some disks to operate on! Be sure to use SPACE\n" "instead of RETURN in the disk selection menu when selecting a disk."); ++tries; goto nodisks; } #endif -#ifdef __alpha__ - msgConfirm("Now you need to create BSD partitions on the disk which you are\n" - "installing to. If you have a reasonable amount of disk space (200MB or more)\n" +#if defined(__i386__) || defined(__ia64__) + msgConfirm("Now you need to create BSD partitions inside of the fdisk partition(s)\n" + "just created. If you have a reasonable amount of disk space (200MB or more)\n" "and don't have any special requirements, simply use the (A)uto command to\n" "allocate space automatically. If you have more specific needs or just don't\n" "care for the layout chosen by (A)uto, press F1 for more information on\n" "manual layout."); #else - msgConfirm("Now you need to create BSD partitions inside of the fdisk partition(s)\n" - "just created. If you have a reasonable amount of disk space (200MB or more)\n" + msgConfirm("Now you need to create BSD partitions on the disk which you are\n" + "installing to. If you have a reasonable amount of disk space (200MB or more)\n" "and don't have any special requirements, simply use the (A)uto command to\n" "allocate space automatically. If you have more specific needs or just don't\n" "care for the layout chosen by (A)uto, press F1 for more information on\n" "manual layout."); #endif if (DITEM_STATUS(diskLabelEditor(self)) == DITEM_FAILURE) return DITEM_FAILURE; if (DITEM_STATUS((i = installCommit(self))) == DITEM_FAILURE) { dialog_clear(); msgConfirm("Installation completed with some errors. You may wish to\n" "scroll through the debugging messages on VTY1 with the\n" "scroll-lock feature. You can also choose \"No\" at the next\n" "prompt and go back into the installation menus to try and retry\n" "whichever operations have failed."); return i; } else { dialog_clear(); msgConfirm("Congratulations! You now have FreeBSD installed on your system.\n\n" "We will now move on to the final configuration questions.\n" "For any option you do not wish to configure, simply select\n" "No.\n\n" "If you wish to re-enter this utility after the system is up, you\n" "may do so by typing: /usr/sbin/sysinstall."); } if (mediaDevice->type != DEVICE_TYPE_FTP && mediaDevice->type != DEVICE_TYPE_NFS) { if (!msgYesNo("Would you like to configure any Ethernet or SLIP/PPP network devices?")) { Device *tmp = tcpDeviceSelect(); if (tmp && !((DevInfo *)tmp->private)->use_dhcp && !msgYesNo("Would you like to bring the %s interface up right now?", tmp->name)) if (!DEVICE_INIT(tmp)) msgConfirm("Initialization of %s device failed.", tmp->name); } dialog_clear_norefresh(); } if (!msgNoYes("Do you want this machine to function as a network gateway?")) variable_set2("gateway_enable", "YES", 1); dialog_clear_norefresh(); if (!msgNoYes("Do you want to configure inetd and the network services that it provides?")) configInetd(self); dialog_clear_norefresh(); if (!msgNoYes("Do you want to have anonymous FTP access to this machine?")) configAnonFTP(self); dialog_clear_norefresh(); if (!msgNoYes("Do you want to configure this machine as an NFS server?")) configNFSServer(self); dialog_clear_norefresh(); if (!msgNoYes("Do you want to configure this machine as an NFS client?")) variable_set2("nfs_client_enable", "YES", 1); if (!msgNoYes("Do you want to select a default security profile for\n" "this host (select No for \"moderate\" security)?")) configSecurityProfile(self); else configSecurityModerate(self); dialog_clear_norefresh(); if (!msgNoYes("Would you like to customize your system console settings?")) dmenuOpenSimple(&MenuSyscons, FALSE); dialog_clear_norefresh(); if (!msgYesNo("Would you like to set this machine's time zone now?")) systemExecute("tzsetup"); #ifdef __i386__ dialog_clear_norefresh(); if (!msgYesNo("Would you like to enable Linux binary compatibility?")) (void)configLinux(self); #endif dialog_clear_norefresh(); if (!msgNoYes("Does this system have a non-USB mouse attached to it?")) dmenuOpenSimple(&MenuMouse, FALSE); /* Now would be a good time to checkpoint the configuration data */ configRC_conf(); sync(); if (directory_exists("/usr/X11R6")) { dialog_clear_norefresh(); if (!msgYesNo("Would you like to configure your X server at this time?")) (void)configXSetup(self); } dialog_clear_norefresh(); if (!msgYesNo("The FreeBSD package collection is a collection of thousands of ready-to-run\n" "applications, from text editors to games to WEB servers and more. Would you\n" "like to browse the collection now?")) { (void)configPackages(self); } if (!msgYesNo("Would you like to add any initial user accounts to the system?\n" "Adding at least one account for yourself at this stage is suggested\n" "since working as the \"root\" user is dangerous (it is easy to do\n" "things which adversely affect the entire system).")) (void)configUsers(self); msgConfirm("Now you must set the system manager's password.\n" "This is the password you'll use to log in as \"root\"."); if (!systemExecute("passwd root")) variable_set2("root_password", "YES", 0); /* XXX Put whatever other nice configuration questions you'd like to ask the user here XXX */ /* Give user the option of one last configuration spree */ dialog_clear_norefresh(); installConfigure(); return DITEM_LEAVE_MENU; } /* The version of commit we call from the Install Custom menu */ int installCustomCommit(dialogMenuItem *self) { int i; i = installCommit(self); if (DITEM_STATUS(i) == DITEM_SUCCESS) { /* Set default security level */ configSecurityModerate(NULL); /* Give user the option of one last configuration spree */ installConfigure(); return i; } else msgConfirm("The commit operation completed with errors. Not\n" "updating /etc files."); return i; } /* * What happens when we finally decide to going ahead with the installation. * * This is broken into multiple stages so that the user can do a full * installation but come back here again to load more distributions, * perhaps from a different media type. This would allow, for * example, the user to load the majority of the system from CDROM and * then use ftp to load just the CRYPTO dist. */ int installCommit(dialogMenuItem *self) { int i; char *str; dialog_clear_norefresh(); if (!Dists) distConfig(NULL); if (!Dists) { (void)dmenuOpenSimple(&MenuDistributions, FALSE); /* select reasonable defaults if necessary */ if (!Dists) Dists = _DIST_USER; } if (!mediaVerify()) return DITEM_FAILURE; str = variable_get(SYSTEM_STATE); if (isDebug()) msgDebug("installCommit: System state is `%s'\n", str); /* Installation stuff we wouldn't do to a running system */ if (RunningAsInit && DITEM_STATUS((i = installInitial())) == DITEM_FAILURE) return i; try_media: if (!DEVICE_INIT(mediaDevice)) { if (!msgYesNo("Unable to initialize selected media. Would you like to\n" "adjust your media configuration and try again?")) { mediaDevice = NULL; if (!mediaVerify()) return DITEM_FAILURE; else goto try_media; } else return DITEM_FAILURE; } /* Now go get it all */ i = distExtractAll(self); /* When running as init, *now* it's safe to grab the rc.foo vars */ installEnvironment(); variable_set2(SYSTEM_STATE, DITEM_STATUS(i) == DITEM_FAILURE ? "error-install" : "full-install", 0); return i; } static void installConfigure(void) { /* Final menu of last resort */ if (!msgNoYes("Visit the general configuration menu for a chance to set\n" "any last options?")) dmenuOpenSimple(&MenuConfigure, FALSE); configRC_conf(); sync(); } int installFixupBin(dialogMenuItem *self) { Device **devs; char *cp; int i; FILE *fp; int kstat = 1; /* All of this is done only as init, just to be safe */ if (RunningAsInit) { #ifdef __i386__ if ((fp = fopen("/boot/loader.conf", "a")) != NULL) { if (!kstat || !OnVTY) fprintf(fp, "# -- sysinstall generated deltas -- #\n"); if (!kstat) fprintf(fp, "userconfig_script_load=\"YES\"\n"); if (!OnVTY) fprintf(fp, "console=\"comconsole\"\n"); fclose(fp); } #endif /* BOGON #1: Resurrect /dev after bin distribution screws it up */ dialog_clear_norefresh(); msgNotify("Remaking all devices.. Please wait!"); if (!Fake) (void)unmount("/dev", MNT_FORCE); if (vsystem("cd /dev; sh MAKEDEV all")) { msgConfirm("MAKEDEV returned non-zero status"); return DITEM_FAILURE | DITEM_RESTORE; } dialog_clear_norefresh(); msgNotify("Resurrecting /dev entries for slices.."); devs = deviceFind(NULL, DEVICE_TYPE_DISK); if (!devs) msgFatal("Couldn't get a disk device list!"); /* Resurrect the slices that the former clobbered */ for (i = 0; devs[i]; i++) { Disk *disk = (Disk *)devs[i]->private; Chunk *c1; if (!devs[i]->enabled) continue; if (!disk->chunks) msgFatal("No chunk list found for %s!", disk->name); for (c1 = disk->chunks->part; c1; c1 = c1->next) { if (c1->type == freebsd) { dialog_clear_norefresh(); msgNotify("Making slice entries for %s", c1->name); if (vsystem("cd /dev; sh MAKEDEV %sh", c1->name)) { msgConfirm("Unable to make slice entries for %s!", c1->name); return DITEM_FAILURE | DITEM_RESTORE; } } } } /* BOGON #2: We leave /etc in a bad state */ chmod("/etc", 0755); /* BOGON #3: No /var/db/mountdtab complains */ Mkdir("/var/db"); creat("/var/db/mountdtab", 0644); /* BOGON #4: /compat created by default in root fs */ Mkdir("/usr/compat"); vsystem("ln -s usr/compat /compat"); /* BOGON #5: aliases database not build for bin */ vsystem("newaliases"); /* Now run all the mtree stuff to fix things up */ vsystem("mtree -deU -f /etc/mtree/BSD.root.dist -p /"); vsystem("mtree -deU -f /etc/mtree/BSD.var.dist -p /var"); vsystem("mtree -deU -f /etc/mtree/BSD.usr.dist -p /usr"); /* Do all the last ugly work-arounds here */ } return DITEM_SUCCESS | DITEM_RESTORE; } #ifdef X_AS_PKG int installX11package(dialogMenuItem *self) { WINDOW *w = savescr(); int i; dialog_clear_norefresh(); msgNotify("Installing XFree86 package..."); i = package_add("XFree86-4"); restorescr(w); return i; } #endif /* Fix side-effects from the the XFree86 installation */ int installFixupXFree(dialogMenuItem *self) { /* BOGON #1: XFree86 requires various specialized fixups */ if (directory_exists("/usr/X11R6")) { dialog_clear_norefresh(); msgNotify("Fixing permissions in XFree86 tree.."); vsystem("chmod -R a+r /usr/X11R6"); vsystem("find /usr/X11R6 -type d | xargs chmod a+x"); #ifndef X_AS_PKG /* Also do bogus minimal package registration so ports don't whine */ if (file_readable("/usr/X11R6/lib/X11/pkgreg.tar.gz")) { dialog_clear_norefresh(); msgNotify("Installing package metainfo.."); vsystem("tar xpzf /usr/X11R6/lib/X11/pkgreg.tar.gz -C / && rm /usr/X11R6/lib/X11/pkgreg.tar.gz"); } #endif } return DITEM_SUCCESS | DITEM_RESTORE; } /* Go newfs and/or mount all the filesystems we've been asked to */ int installFilesystems(dialogMenuItem *self) { int i, mountfailed; Disk *disk; Chunk *c1, *c2, *rootdev, *swapdev; Device **devs; PartInfo *root; char dname[80]; extern int MakeDevChunk(Chunk *c, char *n); Boolean upgrade = FALSE; /* If we've already done this, bail out */ if (!variable_cmp(DISK_LABELLED, "written")) return DITEM_SUCCESS; upgrade = !variable_cmp(SYSTEM_STATE, "upgrade"); if (!checkLabels(TRUE, &rootdev, &swapdev, NULL, NULL, NULL, NULL)) return DITEM_FAILURE; if (rootdev) root = (PartInfo *)rootdev->private_data; else root = NULL; command_clear(); if (swapdev && RunningAsInit) { /* As the very first thing, try to get ourselves some swap space */ sprintf(dname, "/dev/%s", swapdev->name); if (!Fake && (!MakeDevChunk(swapdev, "/dev") || !file_readable(dname))) { msgConfirm("Unable to make device node for %s in /dev!\n" "The creation of filesystems will be aborted.", dname); return DITEM_FAILURE; } if (!Fake) { if (!swapon(dname)) { dialog_clear_norefresh(); msgNotify("Added %s as initial swap device", dname); } else { msgConfirm("WARNING! Unable to swap to %s: %s\n" "This may cause the installation to fail at some point\n" "if you don't have a lot of memory.", dname, strerror(errno)); } } } if (rootdev && RunningAsInit) { /* Next, create and/or mount the root device */ sprintf(dname, "/dev/%s", rootdev->name); if (!Fake && (!MakeDevChunk(rootdev, "/dev") || !file_readable(dname))) { msgConfirm("Unable to make device node for %s in /dev!\n" "The creation of filesystems will be aborted.", dname); return DITEM_FAILURE | DITEM_RESTORE; } if (strcmp(root->mountpoint, "/")) msgConfirm("Warning: %s is marked as a root partition but is mounted on %s", rootdev->name, root->mountpoint); if (root->newfs && (!upgrade || !msgNoYes("You are upgrading - are you SURE you want to newfs the root partition?"))) { int i; dialog_clear_norefresh(); msgNotify("Making a new root filesystem on %s", dname); i = vsystem("%s %s", root->newfs_cmd, dname); if (i) { msgConfirm("Unable to make new root filesystem on %s!\n" "Command returned status %d", dname, i); return DITEM_FAILURE | DITEM_RESTORE; } } else { if (!upgrade) { msgConfirm("Warning: Using existing root partition. It will be assumed\n" "that you have the appropriate device entries already in /dev."); } dialog_clear_norefresh(); msgNotify("Checking integrity of existing %s filesystem.", dname); i = vsystem("fsck_ffs -y %s", dname); if (i) msgConfirm("Warning: fsck returned status of %d for %s.\n" "This partition may be unsafe to use.", i, dname); } if (root->soft) { i = vsystem("tunefs -n enable %s", dname); if (i) msgConfirm("Warning: Unable to enable softupdates for root filesystem on %s", dname); } /* Switch to block device */ sprintf(dname, "/dev/%s", rootdev->name); if (Mount("/mnt", dname)) { msgConfirm("Unable to mount the root file system on %s! Giving up.", dname); return DITEM_FAILURE | DITEM_RESTORE; } /* Mount devfs for other partitions to mount */ Mkdir("/mnt/dev"); if (!Fake) mountfailed = mount("devfs", "/mnt/dev", 0, NULL); if (mountfailed) { dialog_clear_norefresh(); msgNotify("Copying initial device files.."); /* Copy the boot floppy's dev files */ if ((root->newfs || upgrade) && vsystem("find -x /dev | cpio %s -pdum /mnt", cpioVerbosity())) { msgConfirm("Couldn't clone the /dev files!"); return DITEM_FAILURE | DITEM_RESTORE; } } } /* Now buzz through the rest of the partitions and mount them too */ devs = deviceFind(NULL, DEVICE_TYPE_DISK); for (i = 0; devs[i]; i++) { if (!devs[i]->enabled) continue; disk = (Disk *)devs[i]->private; if (!disk->chunks) { msgConfirm("No chunk list found for %s!", disk->name); return DITEM_FAILURE | DITEM_RESTORE; } if (mountfailed) { if (RunningAsInit && root && (root->newfs || upgrade)) { Mkdir("/mnt/dev"); if (!Fake) MakeDevDisk(disk, "/mnt/dev"); } else if (!RunningAsInit && !Fake) MakeDevDisk(disk, "/dev"); } for (c1 = disk->chunks->part; c1; c1 = c1->next) { if (c1->type == freebsd) { for (c2 = c1->part; c2; c2 = c2->next) { if (c2->type == part && c2->subtype != FS_SWAP && c2->private_data) { PartInfo *tmp = (PartInfo *)c2->private_data; /* Already did root */ if (c2 == rootdev) continue; if (tmp->newfs && (!upgrade || !msgNoYes("You are upgrading - are you SURE you want to newfs /dev/%s?", c2->name))) command_shell_add(tmp->mountpoint, "%s %s/dev/%s", tmp->newfs_cmd, RunningAsInit ? "/mnt" : "", c2->name); else command_shell_add(tmp->mountpoint, "fsck_ffs -y %s/dev/%s", RunningAsInit ? "/mnt" : "", c2->name); if (tmp->soft) command_shell_add(tmp->mountpoint, "tunefs -n enable %s/dev/%s", RunningAsInit ? "/mnt" : "", c2->name); command_func_add(tmp->mountpoint, Mount, c2->name); } else if (c2->type == part && c2->subtype == FS_SWAP) { char fname[80]; int i; if (c2 == swapdev) continue; sprintf(fname, "%s/dev/%s", RunningAsInit ? "/mnt" : "", c2->name); i = (Fake || swapon(fname)); if (!i) { dialog_clear_norefresh(); msgNotify("Added %s as an additional swap device", fname); } else { msgConfirm("Unable to add %s as a swap device: %s", fname, strerror(errno)); } } } } else if (c1->type == fat && c1->private_data && (root->newfs || upgrade)) { char name[FILENAME_MAX]; sprintf(name, "%s/%s", RunningAsInit ? "/mnt" : "", ((PartInfo *)c1->private_data)->mountpoint); Mkdir(name); } } } command_sort(); command_execute(); dialog_clear_norefresh(); return DITEM_SUCCESS | DITEM_RESTORE; } static char * getRelname(void) { static char buf[64]; size_t sz = (sizeof buf) - 1; if (sysctlbyname("kern.osrelease", buf, &sz, NULL, 0) != -1) { buf[sz] = '\0'; return buf; } else return ""; } /* Initialize various user-settable values to their defaults */ int installVarDefaults(dialogMenuItem *self) { char *cp; /* Set default startup options */ variable_set2(VAR_RELNAME, getRelname(), 0); variable_set2(VAR_CPIO_VERBOSITY, "high", 0); variable_set2(VAR_TAPE_BLOCKSIZE, DEFAULT_TAPE_BLOCKSIZE, 0); variable_set2(VAR_INSTALL_ROOT, "/", 0); variable_set2(VAR_INSTALL_CFG, "install.cfg", 0); cp = getenv("EDITOR"); if (!cp) cp = "/usr/bin/ee"; variable_set2(VAR_EDITOR, cp, 0); variable_set2(VAR_FTP_USER, "ftp", 0); variable_set2(VAR_BROWSER_PACKAGE, "links", 0); variable_set2(VAR_BROWSER_BINARY, "/usr/local/bin/links", 0); variable_set2(VAR_FTP_STATE, "passive", 0); variable_set2(VAR_NFS_SECURE, "NO", -1); if (OnVTY) variable_set2(VAR_FIXIT_TTY, "standard", 0); else variable_set2(VAR_FIXIT_TTY, "serial", 0); variable_set2(VAR_PKG_TMPDIR, "/var/tmp", 0); variable_set2(VAR_MEDIA_TIMEOUT, itoa(MEDIA_TIMEOUT), 0); if (getpid() != 1) variable_set2(SYSTEM_STATE, "update", 0); else variable_set2(SYSTEM_STATE, "init", 0); variable_set2(VAR_NEWFS_ARGS, "-b 16384 -f 2048", 0); variable_set2(VAR_CONSTERM, "NO", 0); return DITEM_SUCCESS; } /* Load the environment up from various system configuration files */ void installEnvironment(void) { configEnvironmentRC_conf(); if (file_readable("/etc/resolv.conf")) configEnvironmentResolv("/etc/resolv.conf"); } /* Copy the boot floppy contents into /stand */ Boolean copySelf(void) { int i; if (file_readable("/boot.help")) vsystem("cp /boot.help /mnt"); msgWeHaveOutput("Copying the boot floppy to /stand on root filesystem"); i = vsystem("find -x /stand | cpio %s -pdum /mnt", cpioVerbosity()); if (i) { msgConfirm("Copy returned error status of %d!", i); return FALSE; } /* Copy the /etc files into their rightful place */ if (vsystem("cd /mnt/stand; find etc | cpio %s -pdum /mnt", cpioVerbosity())) { msgConfirm("Couldn't copy up the /etc files!"); return TRUE; } return TRUE; } static void create_termcap(void) { FILE *fp; const char *caps[] = { termcap_vt100, termcap_cons25, termcap_cons25_m, termcap_cons25r, termcap_cons25r_m, termcap_cons25l1, termcap_cons25l1_m, termcap_xterm, NULL, }; const char **cp; if (!file_readable(TERMCAP_FILE)) { Mkdir("/usr/share/misc"); fp = fopen(TERMCAP_FILE, "w"); if (!fp) { msgConfirm("Unable to initialize termcap file. Some screen-oriented\nutilities may not work."); return; } cp = caps; while (*cp) fprintf(fp, "%s\n", *(cp++)); fclose(fp); } } Index: head/usr.sbin/sade/label.c =================================================================== --- head/usr.sbin/sade/label.c (revision 104939) +++ head/usr.sbin/sade/label.c (revision 104940) @@ -1,1481 +1,1481 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * * $FreeBSD$ * * 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. * * 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 #include #define AUTO_HOME 0 /* do not create /home automatically */ /* * 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 /* The smallest filesystem we're willing to create */ #define FS_MIN_SIZE ONE_MEG /* * Minimum partition sizes */ -#ifdef __alpha__ +#if defined(__alpha__) || defined(__ia64__) || defined(__sparc64__) #define ROOT_MIN_SIZE 40 #else #define ROOT_MIN_SIZE 30 #endif #define SWAP_MIN_SIZE 32 #define USR_MIN_SIZE 80 #define VAR_MIN_SIZE 20 #define TMP_MIN_SIZE 20 #define HOME_MIN_SIZE 20 /* * Swap size limit for auto-partitioning (4G). */ #define SWAP_AUTO_LIMIT_SIZE 4096 /* * Default partition sizes. If we do not have sufficient disk space * for this configuration we scale things relative to the NOM vs DEFAULT * sizes. If the disk is larger then /home will get any remaining space. */ #define ROOT_DEFAULT_SIZE 128 #define USR_DEFAULT_SIZE 3072 #define VAR_DEFAULT_SIZE 256 #define TMP_DEFAULT_SIZE 256 #define HOME_DEFAULT_SIZE USR_DEFAULT_SIZE /* * Nominal partition sizes. These are used to scale the default sizes down * when we have insufficient disk space. If this isn't sufficient we scale * down using the MIN sizes instead. */ #define ROOT_NOMINAL_SIZE 128 #define USR_NOMINAL_SIZE 512 #define VAR_NOMINAL_SIZE 64 #define TMP_NOMINAL_SIZE 64 #define HOME_NOMINAL_SIZE USR_NOMINAL_SIZE /* The bottom-most row we're allowed to scribble on */ #define CHUNK_ROW_MAX 16 /* All the chunks currently displayed on the screen */ static struct { struct chunk *c; PartType type; } label_chunk_info[MAX_CHUNKS + 1]; static int here; /*** with this value we try to track the most recently added label ***/ static int label_focus = 0, pslice_focus = 0; static int diskLabel(Device *dev); static int diskLabelNonInteractive(Device *dev); static char *try_auto_label(Device **devs, Device *dev, int perc, int *req); static int labelHook(dialogMenuItem *selected) { Device **devs = NULL; devs = deviceFind(selected->prompt, DEVICE_TYPE_DISK); if (!devs) { msgConfirm("Unable to find disk %s!", selected->prompt); return DITEM_FAILURE; } /* Toggle enabled status? */ if (!devs[0]->enabled) { devs[0]->enabled = TRUE; diskLabel(devs[0]); } else devs[0]->enabled = FALSE; return DITEM_SUCCESS; } static int labelCheck(dialogMenuItem *selected) { Device **devs = NULL; devs = deviceFind(selected->prompt, DEVICE_TYPE_DISK); if (!devs || devs[0]->enabled == FALSE) return FALSE; return TRUE; } int diskLabelEditor(dialogMenuItem *self) { DMenu *menu; Device **devs; int i, cnt; i = 0; cnt = diskGetSelectCount(&devs); if (cnt == -1) { msgConfirm("No disks found! Please verify that your disk controller is being\n" "properly probed at boot time. See the Hardware Guide on the\n" "Documentation menu for clues on diagnosing this type of problem."); return DITEM_FAILURE; } else if (cnt) { /* Some are already selected */ if (variable_get(VAR_NONINTERACTIVE) && !variable_get(VAR_DISKINTERACTIVE)) i = diskLabelNonInteractive(NULL); else i = diskLabel(NULL); } else { /* No disks are selected, fall-back case now */ cnt = deviceCount(devs); if (cnt == 1) { devs[0]->enabled = TRUE; if (variable_get(VAR_NONINTERACTIVE) && !variable_get(VAR_DISKINTERACTIVE)) i = diskLabelNonInteractive(devs[0]); else i = diskLabel(devs[0]); } else { menu = deviceCreateMenu(&MenuDiskDevices, DEVICE_TYPE_DISK, labelHook, labelCheck); if (!menu) { msgConfirm("No devices suitable for installation found!\n\n" "Please verify that your disk controller (and attached drives)\n" "were detected properly. This can be done by pressing the\n" "[Scroll Lock] key and using the Arrow keys to move back to\n" "the boot messages. Press [Scroll Lock] again to return."); i = DITEM_FAILURE; } else { i = dmenuOpenSimple(menu, FALSE) ? DITEM_SUCCESS : DITEM_FAILURE; free(menu); } } } if (DITEM_STATUS(i) != DITEM_FAILURE) { if (variable_cmp(DISK_LABELLED, "written")) variable_set2(DISK_LABELLED, "yes", 0); } return i; } int diskLabelCommit(dialogMenuItem *self) { char *cp; int i; /* Already done? */ if ((cp = variable_get(DISK_LABELLED)) && strcmp(cp, "yes")) i = DITEM_SUCCESS; else if (!cp) { msgConfirm("You must assign disk labels before this option can be used."); i = DITEM_FAILURE; } /* The routine will guard against redundant writes, just as this one does */ else if (DITEM_STATUS(diskPartitionWrite(self)) != DITEM_SUCCESS) i = DITEM_FAILURE; else if (DITEM_STATUS(installFilesystems(self)) != DITEM_SUCCESS) i = DITEM_FAILURE; else { msgInfo("All filesystem information written successfully."); variable_set2(DISK_LABELLED, "written", 0); i = DITEM_SUCCESS; } return i; } /* 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].type == PART_FAT) && label_chunk_info[i].c->private_data && !strcmp(((PartInfo *)label_chunk_info[i].c->private_data)->mountpoint, name)) return TRUE; return FALSE; } /* How much space is in this FreeBSD slice? */ static int space_free(struct chunk *c) { struct chunk *c1; int sz = c->size; for (c1 = c->part; c1; c1 = c1->next) { if (c1->type != unused) sz -= c1->size; } 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(Device **devs, Device *dev) { int i, j, p; struct chunk *c1, *c2; Disk *d; j = p = 0; /* First buzz through and pick up the FreeBSD slices */ for (i = 0; devs[i]; i++) { if ((dev && devs[i] != dev) || !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; if (!mpoint) mpoint = "/change_me"; ret = (PartInfo *)safe_malloc(sizeof(PartInfo)); sstrncpy(ret->mountpoint, mpoint, FILENAME_MAX); strcpy(ret->newfs_cmd, "newfs "); strcat(ret->newfs_cmd, variable_get(VAR_NEWFS_ARGS)); ret->newfs = newfs; ret->soft = strcmp(mpoint, "/") ? 1 : 0; if (!size) return ret; return ret; } /* Get the mountpoint for a partition and save it away */ static PartInfo * get_mountpoint(struct chunk *old) { char *val; PartInfo *tmp; if (old && old->private_data) tmp = old->private_data; 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_data); old->private_data = 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); val = string_skipwhite(string_prune(val)); tmp = new_part(val, TRUE, 0); if (old) { old->private_data = 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.", }; WINDOW *w = savescr(); i = dialog_menu("Please choose a partition type", "If you want to use this partition for swap space, select Swap.\n" "If you want to put a filesystem on it, choose FS.", -1, -1, 2, 2, fs_types, selection, NULL, NULL); restorescr(w); 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\n" "creating this file system."); if (val) sstrncpy(p->newfs_cmd, val, NEWFS_CMD_MAX); } #define MAX_MOUNT_NAME 9 #define PART_PART_COL 0 #define PART_MOUNT_COL 10 #define PART_SIZE_COL (PART_MOUNT_COL + MAX_MOUNT_NAME + 3) #define PART_NEWFS_COL (PART_SIZE_COL + 8) #define PART_OFF 38 #define TOTAL_AVAIL_LINES (10) #define PSLICE_SHOWABLE (4) /* stick this all up on the screen */ static void print_label_chunks(void) { int i, j, srow, prow, pcol; int sz; char clrmsg[80]; int ChunkPartStartRow; WINDOW *ChunkWin; /********************************************************/ /*** These values are for controling screen resources ***/ /*** Each label line holds up to 2 labels, so beware! ***/ /*** strategy will be to try to always make sure the ***/ /*** highlighted label is in the active display area. ***/ /********************************************************/ int pslice_max, label_max; int pslice_count, label_count, label_focus_found, pslice_focus_found; attrset(A_REVERSE); mvaddstr(0, 25, "FreeBSD Disklabel Editor"); attrset(A_NORMAL); /*** Count the number of parition slices ***/ pslice_count = 0; for (i = 0; label_chunk_info[i].c ; i++) { if (label_chunk_info[i].type == PART_SLICE) ++pslice_count; } pslice_max = pslice_count; /*** 4 line max for partition slices ***/ if (pslice_max > PSLICE_SHOWABLE) { pslice_max = PSLICE_SHOWABLE; } ChunkPartStartRow = CHUNK_SLICE_START_ROW + 3 + pslice_max; /*** View partition slices modulo pslice_max ***/ label_max = TOTAL_AVAIL_LINES - pslice_max; for (i = 0; i < 2; i++) { mvaddstr(ChunkPartStartRow - 2, PART_PART_COL + (i * PART_OFF), "Part"); mvaddstr(ChunkPartStartRow - 1, PART_PART_COL + (i * PART_OFF), "----"); mvaddstr(ChunkPartStartRow - 2, PART_MOUNT_COL + (i * PART_OFF), "Mount"); mvaddstr(ChunkPartStartRow - 1, PART_MOUNT_COL + (i * PART_OFF), "-----"); mvaddstr(ChunkPartStartRow - 2, PART_SIZE_COL + (i * PART_OFF) + 3, "Size"); mvaddstr(ChunkPartStartRow - 1, PART_SIZE_COL + (i * PART_OFF) + 3, "----"); mvaddstr(ChunkPartStartRow - 2, PART_NEWFS_COL + (i * PART_OFF), "Newfs"); mvaddstr(ChunkPartStartRow - 1, PART_NEWFS_COL + (i * PART_OFF), "-----"); } srow = CHUNK_SLICE_START_ROW; prow = 0; pcol = 0; /*** these variables indicate that the focused item is shown currently ***/ label_focus_found = 0; pslice_focus_found = 0; label_count = 0; pslice_count = 0; mvprintw(CHUNK_SLICE_START_ROW - 1, 0, " "); mvprintw(CHUNK_SLICE_START_ROW + pslice_max, 0, " "); ChunkWin = newwin(CHUNK_ROW_MAX - ChunkPartStartRow, 76, ChunkPartStartRow, 0); wclear(ChunkWin); /*** wrefresh(ChunkWin); ***/ for (i = 0; label_chunk_info[i].c; i++) { /* Is it a slice entry displayed at the top? */ if (label_chunk_info[i].type == PART_SLICE) { /*** This causes the new pslice to replace the previous display ***/ /*** focus must remain on the most recently active pslice ***/ if (pslice_count == pslice_max) { if (pslice_focus_found) { /*** This is where we can mark the more following ***/ attrset(A_BOLD); mvprintw(CHUNK_SLICE_START_ROW + pslice_max, 0, "***MORE***"); attrset(A_NORMAL); continue; } else { /*** this is where we set the more previous ***/ attrset(A_BOLD); mvprintw(CHUNK_SLICE_START_ROW - 1, 0, "***MORE***"); attrset(A_NORMAL); pslice_count = 0; srow = CHUNK_SLICE_START_ROW; } } sz = space_free(label_chunk_info[i].c); if (i == here) attrset(ATTR_SELECTED); if (i == pslice_focus) pslice_focus_found = -1; 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)); attrset(A_NORMAL); clrtoeol(); move(0, 0); /*** refresh(); ***/ ++pslice_count; } /* Otherwise it's a DOS, swap or filesystem entry in the Chunk window */ else { char onestr[PART_OFF], num[10], *mountpoint, newfs[10]; /* * 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'; /*** Track how many labels have been displayed ***/ if (label_count == ((label_max - 1 ) * 2)) { if (label_focus_found) { continue; } else { label_count = 0; prow = 0; pcol = 0; } } /* Go for two columns if we've written one full columns worth */ /*** if (prow == (CHUNK_ROW_MAX - ChunkPartStartRow)) ***/ if (label_count == label_max - 1) { pcol = PART_OFF; prow = 0; } 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_data && (label_chunk_info[i].type == PART_FILESYSTEM || label_chunk_info[i].type == PART_FAT)) mountpoint = ((PartInfo *)label_chunk_info[i].c->private_data)->mountpoint; else if (label_chunk_info[i].type == PART_SWAP) mountpoint = "swap"; else mountpoint = ""; /* Now display the newfs field */ if (label_chunk_info[i].type == PART_FAT) strcpy(newfs, "DOS"); else if (label_chunk_info[i].c->private_data && label_chunk_info[i].type == PART_FILESYSTEM) { strcpy(newfs, "UFS"); strcat(newfs, ((PartInfo *)label_chunk_info[i].c->private_data)->soft ? "+S" : " "); strcat(newfs, ((PartInfo *)label_chunk_info[i].c->private_data)->newfs ? " Y" : " N"); } else if (label_chunk_info[i].type == PART_SWAP) strcpy(newfs, "SWAP"); else strcpy(newfs, "*"); for (j = 0; j < MAX_MOUNT_NAME && mountpoint[j]; j++) onestr[PART_MOUNT_COL + j] = mountpoint[j]; snprintf(num, 10, "%5ldMB", 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'; if (i == label_focus) { label_focus_found = -1; wattrset(ChunkWin, A_BOLD); } if (i == here) wattrset(ChunkWin, ATTR_SELECTED); /*** lazy man's way of expensively padding this string ***/ while (strlen(onestr) < 37) strcat(onestr, " "); mvwaddstr(ChunkWin, prow, pcol, onestr); wattrset(ChunkWin, A_NORMAL); move(0, 0); ++prow; ++label_count; } } /*** this will erase all the extra stuff ***/ memset(clrmsg, ' ', 37); clrmsg[37] = '\0'; while (pslice_count < pslice_max) { mvprintw(srow++, 0, clrmsg); clrtoeol(); ++pslice_count; } while (label_count < (2 * (label_max - 1))) { mvwaddstr(ChunkWin, prow++, pcol, clrmsg); ++label_count; if (prow == (label_max - 1)) { prow = 0; pcol = PART_OFF; } } refresh(); wrefresh(ChunkWin); } static void print_command_summary(void) { mvprintw(17, 0, "The following commands are valid here (upper or lower case):"); mvprintw(18, 0, "C = Create D = Delete M = Mount pt."); if (!RunningAsInit) mvprintw(18, 47, "W = Write"); mvprintw(19, 0, "N = Newfs Opts Q = Finish S = Toggle SoftUpdates"); mvprintw(20, 0, "T = Toggle Newfs U = Undo A = Auto Defaults R = Delete+Merge"); mvprintw(22, 0, "Use F1 or ? to get more help, arrow keys to select."); move(0, 0); } static void clear_wins(void) { extern void print_label_chunks(); clear(); print_label_chunks(); } -#ifdef __alpha__ +#if defined(__alpha__) || defined(__sparc64__) /* * If there isn't a freebsd chunk already (i.e. there is no label), * dedicate the disk. */ static void maybe_dedicate(Disk* d) { struct chunk *c; for (c = d->chunks->part; c; c = c->next) { if (c->type == freebsd) break; } if (!c) { msgDebug("dedicating disk"); All_FreeBSD(d, 1); } } #endif static int diskLabel(Device *dev) { int sz, key = 0; Boolean labeling; char *msg = NULL; PartInfo *p, *oldp; PartType type; Device **devs; -#ifdef __alpha__ +#if defined(__alpha__) || defined(__sparc64__) int i; #endif WINDOW *w = savescr(); label_focus = 0; pslice_focus = 0; here = 0; devs = deviceFind(NULL, DEVICE_TYPE_DISK); if (!devs) { msgConfirm("No disks found!"); restorescr(w); return DITEM_FAILURE; } labeling = TRUE; keypad(stdscr, TRUE); -#ifdef __alpha__ +#if defined(__alpha__) || defined(__sparc64__) for (i = 0; devs[i]; i++) { maybe_dedicate((Disk*) devs[i]->private); } #endif record_label_chunks(devs, dev); clear(); while (labeling) { char *cp; int rflags = DELCHUNK_NORMAL; print_label_chunks(); print_command_summary(); if (msg) { attrset(title_attr); mvprintw(23, 0, msg); attrset(A_NORMAL); clrtoeol(); beep(); msg = NULL; } else { move(23, 0); clrtoeol(); } refresh(); key = getch(); switch (toupper(key)) { int i; static char _msg[40]; case '\014': /* ^L */ clear_wins(); break; case '\020': /* ^P */ case KEY_UP: case '-': if (here != 0) --here; else while (label_chunk_info[here + 1].c) ++here; break; case '\016': /* ^N */ 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 '?': systemDisplayHelp("partition"); clear_wins(); break; case 'A': if (label_chunk_info[here].type != PART_SLICE) { msg = "You can only do this in a disk slice (at top of screen)"; break; } /* * Generate standard partitions automatically. If we do not * have sufficient space we attempt to scale-down the size * of the partitions within certain bounds. */ { int perc; int req = 0; for (perc = 100; perc > 0; perc -= 5) { req = 0; /* reset for each loop */ if ((msg = try_auto_label(devs, dev, perc, &req)) == NULL) break; } if (msg) { if (req) { msgConfirm(msg); clear_wins(); msg = NULL; } } } 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; } sz = space_free(label_chunk_info[here].c); if (sz <= FS_MIN_SIZE) { msg = "Not enough space to create an additional FreeBSD partition"; break; } else { char *val; int size; struct chunk *tmp; char osize[80]; u_long flags = 0; sprintf(osize, "%d", sz); val = msgGetInput(osize, "Please specify the partition size in blocks or append a trailing G for\n" "gigabytes, M for megabytes, or C for cylinders.\n" "%d blocks (%dMB) are free.", sz, sz / ONE_MEG); if (!val || (size = strtol(val, &cp, 0)) <= 0) { clear_wins(); break; } if (*cp) { if (toupper(*cp) == 'M') size *= ONE_MEG; else if (toupper(*cp) == 'G') size *= ONE_GIG; 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); clear_wins(); break; } type = get_partition_type(); if (type == PART_NONE) { clear_wins(); beep(); break; } if (type == PART_FILESYSTEM) { if ((p = get_mountpoint(NULL)) == NULL) { clear_wins(); beep(); break; } else if (!strcmp(p->mountpoint, "/")) flags |= CHUNK_IS_ROOT; else flags &= ~CHUNK_IS_ROOT; } else p = NULL; if ((flags & CHUNK_IS_ROOT) && (size < (ROOT_MIN_SIZE * ONE_MEG))) { msgConfirm("Warning: This is smaller than the recommended size for a\n" "root partition. For a variety of reasons, root\n" "partitions should usually be at least %dMB in size", ROOT_MIN_SIZE); } 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?"); clear_wins(); break; } #ifdef __alpha__ /* * SRM requires that the root partition is at the * begining of the disk and cannot boot otherwise. * Warn Alpha users if they are about to shoot themselves in * the foot in this way. * * Since partitions may not start precisely at offset 0 we * check for a "close to 0" instead. :-( */ if ((flags & CHUNK_IS_ROOT) && (tmp->offset > 1024)) { msgConfirm("Your root partition `a' does not seem to be the first\n" "partition. The Alpha's firmware can only boot from the\n" "first partition. So it is unlikely that your current\n" "disk layout will be bootable boot after installation.\n" "\n" "Please allocate the root partition before allocating\n" "any others.\n"); } #endif /* alpha */ if (type != PART_SWAP) { /* This is needed to tell the newfs -u about the size */ tmp->private_data = new_part(p->mountpoint, p->newfs, tmp->size); safe_free(p); } else tmp->private_data = p; tmp->private_free = safe_free; if (variable_cmp(DISK_LABELLED, "written")) variable_set2(DISK_LABELLED, "yes", 0); record_label_chunks(devs, dev); clear_wins(); /* This is where we assign focus to new label so it shows. */ { int i; label_focus = -1; for (i = 0; label_chunk_info[i].c; ++i) { if (label_chunk_info[i].c == tmp) { label_focus = i; break; } } if (label_focus == -1) label_focus = i - 1; } } break; case KEY_DC: case 'R': /* recover space (delete w/ recover) */ /* * Delete the partition w/ space recovery. */ rflags = DELCHUNK_RECOVER; /* fall through */ 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_Chunk2(label_chunk_info[here].c->disk, label_chunk_info[here].c, rflags); if (variable_cmp(DISK_LABELLED, "written")) variable_set2(DISK_LABELLED, "yes", 0); record_label_chunks(devs, dev); 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_data; 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"); } } if (variable_cmp(DISK_LABELLED, "written")) variable_set2(DISK_LABELLED, "yes", 0); record_label_chunks(devs, dev); clear_wins(); break; default: msgFatal("Bogus partition under cursor???"); break; } break; case 'N': /* Set newfs options */ if (label_chunk_info[here].c->private_data && ((PartInfo *)label_chunk_info[here].c->private_data)->newfs) getNewfsCmd(label_chunk_info[here].c->private_data); else msg = MSG_NOT_APPLICABLE; clear_wins(); break; case 'S': /* Toggle soft updates flag */ if (label_chunk_info[here].type == PART_FILESYSTEM) { PartInfo *pi = ((PartInfo *)label_chunk_info[here].c->private_data); if (pi) pi->soft = !pi->soft; else msg = MSG_NOT_APPLICABLE; } else msg = MSG_NOT_APPLICABLE; break; case 'T': /* Toggle newfs state */ if ((label_chunk_info[here].type == PART_FILESYSTEM) && (label_chunk_info[here].c->private_data)) { PartInfo *pi = ((PartInfo *)label_chunk_info[here].c->private_data); if (!pi->newfs) label_chunk_info[here].c->flags |= CHUNK_NEWFS; else label_chunk_info[here].c->flags &= ~CHUNK_NEWFS; label_chunk_info[here].c->private_data = new_part(pi ? pi->mountpoint : NULL, pi ? !pi->newfs : TRUE, label_chunk_info[here].c->size); if (pi && pi->soft) ((PartInfo *)label_chunk_info[here].c->private_data)->soft = 1; safe_free(pi); label_chunk_info[here].c->private_free = safe_free; if (variable_cmp(DISK_LABELLED, "written")) variable_set2(DISK_LABELLED, "yes", 0); } else msg = MSG_NOT_APPLICABLE; break; case 'U': clear(); if (!variable_cmp(DISK_LABELLED, "written")) { msgConfirm("You've already written out your changes -\n" "it's too late to undo!"); } else if (!msgNoYes("Are you SURE you want to Undo everything?")) { variable_unset(DISK_PARTITIONED); variable_unset(DISK_LABELLED); for (i = 0; devs[i]; i++) { Disk *d; if (!devs[i]->enabled) continue; else if ((d = Open_Disk(devs[i]->name)) != NULL) { Free_Disk(devs[i]->private); devs[i]->private = d; diskPartition(devs[i]); } } record_label_chunks(devs, dev); } clear_wins(); break; case 'W': if (!variable_cmp(DISK_LABELLED, "written")) { msgConfirm("You've already written out your changes - if you\n" "wish to overwrite them, you'll have to restart\n" "sysinstall first."); } else if (!msgNoYes("WARNING: This should only be used when modifying an EXISTING\n" "installation. If you are installing FreeBSD for the first time\n" "then you should simply type Q when you're finished here and your\n" "changes will be committed in one batch automatically at the end of\n" "these questions.\n\n" "Are you absolutely sure you want to do this now?")) { variable_set2(DISK_LABELLED, "yes", 0); diskLabelCommit(NULL); } clear_wins(); break; case '|': if (!msgNoYes("Are you sure you want to go into Wizard mode?\n\n" "This is an entirely undocumented feature which you are not\n" "expected 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 devices!"); break; } for (i = 0; devs[i] && ((Disk *)devs[i]->private); i++) { if (devs[i]->enabled) slice_wizard(((Disk *)devs[i]->private)); } if (variable_cmp(DISK_LABELLED, "written")) variable_set2(DISK_LABELLED, "yes", 0); DialogActive = TRUE; record_label_chunks(devs, dev); clear_wins(); } else msg = "A most prudent choice!"; break; case '\033': /* ESC */ case 'Q': labeling = FALSE; break; default: beep(); sprintf(_msg, "Invalid key %d - Type F1 or ? for help", key); msg = _msg; break; } if (label_chunk_info[here].type == PART_SLICE) pslice_focus = here; else label_focus = here; } restorescr(w); return DITEM_SUCCESS; } static __inline int requested_part_size(char *varName, int nom, int def, int perc) { char *cp; int sz; if ((cp = variable_get(varName)) != NULL) sz = atoi(cp); else sz = nom + (def - nom) * perc / 100; return(sz * ONE_MEG); } /* * Attempt to auto-label the disk. 'perc' (0-100) scales * the size of the various partitions within appropriate * bounds (NOMINAL through DEFAULT sizes). The procedure * succeeds of NULL is returned. A non-null return message * is either a failure-status message (*req == 0), or * a confirmation requestor (*req == 1). *req is 0 on * entry to this call. * * We autolabel the following partitions: /, swap, /var, /tmp, /usr, * and /home. /home receives any extra left over disk space. */ static char * try_auto_label(Device **devs, Device *dev, int perc, int *req) { int sz; struct chunk *root_chunk = NULL; struct chunk *swap_chunk = NULL; struct chunk *usr_chunk = NULL; struct chunk *var_chunk = NULL; struct chunk *tmp_chunk = NULL; struct chunk *home_chunk = NULL; int mib[2]; unsigned int physmem; size_t size; Chunk *rootdev, *swapdev, *usrdev, *vardev; Chunk *tmpdev, *homedev; char *msg = NULL; sz = space_free(label_chunk_info[here].c); if (sz <= FS_MIN_SIZE) return("Not enough free space to create a new partition in the slice"); (void)checkLabels(FALSE, &rootdev, &swapdev, &usrdev, &vardev, &tmpdev, &homedev); if (!rootdev) { sz = requested_part_size(VAR_ROOT_SIZE, ROOT_NOMINAL_SIZE, ROOT_DEFAULT_SIZE, perc); root_chunk = Create_Chunk_DWIM(label_chunk_info[here].c->disk, label_chunk_info[here].c, sz, part, FS_BSDFFS, CHUNK_IS_ROOT | CHUNK_AUTO_SIZE); if (!root_chunk) { *req = 1; msg = "Unable to create the root partition. Too big?"; goto done; } root_chunk->private_data = new_part("/", TRUE, root_chunk->size); root_chunk->private_free = safe_free; root_chunk->flags |= CHUNK_NEWFS; record_label_chunks(devs, dev); } if (!swapdev) { sz = requested_part_size(VAR_SWAP_SIZE, 0, 0, perc); if (sz == 0) { int nom; int def; mib[0] = CTL_HW; mib[1] = HW_PHYSMEM; size = sizeof physmem; sysctl(mib, 2, &physmem, &size, (void *)0, (size_t)0); def = 2 * (int)(physmem / 512); if (def < SWAP_MIN_SIZE * ONE_MEG) def = SWAP_MIN_SIZE * ONE_MEG; if (def > SWAP_AUTO_LIMIT_SIZE * ONE_MEG) def = SWAP_AUTO_LIMIT_SIZE * ONE_MEG; nom = (int)(physmem / 512) / 2; sz = nom + (def - nom) * perc / 100; } swap_chunk = Create_Chunk_DWIM(label_chunk_info[here].c->disk, label_chunk_info[here].c, sz, part, FS_SWAP, CHUNK_AUTO_SIZE); if (!swap_chunk) { *req = 1; msg = "Unable to create the swap partition. Too big?"; goto done; } swap_chunk->private_data = 0; swap_chunk->private_free = safe_free; record_label_chunks(devs, dev); } if (!vardev) { sz = requested_part_size(VAR_VAR_SIZE, VAR_NOMINAL_SIZE, VAR_DEFAULT_SIZE, perc); var_chunk = Create_Chunk_DWIM(label_chunk_info[here].c->disk, label_chunk_info[here].c, sz, part, FS_BSDFFS, CHUNK_AUTO_SIZE); if (!var_chunk) { *req = 1; msg = "Not enough free space for /var - you will need to\n" "partition your disk manually with a custom install!"; goto done; } var_chunk->private_data = new_part("/var", TRUE, var_chunk->size); var_chunk->private_free = safe_free; var_chunk->flags |= CHUNK_NEWFS; record_label_chunks(devs, dev); } if (!tmpdev && !variable_get(VAR_NO_TMP)) { sz = requested_part_size(VAR_TMP_SIZE, TMP_NOMINAL_SIZE, TMP_DEFAULT_SIZE, perc); tmp_chunk = Create_Chunk_DWIM(label_chunk_info[here].c->disk, label_chunk_info[here].c, sz, part, FS_BSDFFS, CHUNK_AUTO_SIZE); if (!tmp_chunk) { *req = 1; msg = "Not enough free space for /tmp - you will need to\n" "partition your disk manually with a custom install!"; goto done; } tmp_chunk->private_data = new_part("/tmp", TRUE, tmp_chunk->size); tmp_chunk->private_free = safe_free; tmp_chunk->flags |= CHUNK_NEWFS; record_label_chunks(devs, dev); } if (!usrdev && !variable_get(VAR_NO_USR)) { sz = requested_part_size(VAR_USR_SIZE, USR_NOMINAL_SIZE, USR_DEFAULT_SIZE, perc); #if AUTO_HOME == 0 sz = space_free(label_chunk_info[here].c); #endif if (sz) { if (sz < (USR_MIN_SIZE * ONE_MEG)) { *req = 1; msg = "Not enough free space for /usr - you will need to\n" "partition your disk manually with a custom install!"; } usr_chunk = Create_Chunk_DWIM(label_chunk_info[here].c->disk, label_chunk_info[here].c, sz, part, FS_BSDFFS, CHUNK_AUTO_SIZE); if (!usr_chunk) { msg = "Unable to create the /usr partition. Not enough space?\n" "You will need to partition your disk manually with a custom install!"; goto done; } usr_chunk->private_data = new_part("/usr", TRUE, usr_chunk->size); usr_chunk->private_free = safe_free; usr_chunk->flags |= CHUNK_NEWFS; record_label_chunks(devs, dev); } } #if AUTO_HOME == 1 if (!homedev && !variable_get(VAR_NO_HOME)) { sz = requested_part_size(VAR_HOME_SIZE, HOME_NOMINAL_SIZE, HOME_DEFAULT_SIZE, perc); if (sz < space_free(label_chunk_info[here].c)) sz = space_free(label_chunk_info[here].c); if (sz) { if (sz < (HOME_MIN_SIZE * ONE_MEG)) { *req = 1; msg = "Not enough free space for /home - you will need to\n" "partition your disk manually with a custom install!"; goto done; } home_chunk = Create_Chunk_DWIM(label_chunk_info[here].c->disk, label_chunk_info[here].c, sz, part, FS_BSDFFS, CHUNK_AUTO_SIZE); if (!home_chunk) { msg = "Unable to create the /home partition. Not enough space?\n" "You will need to partition your disk manually with a custom install!"; goto done; } home_chunk->private_data = new_part("/home", TRUE, home_chunk->size); home_chunk->private_free = safe_free; home_chunk->flags |= CHUNK_NEWFS; record_label_chunks(devs, dev); } } #endif /* At this point, we're reasonably "labelled" */ if (variable_cmp(DISK_LABELLED, "written")) variable_set2(DISK_LABELLED, "yes", 0); done: if (msg) { if (root_chunk) Delete_Chunk(root_chunk->disk, root_chunk); if (swap_chunk) Delete_Chunk(swap_chunk->disk, swap_chunk); if (var_chunk) Delete_Chunk(var_chunk->disk, var_chunk); if (tmp_chunk) Delete_Chunk(tmp_chunk->disk, tmp_chunk); if (usr_chunk) Delete_Chunk(usr_chunk->disk, usr_chunk); if (home_chunk) Delete_Chunk(home_chunk->disk, home_chunk); record_label_chunks(devs, dev); } return(msg); } static int diskLabelNonInteractive(Device *dev) { char *cp; PartType type; PartInfo *p; u_long flags = 0; int i, status; Device **devs; Disk *d; status = DITEM_SUCCESS; cp = variable_get(VAR_DISK); if (!cp) { msgConfirm("diskLabel: No disk selected - can't label automatically."); return DITEM_FAILURE; } devs = deviceFind(cp, DEVICE_TYPE_DISK); if (!devs) { msgConfirm("diskLabel: No disk device %s found!", cp); return DITEM_FAILURE; } if (dev) d = dev->private; else d = devs[0]->private; -#ifdef __alpha__ +#if defined(__alpha__) || defined(__sparc64__) maybe_dedicate(d); #endif record_label_chunks(devs, dev); for (i = 0; label_chunk_info[i].c; i++) { Chunk *c1 = label_chunk_info[i].c; if (label_chunk_info[i].type == PART_SLICE) { char name[512]; int entries = 1; while (entries) { snprintf(name, sizeof name, "%s-%d", c1->name, entries); if ((cp = variable_get(name)) != NULL) { int sz, soft = 0; char typ[10], mpoint[50]; if (sscanf(cp, "%s %d %s %d", typ, &sz, mpoint, &soft) < 3) { msgConfirm("For slice entry %s, got an invalid detail entry of: %s", c1->name, cp); status = DITEM_FAILURE; continue; } else { Chunk *tmp; if (!strcmp(typ, "swap")) { type = PART_SWAP; strcpy(mpoint, "SWAP"); } else { type = PART_FILESYSTEM; if (!strcmp(mpoint, "/")) flags |= CHUNK_IS_ROOT; else flags &= ~CHUNK_IS_ROOT; } if (!sz) sz = space_free(c1); if (sz > space_free(c1)) { msgConfirm("Not enough free space to create partition: %s", mpoint); status = DITEM_FAILURE; continue; } if (!(tmp = Create_Chunk_DWIM(d, c1, sz, part, (type == PART_SWAP) ? FS_SWAP : FS_BSDFFS, flags))) { msgConfirm("Unable to create from partition spec: %s. Too big?", cp); status = DITEM_FAILURE; break; } else { tmp->private_data = new_part(mpoint, TRUE, sz); tmp->private_free = safe_free; ((PartInfo *)tmp->private_data)->soft = soft; status = DITEM_SUCCESS; } } entries++; } else { /* No more matches, leave the loop */ entries = 0; } } } else { /* Must be something we can set a mountpoint for */ cp = variable_get(c1->name); if (cp) { char mpoint[50], do_newfs[8]; Boolean newfs = FALSE; do_newfs[0] = '\0'; if (sscanf(cp, "%s %s", mpoint, do_newfs) != 2) { msgConfirm("For slice entry %s, got an invalid detail entry of: %s", c1->name, cp); status = DITEM_FAILURE; continue; } newfs = toupper(do_newfs[0]) == 'Y' ? TRUE : FALSE; if (c1->private_data) { p = c1->private_data; p->newfs = newfs; strcpy(p->mountpoint, mpoint); } else { c1->private_data = new_part(mpoint, newfs, 0); c1->private_free = safe_free; } if (!strcmp(mpoint, "/")) c1->flags |= CHUNK_IS_ROOT; else c1->flags &= ~CHUNK_IS_ROOT; } } } if (status == DITEM_SUCCESS) variable_set2(DISK_LABELLED, "yes", 0); return status; } Index: head/usr.sbin/sade/main.c =================================================================== --- head/usr.sbin/sade/main.c (revision 104939) +++ head/usr.sbin/sade/main.c (revision 104940) @@ -1,179 +1,179 @@ /* * The new sysinstall program. * * This is probably the last attempt in the `sysinstall' line, the next * generation being slated for what's essentially a complete rewrite. * * $FreeBSD$ * * 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. * * 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 const char *StartName; /* Initial contents of argv[0] */ static void screech(int sig) { msgDebug("\007Signal %d caught! That's bad!\n", sig); longjmp(BailOut, sig); } int main(int argc, char **argv) { int choice, scroll, curr, max, status; /* Record name to be able to restart */ StartName = argv[0]; /* Catch fatal signals and complain about them if running as init */ if (getpid() == 1) { signal(SIGBUS, screech); signal(SIGSEGV, screech); } signal(SIGPIPE, SIG_IGN); /* We don't work too well when running as non-root anymore */ if (geteuid() != 0) { fprintf(stderr, "Error: This utility should only be run as root.\n"); return 1; } #ifdef PC98 { /* XXX */ char *p = getenv("TERM"); if (p && strcmp(p, "cons25") == 0) putenv("TERM=cons25w"); } #endif /* Set up whatever things need setting up */ systemInitialize(argc, argv); /* Set default flag and variable values */ installVarDefaults(NULL); /* only when multi-user is it reasonable to do this here */ if (!RunningAsInit) installEnvironment(); if (argc > 1 && !strcmp(argv[1], "-fake")) { variable_set2(VAR_DEBUG, "YES", 0); Fake = TRUE; msgConfirm("I'll be just faking it from here on out, OK?"); } if (argc > 1 && !strcmp(argv[1], "-restart")) Restarting = TRUE; /* Try to preserve our scroll-back buffer */ if (OnVTY) { for (curr = 0; curr < 25; curr++) putchar('\n'); } /* Move stderr aside */ if (DebugFD) dup2(DebugFD, 2); /* Initialize driver modules, if we haven't already done so (ie, the user hit Ctrl-C -> Restart. */ if (!pvariable_get("modulesInitialize")) { moduleInitialize(); pvariable_set("modulesInitialize=1"); } /* Initialize PC-card, if we haven't already done so. */ #ifdef PCCARD_ARCH if (!pvariable_get("pccardInitialize")) { pccardInitialize(); pvariable_set("pccardInitialize=1"); } #endif /* Initialize USB, if we haven't already done so. */ if (!pvariable_get("usbInitialize")) { usbInitialize(); pvariable_set("usbInitialize=1"); } /* Probe for all relevant devices on the system */ deviceGetAll(); /* First, see if we have any arguments to process (and argv[0] counts if it's not "sysinstall") */ if (!RunningAsInit) { int i, start_arg; if (!strstr(argv[0], "sysinstall")) start_arg = 0; else if (Fake || Restarting) start_arg = 2; else start_arg = 1; for (i = start_arg; i < argc; i++) { if (DITEM_STATUS(dispatchCommand(argv[i])) != DITEM_SUCCESS) systemShutdown(1); } if (argc > start_arg) systemShutdown(0); } else dispatch_load_file_int(TRUE); status = setjmp(BailOut); if (status) { msgConfirm("A signal %d was caught - I'm saving what I can and shutting\n" "down. If you can reproduce the problem, please turn Debug on\n" "in the Options menu for the extra information it provides\n" "in debugging problems like this.", status); systemShutdown(status); } /* Begin user dialog at outer menu */ dialog_clear(); while (1) { choice = scroll = curr = max = 0; dmenuOpen(&MenuInitial, &choice, &scroll, &curr, &max, TRUE); if (getpid() != 1 -#ifdef __alpha__ +#if defined(__alpha__) || defined(__sparc64__) || !msgNoYes("Are you sure you wish to exit? The system will halt.") #else || !msgNoYes("Are you sure you wish to exit? The system will reboot\n" "(be sure to remove any floppies/CDs/DVDs from the drives).") #endif ) break; } /* Say goodnight, Gracie */ systemShutdown(0); return 0; /* We should never get here */ } Index: head/usr.sbin/sade/menus.c =================================================================== --- head/usr.sbin/sade/menus.c (revision 104939) +++ head/usr.sbin/sade/menus.c (revision 104940) @@ -1,2157 +1,2160 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * * 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. * * 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. * */ #ifndef lint static const char rcsid[] = "$FreeBSD$"; #endif #include "sysinstall.h" /* Miscellaneous work routines for menus */ static int setSrc(dialogMenuItem *self) { Dists |= DIST_SRC; SrcDists = DIST_SRC_ALL; CRYPTODists |= (DIST_CRYPTO_SCRYPTO | DIST_CRYPTO_SSECURE | DIST_CRYPTO_SKERBEROS4 | DIST_CRYPTO_SKERBEROS5); return DITEM_SUCCESS | DITEM_REDRAW; } static int clearSrc(dialogMenuItem *self) { Dists &= ~DIST_SRC; SrcDists = 0; CRYPTODists &= ~(DIST_CRYPTO_SCRYPTO | DIST_CRYPTO_SSECURE | DIST_CRYPTO_SKERBEROS4 | DIST_CRYPTO_SKERBEROS5); return DITEM_SUCCESS | DITEM_REDRAW; } static int setX11Misc(dialogMenuItem *self) { XF86Dists |= DIST_XF86_MISC_ALL; Dists |= DIST_XF86; return DITEM_SUCCESS | DITEM_REDRAW; } static int clearX11Misc(dialogMenuItem *self) { XF86Dists &= ~DIST_XF86_MISC_ALL; if (!XF86ServerDists && !XF86FontDists) Dists &= ~DIST_XF86; return DITEM_SUCCESS | DITEM_REDRAW; } static int setX11Servers(dialogMenuItem *self) { XF86Dists |= DIST_XF86_SERVER; XF86ServerDists = DIST_XF86_SERVER_ALL; return DITEM_SUCCESS | DITEM_REDRAW; } static int clearX11Servers(dialogMenuItem *self) { XF86Dists &= ~DIST_XF86_SERVER; XF86ServerDists = 0; return DITEM_SUCCESS | DITEM_REDRAW; } static int setX11Fonts(dialogMenuItem *self) { XF86Dists |= DIST_XF86_FONTS; XF86FontDists = DIST_XF86_FONTS_ALL; return DITEM_SUCCESS | DITEM_REDRAW; } static int clearX11Fonts(dialogMenuItem *self) { XF86Dists &= ~DIST_XF86_FONTS; XF86FontDists = 0; return DITEM_SUCCESS | DITEM_REDRAW; } #define _IS_SET(dist, set) (((dist) & (set)) == (set)) #define IS_DEVELOPER(dist, extra) (_IS_SET(dist, _DIST_DEVELOPER | extra) || \ _IS_SET(dist, _DIST_DEVELOPER | extra)) #define IS_USER(dist, extra) (_IS_SET(dist, _DIST_USER | extra) || \ _IS_SET(dist, _DIST_USER | extra)) static int checkDistDeveloper(dialogMenuItem *self) { return IS_DEVELOPER(Dists, 0) && _IS_SET(SrcDists, DIST_SRC_ALL); } static int checkDistXDeveloper(dialogMenuItem *self) { return IS_DEVELOPER(Dists, DIST_XF86) && _IS_SET(SrcDists, DIST_SRC_ALL); } static int checkDistKernDeveloper(dialogMenuItem *self) { return IS_DEVELOPER(Dists, 0) && _IS_SET(SrcDists, DIST_SRC_SYS); } static int checkDistXKernDeveloper(dialogMenuItem *self) { return IS_DEVELOPER(Dists, DIST_XF86) && _IS_SET(SrcDists, DIST_SRC_SYS); } static int checkDistUser(dialogMenuItem *self) { return IS_USER(Dists, 0); } static int checkDistXUser(dialogMenuItem *self) { return IS_USER(Dists, DIST_XF86); } static int checkDistMinimum(dialogMenuItem *self) { return Dists == (DIST_BASE | DIST_CRYPTO); } static int checkDistEverything(dialogMenuItem *self) { return Dists == DIST_ALL && CRYPTODists == DIST_CRYPTO_ALL && \ _IS_SET(SrcDists, DIST_SRC_ALL) && \ _IS_SET(XF86Dists, DIST_XF86_ALL) && \ _IS_SET(XF86ServerDists, DIST_XF86_SERVER_ALL) && \ _IS_SET(XF86FontDists, DIST_XF86_FONTS_ALL); } static int srcFlagCheck(dialogMenuItem *item) { return SrcDists; } static int x11FlagCheck(dialogMenuItem *item) { return Dists & DIST_XF86; } static int checkTrue(dialogMenuItem *item) { return TRUE; } /* 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. */ DMenu MenuIndex = { DMENU_NORMAL_TYPE, "Glossary of functions", "This menu contains an alphabetized index of the top level functions in\n" "this program (sysinstall). Invoke an option by pressing [SPACE] or\n" "[ENTER]. To exit, use [TAB] to move to the Cancel button.", "Use PageUp or PageDown to move through this menu faster!", NULL, { { " Anon FTP", "Configure anonymous FTP logins.", dmenuVarCheck, configAnonFTP, NULL, "anon_ftp" }, { " Commit", "Commit any pending actions (dangerous!)", NULL, installCustomCommit }, { " Console settings", "Customize system console behavior.", NULL, dmenuSubmenu, NULL, &MenuSyscons }, { " Configure", "The system configuration menu.", NULL, dmenuSubmenu, NULL, &MenuConfigure }, { " Defaults, Load", "Load default settings.", NULL, dispatch_load_floppy }, { " Device, Mouse", "The mouse configuration menu.", NULL, dmenuSubmenu, NULL, &MenuMouse }, { " Disklabel", "The disk Label editor", NULL, diskLabelEditor }, { " Dists, All", "Root of the distribution tree.", NULL, dmenuSubmenu, NULL, &MenuDistributions }, { " Dists, Basic", "Basic FreeBSD distribution menu.", NULL, dmenuSubmenu, NULL, &MenuSubDistributions }, { " Dists, Developer", "Select developer's distribution.", checkDistDeveloper, distSetDeveloper }, { " Dists, Src", "Src distribution menu.", NULL, dmenuSubmenu, NULL, &MenuSrcDistributions }, { " Dists, X Developer", "Select X developer's distribution.", checkDistXDeveloper, distSetXDeveloper }, { " Dists, Kern Developer", "Select kernel developer's distribution.", checkDistKernDeveloper, distSetKernDeveloper }, { " Dists, User", "Select average user distribution.", checkDistUser, distSetUser }, { " Dists, X User", "Select average X user distribution.", checkDistXUser, distSetXUser }, { " Distributions, Adding", "Installing additional distribution sets", NULL, distExtractAll }, { " Distributions, XFree86","XFree86 distribution menu.", NULL, distSetXF86 }, { " Documentation", "Installation instructions, README, etc.", NULL, dmenuSubmenu, NULL, &MenuDocumentation }, { " Doc, README", "The distribution README file.", NULL, dmenuDisplayFile, NULL, "README" }, { " Doc, Errata", "The distribution errata.", NULL, dmenuDisplayFile, NULL, "ERRATA" }, { " Doc, Hardware", "The distribution hardware guide.", NULL, dmenuDisplayFile, NULL, "HARDWARE" }, { " Doc, Install", "The distribution installation guide.", NULL, dmenuDisplayFile, NULL, "INSTALL" }, { " Doc, Copyright", "The distribution copyright notices.", NULL, dmenuDisplayFile, NULL, "COPYRIGHT" }, { " Doc, Release", "The distribution release notes.", NULL, dmenuDisplayFile, NULL, "RELNOTES" }, { " Doc, HTML", "The HTML documentation menu.", NULL, docBrowser }, { " Dump Vars", "(debugging) dump out internal variables.", NULL, dump_variables }, { " Emergency shell", "Start an Emergency Holographic shell.", NULL, installFixitHoloShell }, #if defined(__i386__) || defined(__ia64__) { " Fdisk", "The disk Partition Editor", NULL, diskPartitionEditor }, #endif { " Fixit", "Repair mode with CDROM or fixit floppy.", NULL, dmenuSubmenu, NULL, &MenuFixit }, { " FTP sites", "The FTP mirror site listing.", NULL, dmenuSubmenu, NULL, &MenuMediaFTP }, { " Gateway", "Set flag to route packets between interfaces.", dmenuVarCheck, dmenuToggleVariable, NULL, "gateway=YES" }, { " HTML Docs", "The HTML documentation menu", NULL, docBrowser }, { " inetd Configuration", "Configure inetd and simple internet services.", dmenuVarCheck, configInetd, NULL, "inetd_enable=YES" }, { " Install, Standard", "A standard system installation.", NULL, installStandard }, { " Install, Express", "An express system installation.", NULL, installExpress }, { " Install, Custom", "The custom installation menu", NULL, dmenuSubmenu, NULL, &MenuInstallCustom }, { " Label", "The disk Label editor", NULL, diskLabelEditor }, { " Media", "Top level media selection menu.", NULL, dmenuSubmenu, NULL, &MenuMedia }, { " Media, Tape", "Select tape installation media.", NULL, mediaSetTape }, { " Media, NFS", "Select NFS installation media.", NULL, mediaSetNFS }, { " Media, Floppy", "Select floppy installation media.", NULL, mediaSetFloppy }, { " Media, CDROM/DVD", "Select CDROM/DVD installation media.", NULL, mediaSetCDROM }, { " Media, DOS", "Select DOS installation media.", NULL, mediaSetDOS }, { " Media, UFS", "Select UFS installation media.", NULL, mediaSetUFS }, { " Media, FTP", "Select FTP installation media.", NULL, mediaSetFTP }, { " Media, FTP Passive", "Select passive FTP installation media.", NULL, mediaSetFTPPassive }, { " Media, HTTP", "Select FTP via HTTP proxy installation media.", NULL, mediaSetHTTP }, { " Network Interfaces", "Configure network interfaces", NULL, tcpMenuSelect }, { " Networking Services", "The network services menu.", NULL, dmenuSubmenu, NULL, &MenuNetworking }, { " NFS, client", "Set NFS client flag.", dmenuVarCheck, dmenuToggleVariable, NULL, "nfs_client_enable=YES" }, { " NFS, server", "Set NFS server flag.", dmenuVarCheck, configNFSServer, NULL, "nfs_server_enable=YES" }, { " NTP Menu", "The NTP configuration menu.", NULL, dmenuSubmenu, NULL, &MenuNTP }, { " Options", "The options editor.", NULL, optionsEditor }, { " Packages", "The packages collection", NULL, configPackages }, { " Partition", "The disk Slice (PC-style partition) Editor", NULL, diskPartitionEditor }, { " PCNFSD", "Run authentication server for PC-NFS.", dmenuVarCheck, configPCNFSD, NULL, "pcnfsd" }, { " Root Password", "Set the system manager's password.", NULL, dmenuSystemCommand, NULL, "passwd root" }, { " Router", "Select routing daemon (default: routed)", NULL, configRouter, NULL, "router_enable" }, { " Security", "Configure system security options", NULL, dmenuSubmenu, NULL, &MenuSecurity }, { " Syscons", "The system console configuration menu.", NULL, dmenuSubmenu, NULL, &MenuSyscons }, { " Syscons, Font", "The console screen font.", NULL, dmenuSubmenu, NULL, &MenuSysconsFont }, { " Syscons, Keymap", "The console keymap configuration menu.", NULL, dmenuSubmenu, NULL, &MenuSysconsKeymap }, { " Syscons, Keyrate", "The console key rate configuration menu.", NULL, dmenuSubmenu, NULL, &MenuSysconsKeyrate }, { " Syscons, Saver", "The console screen saver configuration menu.", NULL, dmenuSubmenu, NULL, &MenuSysconsSaver }, { " Syscons, Screenmap", "The console screenmap configuration menu.", NULL, dmenuSubmenu, NULL, &MenuSysconsScrnmap }, { " Syscons, Ttys", "The console terminal type menu.", NULL, dmenuSubmenu, NULL, &MenuSysconsTtys }, { " Time Zone", "Set the system's time zone.", NULL, dmenuSystemCommand, NULL, "tzsetup" }, { " TTYs", "Configure system ttys.", NULL, configEtcTtys, NULL, "ttys" }, { " Upgrade", "Upgrade an existing system.", NULL, installUpgrade }, { " Usage", "Quick start - How to use this menu system.", NULL, dmenuDisplayFile, NULL, "usage" }, { " User Management", "Add user and group information.", NULL, dmenuSubmenu, NULL, &MenuUsermgmt }, { " XFree86, Fonts", "XFree86 Font selection menu.", NULL, dmenuSubmenu, NULL, &MenuXF86SelectFonts }, { " XFree86, Server", "XFree86 Server selection menu.", NULL, dmenuSubmenu, NULL, &MenuXF86SelectServer }, #if defined(__i386__) && defined(PC98) { " XFree86, PC98 Server", "XFree86 PC98 Server selection menu.", NULL, dmenuSubmenu, NULL, &MenuXF86SelectPC98Server }, #endif { NULL } }, }; /* The initial installation menu */ DMenu MenuInitial = { DMENU_NORMAL_TYPE, "sysinstall Main Menu", /* title */ "Welcome to the FreeBSD installation and configuration tool. Please\n" /* prompt */ "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 with [SPACE] or [ENTER]. To exit, use [TAB] to move to Exit.", "Press F1 for Installation Guide", /* help line */ "INSTALL", /* help file */ { { "Select" }, { "X Exit Install", NULL, NULL, dmenuExit }, { " Usage", "Quick start - How to use this menu system", NULL, dmenuDisplayFile, NULL, "usage" }, { "Standard", "Begin a standard installation (recommended)", NULL, installStandard }, { "Express", "Begin a quick installation (for experts)", NULL, installExpress }, { " Custom", "Begin a custom installation (for experts)", NULL, dmenuSubmenu, NULL, &MenuInstallCustom }, { "Configure", "Do post-install configuration of FreeBSD", NULL, dmenuSubmenu, NULL, &MenuConfigure }, { "Doc", "Installation instructions, README, etc.", NULL, dmenuSubmenu, NULL, &MenuDocumentation }, { "Keymap", "Select keyboard type", NULL, dmenuSubmenu, NULL, &MenuSysconsKeymap }, { "Options", "View/Set various installation options", NULL, optionsEditor }, { "Fixit", "Repair mode with CDROM/DVD/floppy or start shell", NULL, dmenuSubmenu, NULL, &MenuFixit }, { "Upgrade", "Upgrade an existing system", NULL, installUpgrade }, { "Load Config","Load default install configuration", NULL, dispatch_load_floppy }, { "Index", "Glossary of functions", NULL, dmenuSubmenu, NULL, &MenuIndex }, { NULL } }, }; /* The main documentation menu */ DMenu MenuDocumentation = { DMENU_NORMAL_TYPE, "FreeBSD Documentation Menu", "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", { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "1 README", "A general description of FreeBSD. Read this!", NULL, dmenuDisplayFile, NULL, "README" }, { "2 Errata", "Late-breaking, post-release news.", NULL, dmenuDisplayFile, NULL, "ERRATA" }, { "3 Hardware", "The FreeBSD survival guide for PC hardware.", NULL, dmenuDisplayFile, NULL, "HARDWARE" }, { "4 Install", "A step-by-step guide to installing FreeBSD.", NULL, dmenuDisplayFile, NULL, "INSTALL" }, { "5 Copyright", "The FreeBSD Copyright notices.", NULL, dmenuDisplayFile, NULL, "COPYRIGHT" }, { "6 Release" ,"The release notes for this version of FreeBSD.", NULL, dmenuDisplayFile, NULL, "RELNOTES" }, { "7 Shortcuts", "Creating shortcuts to sysinstall.", NULL, dmenuDisplayFile, NULL, "shortcuts" }, { "8 HTML Docs", "Go to the HTML documentation menu (post-install).", NULL, docBrowser }, { NULL } }, }; DMenu MenuMouseType = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Select a protocol type for your mouse", "If your mouse is attached to the PS/2 mouse port or the bus mouse port,\n" "you should always choose \"Auto\", regardless of the model and the brand\n" "of the mouse. All other protocol types are for serial mice and should\n" "not be used with the PS/2 port mouse or the bus mouse. If you have\n" "a serial mouse and are not sure about its protocol, you should also try\n" "\"Auto\". It may not work for the serial mouse if the mouse does not\n" "support the PnP standard. But, it won't hurt. Many 2-button serial mice\n" "are compatible with \"Microsoft\" or \"MouseMan\". 3-button serial mice\n" "may be compatible with \"MouseSystems\" or \"MouseMan\". If the serial\n" "mouse has a wheel, it may be compatible with \"IntelliMouse\".", NULL, NULL, { { "1 Auto", "Bus mouse, PS/2 style mouse or PnP serial mouse", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=auto" }, { "2 GlidePoint", "ALPS GlidePoint pad (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=glidepoint" }, { "3 Hitachi","Hitachi tablet (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=mmhittab" }, { "4 IntelliMouse", "Microsoft IntelliMouse (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=intellimouse" }, { "5 Logitech", "Logitech protocol (old models) (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=logitech" }, { "6 Microsoft", "Microsoft protocol (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=microsoft" }, { "7 MM Series","MM Series protocol (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=mmseries" }, { "8 MouseMan", "Logitech MouseMan/TrackMan models (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=mouseman" }, { "9 MouseSystems", "MouseSystems protocol (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=mousesystems" }, { "A ThinkingMouse","Kensington ThinkingMouse (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=thinkingmouse" }, { NULL } }, }; DMenu MenuMousePort = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Select your mouse port from the following menu", "The built-in pointing device of laptop/notebook computers is usually\n" "a PS/2 style device.", NULL, NULL, { { "1 PS/2", "PS/2 style mouse (/dev/psm0)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/psm0" }, { "2 COM1", "Serial mouse on COM1 (/dev/cuaa0)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuaa0" }, { "3 COM2", "Serial mouse on COM2 (/dev/cuaa1)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuaa1" }, { "4 COM3", "Serial mouse on COM3 (/dev/cuaa2)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuaa2" }, { "5 COM4", "Serial mouse on COM4 (/dev/cuaa3)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuaa3" }, { "6 BusMouse", "Logitech, ATI or MS bus mouse (/dev/mse0)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/mse0" }, { NULL } }, }; DMenu MenuMouse = { DMENU_NORMAL_TYPE, "Please configure your mouse", "You can cut and paste text in the text console by running the mouse\n" "daemon. Specify a port and a protocol type of your mouse and enable\n" "the mouse daemon. If you don't want this feature, select 6 to disable\n" "the daemon.\n" "Once you've enabled the mouse daemon, you can specify \"/dev/sysmouse\"\n" "as your mouse device and \"SysMouse\" or \"MouseSystems\" as mouse\n" "protocol when running the X configuration utility (see Configuration\n" "menu).", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "2 Enable", "Test and run the mouse daemon", NULL, mousedTest, NULL, NULL }, { "3 Type", "Select mouse protocol type", NULL, dmenuSubmenu, NULL, &MenuMouseType }, { "4 Port", "Select mouse port", NULL, dmenuSubmenu, NULL, &MenuMousePort }, { "5 Flags", "Set additional flags", dmenuVarCheck, setMouseFlags, NULL, VAR_MOUSED_FLAGS "=" }, { "6 Disable", "Disable the mouse daemon", NULL, mousedDisable, NULL, NULL }, { NULL } }, }; DMenu MenuMediaCDROM = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Choose a CD/DVD type", "FreeBSD can be installed directly from a CD/DVD containing a valid\n" "FreeBSD distribution. If you are seeing this menu it is because\n" "more than one CD/DVD drive was found on your system. Please select one\n" "of the following CD/DVD drives as your installation drive.", "Press F1 to read the installation guide", "INSTALL", { { NULL } }, }; DMenu MenuMediaFloppy = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Choose a Floppy drive", "You have more than one floppy drive. Please choose which drive\n" "you would like to use.", 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", { { NULL } }, }; DMenu MenuMediaFTP = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Please select a FreeBSD FTP distribution site", "Please select the site closest to you or \"other\" if you'd like to\n" "specify a different choice. Also note that not every site listed here\n" "carries more than the base distribution kits. Only the Primary site is\n" "guaranteed to carry the full range of possible distributions.", "Select a site that's close!", "INSTALL", { { "Primary Site", "ftp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.freebsd.org" }, { "URL", "Specify some other ftp site by URL", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=other" }, { " 5.0 SNAP Server", "current.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://current.freebsd.org" }, { " 4.x SNAP Server", "releng4.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://releng4.freebsd.org" }, { " jp.FreeBSD.org SNAP Server", "snapshots.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://snapshots.jp.freebsd.org" }, { " IPv6 Ready", "ftp2.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.jp.freebsd.org" }, { " IPv6 Ready #2", "ftp7.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp7.jp.freebsd.org" }, { "Argentina", "ftp.ar.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ar.freebsd.org" }, { " Australia", "ftp.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.au.freebsd.org" }, { " Australia #2","ftp2.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.au.freebsd.org" }, { " Australia #3","ftp3.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.au.freebsd.org" }, { " Australia #4","ftp4.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.au.freebsd.org" }, { " Australia #5","ftp5.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.au.freebsd.org" }, { "Brazil", "ftp.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.br.freebsd.org" }, { " Brazil #2", "ftp2.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.br.freebsd.org" }, { " Brazil #3", "ftp3.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.br.freebsd.org" }, { " Brazil #4", "ftp4.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.br.freebsd.org" }, { " Brazil #5", "ftp5.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.br.freebsd.org" }, { " Brazil #6", "ftp6.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp6.br.freebsd.org" }, { " Brazil #7", "ftp7.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp7.br.freebsd.org" }, { " Canada", "ftp.ca.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ca.freebsd.org" }, { " Czech Republic", "ftp.cz.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.cz.freebsd.org" }, { "Denmark (Primary)", "ftp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.dk.freebsd.org" }, { " Denmark", "ftp.dk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.dk.freebsd.org" }, { " Denmark #2", "ftp2.dk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.dk.freebsd.org" }, { "Estonia", "ftp.ee.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ee.freebsd.org" }, { "Finland", "ftp.fi.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.fi.freebsd.org" }, { " France", "ftp.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.fr.freebsd.org" }, { " France #1", "ftp.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.fr.freebsd.org" }, { " France #2", "ftp2.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.fr.freebsd.org" }, { " France #3", "ftp3.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.fr.freebsd.org" }, { " France #4", "ftp4.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.fr.freebsd.org" }, { " France #5", "ftp5.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.fr.freebsd.org" }, { " France #6", "ftp6.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp6.fr.freebsd.org" }, { " France #7", "ftp7.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp7.fr.freebsd.org" }, { " France #8", "ftp8.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp8.fr.freebsd.org" }, { "Germany", "ftp.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.de.freebsd.org" }, { " Germany #2", "ftp2.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.de.freebsd.org" }, { " Germany #3", "ftp3.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.de.freebsd.org" }, { " Germany #4", "ftp4.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.de.freebsd.org" }, { " Germany #5", "ftp5.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.de.freebsd.org" }, { " Germany #6", "ftp6.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp6.de.freebsd.org" }, { " Germany #7", "ftp7.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp7.de.freebsd.org" }, { " Greece", "ftp.gr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.gr.freebsd.org" }, { " Greece #2", "ftp2.gr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.gr.freebsd.org" }, { "Holland", "ftp.nl.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.nl.freebsd.org" }, { " Hong Kong", "ftp.hk.super.net", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.hk.super.net" }, { " Hungary", "ftp.hu.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.hu.freebsd.org" }, { "Iceland", "ftp.is.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.is.freebsd.org" }, { " Ireland", "ftp.ie.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ie.freebsd.org" }, { " Israel", "ftp.il.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.il.freebsd.org" }, { " Israel #2", "ftp2.il.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.il.freebsd.org" }, { "Japan", "ftp.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.jp.freebsd.org" }, { " Japan #2", "ftp2.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.jp.freebsd.org" }, { " Japan #3", "ftp3.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.jp.freebsd.org" }, { " Japan #4", "ftp4.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.jp.freebsd.org" }, { " Japan #5", "ftp5.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.jp.freebsd.org" }, { " Japan #6", "ftp6.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp6.jp.freebsd.org" }, { " Japan #7", "ftp7.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp7.jp.freebsd.org" }, { "Korea", "ftp.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.kr.freebsd.org" }, { " Korea #2", "ftp2.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.kr.freebsd.org" }, { " Korea #3", "ftp3.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.kr.freebsd.org" }, { " Korea #4", "ftp4.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.kr.freebsd.org" }, { " Korea #5", "ftp5.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.kr.freebsd.org" }, { "Lithuania", "ftp.lt.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.lt.freebsd.org" }, { "New Zealand", "ftp.nz.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.nz.freebsd.org" }, { "Norway", "ftp.no.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.no.freebsd.org" }, { "Poland", "ftp.pl.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.pl.freebsd.org" }, { " Portugal", "ftp.pt.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.pt.freebsd.org" }, { " Portugal #2", "ftp2.pt.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.pt.freebsd.org" }, { "Romania", "ftp.ro.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ro.freebsd.org" }, { " Russia", "ftp.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ru.freebsd.org" }, { " Russia #2", "ftp2.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.ru.freebsd.org" }, { " Russia #3", "ftp3.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.ru.freebsd.org" }, { " Russia #4", "ftp4.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.ru.freebsd.org" }, { "Slovak Republic", "ftp.sk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.sk.freebsd.org" }, { "Slovenia", "ftp.si.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.si.freebsd.org" }, { " South Africa", "ftp.za.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.za.freebsd.org" }, { " South Africa #2", "ftp2.za.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.za.freebsd.org" }, { " South Africa #3", "ftp3.za.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.za.freebsd.org" }, { " South Africa #4", "ftp4.za.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.za.freebsd.org" }, { " Spain", "ftp.es.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.es.freebsd.org" }, { " Spain #2", "ftp2.es.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.es.freebsd.org" }, { " Spain #3", "ftp3.es.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.es.freebsd.org" }, { " Sweden", "ftp.se.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.se.freebsd.org" }, { " Sweden #2", "ftp2.se.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.se.freebsd.org" }, { " Sweden #3", "ftp3.se.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.se.freebsd.org" }, { "Taiwan", "ftp.tw.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.tw.freebsd.org" }, { " Taiwan #2", "ftp2.tw.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.tw.freebsd.org" }, { " Taiwan #3", "ftp3.tw.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.tw.freebsd.org" }, { " Taiwan #4", "ftp4.tw.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.tw.freebsd.org" }, { " Thailand", "ftp.nectec.or.th", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.nectec.or.th/pub/mirrors/FreeBSD/" }, { "UK", "ftp.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.uk.freebsd.org" }, { " UK #2", "ftp2.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.uk.freebsd.org" }, { " UK #3", "ftp3.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.uk.freebsd.org" }, { " UK #4", "ftp4.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.uk.freebsd.org" }, { " UK #5", "ftp5.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.uk.freebsd.org" }, { " Ukraine", "ftp.ua.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ua.freebsd.org" }, { " Ukraine #2", "ftp2.ua.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.ua.freebsd.org" }, { " Ukraine #3", "ftp3.ua.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.ua.freebsd.org" }, { " USA #2", "ftp2.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.freebsd.org" }, { " USA #3", "ftp3.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.freebsd.org" }, { " USA #4", "ftp4.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.freebsd.org" }, { " USA #5", "ftp5.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.freebsd.org" }, { " USA #6", "ftp6.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp6.freebsd.org" }, { 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", { { NULL } }, }; DMenu MenuNetworkDevice = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Network interface information required", "If you are using PPP over a serial device, as opposed to a direct\n" "ethernet connection, then you may first need to dial your Internet\n" "Service Provider using the ppp utility we provide for that purpose.\n" "If you're using SLIP over a serial device then the expectation is\n" "that you have a HARDWIRED connection.\n\n" "You can also install over a parallel port using a special \"laplink\"\n" "cable to another machine running a fairly recent (2.0R or later)\n" "version of FreeBSD.", "Press F1 to read network configuration manual", "network_device", { { NULL } }, }; /* Prototype KLD load menu */ DMenu MenuKLD = { DMENU_NORMAL_TYPE, "KLD Menu", "Load a KLD from a floppy\n", NULL, NULL, { { 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 an Internet FTP server. If you're\n" "installing FreeBSD from a supported CD/DVD drive then this is generally\n" "the best media to use if you have no overriding reason for using other\n" "media.", "Press F1 for more information on the various media types", "media", { { "1 CD/DVD", "Install from a FreeBSD CD/DVD", NULL, mediaSetCDROM }, { "2 FTP", "Install from an FTP server", NULL, mediaSetFTPActive }, { "3 FTP Passive", "Install from an FTP server through a firewall", NULL, mediaSetFTPPassive }, { "4 HTTP", "Install from an FTP server through a http proxy", NULL, mediaSetHTTP }, { "5 DOS", "Install from a DOS partition", NULL, mediaSetDOS }, { "6 NFS", "Install over NFS", NULL, mediaSetNFS }, { "7 File System", "Install from an existing filesystem", NULL, mediaSetUFS }, { "8 Floppy", "Install from a floppy disk set", NULL, mediaSetFloppy }, { "9 Tape", "Install from SCSI or QIC tape", NULL, mediaSetTape }, { "X Options", "Go to the Options screen", NULL, optionsEditor }, { NULL } }, }; /* The distributions menu */ DMenu MenuDistributions = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "Choose Distributions", "As a convenience, we provide several \"canned\" distribution sets.\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 the\n" "list of distributions yourself, simply select \"Custom\". You can also\n" "pick a canned distribution set and then fine-tune it with the Custom item.\n\n" "Choose an item by pressing [SPACE] or [ENTER]. When finished, choose the\n" "Exit item or move to the OK button with [TAB].", "Press F1 for more information on these options.", "distributions", { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { "All", "All system sources, binaries and X Window System)", checkDistEverything, distSetEverything, NULL, NULL, ' ', ' ', ' ' }, { "Reset", "Reset selected distribution list to nothing", NULL, distReset, NULL, NULL, ' ', ' ', ' ' }, { "4 Developer", "Full sources, binaries and doc but no games", checkDistDeveloper, distSetDeveloper }, { "5 X-Developer", "Same as above + X Window System", checkDistXDeveloper, distSetXDeveloper }, { "6 Kern-Developer", "Full binaries and doc, kernel sources only", checkDistKernDeveloper, distSetKernDeveloper }, { "7 X-Kern-Developer", "Same as above + X Window System", checkDistXKernDeveloper, distSetXKernDeveloper }, { "8 User", "Average user - binaries and doc only", checkDistUser, distSetUser }, { "9 X-User", "Same as above + X Window System", checkDistXUser, distSetXUser }, { "A Minimal", "The smallest configuration possible", checkDistMinimum, distSetMinimum }, { "B Custom", "Specify your own distribution set", NULL, dmenuSubmenu, NULL, &MenuSubDistributions, '>', '>', '>' }, { NULL } }, }; DMenu MenuSubDistributions = { DMENU_CHECKLIST_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 \"base\".", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { "All", "All system sources, binaries and X Window System", NULL, distSetEverything, NULL, NULL, ' ', ' ', ' ' }, { "Reset", "Reset all of the below", NULL, distReset, NULL, NULL, ' ', ' ', ' ' }, { " base", "Binary base distribution (required)", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_BASE }, #ifdef __i386__ { " compat1x", "FreeBSD 1.x binary compatibility", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_COMPAT1X }, { " compat20", "FreeBSD 2.0 binary compatibility", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_COMPAT20 }, { " compat21", "FreeBSD 2.1 binary compatibility", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_COMPAT21 }, { " compat22", "FreeBSD 2.2.x and 3.0 a.out binary compatibility", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_COMPAT22 }, #if __FreeBSD__ > 3 { " compat3x", "FreeBSD 3.x binary compatibility", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_COMPAT3X }, #endif #if __FreeBSD__ >= 4 { " compat4x", "FreeBSD 4.x binary compatibility", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_COMPAT4X }, #endif #endif { " crypto", "Basic encryption services", dmenuFlagCheck, dmenuSetFlag, NULL, &CRYPTODists, '[', 'X', ']', DIST_CRYPTO_CRYPTO, }, #if __FreeBSD__ <= 3 { " krb", "KerberosIV authentication services", dmenuFlagCheck, dmenuSetFlag, NULL, &CRYPTODists, '[', 'X', ']', DIST_CRYPTO_KERBEROS }, #else { " krb4", "KerberosIV authentication services", dmenuFlagCheck, dmenuSetFlag, NULL, &CRYPTODists, '[', 'X', ']', DIST_CRYPTO_KERBEROS4 }, { " krb5", "Kerberos5 authentication services", dmenuFlagCheck, dmenuSetFlag, NULL, &CRYPTODists, '[', 'X', ']', DIST_CRYPTO_KERBEROS5 }, #endif { " dict", "Spelling checker dictionary files", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_DICT }, { " doc", "Miscellaneous FreeBSD online docs", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_DOC }, { " games", "Games (non-commercial)", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_GAMES }, { " info", "GNU info files", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_INFO }, { " man", "System manual pages - recommended", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_MANPAGES }, { " catman", "Preformatted system manual pages", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_CATPAGES }, { " proflibs", "Profiled versions of the libraries", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_PROFLIBS }, { " src", "Sources for everything", srcFlagCheck, distSetSrc }, { " ports", "The FreeBSD Ports collection", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_PORTS }, { " local", "Local additions collection", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_LOCAL}, { " XFree86", "The XFree86 distribution", #ifdef X_AS_PKG dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_XF86 }, #else x11FlagCheck, distSetXF86 }, #endif { NULL } }, }; DMenu MenuSrcDistributions = { DMENU_CHECKLIST_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, { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { "All", "Select all of the below", NULL, setSrc, NULL, NULL, ' ', ' ', ' ' }, { "Reset", "Reset all of the below", NULL, clearSrc, NULL, NULL, ' ', ' ', ' ' }, { " base", "top-level files in /usr/src", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_BASE }, { " contrib", "/usr/src/contrib (contributed software)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_CONTRIB }, { " gnu", "/usr/src/gnu (software from the GNU Project)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_GNU }, { " etc", "/usr/src/etc (miscellaneous system files)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_ETC }, { " games", "/usr/src/games (the obvious!)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_GAMES }, { " include", "/usr/src/include (header files)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_INCLUDE }, { " lib", "/usr/src/lib (system libraries)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_LIB }, { " libexec", "/usr/src/libexec (system programs)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_LIBEXEC }, { " release", "/usr/src/release (release-generation tools)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_RELEASE }, { " bin", "/usr/src/bin (system binaries)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_BIN }, { " sbin", "/usr/src/sbin (system binaries)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_SBIN }, { " scrypto", "/usr/src/crypto (contrib encryption sources)", dmenuFlagCheck, dmenuSetFlag, NULL, &CRYPTODists, '[', 'X', ']', DIST_CRYPTO_SCRYPTO }, { " share", "/usr/src/share (documents and shared files)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_SHARE }, { " skrb4", "/usr/src/kerberosIV (sources for KerberosIV)", dmenuFlagCheck, dmenuSetFlag, NULL, &CRYPTODists, '[', 'X', ']', DIST_CRYPTO_SKERBEROS4 }, { " skrb5", "/usr/src/kerberos5 (sources for Kerberos5)", dmenuFlagCheck, dmenuSetFlag, NULL, &CRYPTODists, '[', 'X', ']', DIST_CRYPTO_SKERBEROS5 }, { " ssecure", "/usr/src/secure (BSD encryption sources)", dmenuFlagCheck, dmenuSetFlag, NULL, &CRYPTODists, '[', 'X', ']', DIST_CRYPTO_SSECURE }, { " sys", "/usr/src/sys (FreeBSD kernel)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_SYS }, { " tools", "/usr/src/tools (miscellaneous tools)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_TOOLS }, { " ubin", "/usr/src/usr.bin (user binaries)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_UBIN }, { " usbin", "/usr/src/usr.sbin (aux system binaries)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_USBIN }, { NULL } }, }; DMenu MenuXF86Config = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Please select the XFree86 configuration tool you want to use.", "The first option, xf86cfg, is fully graphical.\n" "The second option provides a menu-based interface similar to\n" "what you are currently using. " "The third option, xf86config, is\n" "a more simplistic shell-script based tool and less friendly to\n" "new users, but it may work in situations where the other options\n" "do not.", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "2 xf86cfg", "Fully graphical XFree86 configuration tool.", NULL, dmenuSetVariable, NULL, VAR_XF86_CONFIG "=xf86cfg" }, { "3 xf86cfg -textmode", "ncurses-based XFree86 configuration tool.", NULL, dmenuSetVariable, NULL, VAR_XF86_CONFIG "=xf86cfg -textmode" }, { "4 xf86config", "Shell-script based XFree86 configuration tool.", NULL, dmenuSetVariable, NULL, VAR_XF86_CONFIG "=xf86config" }, { "D XDesktop", "X already set up, just do desktop configuration.", NULL, dmenuSubmenu, NULL, &MenuXDesktops }, { NULL } }, }; DMenu MenuXDesktops = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Please select the default X desktop to use.", "By default, XFree86 comes with a fairly vanilla desktop which\n" "is based around the twm(1) window manager and does not offer\n" "much in the way of features. It does have the advantage of\n" "being a standard part of X so you don't need to load anything\n" "extra in order to use it. If, however, you have access to a\n" "reasonably full packages collection on your installation media,\n" "you can choose any one of the following desktops as alternatives.", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "2 KDE", "The K Desktop Environment.", NULL, dmenuSetVariable, NULL, VAR_DESKSTYLE "=kde" }, { "3 GNOME + Sawfish", "GNOME + Sawfish window manager.", NULL, dmenuSetVariable, NULL, VAR_DESKSTYLE "=gnome" }, { "4 GNOME + Enlightenment","GNOME + The E window manager", NULL, dmenuSetVariable, NULL, VAR_DESKSTYLE "=enlightenment" }, { "5 Afterstep", "The Afterstep window manager", NULL, dmenuSetVariable, NULL, VAR_DESKSTYLE "=afterstep" }, { "6 Windowmaker", "The Windowmaker window manager", NULL, dmenuSetVariable, NULL, VAR_DESKSTYLE "=windowmaker" }, { "7 fvwm", "The fvwm window manager", NULL, dmenuSetVariable, NULL, VAR_DESKSTYLE "=fvwm2" }, { NULL } }, }; DMenu MenuXF86Select = { DMENU_NORMAL_TYPE, "XFree86 Distribution", "Please select the components you need from the XFree86\n" "distribution sets.", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "Basic", "Basic component menu (required)", NULL, dmenuSubmenu, NULL, &MenuXF86SelectCore }, { "Server", "X server menu", NULL, dmenuSubmenu, NULL, &MenuXF86SelectServer }, { "Fonts", "Font set menu", NULL, dmenuSubmenu, NULL, &MenuXF86SelectFonts }, { NULL } }, }; DMenu MenuXF86SelectCore = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "XFree86 base distribution types", "Please check off the basic XFree86 components you wish to install.\n" "Bin, lib, and set are recommended for a minimum installaion.", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { "All", "Select all below", NULL, setX11Misc, NULL, NULL, ' ', ' ', ' ' }, { "Reset", "Reset all below", NULL, clearX11Misc, NULL, NULL, ' ', ' ', ' ' }, { " bin", "Client applications and shared libs", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_BIN }, { " lib", "Data files needed at runtime", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_LIB }, { " cfg", "Configuration files", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_CFG }, { " set", "XFree86 Setup Utility", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_SET }, { " man", "Manual pages", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_MAN }, { " doc", "READMEs and release notes", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_DOC }, { " html", "HTML documentation files", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_HTML }, { " lkit", "Server link kit for all other machines", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_LKIT }, { " prog", "Programmer's header and library files", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_PROG }, #if defined(__i386__) && defined(PC98) { " 9set", "XFree86 Setup Utility for PC98 machines", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_9SET }, { " lk98", "Server link kit for PC98 machines", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_LKIT98 }, #endif { NULL } }, }; DMenu MenuXF86SelectFonts = { DMENU_CHECKLIST_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).", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { "All", "All fonts", NULL, setX11Fonts, NULL, NULL, ' ', ' ', ' ' }, { "Reset", "Reset font selections", NULL, clearX11Fonts, NULL, NULL, ' ', ' ', ' ' }, { " fnts", "Standard 75 DPI and miscellaneous fonts", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86FontDists, '[', 'X', ']', DIST_XF86_FONTS_MISC }, { " f100", "100 DPI fonts", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86FontDists, '[', 'X', ']', DIST_XF86_FONTS_100 }, { " fcyr", "Cyrillic Fonts", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86FontDists, '[', 'X', ']', DIST_XF86_FONTS_CYR }, { " fscl", "Speedo and Type scalable fonts", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86FontDists, '[', 'X', ']', DIST_XF86_FONTS_SCALE }, { " non", "Japanese, Chinese and other non-english fonts", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86FontDists, '[', 'X', ']', DIST_XF86_FONTS_NON }, { " server", "Font server", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86FontDists, '[', 'X', ']', DIST_XF86_FONTS_SERVER }, { NULL } }, }; DMenu MenuXF86SelectServer = { DMENU_CHECKLIST_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 or, for PC98\n" "machines, the 9EGC or 9840 servers.", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { "All", "Select all of the above", NULL, setX11Servers, NULL, NULL, ' ', ' ', ' ' }, { "Reset", "Reset all of the above", NULL, clearX11Servers, NULL, NULL, ' ', ' ', ' ' }, { " SVGA", "Standard VGA or Super VGA card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_SVGA }, { " VGA16", "Standard 16 color VGA card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_VGA16 }, { " Mono", "Standard Monochrome card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_MONO }, { " 3DL", "8, 16 and 24 bit color 3D Labs boards", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_3DL }, { " 8514", "8-bit (256 color) IBM 8514 or compatible card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_8514 }, { " AGX", "8-bit AGX card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_AGX }, { " I128", "8, 16 and 24-bit #9 Imagine I128 card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_I128 }, { " Ma8", "8-bit ATI Mach8 card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_MACH8 }, { " Ma32", "8 and 16-bit (65K color) ATI Mach32 card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_MACH32 }, { " Ma64", "8 and 16-bit (65K color) ATI Mach64 card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_MACH64 }, { " P9K", "8, 16, and 24-bit color Weitek P9000 based boards", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_P9000 }, { " S3", "8, 16 and 24-bit color S3 based boards", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_S3 }, { " S3V", "8, 16 and 24-bit color S3 Virge based boards", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_S3V }, { " W32", "8-bit ET4000/W32, /W32i and /W32p cards", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_W32 }, #if defined(__i386__) && defined(PC98) { " PC98", "Select an X server for a NEC PC98 [Submenu]", NULL, dmenuSubmenu, NULL, &MenuXF86SelectPC98Server, '>', ' ', '>', 0 }, #elif __alpha__ { " TGA", "TGA cards (alpha architecture only)", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_TGA }, #endif { NULL } }, }; #if defined(__i386__) && defined(PC98) DMenu MenuXF86SelectPC98Server = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "PC98 X Server selection.", "Please check off the types of NEC PC98 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).", NULL, NULL, { { " 9480", "PC98 8-bit (256 color) PEGC-480 card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_9480 }, { " 9EGC", "PC98 4-bit (16 color) EGC card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_9EGC }, { " 9GA9", "PC98 GA-968V4/PCI (S3 968) card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_9GA9 }, { " 9GAN", "PC98 GANB-WAP (cirrus) card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_9GAN }, { " 9LPW", "PC98 PowerWindowLB (S3) card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_9LPW }, { " 9MGA", "PC98 MGA (Matrox) card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_9MGA }, { " 9NKV", "PC98 NKV-NEC (cirrus) card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_9NKV }, { " 9NS3", "PC98 NEC (S3) card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_9NS3 }, { " 9SPW", "PC98 SKB-PowerWindow (S3) card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_9SPW }, { " 9SVG", "PC98 generic SVGA card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_9SVG }, { " 9TGU", "PC98 Cyber9320 and TGUI9680 cards", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_9TGU }, { " 9WEP", "PC98 WAB-EP (cirrus) card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_9WEP }, { " 9WS", "PC98 WABS (cirrus) card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_9WS }, { " 9WSN", "PC98 WSN-A2F (cirrus) card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_9WSN }, { NULL } } }; #endif DMenu MenuDiskDevices = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "Select Drive(s)", "Please select the drive, or drives, on which you wish to perform\n" "this operation. If you are attempting to install a boot partition\n" "on a drive other than the first one 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] or [ENTER]. To de-select it, press it again.\n\n" "Use [TAB] to get to the buttons and leave this menu.", "Press F1 for important information regarding disk geometry!", "drives", { { NULL } }, }; DMenu MenuHTMLDoc = { DMENU_NORMAL_TYPE, "Select HTML Documentation pointer", "Please select the body of documentation you're interested in, the main\n" "ones right now being the FAQ and the Handbook. You can also choose \"other\"\n" "to enter an arbitrary URL for browsing.", "Press F1 for more help on what you see here.", "html", { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "2 Handbook", "The FreeBSD Handbook.", NULL, docShowDocument }, { "3 FAQ", "The Frequently Asked Questions guide.", NULL, docShowDocument }, { "4 Home", "The Home Pages for the FreeBSD Project (requires net)", NULL, docShowDocument }, { "5 Other", "Enter a URL.", NULL, docShowDocument }, { 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", { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "2 Options", "View/Set various installation options", NULL, optionsEditor }, -#ifdef __alpha__ +#if defined(__alpha__) || defined(__sparc64__) { "3 Label", "Label disk partitions", NULL, diskLabelEditor }, { "4 Distributions", "Select distribution(s) to extract", NULL, dmenuSubmenu, NULL, &MenuDistributions }, { "5 Media", "Choose the installation media type", NULL, dmenuSubmenu, NULL, &MenuMedia }, { "6 Commit", "Perform any pending Partition/Label/Extract actions", NULL, installCustomCommit }, #else { "3 Partition", "Allocate disk space for FreeBSD", NULL, diskPartitionEditor }, { "4 Label", "Label allocated disk partitions", NULL, diskLabelEditor }, { "5 Distributions", "Select distribution(s) to extract", NULL, dmenuSubmenu, NULL, &MenuDistributions }, { "6 Media", "Choose the installation media type", NULL, dmenuSubmenu, NULL, &MenuMedia }, { "7 Commit", "Perform any pending Partition/Label/Extract actions", NULL, installCustomCommit }, #endif { NULL } }, }; /* MBR type menu */ DMenu MenuMBRType = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "overwrite me", /* will be disk specific label */ "FreeBSD comes with a boot selector that allows you to easily\n" "select between FreeBSD and any other operating systems on your machine\n" "at boot time. If you have more than one drive and want to boot\n" "from the second one, the boot selector will also make it possible\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\".\n\n" " NOTE: PC-DOS users will almost certainly require \"None\"!", "Press F1 to read about drive setup", "drives", { { "BootMgr", "Install the FreeBSD Boot Manager", dmenuRadioCheck, dmenuSetValue, NULL, &BootMgr }, #ifndef PC98 { "Standard", "Install a standard MBR (no boot manager)", dmenuRadioCheck, dmenuSetValue, NULL, &BootMgr, '(', '*', ')', 1 }, #endif { "None", "Leave the Master Boot Record untouched", dmenuRadioCheck, dmenuSetValue, NULL, &BootMgr, '(', '*', ')', 2 }, { 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 customize\n" "it somewhat to suit your particular configuration. Most importantly,\n" "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", { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { " Distributions", "Install additional distribution sets", NULL, distExtractAll }, { " Packages", "Install pre-packaged software for FreeBSD", NULL, configPackages }, { " Root Password", "Set the system manager's password", NULL, dmenuSystemCommand, NULL, "passwd root" }, #if defined(__i386__) || defined(__ia64__) { " Fdisk", "The disk Slice (PC-style partition) Editor", NULL, diskPartitionEditor }, #endif { " Label", "The disk Label editor", NULL, diskLabelEditor }, { " User Management", "Add user and group information", NULL, dmenuSubmenu, NULL, &MenuUsermgmt }, { " Console", "Customize system console behavior", NULL, dmenuSubmenu, NULL, &MenuSyscons }, { " Time Zone", "Set which time zone you're in", NULL, dmenuSystemCommand, NULL, "tzsetup" }, { " Media", "Change the installation media type", NULL, dmenuSubmenu, NULL, &MenuMedia }, { " Mouse", "Configure your mouse", NULL, dmenuSubmenu, NULL, &MenuMouse, NULL }, { " Networking", "Configure additional network services", NULL, dmenuSubmenu, NULL, &MenuNetworking }, { " Security", "Configure system security options", NULL, dmenuSubmenu, NULL, &MenuSecurity }, { " Startup", "Configure system startup options", NULL, dmenuSubmenu, NULL, &MenuStartup }, { " TTYs", "Configure system ttys.", NULL, configEtcTtys, NULL, "ttys" }, { " Options", "View/Set various installation options", NULL, optionsEditor }, { " XFree86", "Configure XFree86 Server", NULL, configXSetup }, { " Desktop", "Configure XFree86 Desktop", NULL, configXDesktop }, { " HTML Docs", "Go to the HTML documentation menu (post-install)", NULL, docBrowser }, { " Load KLD", "Load a KLD from a floppy", NULL, kldBrowser }, { NULL } }, }; DMenu MenuStartup = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "Startup Services Menu", "This menu allows you to configure various aspects of your system's\n" "startup configuration. Use [SPACE] or [ENTER] to select items, and\n" "[TAB] to move to the buttons. Select Exit to leave this menu.", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { " APM", "Auto-power management services (typically laptops)", dmenuVarCheck, dmenuToggleVariable, NULL, "apm_enable=YES" }, #ifdef PCCARD_ARCH { " pccard", "Enable PCCARD (AKA PCMCIA) services (also laptops)", dmenuVarCheck, dmenuToggleVariable, NULL, "pccard_enable=YES" }, { " pccard mem", "Set PCCARD memory address (if enabled)", dmenuVarCheck, dmenuISetVariable, NULL, "pccard_mem" }, { " pccard ifconfig", "List of PCCARD ethernet devices to configure", dmenuVarCheck, dmenuISetVariable, NULL, "pccard_ifconfig" }, #endif { " usbd", "Enable USB daemon (detect USB attach / detach)", dmenuVarCheck, dmenuToggleVariable, NULL, "usbd_enable=YES" }, { " usbd flags", "Set default flags to usbd (if enabled)", dmenuVarCheck, dmenuISetVariable, NULL, "usbd_flags" }, { " ", " -- ", NULL, NULL, NULL, NULL, ' ', ' ', ' ' }, { " startup dirs", "Set the list of dirs to look for startup scripts", dmenuVarCheck, dmenuISetVariable, NULL, "local_startup" }, { " named", "Run a local name server on this host", dmenuVarCheck, dmenuToggleVariable, NULL, "named_enable=YES" }, { " named flags", "Set default flags to named (if enabled)", dmenuVarCheck, dmenuISetVariable, NULL, "named_flags" }, { " nis client", "This host wishes to be an NIS client.", dmenuVarCheck, dmenuToggleVariable, NULL, "nis_client_enable=YES" }, { " nis domainname", "Set NIS domainname (if enabled)", dmenuVarCheck, dmenuISetVariable, NULL, "nisdomainname" }, { " nis server", "This host wishes to be an NIS server.", dmenuVarCheck, dmenuToggleVariable, NULL, "nis_server_enable=YES" }, { " ", " -- ", NULL, NULL, NULL, NULL, ' ', ' ', ' ' }, { " accounting", "This host wishes to run process accounting.", dmenuVarCheck, dmenuToggleVariable, NULL, "accounting_enable=YES" }, { " lpd", "This host has a printer and wants to run lpd.", dmenuVarCheck, dmenuToggleVariable, NULL, "lpd_enable=YES" }, -#ifdef __i386__ { " linux", "This host wants to be able to run linux binaries.", dmenuVarCheck, configLinux, NULL, VAR_LINUX_ENABLE "=YES" }, - { " SVR4", "This host wants to be able to run SVR4 binaries.", - dmenuVarCheck, dmenuToggleVariable, NULL, "svr4_enable=YES" }, +#ifdef __i386__ { " SCO", "This host wants to be able to run IBCS2 binaries.", dmenuVarCheck, dmenuToggleVariable, NULL, "ibcs2_enable=YES" }, -#elif __alpha__ +#endif +#if defined(__i386__) || defined(__sparc64__) + { " SVR4", "This host wants to be able to run SVR4 binaries.", + dmenuVarCheck, dmenuToggleVariable, NULL, "svr4_enable=YES" }, +#endif +#ifdef __alpha__ { " OSF/1", "This host wants to be able to run DEC OSF/1 binaries.", dmenuVarCheck, dmenuToggleVariable, NULL, "osf1_enable=YES" }, #endif { " quotas", "This host wishes to check quotas on startup.", dmenuVarCheck, dmenuToggleVariable, NULL, "check_quotas=YES" }, { NULL } }, }; DMenu MenuNetworking = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "Network Services Menu", "You may have already configured one network device (and the other\n" "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, { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { " Interfaces", "Configure additional network interfaces", NULL, tcpMenuSelect }, { " AMD", "This machine wants to run the auto-mounter service", dmenuVarCheck, dmenuToggleVariable, NULL, "amd_enable=YES" }, { " AMD Flags", "Set flags to AMD service (if enabled)", dmenuVarCheck, dmenuISetVariable, NULL, "amd_flags" }, { " Anon FTP", "This machine wishes to allow anonymous FTP.", dmenuVarCheck, configAnonFTP, NULL, "anon_ftp" }, { " Gateway", "This machine will route packets between interfaces", dmenuVarCheck, dmenuToggleVariable, NULL, "gateway_enable=YES" }, { " inetd", "This machine wants to run the inet daemon", dmenuVarCheck, configInetd, NULL, "inetd_enable=YES" }, { " NFS client", "This machine will be an NFS client", dmenuVarCheck, dmenuToggleVariable, NULL, "nfs_client_enable=YES" }, { " NFS server", "This machine will be an NFS server", dmenuVarCheck, configNFSServer, NULL, "nfs_server_enable=YES" }, { " Ntpdate", "Select a clock-synchronization server", dmenuVarCheck, dmenuSubmenu, NULL, &MenuNTP, '[', 'X', ']', "ntpdate_enable=YES" }, { " PCNFSD", "Run authentication server for clients with PC-NFS.", dmenuVarCheck, configPCNFSD, NULL, "pcnfsd" }, { " portmap", "This machine wants to run the portmapper daemon", dmenuVarCheck, dmenuToggleVariable, NULL, "portmap_enable=YES" }, { " Routed", "Select routing daemon (default: routed)", dmenuVarCheck, configRouter, NULL, "router_enable=YES" }, { " Rwhod", "This machine wants to run the rwho daemon", dmenuVarCheck, dmenuToggleVariable, NULL, "rwhod_enable=YES" }, { " Sendmail", "This machine wants to run the sendmail daemon", NULL, dmenuSubmenu, NULL, &MenuSendmail }, { " Sshd", "This machine wants to run the ssh daemon", dmenuVarCheck, dmenuToggleVariable, NULL, "sshd_enable=YES" }, { " TCP Extensions", "Allow RFC1323 and RFC1644 TCP extensions?", dmenuVarCheck, dmenuToggleVariable, NULL, "tcp_extensions=YES" }, { NULL } }, }; DMenu MenuSendmail = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Sendmail Invocation Selection", "There are three options for invoking sendmail at startup.\n" "Please select Yes if you want to use sendmail as your mail transfer\n" "agent. Selecting No disables sendmail's network socket for incoming\n" "email, but still enables sendmail for local and outbound mail.\n" "None disables sendmail completely at startup and disables inbound,\n" "outbound, and local mail. See /etc/mail/README for more\n" "information.\n", NULL, NULL, { { " Yes", "Start sendmail", dmenuVarCheck, dmenuSetVariable, NULL, "sendmail_enable=YES" }, { " No", "Start sendmail, but don't listen from network", dmenuVarCheck, dmenuSetVariable, NULL, "sendmail_enable=NO" }, { " None", "Don't start any sendmail processes", dmenuVarCheck, dmenuSetVariable, NULL, "sendmail_enable=NONE" }, { NULL } }, }; DMenu MenuNTP = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "NTPDATE Server Selection", "There are a number of time synchronization servers available\n" "for public use around the Internet. Please select one reasonably\n" "close to you to have your system time synchronized accordingly.", "These are the primary open-access NTP servers", NULL, { { "None", "No NTP server", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=NO,ntpdate_flags=none" }, { "Other", "Select a site not on this list", dmenuVarsCheck, configNTP, NULL, NULL }, { "Argentina", "tick.nap.com.ar", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tick.nap.com.ar" }, { "Argentina #2", "time.sinectis.com.ar", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.sinectis.com.ar" }, { "Argentina #3", "tock.nap.com.ar", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tock.nap.com.ar" }, { "Australia", "augean.eleceng.adelaide.edu.au", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=augean.eleceng.adelaide.edu.au" }, { "Australia #2", "ntp.adelaide.edu.au", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.adelaide.edu.au" }, { "Australia #3", "ntp.saard.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.saard.net" }, { "Australia #4", "time.deakin.edu.au", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.deakin.edu.au" }, { "Australia #5", "time.esec.com.au", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.esec.com.au" }, { "Belgium", "ntp1.belbone.be", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.belbone.be" }, { "Belgium #2", "ntp2.belbone.be", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.belbone.be" }, { "Brazil", "ntp.cais.rnp.br", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.cais.rnp.br" }, { "Brazil #2", "ntp.pop-df.rnp.br", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.pop-df.rnp.br" }, { "Brazil #3", "ntp.ufes.br", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.ufes.br" }, { "Brazil #4", "ntp1.pucpr.br", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.pucpr.br" }, { "Canada", "ntp.cpsc.ucalgary.ca", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.cpsc.ucalgary.ca" }, { "Canada #2", "ntp1.cmc.ec.gc.ca", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.cmc.ec.gc.ca" }, { "Canada #3", "ntp2.cmc.ec.gc.ca", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.cmc.ec.gc.ca" }, { "Canada #4", "tick.utoronto.ca", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tick.utoronto.ca" }, { "Canada #5", "time.chu.nrc.ca", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.chu.nrc.ca" }, { "Canada #6", "time.nrc.ca", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.nrc.ca" }, { "Canada #7", "timelord.uregina.ca", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=timelord.uregina.ca" }, { "Canada #8", "tock.utoronto.ca", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tock.utoronto.ca" }, { "Czech", "ntp.karpo.cz", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.karpo.cz" }, { "Denmark", "clock.netcetera.dk", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock.netcetera.dk" }, { "Denmark", "clock2.netcetera.dk", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock2.netcetera.dk" }, { "Spain", "slug.ctv.es", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=slug.ctv.es" }, { "Finland", "tick.keso.fi", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tick.keso.fi" }, { "Finland #2", "tock.keso.fi", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tock.keso.fi" }, { "France", "ntp.obspm.fr", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.obspm.fr" }, { "France #2", "ntp.univ-lyon1.fr", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.univ-lyon1.fr" }, { "France #3", "ntp.via.ecp.fr", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.via.ecp.fr" }, { "Croatia", "zg1.ntp.carnet.hr", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=zg1.ntp.carnet.hr" }, { "Croatia #2", "zg2.ntp.carnet.hr", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=zg2.ntp.carnet.hr" }, { "Croatia #3", "st.ntp.carnet.hr", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=st.ntp.carnet.hr" }, { "Croatia #4", "ri.ntp.carnet.hr", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ri.ntp.carnet.hr" }, { "Croatia #5", "os.ntp.carnet.hr", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=os.ntp.carnet.hr" }, { "Hungary", "time.kfki.hu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.kfki.hu" }, { "Indonesia", "ntp.incaf.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.incaf.net" }, { "Ireland", "ntp.maths.tcd.ie", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.maths.tcd.ie" }, { "Italy", "ntps.net4u.it", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=" }, { "Japan", "ntp.cyber-fleet.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.cyber-fleet.net" }, { "Korea", "time.nuri.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.nuri.net" }, { "Mexico", "ntp2a.audiotel.com.mx", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2a.audiotel.com.mx" }, { "Mexico #2", "ntp2b.audiotel.com.mx", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2b.audiotel.com.mx" }, { "Mexico #3", "ntp2c.audiotel.com.mx", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2c.audiotel.com.mx" }, { "Nigeria", "ntp.supernet300.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.supernet300.com" }, { "Netherlands", "ntp1.theinternetone.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.theinternetone.net" }, { "Netherlands #2", "ntp2.theinternetone.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.theinternetone.net" }, { "Netherlands #3", "ntp3.theinternetone.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp3.theinternetone.net" }, { "Norway", "fartein.ifi.uio.no", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=fartein.ifi.uio.no" }, { "Norway #2", "time.alcanet.no", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.alcanet.no" }, { "New Zealand", "ntp.massey.ac.nz", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.massey.ac.nz" }, { "New Zealand #2", "ntp.public.otago.ac.nz", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.public.otago.ac.nz" }, { "New Zealand #3", "tk1.ihug.co.nz", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tk1.ihug.co.nz" }, { "New Zealand #4", "ntp.waikato.ac.nz", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.waikato.ac.nz" }, { "Poland", "info.cyf-kr.edu.pl", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=info.cyf-kr.edu.pl" }, { "Portugal", "bug.fe.up.pt", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=bug.fe.up.pt" }, { "Romania", "ntp.ip.ro", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.ip.ro" }, { "Russia", "ntp.psn.ru", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.psn.ru" }, { "Russia #2", "sign.chg.ru", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=sign.chg.ru" }, { "Sweden", "ntp.lth.se", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.lth.se" }, { "Singapore", "ntp.shim.org", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.shim.org" }, { "Slovenia", "calvus.rzs-hm.si", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=calvus.rzs-hm.si" }, { "Slovenia #2", "sizif.mf.uni-lj.si", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=sizif.mf.uni-lj.si" }, { "Slovenia #3", "ntp1.arnes.si", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.arnes.si" }, { "Slovenia #4", "ntp2.arnes.si", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.arnes.si" }, { "Slovenia #5", "time.ijs.si", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.ijs.si" }, { "Scotland", "ntp.cs.strath.ac.uk", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.cs.strath.ac.uk" }, { "United Kingdom", "ntp.exnet.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.exnet.com" }, { "United Kingdom #2", "ntp0.uk.uu.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp0.uk.uu.net" }, { "United Kingdom #3", "ntp1.uk.uu.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.uk.uu.net" }, { "United Kingdom #4", "ntp2.uk.uu.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.uk.uu.net" }, { "United Kingdom #5", "ntp2a.mcc.ac.uk", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2a.mcc.ac.uk" }, { "United Kingdom #6", "ntp2b.mcc.ac.uk", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2b.mcc.ac.uk" }, { "United Kingdom #7", "ntp2c.mcc.ac.uk", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2c.mcc.ac.uk" }, { "United Kingdom #8", "ntp2d.mcc.ac.uk", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2d.mcc.ac.uk" }, { "United Kingdom #9", "tick.tanac.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tick.tanac.net" }, { "U.S. AR", "sushi.compsci.lyon.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=sushi.compsci.lyon.edu" }, { "U.S. AZ", "ntp.drydog.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.drydog.com" }, { "U.S. CA", "ntp.ucsd.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.ucsd.edu" }, { "U.S. CA #2", "ntp1.mainecoon.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.mainecoon.com" }, { "U.S. CA #3", "ntp2.mainecoon.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.mainecoon.com" }, { "U.S. CA #4", "reloj.kjsl.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=reloj.kjsl.com" }, { "U.S. CA #5", "time.five-ten-sg.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.five-ten-sg.com" }, { "U.S. DE", "louie.udel.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=louie.udel.edu" }, { "U.S. GA", "ntp.shorty.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.shorty.com" }, { "U.S. GA #2", "rolex.usg.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=rolex.usg.edu" }, { "U.S. GA #3", "timex.usg.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=timex.usg.edu" }, { "U.S. IL", "ntp-0.cso.uiuc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-0.cso.uiuc.edu" }, { "U.S. IL #2", "ntp-1.cso.uiuc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-1.cso.uiuc.edu" }, { "U.S. IL #3", "ntp-1.mcs.anl.gov", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-1.mcs.anl.gov" }, { "U.S. IL #4", "ntp-2.cso.uiuc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-2.cso.uiuc.edu" }, { "U.S. IL #5", "ntp-2.mcs.anl.gov", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-2.mcs.anl.gov" }, { "U.S. IN", "gilbreth.ecn.purdue.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=gilbreth.ecn.purdue.edu" }, { "U.S. IN #2", "harbor.ecn.purdue.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=harbor.ecn.purdue.edu" }, { "U.S. IN #3", "molecule.ecn.purdue.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=molecule.ecn.purdue.edu" }, { "U.S. KS", "ntp1.kansas.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.kansas.net" }, { "U.S. KS #2", "ntp2.kansas.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.kansas.net" }, { "U.S. MA", "ntp.ourconcord.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.ourconcord.net" }, { "U.S. MA #2", "timeserver.cs.umb.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=timeserver.cs.umb.edu" }, { "U.S. MN", "ns.nts.umn.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ns.nts.umn.edu" }, { "U.S. MN #2", "nss.nts.umn.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=nss.nts.umn.edu" }, { "U.S. MO", "time-ext.missouri.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time-ext.missouri.edu" }, { "U.S. MT", "chronos1.umt.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=chronos1.umt.edu" }, { "U.S. MT #2", "chronos2.umt.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=chronos2.umt.edu" }, { "U.S. MT #3", "chronos3.umt.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=chronos3.umt.edu" }, { "U.S. NC", "clock1.unc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock1.unc.edu" }, { "U.S. NV", "cuckoo.nevada.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=cuckoo.nevada.edu" }, { "U.S. NV #2", "tick.cs.unlv.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tick.cs.unlv.edu" }, { "U.S. NV #3", "tock.cs.unlv.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tock.cs.unlv.edu" }, { "U.S. NY", "clock.linuxshell.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock.linuxshell.net" }, { "U.S. NY #2", "ntp.ctr.columbia.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.ctr.columbia.edu" }, { "U.S. NY #3", "ntp0.cornell.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp0.cornell.edu" }, { "U.S. NY #4", "ntp1.mpis.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.mpis.net" }, { "U.S. NY #5", "ntp2.mpis.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.mpis.net" }, { "U.S. NY #6", "sundial.columbia.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=sundial.columbia.edu" }, { "U.S. NY #7", "timex.cs.columbia.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=timex.cs.columbia.edu" }, { "U.S. OK", "constellation.ecn.uoknor.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=constellation.ecn.uoknor.edu" }, { "U.S. PA", "clock-1.cs.cmu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock-1.cs.cmu.edu" }, { "U.S. PA #2", "clock-2.cs.cmu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock-2.cs.cmu.edu" }, { "U.S. PA #3", "clock.psu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock.psu.edu" }, { "U.S. PA #4", "fuzz.psc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=fuzz.psc.edu" }, { "U.S. PA #5", "ntp-1.ece.cmu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-1.ece.cmu.edu" }, { "U.S. PA #6", "ntp-2.ece.cmu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-2.ece.cmu.edu" }, { "U.S. TX", "ntp.cox.smu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.cox.smu.edu" }, { "U.S. TX #2", "ntp.fnbhs.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.fnbhs.com" }, { "U.S. TX #3", "ntp.tmc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.tmc.edu" }, { "U.S. TX #4", "ntp5.tamu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp5.tamu.edu" }, { "U.S. TX #5", "tick.greyware.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tick.greyware.com" }, { "U.S. TX #6", "tock.greyware.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tock.greyware.com" }, { "U.S. VA", "ntp-1.vt.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-1.vt.edu" }, { "U.S. VA #2", "ntp-2.vt.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-2.vt.edu" }, { "U.S. VA #3", "ntp.cmr.gov", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.cmr.gov" }, { "U.S. VT", "ntp0.state.vt.us", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp0.state.vt.us" }, { "U.S. VT #2", "ntp1.state.vt.us", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.state.vt.us" }, { "U.S. VT #3", "ntp2.state.vt.us", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.state.vt.us" }, { "U.S. WA", "clock.tricity.wsu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock.tricity.wsu.edu" }, { "U.S. WA #2", "ntp.tcp-udp.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.tcp-udp.net" }, { "U.S. WI", "ntp1.cs.wisc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.cs.wisc.edu" }, { "U.S. WI #2", "ntp3.cs.wisc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp3.cs.wisc.edu" }, { "Venezuela", "ntp.linux.org.ve", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.linux.org.ve" }, { "South Africa", "ntp.cs.unp.ac.za", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.cs.unp.ac.za" }, { 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, { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "2 Font", "Choose an alternate screen font", NULL, dmenuSubmenu, NULL, &MenuSysconsFont }, { "3 Keymap", "Choose an alternate keyboard map", NULL, dmenuSubmenu, NULL, &MenuSysconsKeymap }, { "4 Repeat", "Set the rate at which keys repeat", NULL, dmenuSubmenu, NULL, &MenuSysconsKeyrate }, { "5 Saver", "Configure the screen saver", NULL, dmenuSubmenu, NULL, &MenuSysconsSaver }, { "6 Screenmap", "Choose an alternate screenmap", NULL, dmenuSubmenu, NULL, &MenuSysconsScrnmap }, { "7 Ttys", "Choose console terminal type", NULL, dmenuSubmenu, NULL, &MenuSysconsTtys }, { NULL } }, }; #ifdef PC98 DMenu MenuSysconsKeymap = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "System Console Keymap", "The default system console driver for FreeBSD (syscons) defaults\n" "to a standard \"PC-98x1\" keyboard map. Users may wish to choose\n" "one of the other keymaps below.\n" "Note that sysinstall itself only uses the part of the keyboard map\n" "which is required to generate the ANSI character subset, but your\n" "choice of keymap will also be saved for later (fuller) use.", "Choose a keyboard map", NULL, { { "Japanese PC-98x1", "Japanese PC-98x1 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=jp.pc98" }, { " Japanese PC-98x1 (ISO)", "Japanese PC-98x1 (ISO) keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=jp.pc98.iso" }, { NULL } }, }; #else DMenu MenuSysconsKeymap = { DMENU_NORMAL_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.\n" "Note that sysinstall itself only uses the part of the keyboard map\n" "which is required to generate the ANSI character subset, but your\n" "choice of keymap will also be saved for later (fuller) use.", "Choose a keyboard map", NULL, { { "Belgian", "Belgian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=be.iso" }, { " Brazil CP850", "Brazil CP850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=br275.cp850" }, { " Brazil ISO (accent)", "Brazil ISO keymap (accent keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=br275.iso.acc" }, { " Brazil ISO", "Brazil ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=br275.iso" }, { " Bulgarian BDS", "Bulgarian BDS keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=bg.bds.ctrlcaps" }, { " Bulgarian Phonetic", "Bulgarian Phonetic keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=bg.phonetic.ctrlcaps" }, { " Croatian ISO", "Croatian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=hr.iso" }, { " Czech ISO (accent)", "Czech ISO keymap (accent keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=cs.latin2.qwertz" }, { "Danish CP865", "Danish Code Page 865 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=danish.cp865" }, { " Danish ISO", "Danish ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=danish.iso" }, { "Estonian ISO", "Estonian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=estonian.iso" }, { " Estonian ISO 15", "Estonian ISO 8859-15 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=estonian.iso15" }, { " Estonian CP850", "Estonian Code Page 850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=estonian.cp850" }, { "Finnish CP850","Finnish Code Page 850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=finnish.cp850" }, { " Finnish ISO", "Finnish ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=finnish.iso" }, { " French ISO (accent)", "French ISO keymap (accent keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=fr.iso.acc" }, { " French ISO", "French ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=fr.iso" }, { "German CP850", "German Code Page 850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=german.cp850" }, { " German ISO", "German ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=german.iso" }, { "Hungarian 101", "Hungarian ISO keymap (101 key)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=hu.iso2.101keys" }, { " Hungarian 102", "Hungarian ISO keymap (102 key)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=hu.iso2.102keys" }, { "Icelandic (accent)", "Icelandic ISO keymap (accent keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=icelandic.iso.acc" }, { " Icelandic", "Icelandic ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=icelandic.iso" }, { " Italian", "Italian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=it.iso" }, { "Japanese 106", "Japanese 106 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=jp.106" }, { "Latin American", "Latin American ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=lat-amer" }, { "Norway ISO", "Norwegian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=norwegian.iso" }, { "Polish ISO", "Polish ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=pl_PL.ISO8859-2" }, { " Portuguese (accent)", "Portuguese ISO keymap (accent keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=pt.iso.acc" }, { " Portuguese", "Portuguese ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=pt.iso" }, { "Russia KOI8-R", "Russian KOI8-R keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=ru.koi8-r" }, { "Slovenian", "Slovenian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=si.iso" }, { " Spanish (accent)", "Spanish ISO keymap (accent keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=spanish.iso.acc" }, { " Spanish", "Spanish ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=spanish.iso" }, { " Swedish CP850", "Swedish Code Page 850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swedish.cp850" }, { " Swedish ISO", "Swedish ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swedish.iso" }, { " Swiss French ISO (accent)", "Swiss French ISO keymap (accent keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swissfrench.iso.acc" }, { " Swiss French ISO", "Swiss French ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swissfrench.iso" }, { " Swiss French CP850", "Swiss French Code Page 850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swissfrench.cp850" }, { " Swiss German ISO (accent)", "Swiss German ISO keymap (accent keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swissgerman.iso.acc" }, { " Swiss German ISO", "Swiss German ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swissgerman.iso" }, { " Swiss German CP850", "Swiss German Code Page 850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swissgerman.cp850" }, { "UK CP850", "UK Code Page 850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=uk.cp850" }, { " UK ISO", "UK ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=uk.iso" }, { " Ukrainian KOI8-U", "Ukrainian KOI8-U keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=ua.koi8-u" }, { " Ukrainian KOI8-U+KOI8-R", "Ukrainian KOI8-U+KOI8-R keymap (alter)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=ua.koi8-u.shift.alt" }, { " USA CapsLock->Ctrl", "US standard (Caps as L-Control)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=us.pc-ctrl" }, { " USA Dvorak", "US Dvorak keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=us.dvorak" }, { " USA Dvorak (left)", "US left handed Dvorak keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=us.dvorakl" }, { " USA Dvorak (right)", "US right handed Dvorak keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=us.dvorakr" }, { " USA Emacs", "US standard optimized for EMACS", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=us.emacs" }, { " USA ISO", "US ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=us.iso" }, { " USA UNIX", "US traditional UNIX-workstation", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=us.unix" }, { NULL } }, }; #endif DMenu MenuSysconsKeyrate = { DMENU_NORMAL_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", dmenuVarCheck, dmenuSetVariable, NULL, "keyrate=slow" }, { "Normal", "\"Normal\" keyboard repeat rate", dmenuVarCheck, dmenuSetVariable, NULL, "keyrate=normal" }, { "Fast", "Fast keyboard repeat rate", dmenuVarCheck, dmenuSetVariable, NULL, "keyrate=fast" }, { "Default", "Use default keyboard repeat rate", dmenuVarCheck, dmenuSetVariable, NULL, "keyrate=NO" }, { NULL } }, }; DMenu MenuSysconsSaver = { DMENU_NORMAL_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, { { "1 Blank", "Simply blank the screen", dmenuVarCheck, configSaver, NULL, "saver=blank" }, { "2 Daemon", "\"BSD Daemon\" animated screen saver (text)", dmenuVarCheck, configSaver, NULL, "saver=daemon" }, { "3 Fade", "Fade out effect screen saver", dmenuVarCheck, configSaver, NULL, "saver=fade" }, { "4 Fire", "Flames effect screen saver", dmenuVarCheck, configSaver, NULL, "saver=fire" }, { "5 Green", "\"Green\" power saving mode (if supported by monitor)", dmenuVarCheck, configSaver, NULL, "saver=green" }, { "6 Logo", "\"BSD Daemon\" animated screen saver (graphics)", dmenuVarCheck, configSaver, NULL, "saver=logo" }, { "7 Rain", "Rain drops screen saver", dmenuVarCheck, configSaver, NULL, "saver=rain" }, { "8 Snake", "Draw a FreeBSD \"snake\" on your screen", dmenuVarCheck, configSaver, NULL, "saver=snake" }, { "9 Star", "A \"twinkling stars\" effect", dmenuVarCheck, configSaver, NULL, "saver=star" }, { "Warp", "A \"stars warping\" effect", dmenuVarCheck, configSaver, NULL, "saver=warp" }, { "Timeout", "Set the screen saver timeout interval", NULL, configSaverTimeout, NULL, NULL, ' ', ' ', ' ' }, { NULL } }, }; DMenu MenuSysconsScrnmap = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "System Console Screenmap", "Unless you load a specific font, most PC hardware defaults to\n" "displaying characters in the IBM 437 character set. However,\n" "in the Unix world, this character set is very rarely used. Most\n" "Western European countries, for example, prefer ISO 8859-1.\n" "American users won't notice the difference since the bottom half\n" "of all these character sets is ANSI anyway.\n" "If your hardware is capable of downloading a new display font,\n" "you should probably choose that option. However, for hardware\n" "where this is not possible (e.g. monochrome adapters), a screen\n" "map will give you the best approximation that your hardware can\n" "display at all.", "Choose a screen map", NULL, { { "1 None", "No screenmap, don't touch font", dmenuVarCheck, dmenuSetVariable, NULL, "scrnmap=NO" }, { "2 ISO 8859-1 to IBM437", "W-Europe ISO 8859-1 to IBM 437 screenmap", dmenuVarCheck, dmenuSetVariable, NULL, "scrnmap=iso-8859-1_to_cp437" }, { "3 ISO 8859-7 to IBM437", "Greek ISO 8859-7 to IBM 437 screenmap", dmenuVarCheck, dmenuSetVariable, NULL, "scrnmap=iso-8859-7_to_cp437" }, { "4 US-ASCII to IBM437", "US-ASCII to IBM 437 screenmap", dmenuVarCheck, dmenuSetVariable, NULL, "scrnmap=us-ascii_to_cp437" }, { "5 KOI8-R to IBM866", "Russian KOI8-R to IBM 866 screenmap", dmenuVarCheck, dmenuSetVariable, NULL, "scrnmap=koi8-r2cp866" }, { "6 KOI8-U to IBM866u", "Ukrainian KOI8-U to IBM 866u screenmap", dmenuVarCheck, dmenuSetVariable, NULL, "scrnmap=koi8-u2cp866u" }, { NULL } }, }; DMenu MenuSysconsTtys = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "System Console Terminal Type", "For various console encodings, a corresponding terminal type\n" "must be chosen in /etc/ttys.\n\n" "WARNING: For compatibility reasons, only entries starting with\n" "ttyv and terminal types starting with cons[0-9] can be changed\n" "via this menu.\n", "Choose a terminal type", NULL, { { "1 None", "Don't touch anything", dmenuVarCheck, dmenuSetVariable, NULL, VAR_CONSTERM "=NO" }, { "2 IBM437 (VGA default)", "cons25", dmenuVarCheck, dmenuSetVariable, NULL, VAR_CONSTERM "=cons25" }, { "3 ISO 8859-1", "cons25l1", dmenuVarCheck, dmenuSetVariable, NULL, VAR_CONSTERM "=cons25l1" }, { "4 ISO 8859-2", "cons25l2", dmenuVarCheck, dmenuSetVariable, NULL, VAR_CONSTERM "=cons25l2" }, { "5 ISO 8859-7", "cons25l7", dmenuVarCheck, dmenuSetVariable, NULL, VAR_CONSTERM "=cons25l7" }, { "6 KOI8-R", "cons25r", dmenuVarCheck, dmenuSetVariable, NULL, VAR_CONSTERM "=cons25r" }, { "7 KOI8-U", "cons25u", dmenuVarCheck, dmenuSetVariable, NULL, VAR_CONSTERM "=cons25u" }, { "8 US-ASCII", "cons25w", dmenuVarCheck, dmenuSetVariable, NULL, VAR_CONSTERM "=cons25w" }, { NULL } }, }; DMenu MenuSysconsFont = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "System Console Font", "Most PC hardware defaults to displaying characters in the\n" "IBM 437 character set. However, in the Unix world, this\n" "character set is very rarely used. Most Western European\n" "countries, for example, prefer ISO 8859-1.\n" "American users won't notice the difference since the bottom half\n" "of all these charactersets is ANSI anyway. However, they might\n" "want to load a font anyway to use the 30- or 50-line displays.\n" "If your hardware is capable of downloading a new display font,\n" "you can select the appropriate font below.", "Choose a font", NULL, { { "1 None", "Use hardware default font", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=NO,font8x14=NO,font8x16=NO" }, { "2 IBM 437", "English and others, VGA default", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp437-8x8,font8x14=cp437-8x14,font8x16=cp437-8x16" }, { "3 IBM 850", "Western Europe, IBM encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp850-8x8,font8x14=cp850-8x14,font8x16=cp850-8x16" }, { "4 IBM 865", "Norwegian, IBM encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp865-8x8,font8x14=cp865-8x14,font8x16=cp865-8x16" }, { "5 IBM 866", "Russian, IBM encoding (use with KOI8-R screenmap)", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp866-8x8,font8x14=cp866-8x14,font8x16=cp866b-8x16,mousechar_start=3" }, { "6 IBM 866u", "Ukrainian, IBM encoding (use with KOI8-U screenmap)", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp866u-8x8,font8x14=cp866u-8x14,font8x16=cp866u-8x16,mousechar_start=3" }, { "7 IBM 1251", "Cyrillic, MS Windows encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp1251-8x8,font8x14=cp1251-8x14,font8x16=cp1251-8x16,mousechar_start=3" }, { "8 ISO 8859-1", "Western Europe, ISO encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=iso-8x8,font8x14=iso-8x14,font8x16=iso-8x16" }, { "9 ISO 8859-2", "Eastern Europe, ISO encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=iso02-8x8,font8x14=iso02-8x14,font8x16=iso02-8x16" }, { "a ISO 8859-4", "Baltic, ISO encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=iso04-8x8,font8x14=iso04-8x14,font8x16=iso04-8x16" }, { "b ISO 8859-7", "Greek, ISO encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=iso07-8x8,font8x14=iso07-8x14,font8x16=iso07-8x16" }, { "c ISO 8859-8", "Hebrew, ISO encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=iso08-8x8,font8x14=iso08-8x14,font8x16=iso08-8x16" }, { "d ISO 8859-15", "Europe, ISO encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=iso15-8x8,font8x14=iso15-8x14,font8x16=iso15-8x16" }, { "e SWISS", "English, better resolution", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=swiss-8x8,font8x14=NO,font8x16=swiss-8x16" }, { NULL } }, }; DMenu MenuUsermgmt = { DMENU_NORMAL_TYPE, "User and group management", "The submenus here allow to manipulate user groups and\n" "login accounts.\n", "Configure your user groups and users", NULL, { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "User", "Add a new user to the system.", NULL, userAddUser }, { "Group", "Add a new user group to the system.", NULL, userAddGroup }, { NULL } }, }; DMenu MenuSecurity = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "System Security Options Menu", "This menu allows you to configure aspects of the operating system security\n" "policy. Please read the system documentation carefully before modifying\n" "these settings, as they may cause service disruption if used improperly.\n" "\n" "Most settings will take affect only following a system reboot.", "Configure system security options", NULL, { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { " Security Profile", "Select a security profile for the system", NULL, configSecurityProfile }, { " LOMAC", "Use Low Watermark Mandatory Access Control at boot", dmenuVarCheck, dmenuToggleVariable, NULL, "lomac_enable=YES" }, { " NFS port", "Require that the NFS clients used reserved ports", dmenuVarCheck, dmenuToggleVariable, NULL, "nfs_reserved_port_only=YES" }, { NULL } }, }; DMenu MenuSecurityProfile = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Default system security profile", "Each item in this list will set what it considers to\n" "be \"appropriate\" values in that category for various\n" "security-related knobs in /etc/rc.conf.", "Select a canned security profile - F1 for help", "security", /* help file */ { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "Medium", "Moderate security settings.", NULL, configSecurityModerate }, { "Extreme", "Very restrictive security settings.", NULL, configSecurityExtreme }, { NULL } }, }; DMenu MenuFixit = { DMENU_NORMAL_TYPE, "Please choose a fixit option", "There are three ways of going into \"fixit\" mode:\n" "- you can use the live filesystem CDROM/DVD, in which case there will be\n" " full access to the complete set of FreeBSD commands and utilities,\n" "- you can use the more limited (but perhaps customized) fixit floppy,\n" "- or you can start an Emergency Holographic Shell now, which is\n" " limited to the subset of commands that is already available right now.", "Press F1 for more detailed repair instructions", "fixit", { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "2 CDROM/DVD", "Use the \"live\" filesystem CDROM/DVD", NULL, installFixitCDROM }, { "3 Floppy", "Use a floppy generated from the fixit image", NULL, installFixitFloppy }, { "4 Shell", "Start an Emergency Holographic Shell", NULL, installFixitHoloShell }, { NULL } }, }; Index: head/usr.sbin/sade/system.c =================================================================== --- head/usr.sbin/sade/system.c (revision 104939) +++ head/usr.sbin/sade/system.c (revision 104940) @@ -1,537 +1,537 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * * $FreeBSD$ * * Jordan Hubbard * * My contributions are in the public domain. * * Parts of this file are also blatently stolen from Poul-Henning Kamp's * previous version of sysinstall, and as such fall under his "BEERWARE license" * so buy him a beer if you like it! Buy him a beer for me, too! * Heck, get him completely drunk and send me pictures! :-) */ #include "sysinstall.h" #include #include #include #include #include #include #include #include #include /* Where we stick our temporary expanded doc file */ #define DOC_TMP_DIR "/tmp/.doc" #define DOC_TMP_FILE "/tmp/.doc/doc.tmp" static pid_t ehs_pid; /* * Handle interrupt signals - this probably won't work in all cases * due to our having bogotified the internal state of dialog or curses, * but we'll give it a try. */ static int intr_continue(dialogMenuItem *self) { return DITEM_LEAVE_MENU; } static int intr_reboot(dialogMenuItem *self) { systemShutdown(-1); /* NOTREACHED */ return 0; } static int intr_restart(dialogMenuItem *self) { int ret, fd, fdmax; mediaClose(); free_variables(); fdmax = getdtablesize(); for (fd = 3; fd < fdmax; fd++) close(fd); ret = execl(StartName, StartName, "-restart", (char *)NULL); msgDebug("execl failed (%s)\n", strerror(errno)); /* NOTREACHED */ return -1; } static dialogMenuItem intrmenu[] = { { "Abort", "Abort the installation", NULL, intr_reboot }, { "Restart", "Restart the installation program", NULL, intr_restart }, { "Continue", "Continue the installation", NULL, intr_continue }, }; static void handle_intr(int sig) { WINDOW *save = savescr(); use_helpline(NULL); use_helpfile(NULL); if (OnVTY) { ioctl(0, VT_ACTIVATE, 1); /* Switch back */ msgInfo(NULL); } (void)dialog_menu("Installation interrupt", "Do you want to abort the installation?", -1, -1, 3, -3, intrmenu, NULL, NULL, NULL); restorescr(save); } /* * Harvest children if we are init. */ static void reap_children(int sig) { int errbak = errno; while (waitpid(-1, NULL, WNOHANG) > 0) ; errno = errbak; } /* Expand a file into a convenient location, nuking it each time */ static char * expand(char *fname) { char *gunzip = RunningAsInit ? "/stand/gunzip" : "/usr/bin/gunzip"; if (!directory_exists(DOC_TMP_DIR)) { Mkdir(DOC_TMP_DIR); if (chown(DOC_TMP_DIR, 0, 0) < 0) return NULL; if (chmod(DOC_TMP_DIR, S_IRWXU) < 0) return NULL; } else unlink(DOC_TMP_FILE); if (!file_readable(fname) || vsystem("%s < %s > %s", gunzip, fname, DOC_TMP_FILE)) return NULL; return DOC_TMP_FILE; } /* Initialize system defaults */ void systemInitialize(int argc, char **argv) { size_t i; int boothowto; sigset_t signalset; signal(SIGINT, SIG_IGN); globalsInit(); i = sizeof(boothowto); if (!sysctlbyname("debug.boothowto", &boothowto, &i, NULL, NULL) && (i == sizeof(boothowto)) && (boothowto & RB_VERBOSE)) variable_set2(VAR_DEBUG, "YES", 0); /* Are we running as init? */ if (getpid() == 1) { int fd; RunningAsInit = 1; setsid(); close(0); fd = open("/dev/ttyv0", O_RDWR); if (fd == -1) { fd = open("/dev/console", O_RDWR); /* fallback */ variable_set2(VAR_FIXIT_TTY, "serial", 0); /* give fixit a hint */ } else OnVTY = TRUE; /* * To make _sure_ we're on a VTY and don't have /dev/console switched * away to a serial port or something, attempt to set the cursor appearance. */ if (OnVTY) { int fd2, type; type = 0; /* normal */ if ((fd2 = open("/dev/console", O_RDWR)) != -1) { if (ioctl(fd2, CONS_CURSORTYPE, &type) == -1) { OnVTY = FALSE; variable_set2(VAR_FIXIT_TTY, "serial", 0); /* Tell Fixit the console type */ close(fd); close(fd2); open("/dev/console", O_RDWR); } else close(fd2); } } close(1); dup(0); close(2); dup(0); printf("%s running as init on %s\n", argv[0], OnVTY ? "vty0" : "serial console"); ioctl(0, TIOCSCTTY, (char *)NULL); setlogin("root"); setenv("PATH", "/stand:/bin:/sbin:/usr/sbin:/usr/bin:/mnt/bin:/mnt/sbin:/mnt/usr/sbin:/mnt/usr/bin:/usr/X11R6/bin", 1); setbuf(stdin, 0); setbuf(stderr, 0); #ifdef __alpha__ i = 0; sysctlbyname("machdep.unaligned_print", NULL, 0, &i, sizeof(i)); #endif #if 0 signal(SIGCHLD, reap_children); #endif } else { char hname[256]; /* Initalize various things for a multi-user environment */ if (!gethostname(hname, sizeof hname)) variable_set2(VAR_HOSTNAME, hname, 0); } if (set_termcap() == -1) { printf("Can't find terminal entry\n"); exit(-1); } /* XXX - libdialog has particularly bad return value checking */ init_dialog(); /* If we haven't crashed I guess dialog is running ! */ DialogActive = TRUE; /* Make sure HOME is set for those utilities that need it */ if (!getenv("HOME")) setenv("HOME", "/", 1); signal(SIGINT, handle_intr); /* * Make sure we can be interrupted even if we were re-executed * from an interrupt. */ sigemptyset(&signalset); sigaddset(&signalset, SIGINT); sigprocmask(SIG_UNBLOCK, &signalset, NULL); (void)vsystem("rm -rf %s", DOC_TMP_DIR); } /* Close down and prepare to exit */ void systemShutdown(int status) { /* If some media is open, close it down */ if (status >=0) mediaClose(); /* write out any changes to rc.conf .. */ configRC_conf(); /* Shut down the dialog library */ if (DialogActive) { end_dialog(); DialogActive = FALSE; } /* Shut down curses */ endwin(); /* If we have a temporary doc dir lying around, nuke it */ (void)vsystem("rm -rf %s", DOC_TMP_DIR); /* REALLY exit! */ if (RunningAsInit) { /* Put the console back */ ioctl(0, VT_ACTIVATE, 2); -#ifdef __alpha__ +#if defined(__alpha__) || defined(__sparc64__) reboot(RB_HALT); #else reboot(0); #endif } else exit(status); } /* Run some general command */ int systemExecute(char *command) { int status; struct termios foo; WINDOW *w = savescr(); dialog_clear(); dialog_update(); end_dialog(); DialogActive = FALSE; if (tcgetattr(0, &foo) != -1) { foo.c_cc[VERASE] = '\010'; tcsetattr(0, TCSANOW, &foo); } if (!Fake) status = system(command); else { status = 0; msgDebug("systemExecute: Faked execution of `%s'\n", command); } DialogActive = TRUE; restorescr(w); return status; } /* suspend/resume libdialog/curses screen */ static WINDOW *oldW; void systemSuspendDialog(void) { oldW = savescr(); dialog_clear(); dialog_update(); end_dialog(); DialogActive = FALSE; } void systemResumeDialog(void) { DialogActive = TRUE; restorescr(oldW); } /* Display a help file in a filebox */ int systemDisplayHelp(char *file) { char *fname = NULL; char buf[FILENAME_MAX]; int ret = 0; WINDOW *w = savescr(); fname = systemHelpFile(file, buf); if (!fname) { snprintf(buf, FILENAME_MAX, "The %s file is not provided on this particular floppy image.", file); use_helpfile(NULL); use_helpline(NULL); dialog_mesgbox("Sorry!", buf, -1, -1); ret = 1; } else { use_helpfile(NULL); use_helpline(NULL); dialog_textbox(file, fname, LINES, COLS); } restorescr(w); return ret; } char * systemHelpFile(char *file, char *buf) { if (!file) return NULL; if (file[0] == '/') return file; snprintf(buf, FILENAME_MAX, "/stand/help/%s.hlp.gz", file); if (file_readable(buf)) return expand(buf); snprintf(buf, FILENAME_MAX, "/stand/help/%s.hlp", file); if (file_readable(buf)) return expand(buf); snprintf(buf, FILENAME_MAX, "/stand/help/%s.TXT.gz", file); if (file_readable(buf)) return expand(buf); snprintf(buf, FILENAME_MAX, "/stand/help/%s.TXT", file); if (file_readable(buf)) return expand(buf); snprintf(buf, FILENAME_MAX, "/usr/src/usr.sbin/sysinstall/help/%s.hlp", file); if (file_readable(buf)) return buf; snprintf(buf, FILENAME_MAX, "/usr/src/usr.sbin/sysinstall/help/%s.TXT", file); if (file_readable(buf)) return buf; return NULL; } void systemChangeTerminal(char *color, const u_char c_term[], char *mono, const u_char m_term[]) { if (OnVTY) { int setupterm(char *color, int, int *); if (ColorDisplay) { setenv("TERM", color, 1); setenv("TERMCAP", c_term, 1); reset_shell_mode(); setterm(color); cbreak(); noecho(); } else { setenv("TERM", mono, 1); setenv("TERMCAP", m_term, 1); reset_shell_mode(); setterm(mono); cbreak(); noecho(); } } clear(); refresh(); dialog_clear(); } int vsystem(char *fmt, ...) { va_list args; int pstat; pid_t pid; int omask; sig_t intsave, quitsave; char *cmd; int i; cmd = (char *)alloca(FILENAME_MAX); cmd[0] = '\0'; va_start(args, fmt); vsnprintf(cmd, FILENAME_MAX, fmt, args); va_end(args); omask = sigblock(sigmask(SIGCHLD)); if (Fake) { msgDebug("vsystem: Faked execution of `%s'\n", cmd); return 0; } if (isDebug()) msgDebug("Executing command `%s'\n", cmd); pid = fork(); if (pid == -1) { (void)sigsetmask(omask); i = 127; } else if (!pid) { /* Junior */ (void)sigsetmask(omask); if (DebugFD != -1) { dup2(DebugFD, 0); dup2(DebugFD, 1); dup2(DebugFD, 2); } else { close(1); open("/dev/null", O_WRONLY); dup2(1, 2); } if (!RunningAsInit) execl("/bin/sh", "/bin/sh", "-c", cmd, (char *)NULL); else execl("/stand/sh", "/stand/sh", "-c", cmd, (char *)NULL); exit(1); } else { intsave = signal(SIGINT, SIG_IGN); quitsave = signal(SIGQUIT, SIG_IGN); pid = waitpid(pid, &pstat, 0); (void)sigsetmask(omask); (void)signal(SIGINT, intsave); (void)signal(SIGQUIT, quitsave); i = (pid == -1) ? -1 : WEXITSTATUS(pstat); if (isDebug()) msgDebug("Command `%s' returns status of %d\n", cmd, i); } return i; } void systemCreateHoloshell(void) { int waitstatus; if ((FixItMode || OnVTY) && RunningAsInit) { if (ehs_pid != 0) { int pstat; if (kill(ehs_pid, 0) == 0) { if (msgNoYes("There seems to be an emergency holographic shell\n" "already running on VTY 4.\n\n" "Kill it and start a new one?")) return; /* try cleaning up as much as possible */ (void) kill(ehs_pid, SIGHUP); sleep(1); (void) kill(ehs_pid, SIGKILL); } /* avoid too many zombies */ (void) waitpid(ehs_pid, &pstat, WNOHANG); } if (strcmp(variable_get(VAR_FIXIT_TTY), "serial") == 0) systemSuspendDialog(); /* must be before the fork() */ if ((ehs_pid = fork()) == 0) { int i, fd; struct termios foo; extern int login_tty(int); ioctl(0, TIOCNOTTY, NULL); for (i = getdtablesize(); i >= 0; --i) close(i); if (strcmp(variable_get(VAR_FIXIT_TTY), "serial") == 0) fd = open("/dev/console", O_RDWR); else fd = open("/dev/ttyv3", O_RDWR); ioctl(0, TIOCSCTTY, &fd); dup2(0, 1); dup2(0, 2); DebugFD = 2; if (login_tty(fd) == -1) msgDebug("Doctor: I can't set the controlling terminal.\n"); signal(SIGTTOU, SIG_IGN); if (tcgetattr(fd, &foo) != -1) { foo.c_cc[VERASE] = '\010'; if (tcsetattr(fd, TCSANOW, &foo) == -1) msgDebug("Doctor: I'm unable to set the erase character.\n"); } else msgDebug("Doctor: I'm unable to get the terminal attributes!\n"); if (strcmp(variable_get(VAR_FIXIT_TTY), "serial") == 0) { printf("Type ``exit'' in this fixit shell to resume sysinstall.\n\n"); fflush(stdout); } execlp("sh", "-sh", 0); msgDebug("Was unable to execute sh for Holographic shell!\n"); exit(1); } else { if (strcmp(variable_get(VAR_FIXIT_TTY), "standard") == 0) { WINDOW *w = savescr(); msgNotify("Starting an emergency holographic shell on VTY4"); sleep(2); restorescr(w); } else { (void)waitpid(ehs_pid, &waitstatus, 0); /* we only wait for shell to finish it serial mode since there is no virtual console */ systemResumeDialog(); } } } } Index: head/usr.sbin/sysinstall/cdrom.c =================================================================== --- head/usr.sbin/sysinstall/cdrom.c (revision 104939) +++ head/usr.sbin/sysinstall/cdrom.c (revision 104940) @@ -1,208 +1,210 @@ /* * The new sysinstall program. * * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * * $FreeBSD$ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. * Copyright (c) 1995 * Gary J Palmer. 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. * * 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. * */ /* These routines deal with getting things off of CDROM media */ #include "sysinstall.h" #include #include #include #include #include #include #include #include #define CD9660 #include #include #undef CD9660 static Boolean cdromMounted; static Boolean previouslyMounted; /* Was the disc already mounted? */ static char mountpoint[MAXPATHLEN] = "/dist"; static properties read_props(char *name) { int fd; properties n; fd = open(name, O_RDONLY); if (fd == -1) return NULL; n = properties_read(fd); close(fd); return n; } Boolean mediaInitCDROM(Device *dev) { struct iso_args args; properties cd_attr = NULL; char *cp = NULL; Boolean readInfo = TRUE; static Boolean bogusCDOK = FALSE; if (cdromMounted) return TRUE; Mkdir(mountpoint); bzero(&args, sizeof(args)); args.fspec = dev->devname; args.flags = 0; if (mount("cd9660", mountpoint, MNT_RDONLY, (caddr_t) &args) == -1) { if (errno == EINVAL) { msgConfirm("The disc in your drive looks more like an Audio disc than a FreeBSD release."); return FALSE; } else if (errno == EBUSY) { /* Perhaps the CDROM drive is already mounted as /cdrom */ if (file_readable("/cdrom/cdrom.inf")) { previouslyMounted = TRUE; strlcpy(mountpoint, "/cdrom", 7); } } else { msgConfirm("Error mounting %s on %s: %s (%u)", dev->devname, mountpoint, strerror(errno), errno); return FALSE; } } cdromMounted = TRUE; if (!file_readable(string_concat(mountpoint, "/cdrom.inf")) && !bogusCDOK) { if (msgYesNo("Warning: The disc currently in the drive is either not a FreeBSD\n" "disc or it is an older (pre 2.1.5) FreeBSD CD which does not\n" "have a version number on it. Do you wish to use this disc anyway?") != 0) { if (!previouslyMounted) unmount(mountpoint, MNT_FORCE); cdromMounted = FALSE; return FALSE; } else { readInfo = FALSE; bogusCDOK = TRUE; } } if (readInfo) { if (!(cd_attr = read_props(string_concat(mountpoint, "/cdrom.inf"))) || !(cp = property_find(cd_attr, "CD_VERSION"))) { msgConfirm("Unable to find a %s/cdrom.inf file.\n" "Either this is not a FreeBSD disc, there is a problem with\n" "the CDROM driver or something is wrong with your hardware.\n" "Please fix this problem (check the console logs on VTY2) and\n" "try again.", mountpoint); } else { if (variable_cmp(VAR_RELNAME, cp) && variable_cmp(VAR_RELNAME, "any") && variable_cmp(cp, "any") && !bogusCDOK) { msgConfirm("Warning: The version of the FreeBSD disc currently in the drive\n" "(%s) does not match the version of the boot floppy\n" "(%s).\n\n" "If this is intentional, to avoid this message in the future\n" "please visit the Options editor to set the boot floppy version\n" "string to match that of the disc before selecting it as your\n" "installation media.", cp, variable_get(VAR_RELNAME)); if (msgYesNo("Would you like to try and use this disc anyway?") != 0) { if (!previouslyMounted) unmount(mountpoint, MNT_FORCE); cdromMounted = FALSE; properties_free(cd_attr); return FALSE; } else bogusCDOK = TRUE; } if ((cp = property_find(cd_attr, "CD_MACHINE_ARCH")) != NULL) { if (strcmp(cp, "any") && #ifdef __alpha__ strcmp(cp, "alpha")) { +#elif defined(__sparc64__) + strcmp(cp, "sparc64")) { #else strcmp(cp, "x86")) { #endif msgConfirm("Fatal: The FreeBSD install CD/DVD currently in the drive\n" "is for the %s architecture, not the machine you're using.\n\n" "Please use the correct installation CD/DVD for your machine type.", cp); if (!previouslyMounted) unmount(mountpoint, MNT_FORCE); cdromMounted = FALSE; properties_free(cd_attr); return FALSE; } } if ((cp = property_find(cd_attr, "CD_VOLUME")) != NULL) { dev->volume = atoi(cp); /* XXX - Sanity check the volume here? */ msgDebug("CD Volume %d initialized!\n", dev->volume); } else { dev->volume = 0; } } } if (cd_attr) properties_free(cd_attr); return TRUE; } FILE * mediaGetCDROM(Device *dev, char *file, Boolean probe) { return mediaGenericGet(mountpoint, file); } void mediaShutdownCDROM(Device *dev) { if (!cdromMounted) return; if (previouslyMounted) { cdromMounted = FALSE; return; } if (unmount(mountpoint, MNT_FORCE) != 0) msgConfirm("Could not unmount the CDROM/DVD from %s: %s", mountpoint, strerror(errno)); else cdromMounted = FALSE; } Index: head/usr.sbin/sysinstall/disks.c =================================================================== --- head/usr.sbin/sysinstall/disks.c (revision 104939) +++ head/usr.sbin/sysinstall/disks.c (revision 104940) @@ -1,964 +1,964 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * * $FreeBSD$ * * 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. * * 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 #include enum size_units_t { UNIT_BLOCKS, UNIT_KILO, UNIT_MEG, UNIT_SIZE }; #ifdef PC98 #define SUBTYPE_FREEBSD 50324 #define SUBTYPE_FAT 37218 #else #define SUBTYPE_FREEBSD 165 #define SUBTYPE_FAT 6 #endif /* 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[16]; static int current_chunk; static void diskPartitionNonInteractive(Device *dev); static u_char * bootalloc(char *name, size_t *size); static void record_chunks(Disk *d) { struct chunk *c1 = NULL; int i = 0; int last_free = 0; if (!d->chunks) msgFatal("No chunk list found for %s!", d->name); for (c1 = d->chunks->part; c1; c1 = c1->next) { if (c1->type == unused && c1->size > last_free) { last_free = c1->size; current_chunk = i; } chunk_info[i++] = c1; } chunk_info[i] = NULL; if (current_chunk >= i) current_chunk = i - 1; } static int Total; static void print_chunks(Disk *d, int u) { int row; int i; int sz; char *szstr; szstr = (u == UNIT_MEG ? "MB" : (u == UNIT_KILO ? "KB" : "ST")); for (i = Total = 0; chunk_info[i]; i++) Total += chunk_info[i]->size; #ifndef PC98 if (d->bios_cyl > 65536 || d->bios_hd > 256 || d->bios_sect >= 64) { dialog_clear_norefresh(); msgConfirm("WARNING: A geometry of %lu/%lu/%lu for %s is incorrect. Using\n" "a more likely geometry. If this geometry is incorrect or you\n" "are unsure as to whether or not it's correct, please consult\n" "the Hardware Guide in the Documentation submenu or use the\n" "(G)eometry command to change it now.\n\n" "Remember: you need to enter whatever your BIOS thinks the\n" "geometry is! For IDE, it's what you were told in the BIOS\n" "setup. For SCSI, it's the translation mode your controller is\n" "using. Do NOT use a ``physical geometry''.", d->bios_cyl, d->bios_hd, d->bios_sect, d->name); Sanitize_Bios_Geom(d); } #endif 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, "DISK Geometry:\t%lu cyls/%lu heads/%lu sectors = %lu sectors (%luMB)", d->bios_cyl, d->bios_hd, d->bios_sect, d->bios_cyl * d->bios_hd * d->bios_sect, d->bios_cyl * d->bios_hd * d->bios_sect / (1024/512) / 1024); mvprintw(3, 0, "%6s %10s(%s) %10s %8s %6s %10s %8s %8s", "Offset", "Size", szstr, "End", "Name", "PType", "Desc", "Subtype", "Flags"); for (i = 0, row = CHUNK_START_ROW; chunk_info[i]; i++, row++) { switch(u) { default: /* fall thru */ case UNIT_BLOCKS: sz = chunk_info[i]->size; break; case UNIT_KILO: sz = chunk_info[i]->size / (1024/512); break; case UNIT_MEG: sz = chunk_info[i]->size / (1024/512) / 1024; break; } if (i == current_chunk) attrset(ATTR_SELECTED); mvprintw(row, 0, "%10ld %10lu %10lu %8s %6d %10s %8d\t%-6s", chunk_info[i]->offset, sz, chunk_info[i]->end, chunk_info[i]->name, chunk_info[i]->type, slice_type_name(chunk_info[i]->type, chunk_info[i]->subtype), 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 G = set Drive Geometry C = Create Slice F = `DD' mode"); mvprintw(17, 0, "D = Delete Slice Z = Toggle Size Units S = Set Bootable | = Wizard m."); mvprintw(18, 0, "T = Change Type U = Undo All Changes Q = Finish"); if (!RunningAsInit) mvprintw(18, 47, "W = Write Changes"); mvprintw(21, 0, "Use F1 or ? to get more help, arrow keys to select."); move(0, 0); } #ifdef PC98 static void getBootMgr(char *dname, u_char **bootipl, size_t *bootipl_size, u_char **bootmenu, size_t *bootmenu_size) { static u_char *boot0; static size_t boot0_size; static u_char *boot05; static size_t boot05_size; char str[80]; char *cp; int i = 0; cp = variable_get(VAR_BOOTMGR); if (!cp) { /* Figure out what kind of MBR the user wants */ sprintf(str, "Install Boot Manager for drive %s?", dname); MenuMBRType.title = str; i = dmenuOpenSimple(&MenuMBRType, FALSE); } else { if (!strncmp(cp, "boot", 4)) BootMgr = 0; else BootMgr = 2; } if (cp || i) { switch (BootMgr) { case 0: if (!boot0) boot0 = bootalloc("boot0", &boot0_size); *bootipl = boot0; *bootipl_size = boot0_size; if (!boot05) boot05 = bootalloc("boot0.5", &boot05_size); *bootmenu = boot05; *bootmenu_size = boot05_size; return; case 2: default: break; } } *bootipl = NULL; *bootipl_size = 0; *bootmenu = NULL; *bootmenu_size = 0; } #else static void getBootMgr(char *dname, u_char **bootCode, size_t *bootCodeSize) { #ifdef __i386__ /* only meaningful on x86 */ static u_char *mbr, *boot0; static size_t mbr_size, boot0_size; char str[80]; char *cp; int i = 0; cp = variable_get(VAR_BOOTMGR); if (!cp) { /* Figure out what kind of MBR the user wants */ sprintf(str, "Install Boot Manager for drive %s?", dname); MenuMBRType.title = str; i = dmenuOpenSimple(&MenuMBRType, FALSE); } else { if (!strncmp(cp, "boot", 4)) BootMgr = 0; else if (!strcmp(cp, "standard")) BootMgr = 1; else BootMgr = 2; } if (cp || i) { switch (BootMgr) { case 0: if (!boot0) boot0 = bootalloc("boot0", &boot0_size); *bootCode = boot0; *bootCodeSize = boot0_size; return; case 1: if (!mbr) mbr = bootalloc("mbr", &mbr_size); *bootCode = mbr; *bootCodeSize = mbr_size; return; case 2: default: break; } } #endif *bootCode = NULL; *bootCodeSize = 0; } #endif int diskGetSelectCount(Device ***devs) { int i, cnt, enabled; char *cp; Device **dp; cp = variable_get(VAR_DISK); dp = *devs = deviceFind(cp, DEVICE_TYPE_DISK); cnt = deviceCount(dp); if (!cnt) return -1; for (i = 0, enabled = 0; i < cnt; i++) { if (dp[i]->enabled) ++enabled; } return enabled; } void diskPartition(Device *dev) { char *cp, *p; int rv, key = 0; Boolean chunking; char *msg = NULL; #ifdef PC98 u_char *bootipl; size_t bootipl_size; u_char *bootmenu; size_t bootmenu_size; #else u_char *mbrContents; size_t mbrSize; #endif WINDOW *w = savescr(); Disk *d = (Disk *)dev->private; int size_unit; size_unit = UNIT_BLOCKS; chunking = TRUE; keypad(stdscr, TRUE); /* Flush both the dialog and curses library views of the screen since we don't always know who called us */ dialog_clear_norefresh(), clear(); current_chunk = 0; /* Set up the chunk array */ record_chunks(d); while (chunking) { char *val, geometry[80]; /* Now print our overall state */ if (d) print_chunks(d, size_unit); print_command_summary(); if (msg) { attrset(title_attr); mvprintw(23, 0, msg); attrset(A_NORMAL); beep(); msg = NULL; } else { move(23, 0); clrtoeol(); } /* Get command character */ key = getch(); switch (toupper(key)) { case '\014': /* ^L (redraw) */ clear(); msg = NULL; break; case '\020': /* ^P */ case KEY_UP: case '-': if (current_chunk != 0) --current_chunk; break; case '\016': /* ^N */ 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 '?': systemDisplayHelp("slice"); clear(); break; case 'A': case 'F': /* Undocumented magic Dangerously Dedicated mode */ -#ifdef __alpha__ +#if defined(__alpha__) || defined(__sparc64__) rv = 1; #else /* The rest is only relevant on x86 */ cp = variable_get(VAR_DEDICATE_DISK); if (cp && !strcasecmp(cp, "always")) rv = 1; else if (toupper(key) == 'A') rv = 0; else { rv = msgYesNo("Do you want to do this with a true partition entry\n" "so as to remain cooperative with any future possible\n" "operating systems on the drive(s)?\n" "(See also the section about ``dangerously dedicated''\n" "disks in the FreeBSD FAQ.)"); if (rv == -1) rv = 0; } #endif All_FreeBSD(d, rv); variable_set2(DISK_PARTITIONED, "yes", 0); record_chunks(d); clear(); break; case 'C': if (chunk_info[current_chunk]->type != unused) msg = "Slice in use, delete it first or move to an unused one."; else { char *val, tmp[20], *cp; int size; #ifdef PC98 char name[16]; snprintf(name, 16, "%s", "FreeBSD"); val = msgGetInput(name, "Please specify the name for new FreeBSD slice."); if (val) strncpy(name, val, 16); #else int subtype; chunk_e partitiontype; #endif snprintf(tmp, 20, "%lu", chunk_info[current_chunk]->size); val = msgGetInput(tmp, "Please specify the size for new FreeBSD slice in blocks\n" "or append a trailing `M' for megabytes (e.g. 20M)."); if (val && (size = strtol(val, &cp, 0)) > 0) { if (*cp && toupper(*cp) == 'M') size *= ONE_MEG; else if (*cp && toupper(*cp) == 'G') size *= ONE_GIG; #ifdef PC98 Create_Chunk(d, chunk_info[current_chunk]->offset, size, freebsd, 3, (chunk_info[current_chunk]->flags & CHUNK_ALIGN), name); variable_set2(DISK_PARTITIONED, "yes", 0); record_chunks(d); #else sprintf(tmp, "%d", SUBTYPE_FREEBSD); val = msgGetInput(tmp, "Enter type of partition to create:\n\n" "Pressing Enter will choose the default, a native FreeBSD\n" "slice (type 165). You can choose other types, 6 for a\n" "DOS partition or 131 for a Linux partition, for example.\n\n" "Note: If you choose a non-FreeBSD partition type, it will not\n" "be formatted or otherwise prepared, it will simply reserve space\n" "for you to use another tool, such as DOS FORMAT, to later format\n" "and use the partition."); if (val && (subtype = strtol(val, NULL, 0)) > 0) { if (subtype == SUBTYPE_FREEBSD) partitiontype = freebsd; else if (subtype == SUBTYPE_FAT) partitiontype = fat; else partitiontype = unknown; -#ifdef __alpha__ +#if defined(__alpha__) || defined(__sparc64__) if (partitiontype == freebsd && size == chunk_info[current_chunk]->size) All_FreeBSD(d, 1); else #endif Create_Chunk(d, chunk_info[current_chunk]->offset, size, partitiontype, subtype, (chunk_info[current_chunk]->flags & CHUNK_ALIGN)); variable_set2(DISK_PARTITIONED, "yes", 0); record_chunks(d); } #endif /* PC98 */ } clear(); } break; case KEY_DC: case 'D': if (chunk_info[current_chunk]->type == unused) msg = "Slice is already unused!"; else { Delete_Chunk(d, chunk_info[current_chunk]); variable_set2(DISK_PARTITIONED, "yes", 0); record_chunks(d); } break; case 'T': if (chunk_info[current_chunk]->type == unused) msg = "Slice is currently unused (use create instead)"; else { char *val, tmp[20]; int subtype; chunk_e partitiontype; sprintf(tmp, "%d", SUBTYPE_FREEBSD); #ifdef PC98 val = msgGetInput(tmp, "New partition type:\n\n" "Pressing Enter will choose the default, a native FreeBSD\n" "slice (type 50324). Other popular values are 37218 for\n" "DOS FAT partition.\n\n" "Note: If you choose a non-FreeBSD partition type, it will not\n" "be formatted or otherwise prepared, it will simply reserve space\n" "for you to use another tool, such as DOS format, to later format\n" "and actually use the partition."); #else val = msgGetInput(tmp, "New partition type:\n\n" "Pressing Enter will choose the default, a native FreeBSD\n" "slice (type 165). Other popular values are 6 for\n" "DOS FAT partition, 131 for a Linux ext2fs partition or\n" "130 for a Linux swap partition.\n\n" "Note: If you choose a non-FreeBSD partition type, it will not\n" "be formatted or otherwise prepared, it will simply reserve space\n" "for you to use another tool, such as DOS format, to later format\n" "and actually use the partition."); #endif /* PC98 */ if (val && (subtype = strtol(val, NULL, 0)) > 0) { if (subtype == SUBTYPE_FREEBSD) partitiontype = freebsd; else if (subtype == SUBTYPE_FAT) partitiontype = fat; else partitiontype = unknown; chunk_info[current_chunk]->type = partitiontype; chunk_info[current_chunk]->subtype = subtype; } } break; case 'G': 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.\n" "Don't forget to use the two slash (/) separator characters!\n" "It's not possible to parse the field without them."); if (val) { long nc, nh, ns; nc = strtol(val, &val, 0); nh = strtol(val + 1, &val, 0); ns = strtol(val + 1, 0, 0); Set_Bios_Geom(d, nc, nh, ns); } clear(); break; case 'S': /* Set Bootable */ chunk_info[current_chunk]->flags |= CHUNK_ACTIVE; break; case 'U': if (!variable_cmp(DISK_LABELLED, "written")) { msgConfirm("You've already written this information out - you\n" "can't undo it."); } else if (!msgNoYes("Are you SURE you want to Undo everything?")) { char cp[BUFSIZ]; sstrncpy(cp, d->name, sizeof cp); Free_Disk(dev->private); d = Open_Disk(cp); if (!d) msgConfirm("Can't reopen disk %s! Internal state is probably corrupted", cp); dev->private = d; variable_unset(DISK_PARTITIONED); variable_unset(DISK_LABELLED); if (d) record_chunks(d); } clear(); break; case 'W': if (!msgNoYes("WARNING: This should only be used when modifying an EXISTING\n" "installation. If you are installing FreeBSD for the first time\n" "then you should simply type Q when you're finished here and your\n" "changes will be committed in one batch automatically at the end of\n" "these questions. If you're adding a disk, you should NOT write\n" "from this screen, you should do it from the label editor.\n\n" "Are you absolutely sure you want to do this now?")) { variable_set2(DISK_PARTITIONED, "yes", 0); /* * 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. */ /* * Don't offer to update the MBR on this disk if the first * "real" chunk looks like a FreeBSD "all disk" partition, * or the disk is entirely FreeBSD. */ #ifdef PC98 if ((d->chunks->part->type != freebsd) || (d->chunks->part->offset > 1)) getBootMgr(d->name, &bootipl, &bootipl_size, &bootmenu, &bootmenu_size); else { bootipl = NULL; bootipl_size = 0; bootmenu = NULL; bootmenu_size = 0; } Set_Boot_Mgr(d, bootipl, bootipl_size, bootmenu, bootmenu_size); #else if ((d->chunks->part->type != freebsd) || (d->chunks->part->offset > 1)) getBootMgr(d->name, &mbrContents, &mbrSize); else { mbrContents = NULL; mbrSize = 0; } Set_Boot_Mgr(d, mbrContents, mbrSize); #endif if (DITEM_STATUS(diskPartitionWrite(NULL)) != DITEM_SUCCESS) msgConfirm("Disk partition write returned an error status!"); else msgConfirm("Wrote FDISK partition information out successfully."); } clear(); break; case '|': if (!msgNoYes("Are you SURE you want to go into Wizard mode?\n" "No seat belts whatsoever are provided!")) { clear(); refresh(); slice_wizard(d); variable_set2(DISK_PARTITIONED, "yes", 0); record_chunks(d); } else msg = "Wise choice!"; clear(); break; case '\033': /* ESC */ case 'Q': chunking = FALSE; /* * 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. */ /* * Don't offer to update the MBR on this disk if the first "real" * chunk looks like a FreeBSD "all disk" partition, or the disk is * entirely FreeBSD. */ if ((d->chunks->part->type != freebsd) || (d->chunks->part->offset > 1)) { if (variable_cmp(DISK_PARTITIONED, "written")) { #ifdef PC98 getBootMgr(d->name, &bootipl, &bootipl_size, &bootmenu, &bootmenu_size); if (bootipl != NULL && bootmenu != NULL) Set_Boot_Mgr(d, bootipl, bootipl_size, bootmenu, bootmenu_size); #else getBootMgr(d->name, &mbrContents, &mbrSize); if (mbrContents != NULL) Set_Boot_Mgr(d, mbrContents, mbrSize); #endif } } break; case 'Z': size_unit = (size_unit + 1) % UNIT_SIZE; break; default: beep(); msg = "Type F1 or ? for help"; break; } } p = CheckRules(d); if (p) { char buf[FILENAME_MAX]; use_helpline("Press F1 to read more about disk slices."); use_helpfile(systemHelpFile("partition", buf)); if (!variable_get(VAR_NO_WARN)) dialog_mesgbox("Disk slicing warning:", p, -1, -1); free(p); } restorescr(w); } static u_char * bootalloc(char *name, size_t *size) { char buf[FILENAME_MAX]; struct stat sb; snprintf(buf, sizeof buf, "/boot/%s", name); if (stat(buf, &sb) != -1) { int fd; fd = open(buf, O_RDONLY); if (fd != -1) { u_char *cp; cp = malloc(sb.st_size); if (read(fd, cp, sb.st_size) != sb.st_size) { free(cp); close(fd); msgDebug("bootalloc: couldn't read %ld bytes from %s\n", (long)sb.st_size, buf); return NULL; } close(fd); if (size != NULL) *size = sb.st_size; return cp; } msgDebug("bootalloc: couldn't open %s\n", buf); } else msgDebug("bootalloc: can't stat %s\n", buf); return NULL; } static int partitionHook(dialogMenuItem *selected) { Device **devs = NULL; devs = deviceFind(selected->prompt, DEVICE_TYPE_DISK); if (!devs) { msgConfirm("Unable to find disk %s!", selected->prompt); return DITEM_FAILURE; } /* Toggle enabled status? */ if (!devs[0]->enabled) { devs[0]->enabled = TRUE; diskPartition(devs[0]); } else devs[0]->enabled = FALSE; return DITEM_SUCCESS; } static int partitionCheck(dialogMenuItem *selected) { Device **devs = NULL; devs = deviceFind(selected->prompt, DEVICE_TYPE_DISK); if (!devs || devs[0]->enabled == FALSE) return FALSE; return TRUE; } int diskPartitionEditor(dialogMenuItem *self) { DMenu *menu; Device **devs; int i, cnt, devcnt; cnt = diskGetSelectCount(&devs); devcnt = deviceCount(devs); if (cnt == -1) { msgConfirm("No disks found! Please verify that your disk controller is being\n" "properly probed at boot time. See the Hardware Guide on the\n" "Documentation menu for clues on diagnosing this type of problem."); return DITEM_FAILURE; } else if (cnt) { /* Some are already selected */ for (i = 0; i < devcnt; i++) { if (devs[i]->enabled) { if (variable_get(VAR_NONINTERACTIVE) && !variable_get(VAR_DISKINTERACTIVE)) diskPartitionNonInteractive(devs[i]); else diskPartition(devs[i]); } } } else { /* No disks are selected, fall-back case now */ if (devcnt == 1) { devs[0]->enabled = TRUE; if (variable_get(VAR_NONINTERACTIVE) && !variable_get(VAR_DISKINTERACTIVE)) diskPartitionNonInteractive(devs[0]); else diskPartition(devs[0]); return DITEM_SUCCESS; } else { menu = deviceCreateMenu(&MenuDiskDevices, DEVICE_TYPE_DISK, partitionHook, partitionCheck); if (!menu) { msgConfirm("No devices suitable for installation found!\n\n" "Please verify that your disk controller (and attached drives)\n" "were detected properly. This can be done by pressing the\n" "[Scroll Lock] key and using the Arrow keys to move back to\n" "the boot messages. Press [Scroll Lock] again to return."); return DITEM_FAILURE; } else { i = dmenuOpenSimple(menu, FALSE) ? DITEM_SUCCESS : DITEM_FAILURE; free(menu); } return i; } } return DITEM_SUCCESS; } int diskPartitionWrite(dialogMenuItem *self) { Device **devs; int i; if (!variable_cmp(DISK_PARTITIONED, "written")) return DITEM_SUCCESS; devs = deviceFind(NULL, DEVICE_TYPE_DISK); if (!devs) { msgConfirm("Unable to find any disks to write to??"); return DITEM_FAILURE; } if (isDebug()) msgDebug("diskPartitionWrite: Examining %d devices\n", deviceCount(devs)); for (i = 0; devs[i]; i++) { Disk *d = (Disk *)devs[i]->private; static u_char *boot1; -#ifndef __alpha__ +#if defined(__i386__) || defined(__ia64__) static u_char *boot2; #endif if (!devs[i]->enabled) continue; -#ifdef __alpha__ +#if defined(__i386__) || defined(__ia64__) if (!boot1) boot1 = bootalloc("boot1", NULL); - Set_Boot_Blocks(d, boot1, NULL); -#else - if (!boot1) boot1 = bootalloc("boot1", NULL); if (!boot2) boot2 = bootalloc("boot2", NULL); Set_Boot_Blocks(d, boot1, boot2); +#else + if (!boot1) boot1 = bootalloc("boot1", NULL); + Set_Boot_Blocks(d, boot1, NULL); #endif msgNotify("Writing partition information to drive %s", d->name); if (!Fake && Write_Disk(d)) { msgConfirm("ERROR: Unable to write data to disk %s!", d->name); return DITEM_FAILURE; } } /* Now it's not "yes", but "written" */ variable_set2(DISK_PARTITIONED, "written", 0); return DITEM_SUCCESS | DITEM_RESTORE; } /* Partition a disk based wholly on which variables are set */ static void diskPartitionNonInteractive(Device *dev) { char *cp; int i, sz, all_disk = 0; #ifdef PC98 u_char *bootipl; size_t bootipl_size; u_char *bootmenu; size_t bootmenu_size; #else u_char *mbrContents; size_t mbrSize; #endif Disk *d = (Disk *)dev->private; record_chunks(d); cp = variable_get(VAR_GEOMETRY); if (cp) { msgDebug("Setting geometry from script to: %s\n", cp); d->bios_cyl = strtol(cp, &cp, 0); d->bios_hd = strtol(cp + 1, &cp, 0); d->bios_sect = strtol(cp + 1, 0, 0); } cp = variable_get(VAR_PARTITION); if (cp) { if (!strcmp(cp, "free")) { /* Do free disk space case */ for (i = 0; chunk_info[i]; i++) { /* If a chunk is at least 10MB in size, use it. */ if (chunk_info[i]->type == unused && chunk_info[i]->size > (10 * ONE_MEG)) { #ifdef PC98 Create_Chunk(d, chunk_info[i]->offset, chunk_info[i]->size, freebsd, 3, (chunk_info[i]->flags & CHUNK_ALIGN), "FreeBSD"); #else Create_Chunk(d, chunk_info[i]->offset, chunk_info[i]->size, freebsd, 3, (chunk_info[i]->flags & CHUNK_ALIGN)); #endif variable_set2(DISK_PARTITIONED, "yes", 0); break; } } if (!chunk_info[i]) { msgConfirm("Unable to find any free space on this disk!"); return; } } else if (!strcmp(cp, "all")) { /* Do all disk space case */ msgDebug("Warning: Devoting all of disk %s to FreeBSD.\n", d->name); All_FreeBSD(d, FALSE); } else if (!strcmp(cp, "exclusive")) { /* Do really-all-the-disk-space case */ msgDebug("Warning: Devoting all of disk %s to FreeBSD.\n", d->name); All_FreeBSD(d, all_disk = TRUE); } else if ((sz = strtol(cp, &cp, 0))) { /* Look for sz bytes free */ if (*cp && toupper(*cp) == 'M') sz *= ONE_MEG; else if (*cp && toupper(*cp) == 'G') sz *= ONE_GIG; for (i = 0; chunk_info[i]; i++) { /* If a chunk is at least sz MB, use it. */ if (chunk_info[i]->type == unused && chunk_info[i]->size >= sz) { #ifdef PC98 Create_Chunk(d, chunk_info[i]->offset, sz, freebsd, 3, (chunk_info[i]->flags & CHUNK_ALIGN), "FreeBSD"); #else Create_Chunk(d, chunk_info[i]->offset, sz, freebsd, 3, (chunk_info[i]->flags & CHUNK_ALIGN)); #endif variable_set2(DISK_PARTITIONED, "yes", 0); break; } } if (!chunk_info[i]) { msgConfirm("Unable to find %d free blocks on this disk!", sz); return; } } else if (!strcmp(cp, "existing")) { /* Do existing FreeBSD case */ for (i = 0; chunk_info[i]; i++) { if (chunk_info[i]->type == freebsd) break; } if (!chunk_info[i]) { msgConfirm("Unable to find any existing FreeBSD partitions on this disk!"); return; } } else { msgConfirm("`%s' is an invalid value for %s - is config file valid?", cp, VAR_PARTITION); return; } if (!all_disk) { #ifdef PC98 getBootMgr(d->name, &bootipl, &bootipl_size, &bootmenu, &bootmenu_size); Set_Boot_Mgr(d, bootipl, bootipl_size, bootmenu, bootmenu_size); #else getBootMgr(d->name, &mbrContents, &mbrSize); Set_Boot_Mgr(d, mbrContents, mbrSize); #endif } variable_set2(DISK_PARTITIONED, "yes", 0); } } Index: head/usr.sbin/sysinstall/install.c =================================================================== --- head/usr.sbin/sysinstall/install.c (revision 104939) +++ head/usr.sbin/sysinstall/install.c (revision 104940) @@ -1,1203 +1,1203 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * * $FreeBSD$ * * 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. * * 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 #include #include #include #include #define MSDOSFS #include #include #include #undef MSDOSFS #include #include #include #include /* Hack for rsaref package add, which displays interactive license. * Used by package.c */ int _interactiveHack; int FixItMode = 0; static void create_termcap(void); static void fixit_common(void); #define TERMCAP_FILE "/usr/share/misc/termcap" static void installConfigure(void); Boolean checkLabels(Boolean whinge, Chunk **rdev, Chunk **sdev, Chunk **udev, Chunk **vdev, Chunk **tdev, Chunk **hdev) { Device **devs; Boolean status; Disk *disk; Chunk *c1, *c2, *rootdev, *swapdev, *usrdev, *vardev, *tmpdev, *homedev; int i; /* Don't allow whinging if noWarn is set */ if (variable_get(VAR_NO_WARN)) whinge = FALSE; status = TRUE; if (rdev) *rdev = NULL; if (sdev) *sdev = NULL; if (udev) *udev = NULL; if (vdev) *vdev = NULL; if (tdev) *tdev = NULL; if (hdev) *hdev = NULL; rootdev = swapdev = usrdev = vardev = tmpdev = homedev = NULL; /* We don't need to worry about root/usr/swap if we're already multiuser */ if (!RunningAsInit) return status; devs = deviceFind(NULL, DEVICE_TYPE_DISK); /* First verify that we have a root device */ for (i = 0; devs[i]; i++) { if (!devs[i]->enabled) continue; disk = (Disk *)devs[i]->private; msgDebug("Scanning disk %s for root filesystem\n", disk->name); if (!disk->chunks) msgFatal("No chunk list found for %s!", disk->name); for (c1 = disk->chunks->part; c1; c1 = c1->next) { if (c1->type == freebsd) { for (c2 = c1->part; c2; c2 = c2->next) { if (c2->type == part && c2->subtype != FS_SWAP && c2->private_data) { if (!strcmp(((PartInfo *)c2->private_data)->mountpoint, "/")) { if (rootdev) { if (whinge) msgConfirm("WARNING: You have more than one root device set?!\n" "Using the first one found."); continue; } else { rootdev = c2; if (isDebug()) msgDebug("Found rootdev at %s!\n", rootdev->name); } } else if (!strcmp(((PartInfo *)c2->private_data)->mountpoint, "/usr")) { if (usrdev) { if (whinge) msgConfirm("WARNING: You have more than one /usr filesystem.\n" "Using the first one found."); continue; } else { usrdev = c2; if (isDebug()) msgDebug("Found usrdev at %s!\n", usrdev->name); } } else if (!strcmp(((PartInfo *)c2->private_data)->mountpoint, "/var")) { if (vardev) { if (whinge) msgConfirm("WARNING: You have more than one /var filesystem.\n" "Using the first one found."); continue; } else { vardev = c2; if (isDebug()) msgDebug("Found vardev at %s!\n", vardev->name); } } else if (!strcmp(((PartInfo *)c2->private_data)->mountpoint, "/tmp")) { if (tmpdev) { if (whinge) msgConfirm("WARNING: You have more than one /tmp filesystem.\n" "Using the first one found."); continue; } else { tmpdev = c2; if (isDebug()) msgDebug("Found tmpdev at %s!\n", tmpdev->name); } } else if (!strcmp(((PartInfo *)c2->private_data)->mountpoint, "/home")) { if (homedev) { if (whinge) msgConfirm("WARNING: You have more than one /home filesystem.\n" "Using the first one found."); continue; } else { homedev = c2; if (isDebug()) msgDebug("Found homedev at %s!\n", homedev->name); } } } } } } } /* Now check for swap devices */ for (i = 0; devs[i]; i++) { if (!devs[i]->enabled) continue; disk = (Disk *)devs[i]->private; msgDebug("Scanning disk %s for swap partitions\n", disk->name); if (!disk->chunks) msgFatal("No chunk list found for %s!", disk->name); for (c1 = disk->chunks->part; c1; c1 = c1->next) { if (c1->type == freebsd) { for (c2 = c1->part; c2; c2 = c2->next) { if (c2->type == part && c2->subtype == FS_SWAP && !swapdev) { swapdev = c2; if (isDebug()) msgDebug("Found swapdev at %s!\n", swapdev->name); break; } } } } } /* Copy our values over */ if (rdev) *rdev = rootdev; if (sdev) *sdev = swapdev; if (udev) *udev = usrdev; if (vdev) *vdev = vardev; if (tdev) *tdev = tmpdev; if (hdev) *hdev = homedev; if (!rootdev && whinge) { msgConfirm("No root device found - you must label a partition as /\n" "in the label editor."); status = FALSE; } if (!swapdev && whinge) { msgConfirm("No swap devices found - you must create at least one\n" "swap partition."); status = FALSE; } return status; } static int installInitial(void) { static Boolean alreadyDone = FALSE; int status = DITEM_SUCCESS; if (alreadyDone) return DITEM_SUCCESS; if (!variable_get(DISK_LABELLED)) { msgConfirm("You need to assign disk labels before you can proceed with\n" "the installation."); return DITEM_FAILURE; } /* If it's labelled, assume it's also partitioned */ if (!variable_get(DISK_PARTITIONED)) variable_set2(DISK_PARTITIONED, "yes", 0); /* If we refuse to proceed, bail. */ dialog_clear_norefresh(); if (!variable_get(VAR_NO_WARN)) { if (msgYesNo( "Last Chance! Are you SURE you want continue the installation?\n\n" "If you're running this on a disk with data you wish to save\n" "then WE STRONGLY ENCOURAGE YOU TO MAKE PROPER BACKUPS before\n" "proceeding!\n\n" "We can take no responsibility for lost disk contents!") != 0) return DITEM_FAILURE; } if (DITEM_STATUS(diskLabelCommit(NULL)) != DITEM_SUCCESS) { msgConfirm("Couldn't make filesystems properly. Aborting."); return DITEM_FAILURE; } if (!copySelf()) { msgConfirm("installInitial: Couldn't clone the boot floppy onto the\n" "root file system. Aborting!"); return DITEM_FAILURE; } if (!Restarting && chroot("/mnt") == -1) { msgConfirm("installInitial: Unable to chroot to %s - this is bad!", "/mnt"); return DITEM_FAILURE; } chdir("/"); variable_set2(RUNNING_ON_ROOT, "yes", 0); /* Configure various files in /etc */ if (DITEM_STATUS(configResolv(NULL)) == DITEM_FAILURE) status = DITEM_FAILURE; if (DITEM_STATUS(configFstab(NULL)) == DITEM_FAILURE) status = DITEM_FAILURE; /* stick a helpful shell over on the 4th VTY */ if (!variable_get(VAR_NO_HOLOSHELL)) systemCreateHoloshell(); alreadyDone = TRUE; return status; } int installFixitHoloShell(dialogMenuItem *self) { FixItMode = 1; systemCreateHoloshell(); return DITEM_SUCCESS; FixItMode = 0; } int installFixitCDROM(dialogMenuItem *self) { struct stat sb; if (!RunningAsInit) return DITEM_SUCCESS; variable_set2(SYSTEM_STATE, "fixit", 0); (void)unlink("/mnt2"); (void)rmdir("/mnt2"); while (1) { msgConfirm("Please insert a FreeBSD live filesystem CD/DVD and press return"); if (DITEM_STATUS(mediaSetCDROM(NULL)) != DITEM_SUCCESS || !DEVICE_INIT(mediaDevice)) { /* If we can't initialize it, it's probably not a FreeBSD CDROM so punt on it */ mediaClose(); if (msgYesNo("Unable to mount the disc - do you want to try again?") != 0) return DITEM_FAILURE; } else break; } /* Since the fixit code expects everything to be in /mnt2, and the CDROM mounting stuff /dist, do * a little kludge dance here.. */ if (symlink("/dist", "/mnt2")) { msgConfirm("Unable to symlink /mnt2 to the disc mount point. Please report this\n" "unexpected failure to freebsd-bugs@FreeBSD.org."); return DITEM_FAILURE; } /* * If /tmp points to /mnt2/tmp from a previous fixit floppy session, it's * not very good for us if we point it to the CDROM now. Rather make it * a directory in the root MFS then. Experienced admins will still be * able to mount their disk's /tmp over this if they need. */ if (lstat("/tmp", &sb) == 0 && (sb.st_mode & S_IFMT) == S_IFLNK) (void)unlink("/tmp"); Mkdir("/tmp"); /* * Since setuid binaries ignore LD_LIBRARY_PATH, we indeed need the * ld.so.hints file. Fortunately, it's fairly small (~ 3 KB). */ if (!file_readable("/var/run/ld.so.hints")) { Mkdir("/var/run"); if (vsystem("/mnt2/sbin/ldconfig -s /mnt2/usr/lib")) { msgConfirm("Warning: ldconfig could not create the ld.so hints file.\n" "Dynamic executables from the disc likely won't work."); } } /* Yet more iggly hardcoded pathnames. */ Mkdir("/usr/libexec"); if (!file_readable("/usr/libexec/ld.so") && file_readable("/mnt2/usr/libexec/ld.so")) { if (symlink("/mnt2/usr/libexec/ld.so", "/usr/libexec/ld.so")) msgDebug("Couldn't link to ld.so - not necessarily a problem for ELF\n"); } if (!file_readable("/usr/libexec/ld-elf.so.1")) { if (symlink("/mnt2/usr/libexec/ld-elf.so.1", "/usr/libexec/ld-elf.so.1")) { msgConfirm("Warning: could not create the symlink for ld-elf.so.1\n" "Dynamic executables from the disc likely won't work."); } } /* optional nicety */ if (!file_readable("/usr/bin/vi")) symlink("/mnt2/usr/bin/vi", "/usr/bin/vi"); fixit_common(); mediaClose(); msgConfirm("Please remove the FreeBSD fixit CDROM/DVD now."); return DITEM_SUCCESS; } int installFixitFloppy(dialogMenuItem *self) { struct ufs_args args; extern char *distWanted; if (!RunningAsInit) return DITEM_SUCCESS; /* Try to open the floppy drive */ if (DITEM_STATUS(mediaSetFloppy(NULL)) == DITEM_FAILURE || !mediaDevice) { msgConfirm("Unable to set media device to floppy."); mediaClose(); return DITEM_FAILURE; } memset(&args, 0, sizeof(args)); args.fspec = mediaDevice->devname; mediaDevice->private = "/mnt2"; distWanted = NULL; Mkdir("/mnt2"); variable_set2(SYSTEM_STATE, "fixit", 0); while (1) { if (!DEVICE_INIT(mediaDevice)) { if (msgYesNo("The attempt to mount the fixit floppy failed, bad floppy\n" "or unclean filesystem. Do you want to try again?")) return DITEM_FAILURE; } else break; } if (!directory_exists("/tmp")) (void)symlink("/mnt2/tmp", "/tmp"); fixit_common(); mediaClose(); msgConfirm("Please remove the fixit floppy now."); return DITEM_SUCCESS; } /* * The common code for both fixit variants. */ static void fixit_common(void) { pid_t child; int waitstatus; if (!directory_exists("/var/tmp/vi.recover")) { if (DITEM_STATUS(Mkdir("/var/tmp/vi.recover")) != DITEM_SUCCESS) { msgConfirm("Warning: Was unable to create a /var/tmp/vi.recover directory.\n" "vi will kvetch and moan about it as a result but should still\n" "be essentially usable."); } } if (!directory_exists("/bin")) (void)Mkdir("/bin"); (void)symlink("/stand/sh", "/bin/sh"); /* Link the /etc/ files */ if (DITEM_STATUS(Mkdir("/etc")) != DITEM_SUCCESS) msgConfirm("Unable to create an /etc directory! Things are weird on this floppy.."); else if ((symlink("/mnt2/etc/spwd.db", "/etc/spwd.db") == -1 && errno != EEXIST) || (symlink("/mnt2/etc/protocols", "/etc/protocols") == -1 && errno != EEXIST) || (symlink("/mnt2/etc/group", "/etc/group") == -1 && errno != EEXIST) || (symlink("/mnt2/etc/services", "/etc/services") == -1 && errno != EEXIST)) msgConfirm("Couldn't symlink the /etc/ files! I'm not sure I like this.."); if (!file_readable(TERMCAP_FILE)) create_termcap(); if (strcmp(variable_get(VAR_FIXIT_TTY), "serial") == 0) systemSuspendDialog(); /* must be before the fork() */ if (!(child = fork())) { int i, fd; struct termios foo; extern int login_tty(int); ioctl(0, TIOCNOTTY, NULL); for (i = getdtablesize(); i >= 0; --i) close(i); if (strcmp(variable_get(VAR_FIXIT_TTY), "serial") == 0) fd = open("/dev/console", O_RDWR); else fd = open("/dev/ttyv3", O_RDWR); ioctl(0, TIOCSCTTY, &fd); dup2(0, 1); dup2(0, 2); DebugFD = 2; if (login_tty(fd) == -1) msgDebug("fixit: I can't set the controlling terminal.\n"); signal(SIGTTOU, SIG_IGN); if (tcgetattr(0, &foo) != -1) { foo.c_cc[VERASE] = '\010'; if (tcsetattr(0, TCSANOW, &foo) == -1) msgDebug("fixit shell: Unable to set erase character.\n"); } else msgDebug("fixit shell: Unable to get terminal attributes!\n"); setenv("PATH", "/bin:/sbin:/usr/bin:/usr/sbin:/stand:" "/mnt2/stand:/mnt2/bin:/mnt2/sbin:/mnt2/usr/bin:/mnt2/usr/sbin", 1); setenv("MAKEDEVPATH", "/sbin:/bin:/stand:" "/mnt2/sbin:/mnt2/bin:/mnt2/stand", 1); if (strcmp(variable_get(VAR_FIXIT_TTY), "serial") == 0) { printf("Waiting for fixit shell to exit.\n" "When you are done, type ``exit'' to exit\n" "the fixit shell and be returned here.\n\n"); fflush(stdout); } /* use the .profile from the fixit medium */ setenv("HOME", "/mnt2", 1); chdir("/mnt2"); execlp("sh", "-sh", (char *)0); msgDebug("fixit shell: Failed to execute shell!\n"); _exit(1);; } else { if (strcmp(variable_get(VAR_FIXIT_TTY), "standard") == 0) { dialog_clear_norefresh(); msgNotify("Waiting for fixit shell to exit. Go to VTY4 now by\n" "typing ALT-F4. When you are done, type ``exit'' to exit\n" "the fixit shell and be returned here\n."); } (void)waitpid(child, &waitstatus, 0); if (strcmp(variable_get(VAR_FIXIT_TTY), "serial") == 0) systemResumeDialog(); } dialog_clear(); } int installExpress(dialogMenuItem *self) { int i; dialog_clear_norefresh(); variable_set2(SYSTEM_STATE, "express", 0); -#ifndef __alpha__ +#if defined(__i386__) || defined(__ia64__) if (DITEM_STATUS((i = diskPartitionEditor(self))) == DITEM_FAILURE) return i; #endif if (DITEM_STATUS((i = diskLabelEditor(self))) == DITEM_FAILURE) return i; if (DITEM_STATUS((i = installCommit(self))) == DITEM_SUCCESS) { i |= DITEM_LEAVE_MENU; /* Set default security level */ configSecurityModerate(NULL); /* Give user the option of one last configuration spree */ installConfigure(); } return i; } /* Standard mode installation */ int installStandard(dialogMenuItem *self) { int i, tries = 0; Device **devs; variable_set2(SYSTEM_STATE, "standard", 0); dialog_clear_norefresh(); -#ifndef __alpha__ +#if defined(__i386__) || defined(__ia64__) msgConfirm("In the next menu, you will need to set up a DOS-style (\"fdisk\") partitioning\n" "scheme for your hard disk. If you simply wish to devote all disk space\n" "to FreeBSD (overwriting anything else that might be on the disk(s) selected)\n" "then use the (A)ll command to select the default partitioning scheme followed\n" "by a (Q)uit. If you wish to allocate only free space to FreeBSD, move to a\n" "partition marked \"unused\" and use the (C)reate command."); nodisks: if (DITEM_STATUS(diskPartitionEditor(self)) == DITEM_FAILURE) return DITEM_FAILURE; if (diskGetSelectCount(&devs) <= 0 && tries < 3) { msgConfirm("You need to select some disks to operate on! Be sure to use SPACE\n" "instead of RETURN in the disk selection menu when selecting a disk."); ++tries; goto nodisks; } #endif -#ifdef __alpha__ - msgConfirm("Now you need to create BSD partitions on the disk which you are\n" - "installing to. If you have a reasonable amount of disk space (200MB or more)\n" +#if defined(__i386__) || defined(__ia64__) + msgConfirm("Now you need to create BSD partitions inside of the fdisk partition(s)\n" + "just created. If you have a reasonable amount of disk space (200MB or more)\n" "and don't have any special requirements, simply use the (A)uto command to\n" "allocate space automatically. If you have more specific needs or just don't\n" "care for the layout chosen by (A)uto, press F1 for more information on\n" "manual layout."); #else - msgConfirm("Now you need to create BSD partitions inside of the fdisk partition(s)\n" - "just created. If you have a reasonable amount of disk space (200MB or more)\n" + msgConfirm("Now you need to create BSD partitions on the disk which you are\n" + "installing to. If you have a reasonable amount of disk space (200MB or more)\n" "and don't have any special requirements, simply use the (A)uto command to\n" "allocate space automatically. If you have more specific needs or just don't\n" "care for the layout chosen by (A)uto, press F1 for more information on\n" "manual layout."); #endif if (DITEM_STATUS(diskLabelEditor(self)) == DITEM_FAILURE) return DITEM_FAILURE; if (DITEM_STATUS((i = installCommit(self))) == DITEM_FAILURE) { dialog_clear(); msgConfirm("Installation completed with some errors. You may wish to\n" "scroll through the debugging messages on VTY1 with the\n" "scroll-lock feature. You can also choose \"No\" at the next\n" "prompt and go back into the installation menus to try and retry\n" "whichever operations have failed."); return i; } else { dialog_clear(); msgConfirm("Congratulations! You now have FreeBSD installed on your system.\n\n" "We will now move on to the final configuration questions.\n" "For any option you do not wish to configure, simply select\n" "No.\n\n" "If you wish to re-enter this utility after the system is up, you\n" "may do so by typing: /usr/sbin/sysinstall."); } if (mediaDevice->type != DEVICE_TYPE_FTP && mediaDevice->type != DEVICE_TYPE_NFS) { if (!msgYesNo("Would you like to configure any Ethernet or SLIP/PPP network devices?")) { Device *tmp = tcpDeviceSelect(); if (tmp && !((DevInfo *)tmp->private)->use_dhcp && !msgYesNo("Would you like to bring the %s interface up right now?", tmp->name)) if (!DEVICE_INIT(tmp)) msgConfirm("Initialization of %s device failed.", tmp->name); } dialog_clear_norefresh(); } if (!msgNoYes("Do you want this machine to function as a network gateway?")) variable_set2("gateway_enable", "YES", 1); dialog_clear_norefresh(); if (!msgNoYes("Do you want to configure inetd and the network services that it provides?")) configInetd(self); dialog_clear_norefresh(); if (!msgNoYes("Do you want to have anonymous FTP access to this machine?")) configAnonFTP(self); dialog_clear_norefresh(); if (!msgNoYes("Do you want to configure this machine as an NFS server?")) configNFSServer(self); dialog_clear_norefresh(); if (!msgNoYes("Do you want to configure this machine as an NFS client?")) variable_set2("nfs_client_enable", "YES", 1); if (!msgNoYes("Do you want to select a default security profile for\n" "this host (select No for \"moderate\" security)?")) configSecurityProfile(self); else configSecurityModerate(self); dialog_clear_norefresh(); if (!msgNoYes("Would you like to customize your system console settings?")) dmenuOpenSimple(&MenuSyscons, FALSE); dialog_clear_norefresh(); if (!msgYesNo("Would you like to set this machine's time zone now?")) systemExecute("tzsetup"); #ifdef __i386__ dialog_clear_norefresh(); if (!msgYesNo("Would you like to enable Linux binary compatibility?")) (void)configLinux(self); #endif dialog_clear_norefresh(); if (!msgNoYes("Does this system have a non-USB mouse attached to it?")) dmenuOpenSimple(&MenuMouse, FALSE); /* Now would be a good time to checkpoint the configuration data */ configRC_conf(); sync(); if (directory_exists("/usr/X11R6")) { dialog_clear_norefresh(); if (!msgYesNo("Would you like to configure your X server at this time?")) (void)configXSetup(self); } dialog_clear_norefresh(); if (!msgYesNo("The FreeBSD package collection is a collection of thousands of ready-to-run\n" "applications, from text editors to games to WEB servers and more. Would you\n" "like to browse the collection now?")) { (void)configPackages(self); } if (!msgYesNo("Would you like to add any initial user accounts to the system?\n" "Adding at least one account for yourself at this stage is suggested\n" "since working as the \"root\" user is dangerous (it is easy to do\n" "things which adversely affect the entire system).")) (void)configUsers(self); msgConfirm("Now you must set the system manager's password.\n" "This is the password you'll use to log in as \"root\"."); if (!systemExecute("passwd root")) variable_set2("root_password", "YES", 0); /* XXX Put whatever other nice configuration questions you'd like to ask the user here XXX */ /* Give user the option of one last configuration spree */ dialog_clear_norefresh(); installConfigure(); return DITEM_LEAVE_MENU; } /* The version of commit we call from the Install Custom menu */ int installCustomCommit(dialogMenuItem *self) { int i; i = installCommit(self); if (DITEM_STATUS(i) == DITEM_SUCCESS) { /* Set default security level */ configSecurityModerate(NULL); /* Give user the option of one last configuration spree */ installConfigure(); return i; } else msgConfirm("The commit operation completed with errors. Not\n" "updating /etc files."); return i; } /* * What happens when we finally decide to going ahead with the installation. * * This is broken into multiple stages so that the user can do a full * installation but come back here again to load more distributions, * perhaps from a different media type. This would allow, for * example, the user to load the majority of the system from CDROM and * then use ftp to load just the CRYPTO dist. */ int installCommit(dialogMenuItem *self) { int i; char *str; dialog_clear_norefresh(); if (!Dists) distConfig(NULL); if (!Dists) { (void)dmenuOpenSimple(&MenuDistributions, FALSE); /* select reasonable defaults if necessary */ if (!Dists) Dists = _DIST_USER; } if (!mediaVerify()) return DITEM_FAILURE; str = variable_get(SYSTEM_STATE); if (isDebug()) msgDebug("installCommit: System state is `%s'\n", str); /* Installation stuff we wouldn't do to a running system */ if (RunningAsInit && DITEM_STATUS((i = installInitial())) == DITEM_FAILURE) return i; try_media: if (!DEVICE_INIT(mediaDevice)) { if (!msgYesNo("Unable to initialize selected media. Would you like to\n" "adjust your media configuration and try again?")) { mediaDevice = NULL; if (!mediaVerify()) return DITEM_FAILURE; else goto try_media; } else return DITEM_FAILURE; } /* Now go get it all */ i = distExtractAll(self); /* When running as init, *now* it's safe to grab the rc.foo vars */ installEnvironment(); variable_set2(SYSTEM_STATE, DITEM_STATUS(i) == DITEM_FAILURE ? "error-install" : "full-install", 0); return i; } static void installConfigure(void) { /* Final menu of last resort */ if (!msgNoYes("Visit the general configuration menu for a chance to set\n" "any last options?")) dmenuOpenSimple(&MenuConfigure, FALSE); configRC_conf(); sync(); } int installFixupBin(dialogMenuItem *self) { Device **devs; char *cp; int i; FILE *fp; int kstat = 1; /* All of this is done only as init, just to be safe */ if (RunningAsInit) { #ifdef __i386__ if ((fp = fopen("/boot/loader.conf", "a")) != NULL) { if (!kstat || !OnVTY) fprintf(fp, "# -- sysinstall generated deltas -- #\n"); if (!kstat) fprintf(fp, "userconfig_script_load=\"YES\"\n"); if (!OnVTY) fprintf(fp, "console=\"comconsole\"\n"); fclose(fp); } #endif /* BOGON #1: Resurrect /dev after bin distribution screws it up */ dialog_clear_norefresh(); msgNotify("Remaking all devices.. Please wait!"); if (!Fake) (void)unmount("/dev", MNT_FORCE); if (vsystem("cd /dev; sh MAKEDEV all")) { msgConfirm("MAKEDEV returned non-zero status"); return DITEM_FAILURE | DITEM_RESTORE; } dialog_clear_norefresh(); msgNotify("Resurrecting /dev entries for slices.."); devs = deviceFind(NULL, DEVICE_TYPE_DISK); if (!devs) msgFatal("Couldn't get a disk device list!"); /* Resurrect the slices that the former clobbered */ for (i = 0; devs[i]; i++) { Disk *disk = (Disk *)devs[i]->private; Chunk *c1; if (!devs[i]->enabled) continue; if (!disk->chunks) msgFatal("No chunk list found for %s!", disk->name); for (c1 = disk->chunks->part; c1; c1 = c1->next) { if (c1->type == freebsd) { dialog_clear_norefresh(); msgNotify("Making slice entries for %s", c1->name); if (vsystem("cd /dev; sh MAKEDEV %sh", c1->name)) { msgConfirm("Unable to make slice entries for %s!", c1->name); return DITEM_FAILURE | DITEM_RESTORE; } } } } /* BOGON #2: We leave /etc in a bad state */ chmod("/etc", 0755); /* BOGON #3: No /var/db/mountdtab complains */ Mkdir("/var/db"); creat("/var/db/mountdtab", 0644); /* BOGON #4: /compat created by default in root fs */ Mkdir("/usr/compat"); vsystem("ln -s usr/compat /compat"); /* BOGON #5: aliases database not build for bin */ vsystem("newaliases"); /* Now run all the mtree stuff to fix things up */ vsystem("mtree -deU -f /etc/mtree/BSD.root.dist -p /"); vsystem("mtree -deU -f /etc/mtree/BSD.var.dist -p /var"); vsystem("mtree -deU -f /etc/mtree/BSD.usr.dist -p /usr"); /* Do all the last ugly work-arounds here */ } return DITEM_SUCCESS | DITEM_RESTORE; } #ifdef X_AS_PKG int installX11package(dialogMenuItem *self) { WINDOW *w = savescr(); int i; dialog_clear_norefresh(); msgNotify("Installing XFree86 package..."); i = package_add("XFree86-4"); restorescr(w); return i; } #endif /* Fix side-effects from the the XFree86 installation */ int installFixupXFree(dialogMenuItem *self) { /* BOGON #1: XFree86 requires various specialized fixups */ if (directory_exists("/usr/X11R6")) { dialog_clear_norefresh(); msgNotify("Fixing permissions in XFree86 tree.."); vsystem("chmod -R a+r /usr/X11R6"); vsystem("find /usr/X11R6 -type d | xargs chmod a+x"); #ifndef X_AS_PKG /* Also do bogus minimal package registration so ports don't whine */ if (file_readable("/usr/X11R6/lib/X11/pkgreg.tar.gz")) { dialog_clear_norefresh(); msgNotify("Installing package metainfo.."); vsystem("tar xpzf /usr/X11R6/lib/X11/pkgreg.tar.gz -C / && rm /usr/X11R6/lib/X11/pkgreg.tar.gz"); } #endif } return DITEM_SUCCESS | DITEM_RESTORE; } /* Go newfs and/or mount all the filesystems we've been asked to */ int installFilesystems(dialogMenuItem *self) { int i, mountfailed; Disk *disk; Chunk *c1, *c2, *rootdev, *swapdev; Device **devs; PartInfo *root; char dname[80]; extern int MakeDevChunk(Chunk *c, char *n); Boolean upgrade = FALSE; /* If we've already done this, bail out */ if (!variable_cmp(DISK_LABELLED, "written")) return DITEM_SUCCESS; upgrade = !variable_cmp(SYSTEM_STATE, "upgrade"); if (!checkLabels(TRUE, &rootdev, &swapdev, NULL, NULL, NULL, NULL)) return DITEM_FAILURE; if (rootdev) root = (PartInfo *)rootdev->private_data; else root = NULL; command_clear(); if (swapdev && RunningAsInit) { /* As the very first thing, try to get ourselves some swap space */ sprintf(dname, "/dev/%s", swapdev->name); if (!Fake && (!MakeDevChunk(swapdev, "/dev") || !file_readable(dname))) { msgConfirm("Unable to make device node for %s in /dev!\n" "The creation of filesystems will be aborted.", dname); return DITEM_FAILURE; } if (!Fake) { if (!swapon(dname)) { dialog_clear_norefresh(); msgNotify("Added %s as initial swap device", dname); } else { msgConfirm("WARNING! Unable to swap to %s: %s\n" "This may cause the installation to fail at some point\n" "if you don't have a lot of memory.", dname, strerror(errno)); } } } if (rootdev && RunningAsInit) { /* Next, create and/or mount the root device */ sprintf(dname, "/dev/%s", rootdev->name); if (!Fake && (!MakeDevChunk(rootdev, "/dev") || !file_readable(dname))) { msgConfirm("Unable to make device node for %s in /dev!\n" "The creation of filesystems will be aborted.", dname); return DITEM_FAILURE | DITEM_RESTORE; } if (strcmp(root->mountpoint, "/")) msgConfirm("Warning: %s is marked as a root partition but is mounted on %s", rootdev->name, root->mountpoint); if (root->newfs && (!upgrade || !msgNoYes("You are upgrading - are you SURE you want to newfs the root partition?"))) { int i; dialog_clear_norefresh(); msgNotify("Making a new root filesystem on %s", dname); i = vsystem("%s %s", root->newfs_cmd, dname); if (i) { msgConfirm("Unable to make new root filesystem on %s!\n" "Command returned status %d", dname, i); return DITEM_FAILURE | DITEM_RESTORE; } } else { if (!upgrade) { msgConfirm("Warning: Using existing root partition. It will be assumed\n" "that you have the appropriate device entries already in /dev."); } dialog_clear_norefresh(); msgNotify("Checking integrity of existing %s filesystem.", dname); i = vsystem("fsck_ffs -y %s", dname); if (i) msgConfirm("Warning: fsck returned status of %d for %s.\n" "This partition may be unsafe to use.", i, dname); } if (root->soft) { i = vsystem("tunefs -n enable %s", dname); if (i) msgConfirm("Warning: Unable to enable softupdates for root filesystem on %s", dname); } /* Switch to block device */ sprintf(dname, "/dev/%s", rootdev->name); if (Mount("/mnt", dname)) { msgConfirm("Unable to mount the root file system on %s! Giving up.", dname); return DITEM_FAILURE | DITEM_RESTORE; } /* Mount devfs for other partitions to mount */ Mkdir("/mnt/dev"); if (!Fake) mountfailed = mount("devfs", "/mnt/dev", 0, NULL); if (mountfailed) { dialog_clear_norefresh(); msgNotify("Copying initial device files.."); /* Copy the boot floppy's dev files */ if ((root->newfs || upgrade) && vsystem("find -x /dev | cpio %s -pdum /mnt", cpioVerbosity())) { msgConfirm("Couldn't clone the /dev files!"); return DITEM_FAILURE | DITEM_RESTORE; } } } /* Now buzz through the rest of the partitions and mount them too */ devs = deviceFind(NULL, DEVICE_TYPE_DISK); for (i = 0; devs[i]; i++) { if (!devs[i]->enabled) continue; disk = (Disk *)devs[i]->private; if (!disk->chunks) { msgConfirm("No chunk list found for %s!", disk->name); return DITEM_FAILURE | DITEM_RESTORE; } if (mountfailed) { if (RunningAsInit && root && (root->newfs || upgrade)) { Mkdir("/mnt/dev"); if (!Fake) MakeDevDisk(disk, "/mnt/dev"); } else if (!RunningAsInit && !Fake) MakeDevDisk(disk, "/dev"); } for (c1 = disk->chunks->part; c1; c1 = c1->next) { if (c1->type == freebsd) { for (c2 = c1->part; c2; c2 = c2->next) { if (c2->type == part && c2->subtype != FS_SWAP && c2->private_data) { PartInfo *tmp = (PartInfo *)c2->private_data; /* Already did root */ if (c2 == rootdev) continue; if (tmp->newfs && (!upgrade || !msgNoYes("You are upgrading - are you SURE you want to newfs /dev/%s?", c2->name))) command_shell_add(tmp->mountpoint, "%s %s/dev/%s", tmp->newfs_cmd, RunningAsInit ? "/mnt" : "", c2->name); else command_shell_add(tmp->mountpoint, "fsck_ffs -y %s/dev/%s", RunningAsInit ? "/mnt" : "", c2->name); if (tmp->soft) command_shell_add(tmp->mountpoint, "tunefs -n enable %s/dev/%s", RunningAsInit ? "/mnt" : "", c2->name); command_func_add(tmp->mountpoint, Mount, c2->name); } else if (c2->type == part && c2->subtype == FS_SWAP) { char fname[80]; int i; if (c2 == swapdev) continue; sprintf(fname, "%s/dev/%s", RunningAsInit ? "/mnt" : "", c2->name); i = (Fake || swapon(fname)); if (!i) { dialog_clear_norefresh(); msgNotify("Added %s as an additional swap device", fname); } else { msgConfirm("Unable to add %s as a swap device: %s", fname, strerror(errno)); } } } } else if (c1->type == fat && c1->private_data && (root->newfs || upgrade)) { char name[FILENAME_MAX]; sprintf(name, "%s/%s", RunningAsInit ? "/mnt" : "", ((PartInfo *)c1->private_data)->mountpoint); Mkdir(name); } } } command_sort(); command_execute(); dialog_clear_norefresh(); return DITEM_SUCCESS | DITEM_RESTORE; } static char * getRelname(void) { static char buf[64]; size_t sz = (sizeof buf) - 1; if (sysctlbyname("kern.osrelease", buf, &sz, NULL, 0) != -1) { buf[sz] = '\0'; return buf; } else return ""; } /* Initialize various user-settable values to their defaults */ int installVarDefaults(dialogMenuItem *self) { char *cp; /* Set default startup options */ variable_set2(VAR_RELNAME, getRelname(), 0); variable_set2(VAR_CPIO_VERBOSITY, "high", 0); variable_set2(VAR_TAPE_BLOCKSIZE, DEFAULT_TAPE_BLOCKSIZE, 0); variable_set2(VAR_INSTALL_ROOT, "/", 0); variable_set2(VAR_INSTALL_CFG, "install.cfg", 0); cp = getenv("EDITOR"); if (!cp) cp = "/usr/bin/ee"; variable_set2(VAR_EDITOR, cp, 0); variable_set2(VAR_FTP_USER, "ftp", 0); variable_set2(VAR_BROWSER_PACKAGE, "links", 0); variable_set2(VAR_BROWSER_BINARY, "/usr/local/bin/links", 0); variable_set2(VAR_FTP_STATE, "passive", 0); variable_set2(VAR_NFS_SECURE, "NO", -1); if (OnVTY) variable_set2(VAR_FIXIT_TTY, "standard", 0); else variable_set2(VAR_FIXIT_TTY, "serial", 0); variable_set2(VAR_PKG_TMPDIR, "/var/tmp", 0); variable_set2(VAR_MEDIA_TIMEOUT, itoa(MEDIA_TIMEOUT), 0); if (getpid() != 1) variable_set2(SYSTEM_STATE, "update", 0); else variable_set2(SYSTEM_STATE, "init", 0); variable_set2(VAR_NEWFS_ARGS, "-b 16384 -f 2048", 0); variable_set2(VAR_CONSTERM, "NO", 0); return DITEM_SUCCESS; } /* Load the environment up from various system configuration files */ void installEnvironment(void) { configEnvironmentRC_conf(); if (file_readable("/etc/resolv.conf")) configEnvironmentResolv("/etc/resolv.conf"); } /* Copy the boot floppy contents into /stand */ Boolean copySelf(void) { int i; if (file_readable("/boot.help")) vsystem("cp /boot.help /mnt"); msgWeHaveOutput("Copying the boot floppy to /stand on root filesystem"); i = vsystem("find -x /stand | cpio %s -pdum /mnt", cpioVerbosity()); if (i) { msgConfirm("Copy returned error status of %d!", i); return FALSE; } /* Copy the /etc files into their rightful place */ if (vsystem("cd /mnt/stand; find etc | cpio %s -pdum /mnt", cpioVerbosity())) { msgConfirm("Couldn't copy up the /etc files!"); return TRUE; } return TRUE; } static void create_termcap(void) { FILE *fp; const char *caps[] = { termcap_vt100, termcap_cons25, termcap_cons25_m, termcap_cons25r, termcap_cons25r_m, termcap_cons25l1, termcap_cons25l1_m, termcap_xterm, NULL, }; const char **cp; if (!file_readable(TERMCAP_FILE)) { Mkdir("/usr/share/misc"); fp = fopen(TERMCAP_FILE, "w"); if (!fp) { msgConfirm("Unable to initialize termcap file. Some screen-oriented\nutilities may not work."); return; } cp = caps; while (*cp) fprintf(fp, "%s\n", *(cp++)); fclose(fp); } } Index: head/usr.sbin/sysinstall/label.c =================================================================== --- head/usr.sbin/sysinstall/label.c (revision 104939) +++ head/usr.sbin/sysinstall/label.c (revision 104940) @@ -1,1481 +1,1481 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * * $FreeBSD$ * * 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. * * 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 #include #define AUTO_HOME 0 /* do not create /home automatically */ /* * 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 /* The smallest filesystem we're willing to create */ #define FS_MIN_SIZE ONE_MEG /* * Minimum partition sizes */ -#ifdef __alpha__ +#if defined(__alpha__) || defined(__ia64__) || defined(__sparc64__) #define ROOT_MIN_SIZE 40 #else #define ROOT_MIN_SIZE 30 #endif #define SWAP_MIN_SIZE 32 #define USR_MIN_SIZE 80 #define VAR_MIN_SIZE 20 #define TMP_MIN_SIZE 20 #define HOME_MIN_SIZE 20 /* * Swap size limit for auto-partitioning (4G). */ #define SWAP_AUTO_LIMIT_SIZE 4096 /* * Default partition sizes. If we do not have sufficient disk space * for this configuration we scale things relative to the NOM vs DEFAULT * sizes. If the disk is larger then /home will get any remaining space. */ #define ROOT_DEFAULT_SIZE 128 #define USR_DEFAULT_SIZE 3072 #define VAR_DEFAULT_SIZE 256 #define TMP_DEFAULT_SIZE 256 #define HOME_DEFAULT_SIZE USR_DEFAULT_SIZE /* * Nominal partition sizes. These are used to scale the default sizes down * when we have insufficient disk space. If this isn't sufficient we scale * down using the MIN sizes instead. */ #define ROOT_NOMINAL_SIZE 128 #define USR_NOMINAL_SIZE 512 #define VAR_NOMINAL_SIZE 64 #define TMP_NOMINAL_SIZE 64 #define HOME_NOMINAL_SIZE USR_NOMINAL_SIZE /* The bottom-most row we're allowed to scribble on */ #define CHUNK_ROW_MAX 16 /* All the chunks currently displayed on the screen */ static struct { struct chunk *c; PartType type; } label_chunk_info[MAX_CHUNKS + 1]; static int here; /*** with this value we try to track the most recently added label ***/ static int label_focus = 0, pslice_focus = 0; static int diskLabel(Device *dev); static int diskLabelNonInteractive(Device *dev); static char *try_auto_label(Device **devs, Device *dev, int perc, int *req); static int labelHook(dialogMenuItem *selected) { Device **devs = NULL; devs = deviceFind(selected->prompt, DEVICE_TYPE_DISK); if (!devs) { msgConfirm("Unable to find disk %s!", selected->prompt); return DITEM_FAILURE; } /* Toggle enabled status? */ if (!devs[0]->enabled) { devs[0]->enabled = TRUE; diskLabel(devs[0]); } else devs[0]->enabled = FALSE; return DITEM_SUCCESS; } static int labelCheck(dialogMenuItem *selected) { Device **devs = NULL; devs = deviceFind(selected->prompt, DEVICE_TYPE_DISK); if (!devs || devs[0]->enabled == FALSE) return FALSE; return TRUE; } int diskLabelEditor(dialogMenuItem *self) { DMenu *menu; Device **devs; int i, cnt; i = 0; cnt = diskGetSelectCount(&devs); if (cnt == -1) { msgConfirm("No disks found! Please verify that your disk controller is being\n" "properly probed at boot time. See the Hardware Guide on the\n" "Documentation menu for clues on diagnosing this type of problem."); return DITEM_FAILURE; } else if (cnt) { /* Some are already selected */ if (variable_get(VAR_NONINTERACTIVE) && !variable_get(VAR_DISKINTERACTIVE)) i = diskLabelNonInteractive(NULL); else i = diskLabel(NULL); } else { /* No disks are selected, fall-back case now */ cnt = deviceCount(devs); if (cnt == 1) { devs[0]->enabled = TRUE; if (variable_get(VAR_NONINTERACTIVE) && !variable_get(VAR_DISKINTERACTIVE)) i = diskLabelNonInteractive(devs[0]); else i = diskLabel(devs[0]); } else { menu = deviceCreateMenu(&MenuDiskDevices, DEVICE_TYPE_DISK, labelHook, labelCheck); if (!menu) { msgConfirm("No devices suitable for installation found!\n\n" "Please verify that your disk controller (and attached drives)\n" "were detected properly. This can be done by pressing the\n" "[Scroll Lock] key and using the Arrow keys to move back to\n" "the boot messages. Press [Scroll Lock] again to return."); i = DITEM_FAILURE; } else { i = dmenuOpenSimple(menu, FALSE) ? DITEM_SUCCESS : DITEM_FAILURE; free(menu); } } } if (DITEM_STATUS(i) != DITEM_FAILURE) { if (variable_cmp(DISK_LABELLED, "written")) variable_set2(DISK_LABELLED, "yes", 0); } return i; } int diskLabelCommit(dialogMenuItem *self) { char *cp; int i; /* Already done? */ if ((cp = variable_get(DISK_LABELLED)) && strcmp(cp, "yes")) i = DITEM_SUCCESS; else if (!cp) { msgConfirm("You must assign disk labels before this option can be used."); i = DITEM_FAILURE; } /* The routine will guard against redundant writes, just as this one does */ else if (DITEM_STATUS(diskPartitionWrite(self)) != DITEM_SUCCESS) i = DITEM_FAILURE; else if (DITEM_STATUS(installFilesystems(self)) != DITEM_SUCCESS) i = DITEM_FAILURE; else { msgInfo("All filesystem information written successfully."); variable_set2(DISK_LABELLED, "written", 0); i = DITEM_SUCCESS; } return i; } /* 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].type == PART_FAT) && label_chunk_info[i].c->private_data && !strcmp(((PartInfo *)label_chunk_info[i].c->private_data)->mountpoint, name)) return TRUE; return FALSE; } /* How much space is in this FreeBSD slice? */ static int space_free(struct chunk *c) { struct chunk *c1; int sz = c->size; for (c1 = c->part; c1; c1 = c1->next) { if (c1->type != unused) sz -= c1->size; } 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(Device **devs, Device *dev) { int i, j, p; struct chunk *c1, *c2; Disk *d; j = p = 0; /* First buzz through and pick up the FreeBSD slices */ for (i = 0; devs[i]; i++) { if ((dev && devs[i] != dev) || !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; if (!mpoint) mpoint = "/change_me"; ret = (PartInfo *)safe_malloc(sizeof(PartInfo)); sstrncpy(ret->mountpoint, mpoint, FILENAME_MAX); strcpy(ret->newfs_cmd, "newfs "); strcat(ret->newfs_cmd, variable_get(VAR_NEWFS_ARGS)); ret->newfs = newfs; ret->soft = strcmp(mpoint, "/") ? 1 : 0; if (!size) return ret; return ret; } /* Get the mountpoint for a partition and save it away */ static PartInfo * get_mountpoint(struct chunk *old) { char *val; PartInfo *tmp; if (old && old->private_data) tmp = old->private_data; 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_data); old->private_data = 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); val = string_skipwhite(string_prune(val)); tmp = new_part(val, TRUE, 0); if (old) { old->private_data = 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.", }; WINDOW *w = savescr(); i = dialog_menu("Please choose a partition type", "If you want to use this partition for swap space, select Swap.\n" "If you want to put a filesystem on it, choose FS.", -1, -1, 2, 2, fs_types, selection, NULL, NULL); restorescr(w); 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\n" "creating this file system."); if (val) sstrncpy(p->newfs_cmd, val, NEWFS_CMD_MAX); } #define MAX_MOUNT_NAME 9 #define PART_PART_COL 0 #define PART_MOUNT_COL 10 #define PART_SIZE_COL (PART_MOUNT_COL + MAX_MOUNT_NAME + 3) #define PART_NEWFS_COL (PART_SIZE_COL + 8) #define PART_OFF 38 #define TOTAL_AVAIL_LINES (10) #define PSLICE_SHOWABLE (4) /* stick this all up on the screen */ static void print_label_chunks(void) { int i, j, srow, prow, pcol; int sz; char clrmsg[80]; int ChunkPartStartRow; WINDOW *ChunkWin; /********************************************************/ /*** These values are for controling screen resources ***/ /*** Each label line holds up to 2 labels, so beware! ***/ /*** strategy will be to try to always make sure the ***/ /*** highlighted label is in the active display area. ***/ /********************************************************/ int pslice_max, label_max; int pslice_count, label_count, label_focus_found, pslice_focus_found; attrset(A_REVERSE); mvaddstr(0, 25, "FreeBSD Disklabel Editor"); attrset(A_NORMAL); /*** Count the number of parition slices ***/ pslice_count = 0; for (i = 0; label_chunk_info[i].c ; i++) { if (label_chunk_info[i].type == PART_SLICE) ++pslice_count; } pslice_max = pslice_count; /*** 4 line max for partition slices ***/ if (pslice_max > PSLICE_SHOWABLE) { pslice_max = PSLICE_SHOWABLE; } ChunkPartStartRow = CHUNK_SLICE_START_ROW + 3 + pslice_max; /*** View partition slices modulo pslice_max ***/ label_max = TOTAL_AVAIL_LINES - pslice_max; for (i = 0; i < 2; i++) { mvaddstr(ChunkPartStartRow - 2, PART_PART_COL + (i * PART_OFF), "Part"); mvaddstr(ChunkPartStartRow - 1, PART_PART_COL + (i * PART_OFF), "----"); mvaddstr(ChunkPartStartRow - 2, PART_MOUNT_COL + (i * PART_OFF), "Mount"); mvaddstr(ChunkPartStartRow - 1, PART_MOUNT_COL + (i * PART_OFF), "-----"); mvaddstr(ChunkPartStartRow - 2, PART_SIZE_COL + (i * PART_OFF) + 3, "Size"); mvaddstr(ChunkPartStartRow - 1, PART_SIZE_COL + (i * PART_OFF) + 3, "----"); mvaddstr(ChunkPartStartRow - 2, PART_NEWFS_COL + (i * PART_OFF), "Newfs"); mvaddstr(ChunkPartStartRow - 1, PART_NEWFS_COL + (i * PART_OFF), "-----"); } srow = CHUNK_SLICE_START_ROW; prow = 0; pcol = 0; /*** these variables indicate that the focused item is shown currently ***/ label_focus_found = 0; pslice_focus_found = 0; label_count = 0; pslice_count = 0; mvprintw(CHUNK_SLICE_START_ROW - 1, 0, " "); mvprintw(CHUNK_SLICE_START_ROW + pslice_max, 0, " "); ChunkWin = newwin(CHUNK_ROW_MAX - ChunkPartStartRow, 76, ChunkPartStartRow, 0); wclear(ChunkWin); /*** wrefresh(ChunkWin); ***/ for (i = 0; label_chunk_info[i].c; i++) { /* Is it a slice entry displayed at the top? */ if (label_chunk_info[i].type == PART_SLICE) { /*** This causes the new pslice to replace the previous display ***/ /*** focus must remain on the most recently active pslice ***/ if (pslice_count == pslice_max) { if (pslice_focus_found) { /*** This is where we can mark the more following ***/ attrset(A_BOLD); mvprintw(CHUNK_SLICE_START_ROW + pslice_max, 0, "***MORE***"); attrset(A_NORMAL); continue; } else { /*** this is where we set the more previous ***/ attrset(A_BOLD); mvprintw(CHUNK_SLICE_START_ROW - 1, 0, "***MORE***"); attrset(A_NORMAL); pslice_count = 0; srow = CHUNK_SLICE_START_ROW; } } sz = space_free(label_chunk_info[i].c); if (i == here) attrset(ATTR_SELECTED); if (i == pslice_focus) pslice_focus_found = -1; 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)); attrset(A_NORMAL); clrtoeol(); move(0, 0); /*** refresh(); ***/ ++pslice_count; } /* Otherwise it's a DOS, swap or filesystem entry in the Chunk window */ else { char onestr[PART_OFF], num[10], *mountpoint, newfs[10]; /* * 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'; /*** Track how many labels have been displayed ***/ if (label_count == ((label_max - 1 ) * 2)) { if (label_focus_found) { continue; } else { label_count = 0; prow = 0; pcol = 0; } } /* Go for two columns if we've written one full columns worth */ /*** if (prow == (CHUNK_ROW_MAX - ChunkPartStartRow)) ***/ if (label_count == label_max - 1) { pcol = PART_OFF; prow = 0; } 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_data && (label_chunk_info[i].type == PART_FILESYSTEM || label_chunk_info[i].type == PART_FAT)) mountpoint = ((PartInfo *)label_chunk_info[i].c->private_data)->mountpoint; else if (label_chunk_info[i].type == PART_SWAP) mountpoint = "swap"; else mountpoint = ""; /* Now display the newfs field */ if (label_chunk_info[i].type == PART_FAT) strcpy(newfs, "DOS"); else if (label_chunk_info[i].c->private_data && label_chunk_info[i].type == PART_FILESYSTEM) { strcpy(newfs, "UFS"); strcat(newfs, ((PartInfo *)label_chunk_info[i].c->private_data)->soft ? "+S" : " "); strcat(newfs, ((PartInfo *)label_chunk_info[i].c->private_data)->newfs ? " Y" : " N"); } else if (label_chunk_info[i].type == PART_SWAP) strcpy(newfs, "SWAP"); else strcpy(newfs, "*"); for (j = 0; j < MAX_MOUNT_NAME && mountpoint[j]; j++) onestr[PART_MOUNT_COL + j] = mountpoint[j]; snprintf(num, 10, "%5ldMB", 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'; if (i == label_focus) { label_focus_found = -1; wattrset(ChunkWin, A_BOLD); } if (i == here) wattrset(ChunkWin, ATTR_SELECTED); /*** lazy man's way of expensively padding this string ***/ while (strlen(onestr) < 37) strcat(onestr, " "); mvwaddstr(ChunkWin, prow, pcol, onestr); wattrset(ChunkWin, A_NORMAL); move(0, 0); ++prow; ++label_count; } } /*** this will erase all the extra stuff ***/ memset(clrmsg, ' ', 37); clrmsg[37] = '\0'; while (pslice_count < pslice_max) { mvprintw(srow++, 0, clrmsg); clrtoeol(); ++pslice_count; } while (label_count < (2 * (label_max - 1))) { mvwaddstr(ChunkWin, prow++, pcol, clrmsg); ++label_count; if (prow == (label_max - 1)) { prow = 0; pcol = PART_OFF; } } refresh(); wrefresh(ChunkWin); } static void print_command_summary(void) { mvprintw(17, 0, "The following commands are valid here (upper or lower case):"); mvprintw(18, 0, "C = Create D = Delete M = Mount pt."); if (!RunningAsInit) mvprintw(18, 47, "W = Write"); mvprintw(19, 0, "N = Newfs Opts Q = Finish S = Toggle SoftUpdates"); mvprintw(20, 0, "T = Toggle Newfs U = Undo A = Auto Defaults R = Delete+Merge"); mvprintw(22, 0, "Use F1 or ? to get more help, arrow keys to select."); move(0, 0); } static void clear_wins(void) { extern void print_label_chunks(); clear(); print_label_chunks(); } -#ifdef __alpha__ +#if defined(__alpha__) || defined(__sparc64__) /* * If there isn't a freebsd chunk already (i.e. there is no label), * dedicate the disk. */ static void maybe_dedicate(Disk* d) { struct chunk *c; for (c = d->chunks->part; c; c = c->next) { if (c->type == freebsd) break; } if (!c) { msgDebug("dedicating disk"); All_FreeBSD(d, 1); } } #endif static int diskLabel(Device *dev) { int sz, key = 0; Boolean labeling; char *msg = NULL; PartInfo *p, *oldp; PartType type; Device **devs; -#ifdef __alpha__ +#if defined(__alpha__) || defined(__sparc64__) int i; #endif WINDOW *w = savescr(); label_focus = 0; pslice_focus = 0; here = 0; devs = deviceFind(NULL, DEVICE_TYPE_DISK); if (!devs) { msgConfirm("No disks found!"); restorescr(w); return DITEM_FAILURE; } labeling = TRUE; keypad(stdscr, TRUE); -#ifdef __alpha__ +#if defined(__alpha__) || defined(__sparc64__) for (i = 0; devs[i]; i++) { maybe_dedicate((Disk*) devs[i]->private); } #endif record_label_chunks(devs, dev); clear(); while (labeling) { char *cp; int rflags = DELCHUNK_NORMAL; print_label_chunks(); print_command_summary(); if (msg) { attrset(title_attr); mvprintw(23, 0, msg); attrset(A_NORMAL); clrtoeol(); beep(); msg = NULL; } else { move(23, 0); clrtoeol(); } refresh(); key = getch(); switch (toupper(key)) { int i; static char _msg[40]; case '\014': /* ^L */ clear_wins(); break; case '\020': /* ^P */ case KEY_UP: case '-': if (here != 0) --here; else while (label_chunk_info[here + 1].c) ++here; break; case '\016': /* ^N */ 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 '?': systemDisplayHelp("partition"); clear_wins(); break; case 'A': if (label_chunk_info[here].type != PART_SLICE) { msg = "You can only do this in a disk slice (at top of screen)"; break; } /* * Generate standard partitions automatically. If we do not * have sufficient space we attempt to scale-down the size * of the partitions within certain bounds. */ { int perc; int req = 0; for (perc = 100; perc > 0; perc -= 5) { req = 0; /* reset for each loop */ if ((msg = try_auto_label(devs, dev, perc, &req)) == NULL) break; } if (msg) { if (req) { msgConfirm(msg); clear_wins(); msg = NULL; } } } 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; } sz = space_free(label_chunk_info[here].c); if (sz <= FS_MIN_SIZE) { msg = "Not enough space to create an additional FreeBSD partition"; break; } else { char *val; int size; struct chunk *tmp; char osize[80]; u_long flags = 0; sprintf(osize, "%d", sz); val = msgGetInput(osize, "Please specify the partition size in blocks or append a trailing G for\n" "gigabytes, M for megabytes, or C for cylinders.\n" "%d blocks (%dMB) are free.", sz, sz / ONE_MEG); if (!val || (size = strtol(val, &cp, 0)) <= 0) { clear_wins(); break; } if (*cp) { if (toupper(*cp) == 'M') size *= ONE_MEG; else if (toupper(*cp) == 'G') size *= ONE_GIG; 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); clear_wins(); break; } type = get_partition_type(); if (type == PART_NONE) { clear_wins(); beep(); break; } if (type == PART_FILESYSTEM) { if ((p = get_mountpoint(NULL)) == NULL) { clear_wins(); beep(); break; } else if (!strcmp(p->mountpoint, "/")) flags |= CHUNK_IS_ROOT; else flags &= ~CHUNK_IS_ROOT; } else p = NULL; if ((flags & CHUNK_IS_ROOT) && (size < (ROOT_MIN_SIZE * ONE_MEG))) { msgConfirm("Warning: This is smaller than the recommended size for a\n" "root partition. For a variety of reasons, root\n" "partitions should usually be at least %dMB in size", ROOT_MIN_SIZE); } 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?"); clear_wins(); break; } #ifdef __alpha__ /* * SRM requires that the root partition is at the * begining of the disk and cannot boot otherwise. * Warn Alpha users if they are about to shoot themselves in * the foot in this way. * * Since partitions may not start precisely at offset 0 we * check for a "close to 0" instead. :-( */ if ((flags & CHUNK_IS_ROOT) && (tmp->offset > 1024)) { msgConfirm("Your root partition `a' does not seem to be the first\n" "partition. The Alpha's firmware can only boot from the\n" "first partition. So it is unlikely that your current\n" "disk layout will be bootable boot after installation.\n" "\n" "Please allocate the root partition before allocating\n" "any others.\n"); } #endif /* alpha */ if (type != PART_SWAP) { /* This is needed to tell the newfs -u about the size */ tmp->private_data = new_part(p->mountpoint, p->newfs, tmp->size); safe_free(p); } else tmp->private_data = p; tmp->private_free = safe_free; if (variable_cmp(DISK_LABELLED, "written")) variable_set2(DISK_LABELLED, "yes", 0); record_label_chunks(devs, dev); clear_wins(); /* This is where we assign focus to new label so it shows. */ { int i; label_focus = -1; for (i = 0; label_chunk_info[i].c; ++i) { if (label_chunk_info[i].c == tmp) { label_focus = i; break; } } if (label_focus == -1) label_focus = i - 1; } } break; case KEY_DC: case 'R': /* recover space (delete w/ recover) */ /* * Delete the partition w/ space recovery. */ rflags = DELCHUNK_RECOVER; /* fall through */ 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_Chunk2(label_chunk_info[here].c->disk, label_chunk_info[here].c, rflags); if (variable_cmp(DISK_LABELLED, "written")) variable_set2(DISK_LABELLED, "yes", 0); record_label_chunks(devs, dev); 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_data; 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"); } } if (variable_cmp(DISK_LABELLED, "written")) variable_set2(DISK_LABELLED, "yes", 0); record_label_chunks(devs, dev); clear_wins(); break; default: msgFatal("Bogus partition under cursor???"); break; } break; case 'N': /* Set newfs options */ if (label_chunk_info[here].c->private_data && ((PartInfo *)label_chunk_info[here].c->private_data)->newfs) getNewfsCmd(label_chunk_info[here].c->private_data); else msg = MSG_NOT_APPLICABLE; clear_wins(); break; case 'S': /* Toggle soft updates flag */ if (label_chunk_info[here].type == PART_FILESYSTEM) { PartInfo *pi = ((PartInfo *)label_chunk_info[here].c->private_data); if (pi) pi->soft = !pi->soft; else msg = MSG_NOT_APPLICABLE; } else msg = MSG_NOT_APPLICABLE; break; case 'T': /* Toggle newfs state */ if ((label_chunk_info[here].type == PART_FILESYSTEM) && (label_chunk_info[here].c->private_data)) { PartInfo *pi = ((PartInfo *)label_chunk_info[here].c->private_data); if (!pi->newfs) label_chunk_info[here].c->flags |= CHUNK_NEWFS; else label_chunk_info[here].c->flags &= ~CHUNK_NEWFS; label_chunk_info[here].c->private_data = new_part(pi ? pi->mountpoint : NULL, pi ? !pi->newfs : TRUE, label_chunk_info[here].c->size); if (pi && pi->soft) ((PartInfo *)label_chunk_info[here].c->private_data)->soft = 1; safe_free(pi); label_chunk_info[here].c->private_free = safe_free; if (variable_cmp(DISK_LABELLED, "written")) variable_set2(DISK_LABELLED, "yes", 0); } else msg = MSG_NOT_APPLICABLE; break; case 'U': clear(); if (!variable_cmp(DISK_LABELLED, "written")) { msgConfirm("You've already written out your changes -\n" "it's too late to undo!"); } else if (!msgNoYes("Are you SURE you want to Undo everything?")) { variable_unset(DISK_PARTITIONED); variable_unset(DISK_LABELLED); for (i = 0; devs[i]; i++) { Disk *d; if (!devs[i]->enabled) continue; else if ((d = Open_Disk(devs[i]->name)) != NULL) { Free_Disk(devs[i]->private); devs[i]->private = d; diskPartition(devs[i]); } } record_label_chunks(devs, dev); } clear_wins(); break; case 'W': if (!variable_cmp(DISK_LABELLED, "written")) { msgConfirm("You've already written out your changes - if you\n" "wish to overwrite them, you'll have to restart\n" "sysinstall first."); } else if (!msgNoYes("WARNING: This should only be used when modifying an EXISTING\n" "installation. If you are installing FreeBSD for the first time\n" "then you should simply type Q when you're finished here and your\n" "changes will be committed in one batch automatically at the end of\n" "these questions.\n\n" "Are you absolutely sure you want to do this now?")) { variable_set2(DISK_LABELLED, "yes", 0); diskLabelCommit(NULL); } clear_wins(); break; case '|': if (!msgNoYes("Are you sure you want to go into Wizard mode?\n\n" "This is an entirely undocumented feature which you are not\n" "expected 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 devices!"); break; } for (i = 0; devs[i] && ((Disk *)devs[i]->private); i++) { if (devs[i]->enabled) slice_wizard(((Disk *)devs[i]->private)); } if (variable_cmp(DISK_LABELLED, "written")) variable_set2(DISK_LABELLED, "yes", 0); DialogActive = TRUE; record_label_chunks(devs, dev); clear_wins(); } else msg = "A most prudent choice!"; break; case '\033': /* ESC */ case 'Q': labeling = FALSE; break; default: beep(); sprintf(_msg, "Invalid key %d - Type F1 or ? for help", key); msg = _msg; break; } if (label_chunk_info[here].type == PART_SLICE) pslice_focus = here; else label_focus = here; } restorescr(w); return DITEM_SUCCESS; } static __inline int requested_part_size(char *varName, int nom, int def, int perc) { char *cp; int sz; if ((cp = variable_get(varName)) != NULL) sz = atoi(cp); else sz = nom + (def - nom) * perc / 100; return(sz * ONE_MEG); } /* * Attempt to auto-label the disk. 'perc' (0-100) scales * the size of the various partitions within appropriate * bounds (NOMINAL through DEFAULT sizes). The procedure * succeeds of NULL is returned. A non-null return message * is either a failure-status message (*req == 0), or * a confirmation requestor (*req == 1). *req is 0 on * entry to this call. * * We autolabel the following partitions: /, swap, /var, /tmp, /usr, * and /home. /home receives any extra left over disk space. */ static char * try_auto_label(Device **devs, Device *dev, int perc, int *req) { int sz; struct chunk *root_chunk = NULL; struct chunk *swap_chunk = NULL; struct chunk *usr_chunk = NULL; struct chunk *var_chunk = NULL; struct chunk *tmp_chunk = NULL; struct chunk *home_chunk = NULL; int mib[2]; unsigned int physmem; size_t size; Chunk *rootdev, *swapdev, *usrdev, *vardev; Chunk *tmpdev, *homedev; char *msg = NULL; sz = space_free(label_chunk_info[here].c); if (sz <= FS_MIN_SIZE) return("Not enough free space to create a new partition in the slice"); (void)checkLabels(FALSE, &rootdev, &swapdev, &usrdev, &vardev, &tmpdev, &homedev); if (!rootdev) { sz = requested_part_size(VAR_ROOT_SIZE, ROOT_NOMINAL_SIZE, ROOT_DEFAULT_SIZE, perc); root_chunk = Create_Chunk_DWIM(label_chunk_info[here].c->disk, label_chunk_info[here].c, sz, part, FS_BSDFFS, CHUNK_IS_ROOT | CHUNK_AUTO_SIZE); if (!root_chunk) { *req = 1; msg = "Unable to create the root partition. Too big?"; goto done; } root_chunk->private_data = new_part("/", TRUE, root_chunk->size); root_chunk->private_free = safe_free; root_chunk->flags |= CHUNK_NEWFS; record_label_chunks(devs, dev); } if (!swapdev) { sz = requested_part_size(VAR_SWAP_SIZE, 0, 0, perc); if (sz == 0) { int nom; int def; mib[0] = CTL_HW; mib[1] = HW_PHYSMEM; size = sizeof physmem; sysctl(mib, 2, &physmem, &size, (void *)0, (size_t)0); def = 2 * (int)(physmem / 512); if (def < SWAP_MIN_SIZE * ONE_MEG) def = SWAP_MIN_SIZE * ONE_MEG; if (def > SWAP_AUTO_LIMIT_SIZE * ONE_MEG) def = SWAP_AUTO_LIMIT_SIZE * ONE_MEG; nom = (int)(physmem / 512) / 2; sz = nom + (def - nom) * perc / 100; } swap_chunk = Create_Chunk_DWIM(label_chunk_info[here].c->disk, label_chunk_info[here].c, sz, part, FS_SWAP, CHUNK_AUTO_SIZE); if (!swap_chunk) { *req = 1; msg = "Unable to create the swap partition. Too big?"; goto done; } swap_chunk->private_data = 0; swap_chunk->private_free = safe_free; record_label_chunks(devs, dev); } if (!vardev) { sz = requested_part_size(VAR_VAR_SIZE, VAR_NOMINAL_SIZE, VAR_DEFAULT_SIZE, perc); var_chunk = Create_Chunk_DWIM(label_chunk_info[here].c->disk, label_chunk_info[here].c, sz, part, FS_BSDFFS, CHUNK_AUTO_SIZE); if (!var_chunk) { *req = 1; msg = "Not enough free space for /var - you will need to\n" "partition your disk manually with a custom install!"; goto done; } var_chunk->private_data = new_part("/var", TRUE, var_chunk->size); var_chunk->private_free = safe_free; var_chunk->flags |= CHUNK_NEWFS; record_label_chunks(devs, dev); } if (!tmpdev && !variable_get(VAR_NO_TMP)) { sz = requested_part_size(VAR_TMP_SIZE, TMP_NOMINAL_SIZE, TMP_DEFAULT_SIZE, perc); tmp_chunk = Create_Chunk_DWIM(label_chunk_info[here].c->disk, label_chunk_info[here].c, sz, part, FS_BSDFFS, CHUNK_AUTO_SIZE); if (!tmp_chunk) { *req = 1; msg = "Not enough free space for /tmp - you will need to\n" "partition your disk manually with a custom install!"; goto done; } tmp_chunk->private_data = new_part("/tmp", TRUE, tmp_chunk->size); tmp_chunk->private_free = safe_free; tmp_chunk->flags |= CHUNK_NEWFS; record_label_chunks(devs, dev); } if (!usrdev && !variable_get(VAR_NO_USR)) { sz = requested_part_size(VAR_USR_SIZE, USR_NOMINAL_SIZE, USR_DEFAULT_SIZE, perc); #if AUTO_HOME == 0 sz = space_free(label_chunk_info[here].c); #endif if (sz) { if (sz < (USR_MIN_SIZE * ONE_MEG)) { *req = 1; msg = "Not enough free space for /usr - you will need to\n" "partition your disk manually with a custom install!"; } usr_chunk = Create_Chunk_DWIM(label_chunk_info[here].c->disk, label_chunk_info[here].c, sz, part, FS_BSDFFS, CHUNK_AUTO_SIZE); if (!usr_chunk) { msg = "Unable to create the /usr partition. Not enough space?\n" "You will need to partition your disk manually with a custom install!"; goto done; } usr_chunk->private_data = new_part("/usr", TRUE, usr_chunk->size); usr_chunk->private_free = safe_free; usr_chunk->flags |= CHUNK_NEWFS; record_label_chunks(devs, dev); } } #if AUTO_HOME == 1 if (!homedev && !variable_get(VAR_NO_HOME)) { sz = requested_part_size(VAR_HOME_SIZE, HOME_NOMINAL_SIZE, HOME_DEFAULT_SIZE, perc); if (sz < space_free(label_chunk_info[here].c)) sz = space_free(label_chunk_info[here].c); if (sz) { if (sz < (HOME_MIN_SIZE * ONE_MEG)) { *req = 1; msg = "Not enough free space for /home - you will need to\n" "partition your disk manually with a custom install!"; goto done; } home_chunk = Create_Chunk_DWIM(label_chunk_info[here].c->disk, label_chunk_info[here].c, sz, part, FS_BSDFFS, CHUNK_AUTO_SIZE); if (!home_chunk) { msg = "Unable to create the /home partition. Not enough space?\n" "You will need to partition your disk manually with a custom install!"; goto done; } home_chunk->private_data = new_part("/home", TRUE, home_chunk->size); home_chunk->private_free = safe_free; home_chunk->flags |= CHUNK_NEWFS; record_label_chunks(devs, dev); } } #endif /* At this point, we're reasonably "labelled" */ if (variable_cmp(DISK_LABELLED, "written")) variable_set2(DISK_LABELLED, "yes", 0); done: if (msg) { if (root_chunk) Delete_Chunk(root_chunk->disk, root_chunk); if (swap_chunk) Delete_Chunk(swap_chunk->disk, swap_chunk); if (var_chunk) Delete_Chunk(var_chunk->disk, var_chunk); if (tmp_chunk) Delete_Chunk(tmp_chunk->disk, tmp_chunk); if (usr_chunk) Delete_Chunk(usr_chunk->disk, usr_chunk); if (home_chunk) Delete_Chunk(home_chunk->disk, home_chunk); record_label_chunks(devs, dev); } return(msg); } static int diskLabelNonInteractive(Device *dev) { char *cp; PartType type; PartInfo *p; u_long flags = 0; int i, status; Device **devs; Disk *d; status = DITEM_SUCCESS; cp = variable_get(VAR_DISK); if (!cp) { msgConfirm("diskLabel: No disk selected - can't label automatically."); return DITEM_FAILURE; } devs = deviceFind(cp, DEVICE_TYPE_DISK); if (!devs) { msgConfirm("diskLabel: No disk device %s found!", cp); return DITEM_FAILURE; } if (dev) d = dev->private; else d = devs[0]->private; -#ifdef __alpha__ +#if defined(__alpha__) || defined(__sparc64__) maybe_dedicate(d); #endif record_label_chunks(devs, dev); for (i = 0; label_chunk_info[i].c; i++) { Chunk *c1 = label_chunk_info[i].c; if (label_chunk_info[i].type == PART_SLICE) { char name[512]; int entries = 1; while (entries) { snprintf(name, sizeof name, "%s-%d", c1->name, entries); if ((cp = variable_get(name)) != NULL) { int sz, soft = 0; char typ[10], mpoint[50]; if (sscanf(cp, "%s %d %s %d", typ, &sz, mpoint, &soft) < 3) { msgConfirm("For slice entry %s, got an invalid detail entry of: %s", c1->name, cp); status = DITEM_FAILURE; continue; } else { Chunk *tmp; if (!strcmp(typ, "swap")) { type = PART_SWAP; strcpy(mpoint, "SWAP"); } else { type = PART_FILESYSTEM; if (!strcmp(mpoint, "/")) flags |= CHUNK_IS_ROOT; else flags &= ~CHUNK_IS_ROOT; } if (!sz) sz = space_free(c1); if (sz > space_free(c1)) { msgConfirm("Not enough free space to create partition: %s", mpoint); status = DITEM_FAILURE; continue; } if (!(tmp = Create_Chunk_DWIM(d, c1, sz, part, (type == PART_SWAP) ? FS_SWAP : FS_BSDFFS, flags))) { msgConfirm("Unable to create from partition spec: %s. Too big?", cp); status = DITEM_FAILURE; break; } else { tmp->private_data = new_part(mpoint, TRUE, sz); tmp->private_free = safe_free; ((PartInfo *)tmp->private_data)->soft = soft; status = DITEM_SUCCESS; } } entries++; } else { /* No more matches, leave the loop */ entries = 0; } } } else { /* Must be something we can set a mountpoint for */ cp = variable_get(c1->name); if (cp) { char mpoint[50], do_newfs[8]; Boolean newfs = FALSE; do_newfs[0] = '\0'; if (sscanf(cp, "%s %s", mpoint, do_newfs) != 2) { msgConfirm("For slice entry %s, got an invalid detail entry of: %s", c1->name, cp); status = DITEM_FAILURE; continue; } newfs = toupper(do_newfs[0]) == 'Y' ? TRUE : FALSE; if (c1->private_data) { p = c1->private_data; p->newfs = newfs; strcpy(p->mountpoint, mpoint); } else { c1->private_data = new_part(mpoint, newfs, 0); c1->private_free = safe_free; } if (!strcmp(mpoint, "/")) c1->flags |= CHUNK_IS_ROOT; else c1->flags &= ~CHUNK_IS_ROOT; } } } if (status == DITEM_SUCCESS) variable_set2(DISK_LABELLED, "yes", 0); return status; } Index: head/usr.sbin/sysinstall/main.c =================================================================== --- head/usr.sbin/sysinstall/main.c (revision 104939) +++ head/usr.sbin/sysinstall/main.c (revision 104940) @@ -1,179 +1,179 @@ /* * The new sysinstall program. * * This is probably the last attempt in the `sysinstall' line, the next * generation being slated for what's essentially a complete rewrite. * * $FreeBSD$ * * 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. * * 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 const char *StartName; /* Initial contents of argv[0] */ static void screech(int sig) { msgDebug("\007Signal %d caught! That's bad!\n", sig); longjmp(BailOut, sig); } int main(int argc, char **argv) { int choice, scroll, curr, max, status; /* Record name to be able to restart */ StartName = argv[0]; /* Catch fatal signals and complain about them if running as init */ if (getpid() == 1) { signal(SIGBUS, screech); signal(SIGSEGV, screech); } signal(SIGPIPE, SIG_IGN); /* We don't work too well when running as non-root anymore */ if (geteuid() != 0) { fprintf(stderr, "Error: This utility should only be run as root.\n"); return 1; } #ifdef PC98 { /* XXX */ char *p = getenv("TERM"); if (p && strcmp(p, "cons25") == 0) putenv("TERM=cons25w"); } #endif /* Set up whatever things need setting up */ systemInitialize(argc, argv); /* Set default flag and variable values */ installVarDefaults(NULL); /* only when multi-user is it reasonable to do this here */ if (!RunningAsInit) installEnvironment(); if (argc > 1 && !strcmp(argv[1], "-fake")) { variable_set2(VAR_DEBUG, "YES", 0); Fake = TRUE; msgConfirm("I'll be just faking it from here on out, OK?"); } if (argc > 1 && !strcmp(argv[1], "-restart")) Restarting = TRUE; /* Try to preserve our scroll-back buffer */ if (OnVTY) { for (curr = 0; curr < 25; curr++) putchar('\n'); } /* Move stderr aside */ if (DebugFD) dup2(DebugFD, 2); /* Initialize driver modules, if we haven't already done so (ie, the user hit Ctrl-C -> Restart. */ if (!pvariable_get("modulesInitialize")) { moduleInitialize(); pvariable_set("modulesInitialize=1"); } /* Initialize PC-card, if we haven't already done so. */ #ifdef PCCARD_ARCH if (!pvariable_get("pccardInitialize")) { pccardInitialize(); pvariable_set("pccardInitialize=1"); } #endif /* Initialize USB, if we haven't already done so. */ if (!pvariable_get("usbInitialize")) { usbInitialize(); pvariable_set("usbInitialize=1"); } /* Probe for all relevant devices on the system */ deviceGetAll(); /* First, see if we have any arguments to process (and argv[0] counts if it's not "sysinstall") */ if (!RunningAsInit) { int i, start_arg; if (!strstr(argv[0], "sysinstall")) start_arg = 0; else if (Fake || Restarting) start_arg = 2; else start_arg = 1; for (i = start_arg; i < argc; i++) { if (DITEM_STATUS(dispatchCommand(argv[i])) != DITEM_SUCCESS) systemShutdown(1); } if (argc > start_arg) systemShutdown(0); } else dispatch_load_file_int(TRUE); status = setjmp(BailOut); if (status) { msgConfirm("A signal %d was caught - I'm saving what I can and shutting\n" "down. If you can reproduce the problem, please turn Debug on\n" "in the Options menu for the extra information it provides\n" "in debugging problems like this.", status); systemShutdown(status); } /* Begin user dialog at outer menu */ dialog_clear(); while (1) { choice = scroll = curr = max = 0; dmenuOpen(&MenuInitial, &choice, &scroll, &curr, &max, TRUE); if (getpid() != 1 -#ifdef __alpha__ +#if defined(__alpha__) || defined(__sparc64__) || !msgNoYes("Are you sure you wish to exit? The system will halt.") #else || !msgNoYes("Are you sure you wish to exit? The system will reboot\n" "(be sure to remove any floppies/CDs/DVDs from the drives).") #endif ) break; } /* Say goodnight, Gracie */ systemShutdown(0); return 0; /* We should never get here */ } Index: head/usr.sbin/sysinstall/menus.c =================================================================== --- head/usr.sbin/sysinstall/menus.c (revision 104939) +++ head/usr.sbin/sysinstall/menus.c (revision 104940) @@ -1,2157 +1,2160 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * * 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. * * 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. * */ #ifndef lint static const char rcsid[] = "$FreeBSD$"; #endif #include "sysinstall.h" /* Miscellaneous work routines for menus */ static int setSrc(dialogMenuItem *self) { Dists |= DIST_SRC; SrcDists = DIST_SRC_ALL; CRYPTODists |= (DIST_CRYPTO_SCRYPTO | DIST_CRYPTO_SSECURE | DIST_CRYPTO_SKERBEROS4 | DIST_CRYPTO_SKERBEROS5); return DITEM_SUCCESS | DITEM_REDRAW; } static int clearSrc(dialogMenuItem *self) { Dists &= ~DIST_SRC; SrcDists = 0; CRYPTODists &= ~(DIST_CRYPTO_SCRYPTO | DIST_CRYPTO_SSECURE | DIST_CRYPTO_SKERBEROS4 | DIST_CRYPTO_SKERBEROS5); return DITEM_SUCCESS | DITEM_REDRAW; } static int setX11Misc(dialogMenuItem *self) { XF86Dists |= DIST_XF86_MISC_ALL; Dists |= DIST_XF86; return DITEM_SUCCESS | DITEM_REDRAW; } static int clearX11Misc(dialogMenuItem *self) { XF86Dists &= ~DIST_XF86_MISC_ALL; if (!XF86ServerDists && !XF86FontDists) Dists &= ~DIST_XF86; return DITEM_SUCCESS | DITEM_REDRAW; } static int setX11Servers(dialogMenuItem *self) { XF86Dists |= DIST_XF86_SERVER; XF86ServerDists = DIST_XF86_SERVER_ALL; return DITEM_SUCCESS | DITEM_REDRAW; } static int clearX11Servers(dialogMenuItem *self) { XF86Dists &= ~DIST_XF86_SERVER; XF86ServerDists = 0; return DITEM_SUCCESS | DITEM_REDRAW; } static int setX11Fonts(dialogMenuItem *self) { XF86Dists |= DIST_XF86_FONTS; XF86FontDists = DIST_XF86_FONTS_ALL; return DITEM_SUCCESS | DITEM_REDRAW; } static int clearX11Fonts(dialogMenuItem *self) { XF86Dists &= ~DIST_XF86_FONTS; XF86FontDists = 0; return DITEM_SUCCESS | DITEM_REDRAW; } #define _IS_SET(dist, set) (((dist) & (set)) == (set)) #define IS_DEVELOPER(dist, extra) (_IS_SET(dist, _DIST_DEVELOPER | extra) || \ _IS_SET(dist, _DIST_DEVELOPER | extra)) #define IS_USER(dist, extra) (_IS_SET(dist, _DIST_USER | extra) || \ _IS_SET(dist, _DIST_USER | extra)) static int checkDistDeveloper(dialogMenuItem *self) { return IS_DEVELOPER(Dists, 0) && _IS_SET(SrcDists, DIST_SRC_ALL); } static int checkDistXDeveloper(dialogMenuItem *self) { return IS_DEVELOPER(Dists, DIST_XF86) && _IS_SET(SrcDists, DIST_SRC_ALL); } static int checkDistKernDeveloper(dialogMenuItem *self) { return IS_DEVELOPER(Dists, 0) && _IS_SET(SrcDists, DIST_SRC_SYS); } static int checkDistXKernDeveloper(dialogMenuItem *self) { return IS_DEVELOPER(Dists, DIST_XF86) && _IS_SET(SrcDists, DIST_SRC_SYS); } static int checkDistUser(dialogMenuItem *self) { return IS_USER(Dists, 0); } static int checkDistXUser(dialogMenuItem *self) { return IS_USER(Dists, DIST_XF86); } static int checkDistMinimum(dialogMenuItem *self) { return Dists == (DIST_BASE | DIST_CRYPTO); } static int checkDistEverything(dialogMenuItem *self) { return Dists == DIST_ALL && CRYPTODists == DIST_CRYPTO_ALL && \ _IS_SET(SrcDists, DIST_SRC_ALL) && \ _IS_SET(XF86Dists, DIST_XF86_ALL) && \ _IS_SET(XF86ServerDists, DIST_XF86_SERVER_ALL) && \ _IS_SET(XF86FontDists, DIST_XF86_FONTS_ALL); } static int srcFlagCheck(dialogMenuItem *item) { return SrcDists; } static int x11FlagCheck(dialogMenuItem *item) { return Dists & DIST_XF86; } static int checkTrue(dialogMenuItem *item) { return TRUE; } /* 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. */ DMenu MenuIndex = { DMENU_NORMAL_TYPE, "Glossary of functions", "This menu contains an alphabetized index of the top level functions in\n" "this program (sysinstall). Invoke an option by pressing [SPACE] or\n" "[ENTER]. To exit, use [TAB] to move to the Cancel button.", "Use PageUp or PageDown to move through this menu faster!", NULL, { { " Anon FTP", "Configure anonymous FTP logins.", dmenuVarCheck, configAnonFTP, NULL, "anon_ftp" }, { " Commit", "Commit any pending actions (dangerous!)", NULL, installCustomCommit }, { " Console settings", "Customize system console behavior.", NULL, dmenuSubmenu, NULL, &MenuSyscons }, { " Configure", "The system configuration menu.", NULL, dmenuSubmenu, NULL, &MenuConfigure }, { " Defaults, Load", "Load default settings.", NULL, dispatch_load_floppy }, { " Device, Mouse", "The mouse configuration menu.", NULL, dmenuSubmenu, NULL, &MenuMouse }, { " Disklabel", "The disk Label editor", NULL, diskLabelEditor }, { " Dists, All", "Root of the distribution tree.", NULL, dmenuSubmenu, NULL, &MenuDistributions }, { " Dists, Basic", "Basic FreeBSD distribution menu.", NULL, dmenuSubmenu, NULL, &MenuSubDistributions }, { " Dists, Developer", "Select developer's distribution.", checkDistDeveloper, distSetDeveloper }, { " Dists, Src", "Src distribution menu.", NULL, dmenuSubmenu, NULL, &MenuSrcDistributions }, { " Dists, X Developer", "Select X developer's distribution.", checkDistXDeveloper, distSetXDeveloper }, { " Dists, Kern Developer", "Select kernel developer's distribution.", checkDistKernDeveloper, distSetKernDeveloper }, { " Dists, User", "Select average user distribution.", checkDistUser, distSetUser }, { " Dists, X User", "Select average X user distribution.", checkDistXUser, distSetXUser }, { " Distributions, Adding", "Installing additional distribution sets", NULL, distExtractAll }, { " Distributions, XFree86","XFree86 distribution menu.", NULL, distSetXF86 }, { " Documentation", "Installation instructions, README, etc.", NULL, dmenuSubmenu, NULL, &MenuDocumentation }, { " Doc, README", "The distribution README file.", NULL, dmenuDisplayFile, NULL, "README" }, { " Doc, Errata", "The distribution errata.", NULL, dmenuDisplayFile, NULL, "ERRATA" }, { " Doc, Hardware", "The distribution hardware guide.", NULL, dmenuDisplayFile, NULL, "HARDWARE" }, { " Doc, Install", "The distribution installation guide.", NULL, dmenuDisplayFile, NULL, "INSTALL" }, { " Doc, Copyright", "The distribution copyright notices.", NULL, dmenuDisplayFile, NULL, "COPYRIGHT" }, { " Doc, Release", "The distribution release notes.", NULL, dmenuDisplayFile, NULL, "RELNOTES" }, { " Doc, HTML", "The HTML documentation menu.", NULL, docBrowser }, { " Dump Vars", "(debugging) dump out internal variables.", NULL, dump_variables }, { " Emergency shell", "Start an Emergency Holographic shell.", NULL, installFixitHoloShell }, #if defined(__i386__) || defined(__ia64__) { " Fdisk", "The disk Partition Editor", NULL, diskPartitionEditor }, #endif { " Fixit", "Repair mode with CDROM or fixit floppy.", NULL, dmenuSubmenu, NULL, &MenuFixit }, { " FTP sites", "The FTP mirror site listing.", NULL, dmenuSubmenu, NULL, &MenuMediaFTP }, { " Gateway", "Set flag to route packets between interfaces.", dmenuVarCheck, dmenuToggleVariable, NULL, "gateway=YES" }, { " HTML Docs", "The HTML documentation menu", NULL, docBrowser }, { " inetd Configuration", "Configure inetd and simple internet services.", dmenuVarCheck, configInetd, NULL, "inetd_enable=YES" }, { " Install, Standard", "A standard system installation.", NULL, installStandard }, { " Install, Express", "An express system installation.", NULL, installExpress }, { " Install, Custom", "The custom installation menu", NULL, dmenuSubmenu, NULL, &MenuInstallCustom }, { " Label", "The disk Label editor", NULL, diskLabelEditor }, { " Media", "Top level media selection menu.", NULL, dmenuSubmenu, NULL, &MenuMedia }, { " Media, Tape", "Select tape installation media.", NULL, mediaSetTape }, { " Media, NFS", "Select NFS installation media.", NULL, mediaSetNFS }, { " Media, Floppy", "Select floppy installation media.", NULL, mediaSetFloppy }, { " Media, CDROM/DVD", "Select CDROM/DVD installation media.", NULL, mediaSetCDROM }, { " Media, DOS", "Select DOS installation media.", NULL, mediaSetDOS }, { " Media, UFS", "Select UFS installation media.", NULL, mediaSetUFS }, { " Media, FTP", "Select FTP installation media.", NULL, mediaSetFTP }, { " Media, FTP Passive", "Select passive FTP installation media.", NULL, mediaSetFTPPassive }, { " Media, HTTP", "Select FTP via HTTP proxy installation media.", NULL, mediaSetHTTP }, { " Network Interfaces", "Configure network interfaces", NULL, tcpMenuSelect }, { " Networking Services", "The network services menu.", NULL, dmenuSubmenu, NULL, &MenuNetworking }, { " NFS, client", "Set NFS client flag.", dmenuVarCheck, dmenuToggleVariable, NULL, "nfs_client_enable=YES" }, { " NFS, server", "Set NFS server flag.", dmenuVarCheck, configNFSServer, NULL, "nfs_server_enable=YES" }, { " NTP Menu", "The NTP configuration menu.", NULL, dmenuSubmenu, NULL, &MenuNTP }, { " Options", "The options editor.", NULL, optionsEditor }, { " Packages", "The packages collection", NULL, configPackages }, { " Partition", "The disk Slice (PC-style partition) Editor", NULL, diskPartitionEditor }, { " PCNFSD", "Run authentication server for PC-NFS.", dmenuVarCheck, configPCNFSD, NULL, "pcnfsd" }, { " Root Password", "Set the system manager's password.", NULL, dmenuSystemCommand, NULL, "passwd root" }, { " Router", "Select routing daemon (default: routed)", NULL, configRouter, NULL, "router_enable" }, { " Security", "Configure system security options", NULL, dmenuSubmenu, NULL, &MenuSecurity }, { " Syscons", "The system console configuration menu.", NULL, dmenuSubmenu, NULL, &MenuSyscons }, { " Syscons, Font", "The console screen font.", NULL, dmenuSubmenu, NULL, &MenuSysconsFont }, { " Syscons, Keymap", "The console keymap configuration menu.", NULL, dmenuSubmenu, NULL, &MenuSysconsKeymap }, { " Syscons, Keyrate", "The console key rate configuration menu.", NULL, dmenuSubmenu, NULL, &MenuSysconsKeyrate }, { " Syscons, Saver", "The console screen saver configuration menu.", NULL, dmenuSubmenu, NULL, &MenuSysconsSaver }, { " Syscons, Screenmap", "The console screenmap configuration menu.", NULL, dmenuSubmenu, NULL, &MenuSysconsScrnmap }, { " Syscons, Ttys", "The console terminal type menu.", NULL, dmenuSubmenu, NULL, &MenuSysconsTtys }, { " Time Zone", "Set the system's time zone.", NULL, dmenuSystemCommand, NULL, "tzsetup" }, { " TTYs", "Configure system ttys.", NULL, configEtcTtys, NULL, "ttys" }, { " Upgrade", "Upgrade an existing system.", NULL, installUpgrade }, { " Usage", "Quick start - How to use this menu system.", NULL, dmenuDisplayFile, NULL, "usage" }, { " User Management", "Add user and group information.", NULL, dmenuSubmenu, NULL, &MenuUsermgmt }, { " XFree86, Fonts", "XFree86 Font selection menu.", NULL, dmenuSubmenu, NULL, &MenuXF86SelectFonts }, { " XFree86, Server", "XFree86 Server selection menu.", NULL, dmenuSubmenu, NULL, &MenuXF86SelectServer }, #if defined(__i386__) && defined(PC98) { " XFree86, PC98 Server", "XFree86 PC98 Server selection menu.", NULL, dmenuSubmenu, NULL, &MenuXF86SelectPC98Server }, #endif { NULL } }, }; /* The initial installation menu */ DMenu MenuInitial = { DMENU_NORMAL_TYPE, "sysinstall Main Menu", /* title */ "Welcome to the FreeBSD installation and configuration tool. Please\n" /* prompt */ "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 with [SPACE] or [ENTER]. To exit, use [TAB] to move to Exit.", "Press F1 for Installation Guide", /* help line */ "INSTALL", /* help file */ { { "Select" }, { "X Exit Install", NULL, NULL, dmenuExit }, { " Usage", "Quick start - How to use this menu system", NULL, dmenuDisplayFile, NULL, "usage" }, { "Standard", "Begin a standard installation (recommended)", NULL, installStandard }, { "Express", "Begin a quick installation (for experts)", NULL, installExpress }, { " Custom", "Begin a custom installation (for experts)", NULL, dmenuSubmenu, NULL, &MenuInstallCustom }, { "Configure", "Do post-install configuration of FreeBSD", NULL, dmenuSubmenu, NULL, &MenuConfigure }, { "Doc", "Installation instructions, README, etc.", NULL, dmenuSubmenu, NULL, &MenuDocumentation }, { "Keymap", "Select keyboard type", NULL, dmenuSubmenu, NULL, &MenuSysconsKeymap }, { "Options", "View/Set various installation options", NULL, optionsEditor }, { "Fixit", "Repair mode with CDROM/DVD/floppy or start shell", NULL, dmenuSubmenu, NULL, &MenuFixit }, { "Upgrade", "Upgrade an existing system", NULL, installUpgrade }, { "Load Config","Load default install configuration", NULL, dispatch_load_floppy }, { "Index", "Glossary of functions", NULL, dmenuSubmenu, NULL, &MenuIndex }, { NULL } }, }; /* The main documentation menu */ DMenu MenuDocumentation = { DMENU_NORMAL_TYPE, "FreeBSD Documentation Menu", "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", { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "1 README", "A general description of FreeBSD. Read this!", NULL, dmenuDisplayFile, NULL, "README" }, { "2 Errata", "Late-breaking, post-release news.", NULL, dmenuDisplayFile, NULL, "ERRATA" }, { "3 Hardware", "The FreeBSD survival guide for PC hardware.", NULL, dmenuDisplayFile, NULL, "HARDWARE" }, { "4 Install", "A step-by-step guide to installing FreeBSD.", NULL, dmenuDisplayFile, NULL, "INSTALL" }, { "5 Copyright", "The FreeBSD Copyright notices.", NULL, dmenuDisplayFile, NULL, "COPYRIGHT" }, { "6 Release" ,"The release notes for this version of FreeBSD.", NULL, dmenuDisplayFile, NULL, "RELNOTES" }, { "7 Shortcuts", "Creating shortcuts to sysinstall.", NULL, dmenuDisplayFile, NULL, "shortcuts" }, { "8 HTML Docs", "Go to the HTML documentation menu (post-install).", NULL, docBrowser }, { NULL } }, }; DMenu MenuMouseType = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Select a protocol type for your mouse", "If your mouse is attached to the PS/2 mouse port or the bus mouse port,\n" "you should always choose \"Auto\", regardless of the model and the brand\n" "of the mouse. All other protocol types are for serial mice and should\n" "not be used with the PS/2 port mouse or the bus mouse. If you have\n" "a serial mouse and are not sure about its protocol, you should also try\n" "\"Auto\". It may not work for the serial mouse if the mouse does not\n" "support the PnP standard. But, it won't hurt. Many 2-button serial mice\n" "are compatible with \"Microsoft\" or \"MouseMan\". 3-button serial mice\n" "may be compatible with \"MouseSystems\" or \"MouseMan\". If the serial\n" "mouse has a wheel, it may be compatible with \"IntelliMouse\".", NULL, NULL, { { "1 Auto", "Bus mouse, PS/2 style mouse or PnP serial mouse", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=auto" }, { "2 GlidePoint", "ALPS GlidePoint pad (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=glidepoint" }, { "3 Hitachi","Hitachi tablet (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=mmhittab" }, { "4 IntelliMouse", "Microsoft IntelliMouse (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=intellimouse" }, { "5 Logitech", "Logitech protocol (old models) (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=logitech" }, { "6 Microsoft", "Microsoft protocol (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=microsoft" }, { "7 MM Series","MM Series protocol (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=mmseries" }, { "8 MouseMan", "Logitech MouseMan/TrackMan models (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=mouseman" }, { "9 MouseSystems", "MouseSystems protocol (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=mousesystems" }, { "A ThinkingMouse","Kensington ThinkingMouse (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=thinkingmouse" }, { NULL } }, }; DMenu MenuMousePort = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Select your mouse port from the following menu", "The built-in pointing device of laptop/notebook computers is usually\n" "a PS/2 style device.", NULL, NULL, { { "1 PS/2", "PS/2 style mouse (/dev/psm0)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/psm0" }, { "2 COM1", "Serial mouse on COM1 (/dev/cuaa0)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuaa0" }, { "3 COM2", "Serial mouse on COM2 (/dev/cuaa1)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuaa1" }, { "4 COM3", "Serial mouse on COM3 (/dev/cuaa2)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuaa2" }, { "5 COM4", "Serial mouse on COM4 (/dev/cuaa3)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuaa3" }, { "6 BusMouse", "Logitech, ATI or MS bus mouse (/dev/mse0)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/mse0" }, { NULL } }, }; DMenu MenuMouse = { DMENU_NORMAL_TYPE, "Please configure your mouse", "You can cut and paste text in the text console by running the mouse\n" "daemon. Specify a port and a protocol type of your mouse and enable\n" "the mouse daemon. If you don't want this feature, select 6 to disable\n" "the daemon.\n" "Once you've enabled the mouse daemon, you can specify \"/dev/sysmouse\"\n" "as your mouse device and \"SysMouse\" or \"MouseSystems\" as mouse\n" "protocol when running the X configuration utility (see Configuration\n" "menu).", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "2 Enable", "Test and run the mouse daemon", NULL, mousedTest, NULL, NULL }, { "3 Type", "Select mouse protocol type", NULL, dmenuSubmenu, NULL, &MenuMouseType }, { "4 Port", "Select mouse port", NULL, dmenuSubmenu, NULL, &MenuMousePort }, { "5 Flags", "Set additional flags", dmenuVarCheck, setMouseFlags, NULL, VAR_MOUSED_FLAGS "=" }, { "6 Disable", "Disable the mouse daemon", NULL, mousedDisable, NULL, NULL }, { NULL } }, }; DMenu MenuMediaCDROM = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Choose a CD/DVD type", "FreeBSD can be installed directly from a CD/DVD containing a valid\n" "FreeBSD distribution. If you are seeing this menu it is because\n" "more than one CD/DVD drive was found on your system. Please select one\n" "of the following CD/DVD drives as your installation drive.", "Press F1 to read the installation guide", "INSTALL", { { NULL } }, }; DMenu MenuMediaFloppy = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Choose a Floppy drive", "You have more than one floppy drive. Please choose which drive\n" "you would like to use.", 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", { { NULL } }, }; DMenu MenuMediaFTP = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Please select a FreeBSD FTP distribution site", "Please select the site closest to you or \"other\" if you'd like to\n" "specify a different choice. Also note that not every site listed here\n" "carries more than the base distribution kits. Only the Primary site is\n" "guaranteed to carry the full range of possible distributions.", "Select a site that's close!", "INSTALL", { { "Primary Site", "ftp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.freebsd.org" }, { "URL", "Specify some other ftp site by URL", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=other" }, { " 5.0 SNAP Server", "current.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://current.freebsd.org" }, { " 4.x SNAP Server", "releng4.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://releng4.freebsd.org" }, { " jp.FreeBSD.org SNAP Server", "snapshots.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://snapshots.jp.freebsd.org" }, { " IPv6 Ready", "ftp2.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.jp.freebsd.org" }, { " IPv6 Ready #2", "ftp7.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp7.jp.freebsd.org" }, { "Argentina", "ftp.ar.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ar.freebsd.org" }, { " Australia", "ftp.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.au.freebsd.org" }, { " Australia #2","ftp2.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.au.freebsd.org" }, { " Australia #3","ftp3.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.au.freebsd.org" }, { " Australia #4","ftp4.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.au.freebsd.org" }, { " Australia #5","ftp5.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.au.freebsd.org" }, { "Brazil", "ftp.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.br.freebsd.org" }, { " Brazil #2", "ftp2.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.br.freebsd.org" }, { " Brazil #3", "ftp3.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.br.freebsd.org" }, { " Brazil #4", "ftp4.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.br.freebsd.org" }, { " Brazil #5", "ftp5.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.br.freebsd.org" }, { " Brazil #6", "ftp6.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp6.br.freebsd.org" }, { " Brazil #7", "ftp7.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp7.br.freebsd.org" }, { " Canada", "ftp.ca.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ca.freebsd.org" }, { " Czech Republic", "ftp.cz.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.cz.freebsd.org" }, { "Denmark (Primary)", "ftp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.dk.freebsd.org" }, { " Denmark", "ftp.dk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.dk.freebsd.org" }, { " Denmark #2", "ftp2.dk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.dk.freebsd.org" }, { "Estonia", "ftp.ee.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ee.freebsd.org" }, { "Finland", "ftp.fi.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.fi.freebsd.org" }, { " France", "ftp.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.fr.freebsd.org" }, { " France #1", "ftp.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.fr.freebsd.org" }, { " France #2", "ftp2.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.fr.freebsd.org" }, { " France #3", "ftp3.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.fr.freebsd.org" }, { " France #4", "ftp4.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.fr.freebsd.org" }, { " France #5", "ftp5.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.fr.freebsd.org" }, { " France #6", "ftp6.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp6.fr.freebsd.org" }, { " France #7", "ftp7.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp7.fr.freebsd.org" }, { " France #8", "ftp8.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp8.fr.freebsd.org" }, { "Germany", "ftp.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.de.freebsd.org" }, { " Germany #2", "ftp2.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.de.freebsd.org" }, { " Germany #3", "ftp3.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.de.freebsd.org" }, { " Germany #4", "ftp4.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.de.freebsd.org" }, { " Germany #5", "ftp5.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.de.freebsd.org" }, { " Germany #6", "ftp6.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp6.de.freebsd.org" }, { " Germany #7", "ftp7.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp7.de.freebsd.org" }, { " Greece", "ftp.gr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.gr.freebsd.org" }, { " Greece #2", "ftp2.gr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.gr.freebsd.org" }, { "Holland", "ftp.nl.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.nl.freebsd.org" }, { " Hong Kong", "ftp.hk.super.net", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.hk.super.net" }, { " Hungary", "ftp.hu.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.hu.freebsd.org" }, { "Iceland", "ftp.is.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.is.freebsd.org" }, { " Ireland", "ftp.ie.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ie.freebsd.org" }, { " Israel", "ftp.il.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.il.freebsd.org" }, { " Israel #2", "ftp2.il.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.il.freebsd.org" }, { "Japan", "ftp.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.jp.freebsd.org" }, { " Japan #2", "ftp2.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.jp.freebsd.org" }, { " Japan #3", "ftp3.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.jp.freebsd.org" }, { " Japan #4", "ftp4.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.jp.freebsd.org" }, { " Japan #5", "ftp5.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.jp.freebsd.org" }, { " Japan #6", "ftp6.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp6.jp.freebsd.org" }, { " Japan #7", "ftp7.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp7.jp.freebsd.org" }, { "Korea", "ftp.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.kr.freebsd.org" }, { " Korea #2", "ftp2.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.kr.freebsd.org" }, { " Korea #3", "ftp3.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.kr.freebsd.org" }, { " Korea #4", "ftp4.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.kr.freebsd.org" }, { " Korea #5", "ftp5.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.kr.freebsd.org" }, { "Lithuania", "ftp.lt.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.lt.freebsd.org" }, { "New Zealand", "ftp.nz.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.nz.freebsd.org" }, { "Norway", "ftp.no.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.no.freebsd.org" }, { "Poland", "ftp.pl.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.pl.freebsd.org" }, { " Portugal", "ftp.pt.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.pt.freebsd.org" }, { " Portugal #2", "ftp2.pt.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.pt.freebsd.org" }, { "Romania", "ftp.ro.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ro.freebsd.org" }, { " Russia", "ftp.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ru.freebsd.org" }, { " Russia #2", "ftp2.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.ru.freebsd.org" }, { " Russia #3", "ftp3.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.ru.freebsd.org" }, { " Russia #4", "ftp4.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.ru.freebsd.org" }, { "Slovak Republic", "ftp.sk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.sk.freebsd.org" }, { "Slovenia", "ftp.si.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.si.freebsd.org" }, { " South Africa", "ftp.za.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.za.freebsd.org" }, { " South Africa #2", "ftp2.za.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.za.freebsd.org" }, { " South Africa #3", "ftp3.za.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.za.freebsd.org" }, { " South Africa #4", "ftp4.za.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.za.freebsd.org" }, { " Spain", "ftp.es.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.es.freebsd.org" }, { " Spain #2", "ftp2.es.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.es.freebsd.org" }, { " Spain #3", "ftp3.es.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.es.freebsd.org" }, { " Sweden", "ftp.se.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.se.freebsd.org" }, { " Sweden #2", "ftp2.se.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.se.freebsd.org" }, { " Sweden #3", "ftp3.se.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.se.freebsd.org" }, { "Taiwan", "ftp.tw.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.tw.freebsd.org" }, { " Taiwan #2", "ftp2.tw.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.tw.freebsd.org" }, { " Taiwan #3", "ftp3.tw.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.tw.freebsd.org" }, { " Taiwan #4", "ftp4.tw.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.tw.freebsd.org" }, { " Thailand", "ftp.nectec.or.th", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.nectec.or.th/pub/mirrors/FreeBSD/" }, { "UK", "ftp.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.uk.freebsd.org" }, { " UK #2", "ftp2.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.uk.freebsd.org" }, { " UK #3", "ftp3.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.uk.freebsd.org" }, { " UK #4", "ftp4.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.uk.freebsd.org" }, { " UK #5", "ftp5.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.uk.freebsd.org" }, { " Ukraine", "ftp.ua.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ua.freebsd.org" }, { " Ukraine #2", "ftp2.ua.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.ua.freebsd.org" }, { " Ukraine #3", "ftp3.ua.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.ua.freebsd.org" }, { " USA #2", "ftp2.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.freebsd.org" }, { " USA #3", "ftp3.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.freebsd.org" }, { " USA #4", "ftp4.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.freebsd.org" }, { " USA #5", "ftp5.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.freebsd.org" }, { " USA #6", "ftp6.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp6.freebsd.org" }, { 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", { { NULL } }, }; DMenu MenuNetworkDevice = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Network interface information required", "If you are using PPP over a serial device, as opposed to a direct\n" "ethernet connection, then you may first need to dial your Internet\n" "Service Provider using the ppp utility we provide for that purpose.\n" "If you're using SLIP over a serial device then the expectation is\n" "that you have a HARDWIRED connection.\n\n" "You can also install over a parallel port using a special \"laplink\"\n" "cable to another machine running a fairly recent (2.0R or later)\n" "version of FreeBSD.", "Press F1 to read network configuration manual", "network_device", { { NULL } }, }; /* Prototype KLD load menu */ DMenu MenuKLD = { DMENU_NORMAL_TYPE, "KLD Menu", "Load a KLD from a floppy\n", NULL, NULL, { { 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 an Internet FTP server. If you're\n" "installing FreeBSD from a supported CD/DVD drive then this is generally\n" "the best media to use if you have no overriding reason for using other\n" "media.", "Press F1 for more information on the various media types", "media", { { "1 CD/DVD", "Install from a FreeBSD CD/DVD", NULL, mediaSetCDROM }, { "2 FTP", "Install from an FTP server", NULL, mediaSetFTPActive }, { "3 FTP Passive", "Install from an FTP server through a firewall", NULL, mediaSetFTPPassive }, { "4 HTTP", "Install from an FTP server through a http proxy", NULL, mediaSetHTTP }, { "5 DOS", "Install from a DOS partition", NULL, mediaSetDOS }, { "6 NFS", "Install over NFS", NULL, mediaSetNFS }, { "7 File System", "Install from an existing filesystem", NULL, mediaSetUFS }, { "8 Floppy", "Install from a floppy disk set", NULL, mediaSetFloppy }, { "9 Tape", "Install from SCSI or QIC tape", NULL, mediaSetTape }, { "X Options", "Go to the Options screen", NULL, optionsEditor }, { NULL } }, }; /* The distributions menu */ DMenu MenuDistributions = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "Choose Distributions", "As a convenience, we provide several \"canned\" distribution sets.\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 the\n" "list of distributions yourself, simply select \"Custom\". You can also\n" "pick a canned distribution set and then fine-tune it with the Custom item.\n\n" "Choose an item by pressing [SPACE] or [ENTER]. When finished, choose the\n" "Exit item or move to the OK button with [TAB].", "Press F1 for more information on these options.", "distributions", { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { "All", "All system sources, binaries and X Window System)", checkDistEverything, distSetEverything, NULL, NULL, ' ', ' ', ' ' }, { "Reset", "Reset selected distribution list to nothing", NULL, distReset, NULL, NULL, ' ', ' ', ' ' }, { "4 Developer", "Full sources, binaries and doc but no games", checkDistDeveloper, distSetDeveloper }, { "5 X-Developer", "Same as above + X Window System", checkDistXDeveloper, distSetXDeveloper }, { "6 Kern-Developer", "Full binaries and doc, kernel sources only", checkDistKernDeveloper, distSetKernDeveloper }, { "7 X-Kern-Developer", "Same as above + X Window System", checkDistXKernDeveloper, distSetXKernDeveloper }, { "8 User", "Average user - binaries and doc only", checkDistUser, distSetUser }, { "9 X-User", "Same as above + X Window System", checkDistXUser, distSetXUser }, { "A Minimal", "The smallest configuration possible", checkDistMinimum, distSetMinimum }, { "B Custom", "Specify your own distribution set", NULL, dmenuSubmenu, NULL, &MenuSubDistributions, '>', '>', '>' }, { NULL } }, }; DMenu MenuSubDistributions = { DMENU_CHECKLIST_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 \"base\".", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { "All", "All system sources, binaries and X Window System", NULL, distSetEverything, NULL, NULL, ' ', ' ', ' ' }, { "Reset", "Reset all of the below", NULL, distReset, NULL, NULL, ' ', ' ', ' ' }, { " base", "Binary base distribution (required)", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_BASE }, #ifdef __i386__ { " compat1x", "FreeBSD 1.x binary compatibility", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_COMPAT1X }, { " compat20", "FreeBSD 2.0 binary compatibility", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_COMPAT20 }, { " compat21", "FreeBSD 2.1 binary compatibility", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_COMPAT21 }, { " compat22", "FreeBSD 2.2.x and 3.0 a.out binary compatibility", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_COMPAT22 }, #if __FreeBSD__ > 3 { " compat3x", "FreeBSD 3.x binary compatibility", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_COMPAT3X }, #endif #if __FreeBSD__ >= 4 { " compat4x", "FreeBSD 4.x binary compatibility", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_COMPAT4X }, #endif #endif { " crypto", "Basic encryption services", dmenuFlagCheck, dmenuSetFlag, NULL, &CRYPTODists, '[', 'X', ']', DIST_CRYPTO_CRYPTO, }, #if __FreeBSD__ <= 3 { " krb", "KerberosIV authentication services", dmenuFlagCheck, dmenuSetFlag, NULL, &CRYPTODists, '[', 'X', ']', DIST_CRYPTO_KERBEROS }, #else { " krb4", "KerberosIV authentication services", dmenuFlagCheck, dmenuSetFlag, NULL, &CRYPTODists, '[', 'X', ']', DIST_CRYPTO_KERBEROS4 }, { " krb5", "Kerberos5 authentication services", dmenuFlagCheck, dmenuSetFlag, NULL, &CRYPTODists, '[', 'X', ']', DIST_CRYPTO_KERBEROS5 }, #endif { " dict", "Spelling checker dictionary files", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_DICT }, { " doc", "Miscellaneous FreeBSD online docs", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_DOC }, { " games", "Games (non-commercial)", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_GAMES }, { " info", "GNU info files", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_INFO }, { " man", "System manual pages - recommended", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_MANPAGES }, { " catman", "Preformatted system manual pages", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_CATPAGES }, { " proflibs", "Profiled versions of the libraries", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_PROFLIBS }, { " src", "Sources for everything", srcFlagCheck, distSetSrc }, { " ports", "The FreeBSD Ports collection", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_PORTS }, { " local", "Local additions collection", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_LOCAL}, { " XFree86", "The XFree86 distribution", #ifdef X_AS_PKG dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_XF86 }, #else x11FlagCheck, distSetXF86 }, #endif { NULL } }, }; DMenu MenuSrcDistributions = { DMENU_CHECKLIST_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, { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { "All", "Select all of the below", NULL, setSrc, NULL, NULL, ' ', ' ', ' ' }, { "Reset", "Reset all of the below", NULL, clearSrc, NULL, NULL, ' ', ' ', ' ' }, { " base", "top-level files in /usr/src", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_BASE }, { " contrib", "/usr/src/contrib (contributed software)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_CONTRIB }, { " gnu", "/usr/src/gnu (software from the GNU Project)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_GNU }, { " etc", "/usr/src/etc (miscellaneous system files)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_ETC }, { " games", "/usr/src/games (the obvious!)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_GAMES }, { " include", "/usr/src/include (header files)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_INCLUDE }, { " lib", "/usr/src/lib (system libraries)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_LIB }, { " libexec", "/usr/src/libexec (system programs)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_LIBEXEC }, { " release", "/usr/src/release (release-generation tools)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_RELEASE }, { " bin", "/usr/src/bin (system binaries)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_BIN }, { " sbin", "/usr/src/sbin (system binaries)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_SBIN }, { " scrypto", "/usr/src/crypto (contrib encryption sources)", dmenuFlagCheck, dmenuSetFlag, NULL, &CRYPTODists, '[', 'X', ']', DIST_CRYPTO_SCRYPTO }, { " share", "/usr/src/share (documents and shared files)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_SHARE }, { " skrb4", "/usr/src/kerberosIV (sources for KerberosIV)", dmenuFlagCheck, dmenuSetFlag, NULL, &CRYPTODists, '[', 'X', ']', DIST_CRYPTO_SKERBEROS4 }, { " skrb5", "/usr/src/kerberos5 (sources for Kerberos5)", dmenuFlagCheck, dmenuSetFlag, NULL, &CRYPTODists, '[', 'X', ']', DIST_CRYPTO_SKERBEROS5 }, { " ssecure", "/usr/src/secure (BSD encryption sources)", dmenuFlagCheck, dmenuSetFlag, NULL, &CRYPTODists, '[', 'X', ']', DIST_CRYPTO_SSECURE }, { " sys", "/usr/src/sys (FreeBSD kernel)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_SYS }, { " tools", "/usr/src/tools (miscellaneous tools)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_TOOLS }, { " ubin", "/usr/src/usr.bin (user binaries)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_UBIN }, { " usbin", "/usr/src/usr.sbin (aux system binaries)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_USBIN }, { NULL } }, }; DMenu MenuXF86Config = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Please select the XFree86 configuration tool you want to use.", "The first option, xf86cfg, is fully graphical.\n" "The second option provides a menu-based interface similar to\n" "what you are currently using. " "The third option, xf86config, is\n" "a more simplistic shell-script based tool and less friendly to\n" "new users, but it may work in situations where the other options\n" "do not.", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "2 xf86cfg", "Fully graphical XFree86 configuration tool.", NULL, dmenuSetVariable, NULL, VAR_XF86_CONFIG "=xf86cfg" }, { "3 xf86cfg -textmode", "ncurses-based XFree86 configuration tool.", NULL, dmenuSetVariable, NULL, VAR_XF86_CONFIG "=xf86cfg -textmode" }, { "4 xf86config", "Shell-script based XFree86 configuration tool.", NULL, dmenuSetVariable, NULL, VAR_XF86_CONFIG "=xf86config" }, { "D XDesktop", "X already set up, just do desktop configuration.", NULL, dmenuSubmenu, NULL, &MenuXDesktops }, { NULL } }, }; DMenu MenuXDesktops = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Please select the default X desktop to use.", "By default, XFree86 comes with a fairly vanilla desktop which\n" "is based around the twm(1) window manager and does not offer\n" "much in the way of features. It does have the advantage of\n" "being a standard part of X so you don't need to load anything\n" "extra in order to use it. If, however, you have access to a\n" "reasonably full packages collection on your installation media,\n" "you can choose any one of the following desktops as alternatives.", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "2 KDE", "The K Desktop Environment.", NULL, dmenuSetVariable, NULL, VAR_DESKSTYLE "=kde" }, { "3 GNOME + Sawfish", "GNOME + Sawfish window manager.", NULL, dmenuSetVariable, NULL, VAR_DESKSTYLE "=gnome" }, { "4 GNOME + Enlightenment","GNOME + The E window manager", NULL, dmenuSetVariable, NULL, VAR_DESKSTYLE "=enlightenment" }, { "5 Afterstep", "The Afterstep window manager", NULL, dmenuSetVariable, NULL, VAR_DESKSTYLE "=afterstep" }, { "6 Windowmaker", "The Windowmaker window manager", NULL, dmenuSetVariable, NULL, VAR_DESKSTYLE "=windowmaker" }, { "7 fvwm", "The fvwm window manager", NULL, dmenuSetVariable, NULL, VAR_DESKSTYLE "=fvwm2" }, { NULL } }, }; DMenu MenuXF86Select = { DMENU_NORMAL_TYPE, "XFree86 Distribution", "Please select the components you need from the XFree86\n" "distribution sets.", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "Basic", "Basic component menu (required)", NULL, dmenuSubmenu, NULL, &MenuXF86SelectCore }, { "Server", "X server menu", NULL, dmenuSubmenu, NULL, &MenuXF86SelectServer }, { "Fonts", "Font set menu", NULL, dmenuSubmenu, NULL, &MenuXF86SelectFonts }, { NULL } }, }; DMenu MenuXF86SelectCore = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "XFree86 base distribution types", "Please check off the basic XFree86 components you wish to install.\n" "Bin, lib, and set are recommended for a minimum installaion.", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { "All", "Select all below", NULL, setX11Misc, NULL, NULL, ' ', ' ', ' ' }, { "Reset", "Reset all below", NULL, clearX11Misc, NULL, NULL, ' ', ' ', ' ' }, { " bin", "Client applications and shared libs", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_BIN }, { " lib", "Data files needed at runtime", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_LIB }, { " cfg", "Configuration files", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_CFG }, { " set", "XFree86 Setup Utility", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_SET }, { " man", "Manual pages", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_MAN }, { " doc", "READMEs and release notes", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_DOC }, { " html", "HTML documentation files", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_HTML }, { " lkit", "Server link kit for all other machines", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_LKIT }, { " prog", "Programmer's header and library files", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_PROG }, #if defined(__i386__) && defined(PC98) { " 9set", "XFree86 Setup Utility for PC98 machines", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_9SET }, { " lk98", "Server link kit for PC98 machines", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_LKIT98 }, #endif { NULL } }, }; DMenu MenuXF86SelectFonts = { DMENU_CHECKLIST_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).", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { "All", "All fonts", NULL, setX11Fonts, NULL, NULL, ' ', ' ', ' ' }, { "Reset", "Reset font selections", NULL, clearX11Fonts, NULL, NULL, ' ', ' ', ' ' }, { " fnts", "Standard 75 DPI and miscellaneous fonts", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86FontDists, '[', 'X', ']', DIST_XF86_FONTS_MISC }, { " f100", "100 DPI fonts", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86FontDists, '[', 'X', ']', DIST_XF86_FONTS_100 }, { " fcyr", "Cyrillic Fonts", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86FontDists, '[', 'X', ']', DIST_XF86_FONTS_CYR }, { " fscl", "Speedo and Type scalable fonts", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86FontDists, '[', 'X', ']', DIST_XF86_FONTS_SCALE }, { " non", "Japanese, Chinese and other non-english fonts", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86FontDists, '[', 'X', ']', DIST_XF86_FONTS_NON }, { " server", "Font server", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86FontDists, '[', 'X', ']', DIST_XF86_FONTS_SERVER }, { NULL } }, }; DMenu MenuXF86SelectServer = { DMENU_CHECKLIST_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 or, for PC98\n" "machines, the 9EGC or 9840 servers.", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { "All", "Select all of the above", NULL, setX11Servers, NULL, NULL, ' ', ' ', ' ' }, { "Reset", "Reset all of the above", NULL, clearX11Servers, NULL, NULL, ' ', ' ', ' ' }, { " SVGA", "Standard VGA or Super VGA card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_SVGA }, { " VGA16", "Standard 16 color VGA card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_VGA16 }, { " Mono", "Standard Monochrome card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_MONO }, { " 3DL", "8, 16 and 24 bit color 3D Labs boards", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_3DL }, { " 8514", "8-bit (256 color) IBM 8514 or compatible card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_8514 }, { " AGX", "8-bit AGX card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_AGX }, { " I128", "8, 16 and 24-bit #9 Imagine I128 card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_I128 }, { " Ma8", "8-bit ATI Mach8 card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_MACH8 }, { " Ma32", "8 and 16-bit (65K color) ATI Mach32 card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_MACH32 }, { " Ma64", "8 and 16-bit (65K color) ATI Mach64 card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_MACH64 }, { " P9K", "8, 16, and 24-bit color Weitek P9000 based boards", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_P9000 }, { " S3", "8, 16 and 24-bit color S3 based boards", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_S3 }, { " S3V", "8, 16 and 24-bit color S3 Virge based boards", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_S3V }, { " W32", "8-bit ET4000/W32, /W32i and /W32p cards", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_W32 }, #if defined(__i386__) && defined(PC98) { " PC98", "Select an X server for a NEC PC98 [Submenu]", NULL, dmenuSubmenu, NULL, &MenuXF86SelectPC98Server, '>', ' ', '>', 0 }, #elif __alpha__ { " TGA", "TGA cards (alpha architecture only)", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_TGA }, #endif { NULL } }, }; #if defined(__i386__) && defined(PC98) DMenu MenuXF86SelectPC98Server = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "PC98 X Server selection.", "Please check off the types of NEC PC98 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).", NULL, NULL, { { " 9480", "PC98 8-bit (256 color) PEGC-480 card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_9480 }, { " 9EGC", "PC98 4-bit (16 color) EGC card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_9EGC }, { " 9GA9", "PC98 GA-968V4/PCI (S3 968) card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_9GA9 }, { " 9GAN", "PC98 GANB-WAP (cirrus) card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_9GAN }, { " 9LPW", "PC98 PowerWindowLB (S3) card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_9LPW }, { " 9MGA", "PC98 MGA (Matrox) card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_9MGA }, { " 9NKV", "PC98 NKV-NEC (cirrus) card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_9NKV }, { " 9NS3", "PC98 NEC (S3) card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_9NS3 }, { " 9SPW", "PC98 SKB-PowerWindow (S3) card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_9SPW }, { " 9SVG", "PC98 generic SVGA card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_9SVG }, { " 9TGU", "PC98 Cyber9320 and TGUI9680 cards", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_9TGU }, { " 9WEP", "PC98 WAB-EP (cirrus) card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_9WEP }, { " 9WS", "PC98 WABS (cirrus) card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_9WS }, { " 9WSN", "PC98 WSN-A2F (cirrus) card", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_9WSN }, { NULL } } }; #endif DMenu MenuDiskDevices = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "Select Drive(s)", "Please select the drive, or drives, on which you wish to perform\n" "this operation. If you are attempting to install a boot partition\n" "on a drive other than the first one 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] or [ENTER]. To de-select it, press it again.\n\n" "Use [TAB] to get to the buttons and leave this menu.", "Press F1 for important information regarding disk geometry!", "drives", { { NULL } }, }; DMenu MenuHTMLDoc = { DMENU_NORMAL_TYPE, "Select HTML Documentation pointer", "Please select the body of documentation you're interested in, the main\n" "ones right now being the FAQ and the Handbook. You can also choose \"other\"\n" "to enter an arbitrary URL for browsing.", "Press F1 for more help on what you see here.", "html", { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "2 Handbook", "The FreeBSD Handbook.", NULL, docShowDocument }, { "3 FAQ", "The Frequently Asked Questions guide.", NULL, docShowDocument }, { "4 Home", "The Home Pages for the FreeBSD Project (requires net)", NULL, docShowDocument }, { "5 Other", "Enter a URL.", NULL, docShowDocument }, { 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", { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "2 Options", "View/Set various installation options", NULL, optionsEditor }, -#ifdef __alpha__ +#if defined(__alpha__) || defined(__sparc64__) { "3 Label", "Label disk partitions", NULL, diskLabelEditor }, { "4 Distributions", "Select distribution(s) to extract", NULL, dmenuSubmenu, NULL, &MenuDistributions }, { "5 Media", "Choose the installation media type", NULL, dmenuSubmenu, NULL, &MenuMedia }, { "6 Commit", "Perform any pending Partition/Label/Extract actions", NULL, installCustomCommit }, #else { "3 Partition", "Allocate disk space for FreeBSD", NULL, diskPartitionEditor }, { "4 Label", "Label allocated disk partitions", NULL, diskLabelEditor }, { "5 Distributions", "Select distribution(s) to extract", NULL, dmenuSubmenu, NULL, &MenuDistributions }, { "6 Media", "Choose the installation media type", NULL, dmenuSubmenu, NULL, &MenuMedia }, { "7 Commit", "Perform any pending Partition/Label/Extract actions", NULL, installCustomCommit }, #endif { NULL } }, }; /* MBR type menu */ DMenu MenuMBRType = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "overwrite me", /* will be disk specific label */ "FreeBSD comes with a boot selector that allows you to easily\n" "select between FreeBSD and any other operating systems on your machine\n" "at boot time. If you have more than one drive and want to boot\n" "from the second one, the boot selector will also make it possible\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\".\n\n" " NOTE: PC-DOS users will almost certainly require \"None\"!", "Press F1 to read about drive setup", "drives", { { "BootMgr", "Install the FreeBSD Boot Manager", dmenuRadioCheck, dmenuSetValue, NULL, &BootMgr }, #ifndef PC98 { "Standard", "Install a standard MBR (no boot manager)", dmenuRadioCheck, dmenuSetValue, NULL, &BootMgr, '(', '*', ')', 1 }, #endif { "None", "Leave the Master Boot Record untouched", dmenuRadioCheck, dmenuSetValue, NULL, &BootMgr, '(', '*', ')', 2 }, { 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 customize\n" "it somewhat to suit your particular configuration. Most importantly,\n" "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", { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { " Distributions", "Install additional distribution sets", NULL, distExtractAll }, { " Packages", "Install pre-packaged software for FreeBSD", NULL, configPackages }, { " Root Password", "Set the system manager's password", NULL, dmenuSystemCommand, NULL, "passwd root" }, #if defined(__i386__) || defined(__ia64__) { " Fdisk", "The disk Slice (PC-style partition) Editor", NULL, diskPartitionEditor }, #endif { " Label", "The disk Label editor", NULL, diskLabelEditor }, { " User Management", "Add user and group information", NULL, dmenuSubmenu, NULL, &MenuUsermgmt }, { " Console", "Customize system console behavior", NULL, dmenuSubmenu, NULL, &MenuSyscons }, { " Time Zone", "Set which time zone you're in", NULL, dmenuSystemCommand, NULL, "tzsetup" }, { " Media", "Change the installation media type", NULL, dmenuSubmenu, NULL, &MenuMedia }, { " Mouse", "Configure your mouse", NULL, dmenuSubmenu, NULL, &MenuMouse, NULL }, { " Networking", "Configure additional network services", NULL, dmenuSubmenu, NULL, &MenuNetworking }, { " Security", "Configure system security options", NULL, dmenuSubmenu, NULL, &MenuSecurity }, { " Startup", "Configure system startup options", NULL, dmenuSubmenu, NULL, &MenuStartup }, { " TTYs", "Configure system ttys.", NULL, configEtcTtys, NULL, "ttys" }, { " Options", "View/Set various installation options", NULL, optionsEditor }, { " XFree86", "Configure XFree86 Server", NULL, configXSetup }, { " Desktop", "Configure XFree86 Desktop", NULL, configXDesktop }, { " HTML Docs", "Go to the HTML documentation menu (post-install)", NULL, docBrowser }, { " Load KLD", "Load a KLD from a floppy", NULL, kldBrowser }, { NULL } }, }; DMenu MenuStartup = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "Startup Services Menu", "This menu allows you to configure various aspects of your system's\n" "startup configuration. Use [SPACE] or [ENTER] to select items, and\n" "[TAB] to move to the buttons. Select Exit to leave this menu.", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { " APM", "Auto-power management services (typically laptops)", dmenuVarCheck, dmenuToggleVariable, NULL, "apm_enable=YES" }, #ifdef PCCARD_ARCH { " pccard", "Enable PCCARD (AKA PCMCIA) services (also laptops)", dmenuVarCheck, dmenuToggleVariable, NULL, "pccard_enable=YES" }, { " pccard mem", "Set PCCARD memory address (if enabled)", dmenuVarCheck, dmenuISetVariable, NULL, "pccard_mem" }, { " pccard ifconfig", "List of PCCARD ethernet devices to configure", dmenuVarCheck, dmenuISetVariable, NULL, "pccard_ifconfig" }, #endif { " usbd", "Enable USB daemon (detect USB attach / detach)", dmenuVarCheck, dmenuToggleVariable, NULL, "usbd_enable=YES" }, { " usbd flags", "Set default flags to usbd (if enabled)", dmenuVarCheck, dmenuISetVariable, NULL, "usbd_flags" }, { " ", " -- ", NULL, NULL, NULL, NULL, ' ', ' ', ' ' }, { " startup dirs", "Set the list of dirs to look for startup scripts", dmenuVarCheck, dmenuISetVariable, NULL, "local_startup" }, { " named", "Run a local name server on this host", dmenuVarCheck, dmenuToggleVariable, NULL, "named_enable=YES" }, { " named flags", "Set default flags to named (if enabled)", dmenuVarCheck, dmenuISetVariable, NULL, "named_flags" }, { " nis client", "This host wishes to be an NIS client.", dmenuVarCheck, dmenuToggleVariable, NULL, "nis_client_enable=YES" }, { " nis domainname", "Set NIS domainname (if enabled)", dmenuVarCheck, dmenuISetVariable, NULL, "nisdomainname" }, { " nis server", "This host wishes to be an NIS server.", dmenuVarCheck, dmenuToggleVariable, NULL, "nis_server_enable=YES" }, { " ", " -- ", NULL, NULL, NULL, NULL, ' ', ' ', ' ' }, { " accounting", "This host wishes to run process accounting.", dmenuVarCheck, dmenuToggleVariable, NULL, "accounting_enable=YES" }, { " lpd", "This host has a printer and wants to run lpd.", dmenuVarCheck, dmenuToggleVariable, NULL, "lpd_enable=YES" }, -#ifdef __i386__ { " linux", "This host wants to be able to run linux binaries.", dmenuVarCheck, configLinux, NULL, VAR_LINUX_ENABLE "=YES" }, - { " SVR4", "This host wants to be able to run SVR4 binaries.", - dmenuVarCheck, dmenuToggleVariable, NULL, "svr4_enable=YES" }, +#ifdef __i386__ { " SCO", "This host wants to be able to run IBCS2 binaries.", dmenuVarCheck, dmenuToggleVariable, NULL, "ibcs2_enable=YES" }, -#elif __alpha__ +#endif +#if defined(__i386__) || defined(__sparc64__) + { " SVR4", "This host wants to be able to run SVR4 binaries.", + dmenuVarCheck, dmenuToggleVariable, NULL, "svr4_enable=YES" }, +#endif +#ifdef __alpha__ { " OSF/1", "This host wants to be able to run DEC OSF/1 binaries.", dmenuVarCheck, dmenuToggleVariable, NULL, "osf1_enable=YES" }, #endif { " quotas", "This host wishes to check quotas on startup.", dmenuVarCheck, dmenuToggleVariable, NULL, "check_quotas=YES" }, { NULL } }, }; DMenu MenuNetworking = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "Network Services Menu", "You may have already configured one network device (and the other\n" "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, { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { " Interfaces", "Configure additional network interfaces", NULL, tcpMenuSelect }, { " AMD", "This machine wants to run the auto-mounter service", dmenuVarCheck, dmenuToggleVariable, NULL, "amd_enable=YES" }, { " AMD Flags", "Set flags to AMD service (if enabled)", dmenuVarCheck, dmenuISetVariable, NULL, "amd_flags" }, { " Anon FTP", "This machine wishes to allow anonymous FTP.", dmenuVarCheck, configAnonFTP, NULL, "anon_ftp" }, { " Gateway", "This machine will route packets between interfaces", dmenuVarCheck, dmenuToggleVariable, NULL, "gateway_enable=YES" }, { " inetd", "This machine wants to run the inet daemon", dmenuVarCheck, configInetd, NULL, "inetd_enable=YES" }, { " NFS client", "This machine will be an NFS client", dmenuVarCheck, dmenuToggleVariable, NULL, "nfs_client_enable=YES" }, { " NFS server", "This machine will be an NFS server", dmenuVarCheck, configNFSServer, NULL, "nfs_server_enable=YES" }, { " Ntpdate", "Select a clock-synchronization server", dmenuVarCheck, dmenuSubmenu, NULL, &MenuNTP, '[', 'X', ']', "ntpdate_enable=YES" }, { " PCNFSD", "Run authentication server for clients with PC-NFS.", dmenuVarCheck, configPCNFSD, NULL, "pcnfsd" }, { " portmap", "This machine wants to run the portmapper daemon", dmenuVarCheck, dmenuToggleVariable, NULL, "portmap_enable=YES" }, { " Routed", "Select routing daemon (default: routed)", dmenuVarCheck, configRouter, NULL, "router_enable=YES" }, { " Rwhod", "This machine wants to run the rwho daemon", dmenuVarCheck, dmenuToggleVariable, NULL, "rwhod_enable=YES" }, { " Sendmail", "This machine wants to run the sendmail daemon", NULL, dmenuSubmenu, NULL, &MenuSendmail }, { " Sshd", "This machine wants to run the ssh daemon", dmenuVarCheck, dmenuToggleVariable, NULL, "sshd_enable=YES" }, { " TCP Extensions", "Allow RFC1323 and RFC1644 TCP extensions?", dmenuVarCheck, dmenuToggleVariable, NULL, "tcp_extensions=YES" }, { NULL } }, }; DMenu MenuSendmail = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Sendmail Invocation Selection", "There are three options for invoking sendmail at startup.\n" "Please select Yes if you want to use sendmail as your mail transfer\n" "agent. Selecting No disables sendmail's network socket for incoming\n" "email, but still enables sendmail for local and outbound mail.\n" "None disables sendmail completely at startup and disables inbound,\n" "outbound, and local mail. See /etc/mail/README for more\n" "information.\n", NULL, NULL, { { " Yes", "Start sendmail", dmenuVarCheck, dmenuSetVariable, NULL, "sendmail_enable=YES" }, { " No", "Start sendmail, but don't listen from network", dmenuVarCheck, dmenuSetVariable, NULL, "sendmail_enable=NO" }, { " None", "Don't start any sendmail processes", dmenuVarCheck, dmenuSetVariable, NULL, "sendmail_enable=NONE" }, { NULL } }, }; DMenu MenuNTP = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "NTPDATE Server Selection", "There are a number of time synchronization servers available\n" "for public use around the Internet. Please select one reasonably\n" "close to you to have your system time synchronized accordingly.", "These are the primary open-access NTP servers", NULL, { { "None", "No NTP server", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=NO,ntpdate_flags=none" }, { "Other", "Select a site not on this list", dmenuVarsCheck, configNTP, NULL, NULL }, { "Argentina", "tick.nap.com.ar", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tick.nap.com.ar" }, { "Argentina #2", "time.sinectis.com.ar", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.sinectis.com.ar" }, { "Argentina #3", "tock.nap.com.ar", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tock.nap.com.ar" }, { "Australia", "augean.eleceng.adelaide.edu.au", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=augean.eleceng.adelaide.edu.au" }, { "Australia #2", "ntp.adelaide.edu.au", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.adelaide.edu.au" }, { "Australia #3", "ntp.saard.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.saard.net" }, { "Australia #4", "time.deakin.edu.au", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.deakin.edu.au" }, { "Australia #5", "time.esec.com.au", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.esec.com.au" }, { "Belgium", "ntp1.belbone.be", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.belbone.be" }, { "Belgium #2", "ntp2.belbone.be", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.belbone.be" }, { "Brazil", "ntp.cais.rnp.br", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.cais.rnp.br" }, { "Brazil #2", "ntp.pop-df.rnp.br", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.pop-df.rnp.br" }, { "Brazil #3", "ntp.ufes.br", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.ufes.br" }, { "Brazil #4", "ntp1.pucpr.br", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.pucpr.br" }, { "Canada", "ntp.cpsc.ucalgary.ca", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.cpsc.ucalgary.ca" }, { "Canada #2", "ntp1.cmc.ec.gc.ca", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.cmc.ec.gc.ca" }, { "Canada #3", "ntp2.cmc.ec.gc.ca", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.cmc.ec.gc.ca" }, { "Canada #4", "tick.utoronto.ca", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tick.utoronto.ca" }, { "Canada #5", "time.chu.nrc.ca", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.chu.nrc.ca" }, { "Canada #6", "time.nrc.ca", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.nrc.ca" }, { "Canada #7", "timelord.uregina.ca", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=timelord.uregina.ca" }, { "Canada #8", "tock.utoronto.ca", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tock.utoronto.ca" }, { "Czech", "ntp.karpo.cz", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.karpo.cz" }, { "Denmark", "clock.netcetera.dk", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock.netcetera.dk" }, { "Denmark", "clock2.netcetera.dk", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock2.netcetera.dk" }, { "Spain", "slug.ctv.es", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=slug.ctv.es" }, { "Finland", "tick.keso.fi", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tick.keso.fi" }, { "Finland #2", "tock.keso.fi", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tock.keso.fi" }, { "France", "ntp.obspm.fr", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.obspm.fr" }, { "France #2", "ntp.univ-lyon1.fr", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.univ-lyon1.fr" }, { "France #3", "ntp.via.ecp.fr", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.via.ecp.fr" }, { "Croatia", "zg1.ntp.carnet.hr", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=zg1.ntp.carnet.hr" }, { "Croatia #2", "zg2.ntp.carnet.hr", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=zg2.ntp.carnet.hr" }, { "Croatia #3", "st.ntp.carnet.hr", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=st.ntp.carnet.hr" }, { "Croatia #4", "ri.ntp.carnet.hr", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ri.ntp.carnet.hr" }, { "Croatia #5", "os.ntp.carnet.hr", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=os.ntp.carnet.hr" }, { "Hungary", "time.kfki.hu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.kfki.hu" }, { "Indonesia", "ntp.incaf.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.incaf.net" }, { "Ireland", "ntp.maths.tcd.ie", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.maths.tcd.ie" }, { "Italy", "ntps.net4u.it", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=" }, { "Japan", "ntp.cyber-fleet.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.cyber-fleet.net" }, { "Korea", "time.nuri.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.nuri.net" }, { "Mexico", "ntp2a.audiotel.com.mx", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2a.audiotel.com.mx" }, { "Mexico #2", "ntp2b.audiotel.com.mx", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2b.audiotel.com.mx" }, { "Mexico #3", "ntp2c.audiotel.com.mx", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2c.audiotel.com.mx" }, { "Nigeria", "ntp.supernet300.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.supernet300.com" }, { "Netherlands", "ntp1.theinternetone.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.theinternetone.net" }, { "Netherlands #2", "ntp2.theinternetone.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.theinternetone.net" }, { "Netherlands #3", "ntp3.theinternetone.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp3.theinternetone.net" }, { "Norway", "fartein.ifi.uio.no", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=fartein.ifi.uio.no" }, { "Norway #2", "time.alcanet.no", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.alcanet.no" }, { "New Zealand", "ntp.massey.ac.nz", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.massey.ac.nz" }, { "New Zealand #2", "ntp.public.otago.ac.nz", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.public.otago.ac.nz" }, { "New Zealand #3", "tk1.ihug.co.nz", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tk1.ihug.co.nz" }, { "New Zealand #4", "ntp.waikato.ac.nz", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.waikato.ac.nz" }, { "Poland", "info.cyf-kr.edu.pl", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=info.cyf-kr.edu.pl" }, { "Portugal", "bug.fe.up.pt", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=bug.fe.up.pt" }, { "Romania", "ntp.ip.ro", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.ip.ro" }, { "Russia", "ntp.psn.ru", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.psn.ru" }, { "Russia #2", "sign.chg.ru", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=sign.chg.ru" }, { "Sweden", "ntp.lth.se", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.lth.se" }, { "Singapore", "ntp.shim.org", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.shim.org" }, { "Slovenia", "calvus.rzs-hm.si", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=calvus.rzs-hm.si" }, { "Slovenia #2", "sizif.mf.uni-lj.si", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=sizif.mf.uni-lj.si" }, { "Slovenia #3", "ntp1.arnes.si", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.arnes.si" }, { "Slovenia #4", "ntp2.arnes.si", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.arnes.si" }, { "Slovenia #5", "time.ijs.si", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.ijs.si" }, { "Scotland", "ntp.cs.strath.ac.uk", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.cs.strath.ac.uk" }, { "United Kingdom", "ntp.exnet.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.exnet.com" }, { "United Kingdom #2", "ntp0.uk.uu.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp0.uk.uu.net" }, { "United Kingdom #3", "ntp1.uk.uu.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.uk.uu.net" }, { "United Kingdom #4", "ntp2.uk.uu.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.uk.uu.net" }, { "United Kingdom #5", "ntp2a.mcc.ac.uk", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2a.mcc.ac.uk" }, { "United Kingdom #6", "ntp2b.mcc.ac.uk", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2b.mcc.ac.uk" }, { "United Kingdom #7", "ntp2c.mcc.ac.uk", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2c.mcc.ac.uk" }, { "United Kingdom #8", "ntp2d.mcc.ac.uk", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2d.mcc.ac.uk" }, { "United Kingdom #9", "tick.tanac.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tick.tanac.net" }, { "U.S. AR", "sushi.compsci.lyon.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=sushi.compsci.lyon.edu" }, { "U.S. AZ", "ntp.drydog.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.drydog.com" }, { "U.S. CA", "ntp.ucsd.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.ucsd.edu" }, { "U.S. CA #2", "ntp1.mainecoon.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.mainecoon.com" }, { "U.S. CA #3", "ntp2.mainecoon.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.mainecoon.com" }, { "U.S. CA #4", "reloj.kjsl.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=reloj.kjsl.com" }, { "U.S. CA #5", "time.five-ten-sg.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.five-ten-sg.com" }, { "U.S. DE", "louie.udel.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=louie.udel.edu" }, { "U.S. GA", "ntp.shorty.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.shorty.com" }, { "U.S. GA #2", "rolex.usg.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=rolex.usg.edu" }, { "U.S. GA #3", "timex.usg.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=timex.usg.edu" }, { "U.S. IL", "ntp-0.cso.uiuc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-0.cso.uiuc.edu" }, { "U.S. IL #2", "ntp-1.cso.uiuc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-1.cso.uiuc.edu" }, { "U.S. IL #3", "ntp-1.mcs.anl.gov", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-1.mcs.anl.gov" }, { "U.S. IL #4", "ntp-2.cso.uiuc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-2.cso.uiuc.edu" }, { "U.S. IL #5", "ntp-2.mcs.anl.gov", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-2.mcs.anl.gov" }, { "U.S. IN", "gilbreth.ecn.purdue.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=gilbreth.ecn.purdue.edu" }, { "U.S. IN #2", "harbor.ecn.purdue.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=harbor.ecn.purdue.edu" }, { "U.S. IN #3", "molecule.ecn.purdue.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=molecule.ecn.purdue.edu" }, { "U.S. KS", "ntp1.kansas.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.kansas.net" }, { "U.S. KS #2", "ntp2.kansas.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.kansas.net" }, { "U.S. MA", "ntp.ourconcord.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.ourconcord.net" }, { "U.S. MA #2", "timeserver.cs.umb.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=timeserver.cs.umb.edu" }, { "U.S. MN", "ns.nts.umn.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ns.nts.umn.edu" }, { "U.S. MN #2", "nss.nts.umn.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=nss.nts.umn.edu" }, { "U.S. MO", "time-ext.missouri.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time-ext.missouri.edu" }, { "U.S. MT", "chronos1.umt.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=chronos1.umt.edu" }, { "U.S. MT #2", "chronos2.umt.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=chronos2.umt.edu" }, { "U.S. MT #3", "chronos3.umt.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=chronos3.umt.edu" }, { "U.S. NC", "clock1.unc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock1.unc.edu" }, { "U.S. NV", "cuckoo.nevada.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=cuckoo.nevada.edu" }, { "U.S. NV #2", "tick.cs.unlv.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tick.cs.unlv.edu" }, { "U.S. NV #3", "tock.cs.unlv.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tock.cs.unlv.edu" }, { "U.S. NY", "clock.linuxshell.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock.linuxshell.net" }, { "U.S. NY #2", "ntp.ctr.columbia.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.ctr.columbia.edu" }, { "U.S. NY #3", "ntp0.cornell.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp0.cornell.edu" }, { "U.S. NY #4", "ntp1.mpis.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.mpis.net" }, { "U.S. NY #5", "ntp2.mpis.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.mpis.net" }, { "U.S. NY #6", "sundial.columbia.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=sundial.columbia.edu" }, { "U.S. NY #7", "timex.cs.columbia.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=timex.cs.columbia.edu" }, { "U.S. OK", "constellation.ecn.uoknor.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=constellation.ecn.uoknor.edu" }, { "U.S. PA", "clock-1.cs.cmu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock-1.cs.cmu.edu" }, { "U.S. PA #2", "clock-2.cs.cmu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock-2.cs.cmu.edu" }, { "U.S. PA #3", "clock.psu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock.psu.edu" }, { "U.S. PA #4", "fuzz.psc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=fuzz.psc.edu" }, { "U.S. PA #5", "ntp-1.ece.cmu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-1.ece.cmu.edu" }, { "U.S. PA #6", "ntp-2.ece.cmu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-2.ece.cmu.edu" }, { "U.S. TX", "ntp.cox.smu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.cox.smu.edu" }, { "U.S. TX #2", "ntp.fnbhs.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.fnbhs.com" }, { "U.S. TX #3", "ntp.tmc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.tmc.edu" }, { "U.S. TX #4", "ntp5.tamu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp5.tamu.edu" }, { "U.S. TX #5", "tick.greyware.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tick.greyware.com" }, { "U.S. TX #6", "tock.greyware.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tock.greyware.com" }, { "U.S. VA", "ntp-1.vt.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-1.vt.edu" }, { "U.S. VA #2", "ntp-2.vt.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-2.vt.edu" }, { "U.S. VA #3", "ntp.cmr.gov", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.cmr.gov" }, { "U.S. VT", "ntp0.state.vt.us", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp0.state.vt.us" }, { "U.S. VT #2", "ntp1.state.vt.us", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.state.vt.us" }, { "U.S. VT #3", "ntp2.state.vt.us", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.state.vt.us" }, { "U.S. WA", "clock.tricity.wsu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock.tricity.wsu.edu" }, { "U.S. WA #2", "ntp.tcp-udp.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.tcp-udp.net" }, { "U.S. WI", "ntp1.cs.wisc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.cs.wisc.edu" }, { "U.S. WI #2", "ntp3.cs.wisc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp3.cs.wisc.edu" }, { "Venezuela", "ntp.linux.org.ve", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.linux.org.ve" }, { "South Africa", "ntp.cs.unp.ac.za", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.cs.unp.ac.za" }, { 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, { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "2 Font", "Choose an alternate screen font", NULL, dmenuSubmenu, NULL, &MenuSysconsFont }, { "3 Keymap", "Choose an alternate keyboard map", NULL, dmenuSubmenu, NULL, &MenuSysconsKeymap }, { "4 Repeat", "Set the rate at which keys repeat", NULL, dmenuSubmenu, NULL, &MenuSysconsKeyrate }, { "5 Saver", "Configure the screen saver", NULL, dmenuSubmenu, NULL, &MenuSysconsSaver }, { "6 Screenmap", "Choose an alternate screenmap", NULL, dmenuSubmenu, NULL, &MenuSysconsScrnmap }, { "7 Ttys", "Choose console terminal type", NULL, dmenuSubmenu, NULL, &MenuSysconsTtys }, { NULL } }, }; #ifdef PC98 DMenu MenuSysconsKeymap = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "System Console Keymap", "The default system console driver for FreeBSD (syscons) defaults\n" "to a standard \"PC-98x1\" keyboard map. Users may wish to choose\n" "one of the other keymaps below.\n" "Note that sysinstall itself only uses the part of the keyboard map\n" "which is required to generate the ANSI character subset, but your\n" "choice of keymap will also be saved for later (fuller) use.", "Choose a keyboard map", NULL, { { "Japanese PC-98x1", "Japanese PC-98x1 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=jp.pc98" }, { " Japanese PC-98x1 (ISO)", "Japanese PC-98x1 (ISO) keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=jp.pc98.iso" }, { NULL } }, }; #else DMenu MenuSysconsKeymap = { DMENU_NORMAL_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.\n" "Note that sysinstall itself only uses the part of the keyboard map\n" "which is required to generate the ANSI character subset, but your\n" "choice of keymap will also be saved for later (fuller) use.", "Choose a keyboard map", NULL, { { "Belgian", "Belgian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=be.iso" }, { " Brazil CP850", "Brazil CP850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=br275.cp850" }, { " Brazil ISO (accent)", "Brazil ISO keymap (accent keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=br275.iso.acc" }, { " Brazil ISO", "Brazil ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=br275.iso" }, { " Bulgarian BDS", "Bulgarian BDS keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=bg.bds.ctrlcaps" }, { " Bulgarian Phonetic", "Bulgarian Phonetic keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=bg.phonetic.ctrlcaps" }, { " Croatian ISO", "Croatian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=hr.iso" }, { " Czech ISO (accent)", "Czech ISO keymap (accent keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=cs.latin2.qwertz" }, { "Danish CP865", "Danish Code Page 865 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=danish.cp865" }, { " Danish ISO", "Danish ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=danish.iso" }, { "Estonian ISO", "Estonian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=estonian.iso" }, { " Estonian ISO 15", "Estonian ISO 8859-15 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=estonian.iso15" }, { " Estonian CP850", "Estonian Code Page 850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=estonian.cp850" }, { "Finnish CP850","Finnish Code Page 850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=finnish.cp850" }, { " Finnish ISO", "Finnish ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=finnish.iso" }, { " French ISO (accent)", "French ISO keymap (accent keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=fr.iso.acc" }, { " French ISO", "French ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=fr.iso" }, { "German CP850", "German Code Page 850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=german.cp850" }, { " German ISO", "German ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=german.iso" }, { "Hungarian 101", "Hungarian ISO keymap (101 key)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=hu.iso2.101keys" }, { " Hungarian 102", "Hungarian ISO keymap (102 key)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=hu.iso2.102keys" }, { "Icelandic (accent)", "Icelandic ISO keymap (accent keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=icelandic.iso.acc" }, { " Icelandic", "Icelandic ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=icelandic.iso" }, { " Italian", "Italian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=it.iso" }, { "Japanese 106", "Japanese 106 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=jp.106" }, { "Latin American", "Latin American ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=lat-amer" }, { "Norway ISO", "Norwegian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=norwegian.iso" }, { "Polish ISO", "Polish ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=pl_PL.ISO8859-2" }, { " Portuguese (accent)", "Portuguese ISO keymap (accent keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=pt.iso.acc" }, { " Portuguese", "Portuguese ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=pt.iso" }, { "Russia KOI8-R", "Russian KOI8-R keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=ru.koi8-r" }, { "Slovenian", "Slovenian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=si.iso" }, { " Spanish (accent)", "Spanish ISO keymap (accent keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=spanish.iso.acc" }, { " Spanish", "Spanish ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=spanish.iso" }, { " Swedish CP850", "Swedish Code Page 850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swedish.cp850" }, { " Swedish ISO", "Swedish ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swedish.iso" }, { " Swiss French ISO (accent)", "Swiss French ISO keymap (accent keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swissfrench.iso.acc" }, { " Swiss French ISO", "Swiss French ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swissfrench.iso" }, { " Swiss French CP850", "Swiss French Code Page 850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swissfrench.cp850" }, { " Swiss German ISO (accent)", "Swiss German ISO keymap (accent keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swissgerman.iso.acc" }, { " Swiss German ISO", "Swiss German ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swissgerman.iso" }, { " Swiss German CP850", "Swiss German Code Page 850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swissgerman.cp850" }, { "UK CP850", "UK Code Page 850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=uk.cp850" }, { " UK ISO", "UK ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=uk.iso" }, { " Ukrainian KOI8-U", "Ukrainian KOI8-U keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=ua.koi8-u" }, { " Ukrainian KOI8-U+KOI8-R", "Ukrainian KOI8-U+KOI8-R keymap (alter)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=ua.koi8-u.shift.alt" }, { " USA CapsLock->Ctrl", "US standard (Caps as L-Control)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=us.pc-ctrl" }, { " USA Dvorak", "US Dvorak keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=us.dvorak" }, { " USA Dvorak (left)", "US left handed Dvorak keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=us.dvorakl" }, { " USA Dvorak (right)", "US right handed Dvorak keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=us.dvorakr" }, { " USA Emacs", "US standard optimized for EMACS", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=us.emacs" }, { " USA ISO", "US ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=us.iso" }, { " USA UNIX", "US traditional UNIX-workstation", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=us.unix" }, { NULL } }, }; #endif DMenu MenuSysconsKeyrate = { DMENU_NORMAL_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", dmenuVarCheck, dmenuSetVariable, NULL, "keyrate=slow" }, { "Normal", "\"Normal\" keyboard repeat rate", dmenuVarCheck, dmenuSetVariable, NULL, "keyrate=normal" }, { "Fast", "Fast keyboard repeat rate", dmenuVarCheck, dmenuSetVariable, NULL, "keyrate=fast" }, { "Default", "Use default keyboard repeat rate", dmenuVarCheck, dmenuSetVariable, NULL, "keyrate=NO" }, { NULL } }, }; DMenu MenuSysconsSaver = { DMENU_NORMAL_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, { { "1 Blank", "Simply blank the screen", dmenuVarCheck, configSaver, NULL, "saver=blank" }, { "2 Daemon", "\"BSD Daemon\" animated screen saver (text)", dmenuVarCheck, configSaver, NULL, "saver=daemon" }, { "3 Fade", "Fade out effect screen saver", dmenuVarCheck, configSaver, NULL, "saver=fade" }, { "4 Fire", "Flames effect screen saver", dmenuVarCheck, configSaver, NULL, "saver=fire" }, { "5 Green", "\"Green\" power saving mode (if supported by monitor)", dmenuVarCheck, configSaver, NULL, "saver=green" }, { "6 Logo", "\"BSD Daemon\" animated screen saver (graphics)", dmenuVarCheck, configSaver, NULL, "saver=logo" }, { "7 Rain", "Rain drops screen saver", dmenuVarCheck, configSaver, NULL, "saver=rain" }, { "8 Snake", "Draw a FreeBSD \"snake\" on your screen", dmenuVarCheck, configSaver, NULL, "saver=snake" }, { "9 Star", "A \"twinkling stars\" effect", dmenuVarCheck, configSaver, NULL, "saver=star" }, { "Warp", "A \"stars warping\" effect", dmenuVarCheck, configSaver, NULL, "saver=warp" }, { "Timeout", "Set the screen saver timeout interval", NULL, configSaverTimeout, NULL, NULL, ' ', ' ', ' ' }, { NULL } }, }; DMenu MenuSysconsScrnmap = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "System Console Screenmap", "Unless you load a specific font, most PC hardware defaults to\n" "displaying characters in the IBM 437 character set. However,\n" "in the Unix world, this character set is very rarely used. Most\n" "Western European countries, for example, prefer ISO 8859-1.\n" "American users won't notice the difference since the bottom half\n" "of all these character sets is ANSI anyway.\n" "If your hardware is capable of downloading a new display font,\n" "you should probably choose that option. However, for hardware\n" "where this is not possible (e.g. monochrome adapters), a screen\n" "map will give you the best approximation that your hardware can\n" "display at all.", "Choose a screen map", NULL, { { "1 None", "No screenmap, don't touch font", dmenuVarCheck, dmenuSetVariable, NULL, "scrnmap=NO" }, { "2 ISO 8859-1 to IBM437", "W-Europe ISO 8859-1 to IBM 437 screenmap", dmenuVarCheck, dmenuSetVariable, NULL, "scrnmap=iso-8859-1_to_cp437" }, { "3 ISO 8859-7 to IBM437", "Greek ISO 8859-7 to IBM 437 screenmap", dmenuVarCheck, dmenuSetVariable, NULL, "scrnmap=iso-8859-7_to_cp437" }, { "4 US-ASCII to IBM437", "US-ASCII to IBM 437 screenmap", dmenuVarCheck, dmenuSetVariable, NULL, "scrnmap=us-ascii_to_cp437" }, { "5 KOI8-R to IBM866", "Russian KOI8-R to IBM 866 screenmap", dmenuVarCheck, dmenuSetVariable, NULL, "scrnmap=koi8-r2cp866" }, { "6 KOI8-U to IBM866u", "Ukrainian KOI8-U to IBM 866u screenmap", dmenuVarCheck, dmenuSetVariable, NULL, "scrnmap=koi8-u2cp866u" }, { NULL } }, }; DMenu MenuSysconsTtys = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "System Console Terminal Type", "For various console encodings, a corresponding terminal type\n" "must be chosen in /etc/ttys.\n\n" "WARNING: For compatibility reasons, only entries starting with\n" "ttyv and terminal types starting with cons[0-9] can be changed\n" "via this menu.\n", "Choose a terminal type", NULL, { { "1 None", "Don't touch anything", dmenuVarCheck, dmenuSetVariable, NULL, VAR_CONSTERM "=NO" }, { "2 IBM437 (VGA default)", "cons25", dmenuVarCheck, dmenuSetVariable, NULL, VAR_CONSTERM "=cons25" }, { "3 ISO 8859-1", "cons25l1", dmenuVarCheck, dmenuSetVariable, NULL, VAR_CONSTERM "=cons25l1" }, { "4 ISO 8859-2", "cons25l2", dmenuVarCheck, dmenuSetVariable, NULL, VAR_CONSTERM "=cons25l2" }, { "5 ISO 8859-7", "cons25l7", dmenuVarCheck, dmenuSetVariable, NULL, VAR_CONSTERM "=cons25l7" }, { "6 KOI8-R", "cons25r", dmenuVarCheck, dmenuSetVariable, NULL, VAR_CONSTERM "=cons25r" }, { "7 KOI8-U", "cons25u", dmenuVarCheck, dmenuSetVariable, NULL, VAR_CONSTERM "=cons25u" }, { "8 US-ASCII", "cons25w", dmenuVarCheck, dmenuSetVariable, NULL, VAR_CONSTERM "=cons25w" }, { NULL } }, }; DMenu MenuSysconsFont = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "System Console Font", "Most PC hardware defaults to displaying characters in the\n" "IBM 437 character set. However, in the Unix world, this\n" "character set is very rarely used. Most Western European\n" "countries, for example, prefer ISO 8859-1.\n" "American users won't notice the difference since the bottom half\n" "of all these charactersets is ANSI anyway. However, they might\n" "want to load a font anyway to use the 30- or 50-line displays.\n" "If your hardware is capable of downloading a new display font,\n" "you can select the appropriate font below.", "Choose a font", NULL, { { "1 None", "Use hardware default font", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=NO,font8x14=NO,font8x16=NO" }, { "2 IBM 437", "English and others, VGA default", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp437-8x8,font8x14=cp437-8x14,font8x16=cp437-8x16" }, { "3 IBM 850", "Western Europe, IBM encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp850-8x8,font8x14=cp850-8x14,font8x16=cp850-8x16" }, { "4 IBM 865", "Norwegian, IBM encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp865-8x8,font8x14=cp865-8x14,font8x16=cp865-8x16" }, { "5 IBM 866", "Russian, IBM encoding (use with KOI8-R screenmap)", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp866-8x8,font8x14=cp866-8x14,font8x16=cp866b-8x16,mousechar_start=3" }, { "6 IBM 866u", "Ukrainian, IBM encoding (use with KOI8-U screenmap)", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp866u-8x8,font8x14=cp866u-8x14,font8x16=cp866u-8x16,mousechar_start=3" }, { "7 IBM 1251", "Cyrillic, MS Windows encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp1251-8x8,font8x14=cp1251-8x14,font8x16=cp1251-8x16,mousechar_start=3" }, { "8 ISO 8859-1", "Western Europe, ISO encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=iso-8x8,font8x14=iso-8x14,font8x16=iso-8x16" }, { "9 ISO 8859-2", "Eastern Europe, ISO encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=iso02-8x8,font8x14=iso02-8x14,font8x16=iso02-8x16" }, { "a ISO 8859-4", "Baltic, ISO encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=iso04-8x8,font8x14=iso04-8x14,font8x16=iso04-8x16" }, { "b ISO 8859-7", "Greek, ISO encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=iso07-8x8,font8x14=iso07-8x14,font8x16=iso07-8x16" }, { "c ISO 8859-8", "Hebrew, ISO encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=iso08-8x8,font8x14=iso08-8x14,font8x16=iso08-8x16" }, { "d ISO 8859-15", "Europe, ISO encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=iso15-8x8,font8x14=iso15-8x14,font8x16=iso15-8x16" }, { "e SWISS", "English, better resolution", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=swiss-8x8,font8x14=NO,font8x16=swiss-8x16" }, { NULL } }, }; DMenu MenuUsermgmt = { DMENU_NORMAL_TYPE, "User and group management", "The submenus here allow to manipulate user groups and\n" "login accounts.\n", "Configure your user groups and users", NULL, { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "User", "Add a new user to the system.", NULL, userAddUser }, { "Group", "Add a new user group to the system.", NULL, userAddGroup }, { NULL } }, }; DMenu MenuSecurity = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "System Security Options Menu", "This menu allows you to configure aspects of the operating system security\n" "policy. Please read the system documentation carefully before modifying\n" "these settings, as they may cause service disruption if used improperly.\n" "\n" "Most settings will take affect only following a system reboot.", "Configure system security options", NULL, { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { " Security Profile", "Select a security profile for the system", NULL, configSecurityProfile }, { " LOMAC", "Use Low Watermark Mandatory Access Control at boot", dmenuVarCheck, dmenuToggleVariable, NULL, "lomac_enable=YES" }, { " NFS port", "Require that the NFS clients used reserved ports", dmenuVarCheck, dmenuToggleVariable, NULL, "nfs_reserved_port_only=YES" }, { NULL } }, }; DMenu MenuSecurityProfile = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Default system security profile", "Each item in this list will set what it considers to\n" "be \"appropriate\" values in that category for various\n" "security-related knobs in /etc/rc.conf.", "Select a canned security profile - F1 for help", "security", /* help file */ { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "Medium", "Moderate security settings.", NULL, configSecurityModerate }, { "Extreme", "Very restrictive security settings.", NULL, configSecurityExtreme }, { NULL } }, }; DMenu MenuFixit = { DMENU_NORMAL_TYPE, "Please choose a fixit option", "There are three ways of going into \"fixit\" mode:\n" "- you can use the live filesystem CDROM/DVD, in which case there will be\n" " full access to the complete set of FreeBSD commands and utilities,\n" "- you can use the more limited (but perhaps customized) fixit floppy,\n" "- or you can start an Emergency Holographic Shell now, which is\n" " limited to the subset of commands that is already available right now.", "Press F1 for more detailed repair instructions", "fixit", { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "2 CDROM/DVD", "Use the \"live\" filesystem CDROM/DVD", NULL, installFixitCDROM }, { "3 Floppy", "Use a floppy generated from the fixit image", NULL, installFixitFloppy }, { "4 Shell", "Start an Emergency Holographic Shell", NULL, installFixitHoloShell }, { NULL } }, }; Index: head/usr.sbin/sysinstall/system.c =================================================================== --- head/usr.sbin/sysinstall/system.c (revision 104939) +++ head/usr.sbin/sysinstall/system.c (revision 104940) @@ -1,537 +1,537 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * * $FreeBSD$ * * Jordan Hubbard * * My contributions are in the public domain. * * Parts of this file are also blatently stolen from Poul-Henning Kamp's * previous version of sysinstall, and as such fall under his "BEERWARE license" * so buy him a beer if you like it! Buy him a beer for me, too! * Heck, get him completely drunk and send me pictures! :-) */ #include "sysinstall.h" #include #include #include #include #include #include #include #include #include /* Where we stick our temporary expanded doc file */ #define DOC_TMP_DIR "/tmp/.doc" #define DOC_TMP_FILE "/tmp/.doc/doc.tmp" static pid_t ehs_pid; /* * Handle interrupt signals - this probably won't work in all cases * due to our having bogotified the internal state of dialog or curses, * but we'll give it a try. */ static int intr_continue(dialogMenuItem *self) { return DITEM_LEAVE_MENU; } static int intr_reboot(dialogMenuItem *self) { systemShutdown(-1); /* NOTREACHED */ return 0; } static int intr_restart(dialogMenuItem *self) { int ret, fd, fdmax; mediaClose(); free_variables(); fdmax = getdtablesize(); for (fd = 3; fd < fdmax; fd++) close(fd); ret = execl(StartName, StartName, "-restart", (char *)NULL); msgDebug("execl failed (%s)\n", strerror(errno)); /* NOTREACHED */ return -1; } static dialogMenuItem intrmenu[] = { { "Abort", "Abort the installation", NULL, intr_reboot }, { "Restart", "Restart the installation program", NULL, intr_restart }, { "Continue", "Continue the installation", NULL, intr_continue }, }; static void handle_intr(int sig) { WINDOW *save = savescr(); use_helpline(NULL); use_helpfile(NULL); if (OnVTY) { ioctl(0, VT_ACTIVATE, 1); /* Switch back */ msgInfo(NULL); } (void)dialog_menu("Installation interrupt", "Do you want to abort the installation?", -1, -1, 3, -3, intrmenu, NULL, NULL, NULL); restorescr(save); } /* * Harvest children if we are init. */ static void reap_children(int sig) { int errbak = errno; while (waitpid(-1, NULL, WNOHANG) > 0) ; errno = errbak; } /* Expand a file into a convenient location, nuking it each time */ static char * expand(char *fname) { char *gunzip = RunningAsInit ? "/stand/gunzip" : "/usr/bin/gunzip"; if (!directory_exists(DOC_TMP_DIR)) { Mkdir(DOC_TMP_DIR); if (chown(DOC_TMP_DIR, 0, 0) < 0) return NULL; if (chmod(DOC_TMP_DIR, S_IRWXU) < 0) return NULL; } else unlink(DOC_TMP_FILE); if (!file_readable(fname) || vsystem("%s < %s > %s", gunzip, fname, DOC_TMP_FILE)) return NULL; return DOC_TMP_FILE; } /* Initialize system defaults */ void systemInitialize(int argc, char **argv) { size_t i; int boothowto; sigset_t signalset; signal(SIGINT, SIG_IGN); globalsInit(); i = sizeof(boothowto); if (!sysctlbyname("debug.boothowto", &boothowto, &i, NULL, NULL) && (i == sizeof(boothowto)) && (boothowto & RB_VERBOSE)) variable_set2(VAR_DEBUG, "YES", 0); /* Are we running as init? */ if (getpid() == 1) { int fd; RunningAsInit = 1; setsid(); close(0); fd = open("/dev/ttyv0", O_RDWR); if (fd == -1) { fd = open("/dev/console", O_RDWR); /* fallback */ variable_set2(VAR_FIXIT_TTY, "serial", 0); /* give fixit a hint */ } else OnVTY = TRUE; /* * To make _sure_ we're on a VTY and don't have /dev/console switched * away to a serial port or something, attempt to set the cursor appearance. */ if (OnVTY) { int fd2, type; type = 0; /* normal */ if ((fd2 = open("/dev/console", O_RDWR)) != -1) { if (ioctl(fd2, CONS_CURSORTYPE, &type) == -1) { OnVTY = FALSE; variable_set2(VAR_FIXIT_TTY, "serial", 0); /* Tell Fixit the console type */ close(fd); close(fd2); open("/dev/console", O_RDWR); } else close(fd2); } } close(1); dup(0); close(2); dup(0); printf("%s running as init on %s\n", argv[0], OnVTY ? "vty0" : "serial console"); ioctl(0, TIOCSCTTY, (char *)NULL); setlogin("root"); setenv("PATH", "/stand:/bin:/sbin:/usr/sbin:/usr/bin:/mnt/bin:/mnt/sbin:/mnt/usr/sbin:/mnt/usr/bin:/usr/X11R6/bin", 1); setbuf(stdin, 0); setbuf(stderr, 0); #ifdef __alpha__ i = 0; sysctlbyname("machdep.unaligned_print", NULL, 0, &i, sizeof(i)); #endif #if 0 signal(SIGCHLD, reap_children); #endif } else { char hname[256]; /* Initalize various things for a multi-user environment */ if (!gethostname(hname, sizeof hname)) variable_set2(VAR_HOSTNAME, hname, 0); } if (set_termcap() == -1) { printf("Can't find terminal entry\n"); exit(-1); } /* XXX - libdialog has particularly bad return value checking */ init_dialog(); /* If we haven't crashed I guess dialog is running ! */ DialogActive = TRUE; /* Make sure HOME is set for those utilities that need it */ if (!getenv("HOME")) setenv("HOME", "/", 1); signal(SIGINT, handle_intr); /* * Make sure we can be interrupted even if we were re-executed * from an interrupt. */ sigemptyset(&signalset); sigaddset(&signalset, SIGINT); sigprocmask(SIG_UNBLOCK, &signalset, NULL); (void)vsystem("rm -rf %s", DOC_TMP_DIR); } /* Close down and prepare to exit */ void systemShutdown(int status) { /* If some media is open, close it down */ if (status >=0) mediaClose(); /* write out any changes to rc.conf .. */ configRC_conf(); /* Shut down the dialog library */ if (DialogActive) { end_dialog(); DialogActive = FALSE; } /* Shut down curses */ endwin(); /* If we have a temporary doc dir lying around, nuke it */ (void)vsystem("rm -rf %s", DOC_TMP_DIR); /* REALLY exit! */ if (RunningAsInit) { /* Put the console back */ ioctl(0, VT_ACTIVATE, 2); -#ifdef __alpha__ +#if defined(__alpha__) || defined(__sparc64__) reboot(RB_HALT); #else reboot(0); #endif } else exit(status); } /* Run some general command */ int systemExecute(char *command) { int status; struct termios foo; WINDOW *w = savescr(); dialog_clear(); dialog_update(); end_dialog(); DialogActive = FALSE; if (tcgetattr(0, &foo) != -1) { foo.c_cc[VERASE] = '\010'; tcsetattr(0, TCSANOW, &foo); } if (!Fake) status = system(command); else { status = 0; msgDebug("systemExecute: Faked execution of `%s'\n", command); } DialogActive = TRUE; restorescr(w); return status; } /* suspend/resume libdialog/curses screen */ static WINDOW *oldW; void systemSuspendDialog(void) { oldW = savescr(); dialog_clear(); dialog_update(); end_dialog(); DialogActive = FALSE; } void systemResumeDialog(void) { DialogActive = TRUE; restorescr(oldW); } /* Display a help file in a filebox */ int systemDisplayHelp(char *file) { char *fname = NULL; char buf[FILENAME_MAX]; int ret = 0; WINDOW *w = savescr(); fname = systemHelpFile(file, buf); if (!fname) { snprintf(buf, FILENAME_MAX, "The %s file is not provided on this particular floppy image.", file); use_helpfile(NULL); use_helpline(NULL); dialog_mesgbox("Sorry!", buf, -1, -1); ret = 1; } else { use_helpfile(NULL); use_helpline(NULL); dialog_textbox(file, fname, LINES, COLS); } restorescr(w); return ret; } char * systemHelpFile(char *file, char *buf) { if (!file) return NULL; if (file[0] == '/') return file; snprintf(buf, FILENAME_MAX, "/stand/help/%s.hlp.gz", file); if (file_readable(buf)) return expand(buf); snprintf(buf, FILENAME_MAX, "/stand/help/%s.hlp", file); if (file_readable(buf)) return expand(buf); snprintf(buf, FILENAME_MAX, "/stand/help/%s.TXT.gz", file); if (file_readable(buf)) return expand(buf); snprintf(buf, FILENAME_MAX, "/stand/help/%s.TXT", file); if (file_readable(buf)) return expand(buf); snprintf(buf, FILENAME_MAX, "/usr/src/usr.sbin/sysinstall/help/%s.hlp", file); if (file_readable(buf)) return buf; snprintf(buf, FILENAME_MAX, "/usr/src/usr.sbin/sysinstall/help/%s.TXT", file); if (file_readable(buf)) return buf; return NULL; } void systemChangeTerminal(char *color, const u_char c_term[], char *mono, const u_char m_term[]) { if (OnVTY) { int setupterm(char *color, int, int *); if (ColorDisplay) { setenv("TERM", color, 1); setenv("TERMCAP", c_term, 1); reset_shell_mode(); setterm(color); cbreak(); noecho(); } else { setenv("TERM", mono, 1); setenv("TERMCAP", m_term, 1); reset_shell_mode(); setterm(mono); cbreak(); noecho(); } } clear(); refresh(); dialog_clear(); } int vsystem(char *fmt, ...) { va_list args; int pstat; pid_t pid; int omask; sig_t intsave, quitsave; char *cmd; int i; cmd = (char *)alloca(FILENAME_MAX); cmd[0] = '\0'; va_start(args, fmt); vsnprintf(cmd, FILENAME_MAX, fmt, args); va_end(args); omask = sigblock(sigmask(SIGCHLD)); if (Fake) { msgDebug("vsystem: Faked execution of `%s'\n", cmd); return 0; } if (isDebug()) msgDebug("Executing command `%s'\n", cmd); pid = fork(); if (pid == -1) { (void)sigsetmask(omask); i = 127; } else if (!pid) { /* Junior */ (void)sigsetmask(omask); if (DebugFD != -1) { dup2(DebugFD, 0); dup2(DebugFD, 1); dup2(DebugFD, 2); } else { close(1); open("/dev/null", O_WRONLY); dup2(1, 2); } if (!RunningAsInit) execl("/bin/sh", "/bin/sh", "-c", cmd, (char *)NULL); else execl("/stand/sh", "/stand/sh", "-c", cmd, (char *)NULL); exit(1); } else { intsave = signal(SIGINT, SIG_IGN); quitsave = signal(SIGQUIT, SIG_IGN); pid = waitpid(pid, &pstat, 0); (void)sigsetmask(omask); (void)signal(SIGINT, intsave); (void)signal(SIGQUIT, quitsave); i = (pid == -1) ? -1 : WEXITSTATUS(pstat); if (isDebug()) msgDebug("Command `%s' returns status of %d\n", cmd, i); } return i; } void systemCreateHoloshell(void) { int waitstatus; if ((FixItMode || OnVTY) && RunningAsInit) { if (ehs_pid != 0) { int pstat; if (kill(ehs_pid, 0) == 0) { if (msgNoYes("There seems to be an emergency holographic shell\n" "already running on VTY 4.\n\n" "Kill it and start a new one?")) return; /* try cleaning up as much as possible */ (void) kill(ehs_pid, SIGHUP); sleep(1); (void) kill(ehs_pid, SIGKILL); } /* avoid too many zombies */ (void) waitpid(ehs_pid, &pstat, WNOHANG); } if (strcmp(variable_get(VAR_FIXIT_TTY), "serial") == 0) systemSuspendDialog(); /* must be before the fork() */ if ((ehs_pid = fork()) == 0) { int i, fd; struct termios foo; extern int login_tty(int); ioctl(0, TIOCNOTTY, NULL); for (i = getdtablesize(); i >= 0; --i) close(i); if (strcmp(variable_get(VAR_FIXIT_TTY), "serial") == 0) fd = open("/dev/console", O_RDWR); else fd = open("/dev/ttyv3", O_RDWR); ioctl(0, TIOCSCTTY, &fd); dup2(0, 1); dup2(0, 2); DebugFD = 2; if (login_tty(fd) == -1) msgDebug("Doctor: I can't set the controlling terminal.\n"); signal(SIGTTOU, SIG_IGN); if (tcgetattr(fd, &foo) != -1) { foo.c_cc[VERASE] = '\010'; if (tcsetattr(fd, TCSANOW, &foo) == -1) msgDebug("Doctor: I'm unable to set the erase character.\n"); } else msgDebug("Doctor: I'm unable to get the terminal attributes!\n"); if (strcmp(variable_get(VAR_FIXIT_TTY), "serial") == 0) { printf("Type ``exit'' in this fixit shell to resume sysinstall.\n\n"); fflush(stdout); } execlp("sh", "-sh", 0); msgDebug("Was unable to execute sh for Holographic shell!\n"); exit(1); } else { if (strcmp(variable_get(VAR_FIXIT_TTY), "standard") == 0) { WINDOW *w = savescr(); msgNotify("Starting an emergency holographic shell on VTY4"); sleep(2); restorescr(w); } else { (void)waitpid(ehs_pid, &waitstatus, 0); /* we only wait for shell to finish it serial mode since there is no virtual console */ systemResumeDialog(); } } } }