diff --git a/release/sysinstall/Makefile b/release/sysinstall/Makefile index 0be2955ec6aa..e837479c6334 100644 --- a/release/sysinstall/Makefile +++ b/release/sysinstall/Makefile @@ -1,85 +1,85 @@ PROG= sysinstall MAN8= sysinstall.8 BINDIR=/stand NOSHARED=YES CLEANFILES+= makedevs.c rtermcap rtermcap.tmp dumpnlist CLEANFILES+= keymap.tmp keymap.h .PATH: ${.CURDIR}/../disklabel ${.CURDIR}/../../usr.bin/cksum SRCS= anonFTP.c cdrom.c command.c config.c devices.c kget.c \ disks.c dispatch.c dist.c dmenu.c doc.c dos.c floppy.c \ ftp.c globals.c index.c install.c installUpgrade.c keymap.c \ label.c lndir.c main.c makedevs.c media.c menus.c misc.c mouse.c \ - msg.c network.c nfs.c options.c package.c register.c system.c \ + msg.c network.c nfs.c options.c package.c system.c \ tape.c tcpip.c termcap.c ufs.c user.c variable.c wizard.c \ keymap.h CFLAGS+= -Wall -I${.CURDIR}/../../gnu/lib/libdialog -I${.OBJDIR} CFLAGS+= -I${.CURDIR}/../../sys CFLAGS+= -DUC_PRIVATE -DKERN_NO_SYMBOLS DPADD= ${LIBDIALOG} ${LIBNCURSES} ${LIBMYTINFO} ${LIBUTIL} ${LIBDISK} ${LIBFTPIO} LDADD= -ldialog -lncurses -lmytinfo -lutil -ldisk -lftpio makedevs.c: Makefile rtermcap keymap.h rm -f makedevs.tmp echo '#include ' > makedevs.tmp ./rtermcap ansi | \ file2c 'const char termcap_ansi[] = {' ',0};' \ >> makedevs.tmp ./rtermcap cons25 | \ file2c 'const char termcap_cons25[] = {' ',0};' \ >> makedevs.tmp ./rtermcap cons25-m | \ file2c 'const char termcap_cons25_m[] = {' ',0};' \ >> makedevs.tmp ./rtermcap cons25r | \ file2c 'const char termcap_cons25r[] = {' ',0};' \ >> makedevs.tmp ./rtermcap cons25r-m | \ file2c 'const char termcap_cons25r_m[] = {' ',0};' \ >> makedevs.tmp ./rtermcap cons25l1 | \ file2c 'const char termcap_cons25l1[] = {' ',0};' \ >> makedevs.tmp ./rtermcap cons25l1-m | \ file2c 'const char termcap_cons25l1_m[] = {' ',0};' \ >> makedevs.tmp ./rtermcap vt100 | \ file2c 'const char termcap_vt100[] = {' ',0};' \ >> makedevs.tmp .if ${MACHINE_ARCH} != "alpha" file2c 'u_char boot0[] = {' '};' < /boot/boot0 >> makedevs.tmp .endif mv makedevs.tmp makedevs.c rtermcap: ${.CURDIR}/rtermcap.c ${CC} -o rtermcap ${.CURDIR}/rtermcap.c -ltermcap KEYMAPS= be.iso br275.iso danish.iso finnish.iso fr.iso \ german.iso hr.iso hu.iso2.101keys it.iso icelandic.iso jp.106 \ norwegian.iso pl_PL.ISO_8859-2 pt.iso ru.koi8-r si.iso \ spanish.iso swedish.iso swissfrench.iso swissgerman.iso uk.iso \ us.dvorak us.iso keymap.h: rm -f keymap.tmp for map in ${KEYMAPS} ; do \ kbdcontrol -L $$map | \ sed -e '/^static accentmap_t/,$$d' >> keymap.tmp ; \ done echo "static struct keymapInfo keymapInfos[] = {" >> keymap.tmp for map in ${KEYMAPS} ; do \ echo -n ' { "'$$map'", ' >> keymap.tmp ; \ echo "&keymap_$$map }," | tr '[-.]' '_' >> keymap.tmp ; \ done ( echo " { 0 }"; echo "};" ; echo "" ) >> keymap.tmp mv keymap.tmp keymap.h .include diff --git a/release/sysinstall/config.c b/release/sysinstall/config.c index 74cd5155634d..3ae09a184796 100644 --- a/release/sysinstall/config.c +++ b/release/sysinstall/config.c @@ -1,741 +1,735 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: config.c,v 1.123 1999/02/14 07:35:27 jkh Exp $ + * $Id: config.c,v 1.124 1999/02/14 21:35:01 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer, * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * 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 #include #include static Chunk *chunk_list[MAX_CHUNKS]; static int nchunks; static int rootdev_is_od; /* arg to sort */ static int chunk_compare(Chunk *c1, Chunk *c2) { if (!c1 && !c2) return 0; else if (!c1 && c2) return 1; else if (c1 && !c2) return -1; else if (!c1->private_data && !c2->private_data) return 0; else if (c1->private_data && !c2->private_data) return 1; else if (!c1->private_data && c2->private_data) return -1; else return strcmp(((PartInfo *)(c1->private_data))->mountpoint, ((PartInfo *)(c2->private_data))->mountpoint); } static void chunk_sort(void) { int i, j; for (i = 0; i < nchunks; i++) { for (j = 0; j < nchunks; j++) { if (chunk_compare(chunk_list[j], chunk_list[j + 1]) > 0) { Chunk *tmp = chunk_list[j]; chunk_list[j] = chunk_list[j + 1]; chunk_list[j + 1] = tmp; } } } } static void check_rootdev(Chunk **list, int n) { int i; Chunk *c; rootdev_is_od = 0; for (i = 0; i < n; i++) { c = *list++; if (c->type == part && (c->flags & CHUNK_IS_ROOT) && strncmp(c->disk->name, "od", 2) == 0) rootdev_is_od = 1; } } static char * name_of(Chunk *c1) { return c1->name; } static char * mount_point(Chunk *c1) { if (c1->type == part && c1->subtype == FS_SWAP) return "none"; else if (c1->type == part || c1->type == fat) return ((PartInfo *)c1->private_data)->mountpoint; return "/bogus"; } static char * fstype(Chunk *c1) { if (c1->type == fat) return "msdos"; else if (c1->type == part) { if (c1->subtype != FS_SWAP) return "ufs"; else return "swap"; } return "bogus"; } static char * fstype_short(Chunk *c1) { if (c1->type == part) { if (c1->subtype != FS_SWAP) { if (rootdev_is_od == 0 && strncmp(c1->name, "od", 2) == 0) return "rw,noauto"; else return "rw"; } else return "sw"; } else if (c1->type == fat) { if (strncmp(c1->name, "od", 2) == 0) return "ro,noauto"; else return "ro"; } return "bog"; } static int seq_num(Chunk *c1) { if (c1->type == part && c1->subtype != FS_SWAP) { if (rootdev_is_od == 0 && strncmp(c1->name, "od", 2) == 0) return 0; else if (c1->flags & CHUNK_IS_ROOT) return 1; else return 2; } return 0; } int configFstab(dialogMenuItem *self) { Device **devs; Disk *disk; FILE *fstab; int i, cnt; Chunk *c1, *c2; if (!RunningAsInit) { if (file_readable("/etc/fstab")) return DITEM_SUCCESS; else { msgConfirm("Attempting to rebuild your /etc/fstab file. Warning: If you had\n" "any CD devices in use before running sysinstall then they may NOT\n" "be found by this run!"); } } devs = deviceFind(NULL, DEVICE_TYPE_DISK); if (!devs) { msgConfirm("No disks found!"); return DITEM_FAILURE; } /* Record all the chunks */ nchunks = 0; for (i = 0; devs[i]; i++) { if (!devs[i]->enabled) continue; disk = (Disk *)devs[i]->private; 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)) chunk_list[nchunks++] = c2; } } else if (c1->type == fat && c1->private_data) chunk_list[nchunks++] = c1; } } chunk_list[nchunks] = 0; chunk_sort(); fstab = fopen("/etc/fstab", "w"); if (!fstab) { msgConfirm("Unable to create a new /etc/fstab file! Manual intervention\n" "will be required."); return DITEM_FAILURE; } check_rootdev(chunk_list, nchunks); /* Go for the burn */ msgDebug("Generating /etc/fstab file\n"); fprintf(fstab, "# Device\t\tMountpoint\tFStype\tOptions\t\tDump\tPass#\n"); for (i = 0; i < nchunks; i++) fprintf(fstab, "/dev/%s\t\t%s\t\t%s\t%s\t\t%d\t%d\n", name_of(chunk_list[i]), mount_point(chunk_list[i]), fstype(chunk_list[i]), fstype_short(chunk_list[i]), seq_num(chunk_list[i]), seq_num(chunk_list[i])); /* Now look for the CDROMs */ devs = deviceFind(NULL, DEVICE_TYPE_CDROM); cnt = deviceCount(devs); /* Write out the CDROM entries */ for (i = 0; i < cnt; i++) { char cdname[10]; sprintf(cdname, "/cdrom%s", i ? itoa(i) : ""); if (Mkdir(cdname)) msgConfirm("Unable to make mount point for: %s", cdname); else fprintf(fstab, "/dev/%s\t\t%s\tcd9660\tro,noauto\t0\t0\n", devs[i]->name, cdname); } /* And finally, a /proc. */ fprintf(fstab, "proc\t\t\t/proc\t\tprocfs\trw\t\t0\t0\n"); Mkdir("/proc"); fclose(fstab); if (isDebug()) msgDebug("Wrote out /etc/fstab file\n"); return DITEM_SUCCESS; } /* Do the work of sucking in a config file. * config is the filename to read in. * lines is a fixed (max) sized array of char* * returns number of lines read. line contents * are malloc'd and must be freed by the caller. */ int readConfig(char *config, char **lines, int max) { FILE *fp; char line[256]; int i, nlines; fp = fopen(config, "r"); if (!fp) return -1; nlines = 0; /* Read in the entire file */ for (i = 0; i < max; i++) { if (!fgets(line, sizeof line, fp)) break; lines[nlines++] = strdup(line); } fclose(fp); if (isDebug()) msgDebug("readConfig: Read %d lines from %s.\n", nlines, config); return nlines; } #define MAX_LINES 2000 /* Some big number we're not likely to ever reach - I'm being really lazy here, I know */ static void readConfigFile(char *config, int marked) { char *lines[MAX_LINES], *cp, *cp2; int i, nlines; nlines = readConfig(config, lines, MAX_LINES); if (nlines == -1) return; for (i = 0; i < nlines; i++) { /* Skip the comments & non-variable settings */ if (lines[i][0] == '#' || !(cp = index(lines[i], '='))) { free(lines[i]); continue; } *cp++ = '\0'; /* Find quotes */ if ((cp2 = index(cp, '"')) || (cp2 = index(cp, '\047'))) { cp = cp2 + 1; cp2 = index(cp, *cp2); } /* If valid quotes, use it */ if (cp2) { *cp2 = '\0'; /* If we have a legit value, set it */ if (strlen(cp)) variable_set2(lines[i], cp, marked); } free(lines[i]); } } /* Load the environment from rc.conf file(s) */ void configEnvironmentRC_conf(void) { static struct { char *fname; int marked; } configs[] = { { "/etc/defaults/rc.conf", 0 }, { "/etc/rc.conf", 0 }, { "/etc/rc.conf.local", 0 }, { NULL, 0 }, }; int i; for (i = 0; configs[i].fname; i++) { if (file_readable(configs[i].fname)) readConfigFile(configs[i].fname, configs[i].marked); } } /* Load the environment from a resolv.conf file */ void configEnvironmentResolv(char *config) { char *lines[MAX_LINES]; int i, nlines; nlines = readConfig(config, lines, MAX_LINES); if (nlines == -1) return; for (i = 0; i < nlines; i++) { Boolean name_set = (Boolean)variable_get(VAR_NAMESERVER); if (!strncmp(lines[i], "domain", 6) && !variable_get(VAR_DOMAINNAME)) variable_set2(VAR_DOMAINNAME, string_skipwhite(string_prune(lines[i] + 6)), 0); else if (!name_set && !strncmp(lines[i], "nameserver", 10)) { /* Only take the first nameserver setting - we're lame */ variable_set2(VAR_NAMESERVER, string_skipwhite(string_prune(lines[i] + 10)), 0); } free(lines[i]); } } /* Version of below for dispatch routines */ int configRC(dialogMenuItem *unused) { configRC_conf(); return DITEM_SUCCESS; } void configRC_conf(void) { FILE *rcSite; Variable *v; int write_header; static int did_marker = 0; write_header = !file_readable("/etc/rc.conf"); rcSite = fopen("/etc/rc.conf", "a"); if (!rcSite) return; if (write_header) { fprintf(rcSite, "# This file now contains just the overrides from /etc/defaults/rc.conf\n"); fprintf(rcSite, "# please make all changes to this file.\n\n"); } /* Now do variable substitutions */ for (v = VarHead; v; v = v->next) { if (v->dirty) { if (!did_marker) { fprintf(rcSite, "# -- sysinstall generated deltas -- #\n"); did_marker = 1; } fprintf(rcSite, "%s=\"%s\"\n", v->name, v->value); v->dirty = 0; } } fclose(rcSite); } int configSaver(dialogMenuItem *self) { variable_set((char *)self->data, 1); if (!variable_get(VAR_BLANKTIME)) variable_set2(VAR_BLANKTIME, "300", 1); return DITEM_SUCCESS; } int configSaverTimeout(dialogMenuItem *self) { return (variable_get_value(VAR_BLANKTIME, "Enter time-out period in seconds for screen saver", 1) ? DITEM_SUCCESS : DITEM_FAILURE) | DITEM_RESTORE; } -int -configRegister(dialogMenuItem *self) -{ - return DITEM_STATUS(registerOpenDialog()) | DITEM_RESTORE; -} - int configNTP(dialogMenuItem *self) { int status; status = variable_get_value(VAR_NTPDATE_FLAGS, "Enter the name of an NTP server", 1) ? DITEM_SUCCESS : DITEM_FAILURE; if (status == DITEM_SUCCESS) { static char tmp[255]; snprintf(tmp, sizeof(tmp), "ntpdate_enable=YES,ntpdate_flags=%s", variable_get(VAR_NTPDATE_FLAGS)); self->data = tmp; dmenuSetVariables(self); } return status | DITEM_RESTORE; } int configUsers(dialogMenuItem *self) { dialog_clear_norefresh(); dmenuOpenSimple(&MenuUsermgmt, FALSE); dialog_clear(); return DITEM_SUCCESS | DITEM_RESTORE; } int configXEnvironment(dialogMenuItem *self) { char *config, *execfile; char *moused; tryagain: dialog_clear_norefresh(); if (!dmenuOpenSimple(&MenuXF86Config, FALSE)) return DITEM_FAILURE | DITEM_RESTORE; if (file_readable("/var/run/ld.so.hints")) systemExecute("/sbin/ldconfig -m /usr/lib /usr/X11R6/lib /usr/local/lib /usr/lib/compat"); else systemExecute("/sbin/ldconfig /usr/lib /usr/X11R6/lib /usr/local/lib /usr/lib/compat"); config = variable_get(VAR_XF86_CONFIG); if (!config) return DITEM_FAILURE | DITEM_RESTORE; execfile = string_concat("/usr/X11R6/bin/", config); if (file_executable(execfile)) { dialog_clear_norefresh(); moused = variable_get(VAR_MOUSED); while (!moused || strcmp(moused, "YES")) { if (msgYesNo("The X server may access the mouse in two ways: direct access\n" "or indirect access via the mouse daemon. You have not\n" "configured the mouse daemon. Would you like to configure it\n" "now? If you intend to let the X server access the mouse\n" "directly, choose \"No\" at this time.")) break; dmenuOpenSimple(&MenuMouse, FALSE); dialog_clear(); moused = variable_get(VAR_MOUSED); } if (moused && !strcmp(moused, "YES")) msgConfirm("You have configured and are now running the mouse daemon.\n" "Choose \"/dev/sysmouse\" as the mouse port and \"SysMouse\" or\n" "\"MouseSystems\" as the mouse protocol in the X configuration\n" "utility."); dialog_clear(); systemExecute(execfile); if (!file_readable("/etc/XF86Config") && !msgYesNo("The XFree86 configuration process seems to have\nfailed. Would you like to try again?")) goto tryagain; return DITEM_SUCCESS | DITEM_RESTORE; } else { dialog_clear_norefresh(); msgConfirm("The XFree86 setup utility you chose does not appear to be installed!\n" "Please install this before attempting to configure XFree86."); return DITEM_FAILURE | DITEM_RESTORE; } } int configResolv(dialogMenuItem *ditem) { FILE *fp; char *cp, *dp, *hp; cp = variable_get(VAR_NAMESERVER); if (!cp || !*cp) goto skip; Mkdir("/etc"); fp = fopen("/etc/resolv.conf", "w"); if (!fp) return DITEM_FAILURE; if (variable_get(VAR_DOMAINNAME)) fprintf(fp, "domain\t%s\n", variable_get(VAR_DOMAINNAME)); fprintf(fp, "nameserver\t%s\n", cp); fclose(fp); if (isDebug()) msgDebug("Wrote out /etc/resolv.conf\n"); skip: dp = variable_get(VAR_DOMAINNAME); cp = variable_get(VAR_IPADDR); hp = variable_get(VAR_HOSTNAME); /* Tack ourselves into /etc/hosts */ fp = fopen("/etc/hosts", "w"); if (!fp) return DITEM_FAILURE; /* Add an entry for localhost */ if (dp) fprintf(fp, "127.0.0.1\t\tlocalhost.%s localhost\n", dp); else fprintf(fp, "127.0.0.1\t\tlocalhost\n"); /* Now the host entries, if applicable */ if (cp && cp[0] != '0' && hp) { char cp2[255]; if (!index(hp, '.')) cp2[0] = '\0'; else { SAFE_STRCPY(cp2, hp); *(index(cp2, '.')) = '\0'; } fprintf(fp, "%s\t\t%s %s\n", cp, hp, cp2); fprintf(fp, "%s\t\t%s.\n", cp, hp); } fclose(fp); if (isDebug()) msgDebug("Wrote out /etc/hosts\n"); return DITEM_SUCCESS; } int configRouter(dialogMenuItem *self) { int ret; ret = variable_get_value(VAR_ROUTER, "Please specify the router you wish to use. Routed is\n" "provided with the stock system and gated is provided\n" "as an optional package which this installation system\n" "will attempt to load if you select gated. Any other\n" "choice of routing daemon will be assumed to be something\n" "the user intends to install themselves before rebooting\n" "the system. If you don't want any routing daemon, choose NO", 1) ? DITEM_SUCCESS : DITEM_FAILURE; if (ret == DITEM_SUCCESS) { char *cp = variable_get(VAR_ROUTER); if (cp && strcmp(cp, "NO")) { variable_set2(VAR_ROUTER_ENABLE, "YES", 1); if (!strcmp(cp, "gated")) { if (package_add(variable_get(VAR_GATED_PKG)) != DITEM_SUCCESS) { msgConfirm("Unable to load gated package. Falling back to no router."); variable_unset(VAR_ROUTER); variable_unset(VAR_ROUTERFLAGS); variable_set2(VAR_ROUTER_ENABLE, "NO", 1); cp = NULL; } } if (cp) { /* Now get the flags, if they chose a router */ ret = variable_get_value(VAR_ROUTERFLAGS, "Please Specify the routing daemon flags; if you're running routed\n" "then -q is the right choice for nodes and -s for gateway hosts.\n", 1) ? DITEM_SUCCESS : DITEM_FAILURE; if (ret != DITEM_SUCCESS) variable_unset(VAR_ROUTERFLAGS); } } else { /* No router case */ variable_set2(VAR_ROUTER_ENABLE, "NO", 1); variable_unset(VAR_ROUTERFLAGS); variable_unset(VAR_ROUTER); } } return ret | DITEM_RESTORE; } int configPackages(dialogMenuItem *self) { static PkgNode top, plist; static Boolean index_initted = FALSE; PkgNodePtr tmp; FILE *fp; if (!mediaVerify()) return DITEM_FAILURE; if (!mediaDevice->init(mediaDevice)) return DITEM_FAILURE; if (!index_initted) { msgNotify("Attempting to fetch packages/INDEX file from selected media."); fp = mediaDevice->get(mediaDevice, "packages/INDEX", TRUE); if (!fp) { dialog_clear_norefresh(); msgConfirm("Unable to get packages/INDEX file from selected media.\n" "This may be because the packages collection is not available at\n" "on the distribution media you've chosen (most likely an FTP site\n" "without the packages collection mirrored). Please verify media\n" "(or path to media) and try again. If your local site does not\n" "carry the packages collection, then we recommend either a CD\n" "distribution or the master distribution on ftp.freebsd.org."); mediaDevice->shutdown(mediaDevice); return DITEM_FAILURE | DITEM_RESTORE; } msgNotify("Located INDEX, now reading package data from it..."); index_init(&top, &plist); if (index_read(fp, &top)) { msgConfirm("I/O or format error on packages/INDEX file.\n" "Please verify media (or path to media) and try again."); fclose(fp); return DITEM_FAILURE | DITEM_RESTORE; } fclose(fp); index_sort(&top); index_initted = TRUE; } while (1) { int ret, pos, scroll; /* Bring up the packages menu */ pos = scroll = 0; index_menu(&top, &top, &plist, &pos, &scroll); if (plist.kids && plist.kids->name) { /* Now show the packing list menu */ pos = scroll = 0; ret = index_menu(&plist, &plist, NULL, &pos, &scroll); if (ret & DITEM_LEAVE_MENU) break; else if (DITEM_STATUS(ret) != DITEM_FAILURE) { index_extract(mediaDevice, &top, &plist); break; } } else { dialog_clear_norefresh(); msgConfirm("No packages were selected for extraction."); break; } } tmp = plist.kids; while (tmp) { PkgNodePtr tmp2 = tmp->next; safe_free(tmp); tmp = tmp2; } index_init(NULL, &plist); return DITEM_SUCCESS | DITEM_RESTORE; } /* Load pcnfsd package */ int configPCNFSD(dialogMenuItem *self) { int ret = DITEM_SUCCESS; if (variable_get(VAR_PCNFSD)) variable_unset(VAR_PCNFSD); else { ret = package_add(variable_get(VAR_PCNFSD_PKG)); if (DITEM_STATUS(ret) == DITEM_SUCCESS) { variable_set2(VAR_PCNFSD, "YES", 0); variable_set2("mountd_flags", "-n", 1); } } return ret; } int configNFSServer(dialogMenuItem *self) { char cmd[256]; /* If we're an NFS server, we need an exports file */ if (!file_readable("/etc/exports")) { WINDOW *w = savescr(); if (file_readable("/etc/exports.disabled")) vsystem("mv /etc/exports.disabled /etc/exports"); else { dialog_clear_norefresh(); msgConfirm("Operating as an NFS server means that you must first configure\n" "an /etc/exports file to indicate which hosts are allowed certain\n" "kinds of access to your local file systems.\n" "Press [ENTER] now to invoke an editor on /etc/exports\n"); vsystem("echo '#The following examples export /usr to 3 machines named after ducks,' > /etc/exports"); vsystem("echo '#/home and all directories under it to machines named after dead rock stars' >> /etc/exports"); vsystem("echo '#and, finally, /a to 2 privileged machines allowed to write on it as root.' >> /etc/exports"); vsystem("echo '#/usr huey louie dewie' >> /etc/exports"); vsystem("echo '#/home -alldirs janice jimmy frank' >> /etc/exports"); vsystem("echo '#/a -maproot=0 bill albert' >> /etc/exports"); vsystem("echo '#' >> /etc/exports"); vsystem("echo '# You should replace these lines with your actual exported filesystems.' >> /etc/exports"); vsystem("echo >> /etc/exports"); sprintf(cmd, "%s /etc/exports", variable_get(VAR_EDITOR)); dialog_clear(); systemExecute(cmd); restorescr(w); } variable_set2(VAR_NFS_SERVER, "YES", 1); } else if (variable_get(VAR_NFS_SERVER)) { /* We want to turn it off again? */ vsystem("mv -f /etc/exports /etc/exports.disabled"); variable_unset(VAR_NFS_SERVER); } return DITEM_SUCCESS; } diff --git a/release/sysinstall/dispatch.c b/release/sysinstall/dispatch.c index 8d289e4207fc..7582b3698220 100644 --- a/release/sysinstall/dispatch.c +++ b/release/sysinstall/dispatch.c @@ -1,436 +1,434 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: dispatch.c,v 1.26 1998/11/15 09:06:19 jkh Exp $ + * $Id: dispatch.c,v 1.27 1999/02/05 22:15:48 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer, * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * 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 "list.h" static int dispatch_shutdown(dialogMenuItem *unused); static int dispatch_systemExecute(dialogMenuItem *unused); static int dispatch_msgConfirm(dialogMenuItem *unused); static struct _word { char *name; int (*handler)(dialogMenuItem *self); } resWords[] = { { "configAnonFTP", configAnonFTP }, { "configRouter", configRouter }, { "configNFSServer", configNFSServer }, { "configNTP", configNTP }, { "configPCNFSD", configPCNFSD }, { "configPackages", configPackages }, - { "configRegister", configRegister }, { "configUsers", configUsers }, { "configXEnvironment", configXEnvironment }, { "diskPartitionEditor", diskPartitionEditor }, { "diskPartitionWrite", diskPartitionWrite }, { "diskLabelEditor", diskLabelEditor }, { "diskLabelCommit", diskLabelCommit }, { "distReset", distReset }, { "distSetCustom", distSetCustom }, { "distSetDeveloper", distSetDeveloper }, { "distSetXDeveloper", distSetXDeveloper }, { "distSetKernDeveloper", distSetKernDeveloper }, { "distSetUser", distSetUser }, { "distSetXUser", distSetXUser }, { "distSetMinimum", distSetMinimum }, { "distSetEverything", distSetEverything }, { "distSetDES", distSetDES }, { "distSetSrc", distSetSrc }, { "distSetXF86", distSetXF86 }, { "distExtractAll", distExtractAll }, { "docBrowser", docBrowser }, { "docShowDocument", docShowDocument }, { "installCommit", installCommit }, { "installExpress", installExpress }, { "installNovice", installNovice }, { "installUpgrade", installUpgrade }, { "installFixupBin", installFixupBin }, { "installFixupXFree", installFixupXFree }, { "installFixitHoloShell", installFixitHoloShell }, { "installFixitCDROM", installFixitCDROM }, { "installFixitFloppy", installFixitFloppy }, { "installFilesystems", installFilesystems }, { "installVarDefaults", installVarDefaults }, { "loadConfig", dispatch_load_file }, { "loadFloppyConfig", dispatch_load_floppy }, { "mediaSetCDROM", mediaSetCDROM }, { "mediaSetFloppy", mediaSetFloppy }, { "mediaSetDOS", mediaSetDOS }, { "mediaSetTape", mediaSetTape }, { "mediaSetFTP", mediaSetFTP }, { "mediaSetFTPActive", mediaSetFTPActive }, { "mediaSetFTPPassive", mediaSetFTPPassive }, { "mediaSetUFS", mediaSetUFS }, { "mediaSetNFS", mediaSetNFS }, { "mediaSetFTPUserPass", mediaSetFTPUserPass }, { "mediaSetCPIOVerbosity", mediaSetCPIOVerbosity }, { "mediaGetType", mediaGetType }, { "msgConfirm", dispatch_msgConfirm }, { "optionsEditor", optionsEditor }, - { "register", configRegister }, /* Alias */ { "packageAdd", packageAdd }, { "addGroup", userAddGroup }, { "addUser", userAddUser }, { "shutdown", dispatch_shutdown }, { "system", dispatch_systemExecute }, { "dumpVariables", dump_variables }, { "tcpMenuSelect", tcpMenuSelect }, { NULL, NULL }, }; /* * Helper routines for buffering data. * * We read an entire configuration into memory before executing it * so that we are truely standalone and can do things like nuke the * file or disk we're working on. */ typedef struct command_buffer_ { qelement queue; char * string; } command_buffer; static void dispatch_free_command(command_buffer *item) { REMQUE(item); free(item->string); free(item); } static void dispatch_free_all(qelement *head) { command_buffer *item; while (!EMPTYQUE(*head)) { item = (command_buffer *) head->q_forw; dispatch_free_command(item); } } static command_buffer * dispatch_add_command(qelement *head, char *string) { command_buffer *new; new = malloc(sizeof(command_buffer)); if (!new) return NULL; new->string = strdup(string); INSQUEUE(new, head->q_back); return new; } /* * Command processing */ /* Just convenience */ static int dispatch_shutdown(dialogMenuItem *unused) { systemShutdown(0); return DITEM_FAILURE; } static int dispatch_systemExecute(dialogMenuItem *unused) { char *cmd = variable_get(VAR_COMMAND); if (cmd) return systemExecute(cmd) ? DITEM_FAILURE : DITEM_SUCCESS; else msgDebug("_systemExecute: No command passed in `command' variable.\n"); return DITEM_FAILURE; } static int dispatch_msgConfirm(dialogMenuItem *unused) { char *msg = variable_get(VAR_COMMAND); if (msg) { msgConfirm(msg); return DITEM_SUCCESS; } msgDebug("_msgConfirm: No message passed in `command' variable.\n"); return DITEM_FAILURE; } static int call_possible_resword(char *name, dialogMenuItem *value, int *status) { int i, rval; rval = 0; for (i = 0; resWords[i].name; i++) { if (!strcmp(name, resWords[i].name)) { *status = resWords[i].handler(value); rval = 1; break; } } return rval; } /* For a given string, call it or spit out an undefined command diagnostic */ int dispatchCommand(char *str) { int i; char *cp; if (!str || !*str) { msgConfirm("Null or zero-length string passed to dispatchCommand"); return DITEM_FAILURE; } /* If it's got a newline, trim it */ if ((cp = index(str, '\n')) != NULL) *cp = '\0'; /* If it's got a `=' sign in there, assume it's a variable setting */ if (index(str, '=')) { if (isDebug()) msgDebug("dispatch: setting variable `%s'\n", str); variable_set(str, 0); i = DITEM_SUCCESS; } else { /* A command might be a pathname if it's encoded in argv[0], which we also support */ if ((cp = rindex(str, '/')) != NULL) str = cp + 1; if (isDebug()) msgDebug("dispatch: calling resword `%s'\n", str); if (!call_possible_resword(str, NULL, &i)) { msgNotify("Warning: No such command ``%s''", str); i = DITEM_FAILURE; } } return i; } /* * File processing */ static qelement * dispatch_load_fp(FILE *fp) { qelement *head; char buf[BUFSIZ], *cp; head = malloc(sizeof(qelement)); if (!head) return NULL; INITQUE(*head); while (fgets(buf, sizeof buf, fp)) { if ((cp = strchr(buf, '\n')) != NULL) *cp = '\0'; if (*buf == '\0' || *buf == '#') continue; if (!dispatch_add_command(head, buf)) return NULL; } return head; } static int dispatch_execute(qelement *head) { int result = DITEM_SUCCESS; command_buffer *item; char *old_interactive; if (!head) return result | DITEM_FAILURE; old_interactive = variable_get(VAR_NONINTERACTIVE); if (old_interactive) old_interactive = strdup(old_interactive); /* save copy */ /* Hint to others that we're running from a script, should they care */ variable_set2(VAR_NONINTERACTIVE, "yes", 0); while (!EMPTYQUE(*head)) { item = (command_buffer *) head->q_forw; if (DITEM_STATUS(dispatchCommand(item->string)) != DITEM_SUCCESS) { /* * Allow a user to prefix a command with "noError" to cause * us to ignore any errors for that one command. */ if (variable_get(VAR_NO_ERROR)) variable_unset(VAR_NO_ERROR); else { msgConfirm("Command `%s' failed - rest of script aborted.\n", item->string); result |= DITEM_FAILURE; break; } } dispatch_free_command(item); } dispatch_free_all(head); if (!old_interactive) variable_unset(VAR_NONINTERACTIVE); else { variable_set2(VAR_NONINTERACTIVE, old_interactive, 0); free(old_interactive); } return result; } int dispatch_load_file_int(int quiet) { FILE *fp; char *cp; int i; qelement *list; static const char *names[] = { "install.cfg", "/stand/install.cfg", "/tmp/install.cfg", NULL }; fp = NULL; cp = variable_get(VAR_CONFIG_FILE); if (!cp) { for (i = 0; names[i]; i++) if ((fp = fopen(names[i], "r")) != NULL) break; } else fp = fopen(cp, "r"); if (!fp) { if (!quiet) msgConfirm("Unable to open %s: %s", cp, strerror(errno)); return DITEM_FAILURE; } list = dispatch_load_fp(fp); fclose(fp); return dispatch_execute(list); } int dispatch_load_file(dialogMenuItem *self) { return dispatch_load_file_int(FALSE); } int dispatch_load_floppy(dialogMenuItem *self) { int what = DITEM_RESTORE | DITEM_SUCCESS; extern char *distWanted; char *cp; FILE *fp; qelement *list; mediaClose(); dialog_clear_norefresh(); cp = variable_get_value(VAR_INSTALL_CFG, "Specify the name of a configuration file\n" "residing on a MSDOS or UFS floppy.", 0); if (!cp || !*cp) { variable_unset(VAR_INSTALL_CFG); what |= DITEM_FAILURE; return what; } distWanted = cp; /* Try to open the floppy drive */ if (DITEM_STATUS(mediaSetFloppy(NULL)) == DITEM_FAILURE) { msgConfirm("Unable to set media device to floppy."); what |= DITEM_FAILURE; mediaClose(); return what; } if (!mediaDevice->init(mediaDevice)) { msgConfirm("Unable to mount floppy filesystem."); what |= DITEM_FAILURE; mediaClose(); return what; } fp = mediaDevice->get(mediaDevice, cp, TRUE); if (fp) { list = dispatch_load_fp(fp); fclose(fp); mediaClose(); what |= dispatch_execute(list); } else { if (!variable_get(VAR_NO_ERROR)) msgConfirm("Configuration file '%s' not found.", cp); variable_unset(VAR_INSTALL_CFG); what |= DITEM_FAILURE; mediaClose(); } return what; } diff --git a/release/sysinstall/install.c b/release/sysinstall/install.c index f8a6d59faee6..81d3ddccb1c1 100644 --- a/release/sysinstall/install.c +++ b/release/sysinstall/install.c @@ -1,1134 +1,1119 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: install.c,v 1.229 1999/02/15 00:49:33 jkh Exp $ + * $Id: install.c,v 1.230 1999/03/11 09:38:06 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer, * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * 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 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) { Device **devs; Boolean status; Disk *disk; Chunk *c1, *c2, *rootdev, *swapdev, *usrdev, *vardev; int i; /* Don't allow whinging if noWarn is set */ if (variable_get(VAR_NO_WARN)) whinge = FALSE; status = TRUE; *rdev = *sdev = *udev = *vdev = rootdev = swapdev = usrdev = vardev = 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); } } } } } } } /* 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 */ *rdev = rootdev; *sdev = swapdev; *udev = usrdev; *vdev = vardev; 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; } if (!usrdev && whinge && !variable_get(VAR_NO_USR)) { msgConfirm("WARNING: No /usr filesystem found. This is not technically\n" "an error if your root filesystem is big enough (or you later\n" "intend to mount your /usr filesystem over NFS), but it may otherwise\n" "cause you trouble if you're not exactly sure what you are doing!"); } if (!vardev && whinge && variable_cmp(SYSTEM_STATE, "upgrade")) { msgConfirm("WARNING: No /var filesystem found. This is not technically\n" "an error if your root filesystem is big enough (or you later\n" "intend to link /var to someplace else), but it may otherwise\n" "cause your root filesystem to fill up if you receive lots of mail\n" "or edit large temporary files."); } 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 | DITEM_RESTORE; 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 (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 */ systemCreateHoloshell(); alreadyDone = TRUE; return status; } int installFixitHoloShell(dialogMenuItem *self) { systemCreateHoloshell(); return DITEM_SUCCESS; } 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 CDROM and press return"); if (DITEM_STATUS(mediaSetCDROM(NULL)) != DITEM_SUCCESS || !mediaDevice || !mediaDevice->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 CDROM - 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 CDROM 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 CDROM likely won't work."); } } /* Yet more iggly hardcoded pathnames. */ Mkdir("/usr/libexec"); if (!file_readable("/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 CDROM 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 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 (!mediaDevice->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/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 (!(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); 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); /* use the .profile from the fixit medium */ setenv("HOME", "/mnt2", 1); chdir("/mnt2"); execlp("sh", "-sh", 0); msgDebug("fixit shell: Failed to execute shell!\n"); _exit(1);; } else { 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."); (void)waitpid(child, &waitstatus, 0); } dialog_clear(); } int installExpress(dialogMenuItem *self) { int i; variable_set2(SYSTEM_STATE, "express", 0); #ifndef __alpha__ if (DITEM_STATUS((i = diskPartitionEditor(self))) == DITEM_FAILURE) return i; #endif if (DITEM_STATUS((i = diskLabelEditor(self))) == DITEM_FAILURE) return i; dialog_clear_norefresh(); if (DITEM_STATUS((i = installCommit(self))) == DITEM_SUCCESS) { i |= DITEM_LEAVE_MENU; /* Give user the option of one last configuration spree */ installConfigure(); } return i | DITEM_RESTORE; } /* Novice mode installation */ int installNovice(dialogMenuItem *self) { int i, tries = 0; Device **devs; variable_set2(SYSTEM_STATE, "novice", 0); #ifndef __alpha__ dialog_clear_norefresh(); 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 dialog_clear_norefresh(); #ifdef __alpha__ msgConfirm("First, 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."); #else msgConfirm("First, 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."); #endif if (DITEM_STATUS(diskLabelEditor(self)) == DITEM_FAILURE) return DITEM_FAILURE; dialog_clear_norefresh(); if (DITEM_STATUS((i = installCommit(self))) == DITEM_FAILURE) { dialog_clear_norefresh(); 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 chose \"No\" at the next\n" "prompt and go back into the installation menus to try and retry\n" "whichever operations have failed."); return i | DITEM_RESTORE; } else { dialog_clear_norefresh(); 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: /stand/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; dialog_clear_norefresh(); tmp = tcpDeviceSelect(); dialog_clear_norefresh(); if (tmp && !msgYesNo("Would you like to bring the %s interface up right now?", tmp->name)) if (!tmp->init(tmp)) msgConfirm("Initialization of %s device failed.", tmp->name); } } dialog_clear_norefresh(); if (!msgYesNo("Will this machine be an IP gateway (e.g. will it forward packets\n" "between interfaces)?")) variable_set2("gateway_enable", "YES", 1); dialog_clear_norefresh(); if (!msgYesNo("Do you want to allow anonymous FTP connections to this machine?")) configAnonFTP(self); dialog_clear_norefresh(); if (!msgYesNo("Do you want to configure this machine as an NFS server?")) configNFSServer(self); dialog_clear_norefresh(); if (!msgYesNo("Do you want to configure this machine as an NFS client?")) variable_set2("nfs_client_enable", "YES", 1); dialog_clear_norefresh(); if (!msgYesNo("Would you like to customize your system console settings?")) { WINDOW *w = savescr(); dmenuOpenSimple(&MenuSyscons, FALSE); restorescr(w); } dialog_clear_norefresh(); if (!msgYesNo("Would you like to set this machine's time zone now?")) { WINDOW *w = savescr(); dialog_clear(); systemExecute("tzsetup"); restorescr(w); } dialog_clear_norefresh(); if (!msgYesNo("Does this system have a mouse attached to it?")) { WINDOW *w = savescr(); dmenuOpenSimple(&MenuMouse, FALSE); restorescr(w); } /* 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?")) configXEnvironment(self); } dialog_clear_norefresh(); if (!msgYesNo("The FreeBSD package collection is a collection of hundreds 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?")) configPackages(self); dialog_clear_norefresh(); 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).")) configUsers(self); dialog_clear_norefresh(); msgConfirm("Now you must set the system manager's password.\n" "This is the password you'll use to log in as \"root\"."); { WINDOW *w = savescr(); if (!systemExecute("passwd root")) variable_set2("root_password", "YES", 0); restorescr(w); } - dialog_clear_norefresh(); - if (!msgYesNo("Would you like to register your FreeBSD system at this time?\n\n" - "PLEASE, take just 5 minutes to do this. If we're ever to get any\n" - "significant base of commercial software for FreeBSD, we need to\n" - "be able to provide more information about the size of our user community.\n" - "This is where your registration can really help us, and you can also\n" - "sign up for the new FreeBSD newsletter (its free!) at the same time.\n")) - configRegister(NULL); - else { - dialog_clear_norefresh(); - msgConfirm("OK, but if you should change your mind then you always can register\n" - "later by typing ``/stand/sysinstall register'' or by simply visiting our\n" - "web site at http://www.freebsd.org/register.html"); - - } /* 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 | DITEM_RESTORE; } /* The version of commit we call from the Install Custom menu */ int installCustomCommit(dialogMenuItem *self) { int i; dialog_clear_norefresh(); i = installCommit(self); if (DITEM_STATUS(i) == DITEM_SUCCESS) { /* 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 DES dist. */ int installCommit(dialogMenuItem *self) { int i; char *str; if (!Dists) distConfig(NULL); if (!Dists) if (!dmenuOpenSimple(&MenuDistributions, FALSE) && !Dists) return DITEM_FAILURE | DITEM_RESTORE; if (!mediaVerify()) return DITEM_FAILURE | DITEM_RESTORE; 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 (!mediaDevice->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 | DITEM_RESTORE; else goto try_media; } else return DITEM_FAILURE | DITEM_RESTORE; } /* 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 | DITEM_RESTORE; } static void installConfigure(void) { /* Final menu of last resort */ dialog_clear_norefresh(); if (!msgYesNo("Visit the general configuration menu for a chance to set\n" "any last options?")) { WINDOW *w = savescr(); dmenuOpenSimple(&MenuConfigure, FALSE); restorescr(w); } configRC_conf(); sync(); } int installFixupBin(dialogMenuItem *self) { Device **devs; int i; /* All of this is done only as init, just to be safe */ if (RunningAsInit) { /* Fix up kernel first */ if (!file_readable("/kernel")) { if (file_readable("/kernel.GENERIC")) { if (vsystem("cp -p /kernel.GENERIC /kernel")) { msgConfirm("Unable to copy /kernel into place!"); return DITEM_FAILURE; } #ifndef __alpha__ /* Snapshot any boot -c changes back to the new kernel */ if (kget("/boot/kernel.conf")) { msgConfirm("Kernel copied OK, but unable to save boot -c changes\n" "to it. See the debug screen (ALT-F2) for details."); } else { if (!file_readable("/boot/loader.rc")) { FILE *fp; if ((fp = fopen("/boot/loader.rc", "w")) != NULL) { fprintf(fp, "load /kernel\n"); fprintf(fp, "load -t userconfig_script /boot/kernel.conf\n"); fprintf(fp, "autoboot 5\n"); fclose(fp); } } else { msgConfirm("You already have a /boot/loader.rc file so I won't touch it.\n" "You will need to add a: load -t userconfig_script /boot/kernel.conf\n" "line to your /boot/loader.rc before your saved kernel changes\n" "(if any) can go into effect."); } } #endif } else { msgConfirm("Can't find a kernel image to link to on the root file system!\n" "You're going to have a hard time getting this system to\n" "boot from the hard disk, I'm afraid!"); return DITEM_FAILURE; } } /* BOGON #1: Resurrect /dev after bin distribution screws it up */ msgNotify("Remaking all devices.. Please wait!"); if (vsystem("cd /dev; sh MAKEDEV all")) { msgConfirm("MAKEDEV returned non-zero status"); return DITEM_FAILURE; } 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) { 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; } } } } /* 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; } /* Fix side-effects from the the XFree86 installation */ int installFixupXFree(dialogMenuItem *self) { /* BOGON #1: XFree86 requires various specialized fixups */ if (directory_exists("/usr/X11R6")) { msgNotify("Fixing permissions in XFree86 tree.."); vsystem("chmod -R a+r /usr/X11R6"); vsystem("find /usr/X11R6 -type d | xargs chmod a+x"); /* Also do bogus minimal package registration so ports don't whine */ if (file_readable("/usr/X11R6/lib/X11/pkgreg.tar.gz")) { msgNotify("Installing package metainfo.."); vsystem("tar xpzf /usr/X11R6/lib/X11/pkgreg.tar.gz -C / && rm /usr/X11R6/lib/X11/pkgreg.tar.gz"); } } return DITEM_SUCCESS; } /* Go newfs and/or mount all the filesystems we've been asked to */ int installFilesystems(dialogMenuItem *self) { int i; Disk *disk; Chunk *c1, *c2, *rootdev, *swapdev, *usrdev, *vardev; 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, &usrdev, &vardev)) 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)) 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/r%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; } 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 || !msgYesNo("You are upgrading - are you SURE you want to newfs the root partition?"))) { int i; 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; } } else { if (!upgrade) { msgConfirm("Warning: Using existing root partition. It will be assumed\n" "that you have the appropriate device entries already in /dev."); } msgNotify("Checking integrity of existing %s filesystem.", dname); i = vsystem("fsck -y %s", dname); if (i) msgConfirm("Warning: fsck returned status of %d for %s.\n" "This partition may be unsafe to use.", i, 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; } } /* 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; } 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 || !msgYesNo("You are upgrading - are you SURE you want to newfs /dev/%s?", c2->name))) command_shell_add(tmp->mountpoint, "%s %s/dev/r%s", tmp->newfs_cmd, RunningAsInit ? "/mnt" : "", c2->name); else command_shell_add(tmp->mountpoint, "fsck -y %s/dev/r%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) 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); } } } if (RunningAsInit) { 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; } } command_sort(); command_execute(); return DITEM_SUCCESS; } static char * getRelname(void) { static char buf[64]; int 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, "lynx", 0); variable_set2(VAR_BROWSER_BINARY, "/usr/local/bin/lynx", 0); variable_set2(VAR_FTP_STATE, "passive", 0); variable_set2(VAR_NFS_SECURE, "YES", 0); variable_set2(VAR_PKG_TMPDIR, "/usr/tmp", 0); variable_set2(VAR_GATED_PKG, "gated", 0); variable_set2(VAR_PCNFSD_PKG, "pcnfsd", 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); 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, 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); } } diff --git a/release/sysinstall/menus.c b/release/sysinstall/menus.c index d03b76d3489b..5d7fb7ac4d34 100644 --- a/release/sysinstall/menus.c +++ b/release/sysinstall/menus.c @@ -1,1528 +1,1526 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: menus.c,v 1.193 1999/03/19 10:54:37 jkh Exp $ + * $Id: menus.c,v 1.194 1999/04/21 07:22:37 obrien Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer, * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * 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" #ifdef __alpha__ #define _AS(str) str "alpha/" #else /* i386 */ #define _AS(str) str "i386/" #endif #define _AP(str) _AS(str "/pub/FreeBSD/releases/") /* Miscellaneous work routines for menus */ static int setSrc(dialogMenuItem *self) { Dists |= DIST_SRC; SrcDists = DIST_SRC_ALL; return DITEM_SUCCESS | DITEM_REDRAW; } static int clearSrc(dialogMenuItem *self) { Dists &= ~DIST_SRC; SrcDists = 0; return DITEM_SUCCESS | DITEM_REDRAW; } static int setX11All(dialogMenuItem *self) { XF86Dists = DIST_XF86_ALL; XF86ServerDists = DIST_XF86_SERVER_ALL; XF86FontDists = DIST_XF86_FONTS_ALL; Dists |= DIST_XF86; return DITEM_SUCCESS | DITEM_REDRAW; } static int clearX11All(dialogMenuItem *self) { XF86Dists = 0; XF86ServerDists = 0; XF86FontDists = 0; Dists &= ~DIST_XF86; 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 | DIST_DES | extra)) #define IS_USER(dist, extra) (_IS_SET(dist, _DIST_USER | extra) || \ _IS_SET(dist, _DIST_USER | DIST_DES | 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_BIN; } static int checkDistEverything(dialogMenuItem *self) { return Dists == DIST_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 DESFlagCheck(dialogMenuItem *item) { return DESDists; } 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 [ENTER].\n" "Leave the index page by selecting Cancel [TAB-ENTER].", "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, DES", "DES distribution menu.", NULL, dmenuSubmenu, NULL, &MenuDESDistributions }, { "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, 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 }, { "Fdisk", "The disk Partition Editor", NULL, diskPartitionEditor }, { "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 }, { "Install, Novice", "A novice system installation.", NULL, installNovice }, { "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", "Select CDROM 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 }, { "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" }, - { "Register", "Register yourself or company as a FreeBSD user.", dmenuVarCheck, configRegister, NULL, "registered" }, { "Root Password", "Set the system manager's password.", NULL, dmenuSystemCommand, NULL, "passwd root" }, { "Router", "Select routing daemon (default: routed)", NULL, configRouter, NULL, "router" }, { "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 }, { "Time Zone", "Set the system's time zone.", NULL, dmenuSystemCommand, NULL, "tzsetup" }, { "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 }, { "XFree86, PC98 Server", "XFree86 PC98 Server selection menu.", NULL, dmenuSubmenu, NULL, &MenuXF86SelectPC98Server }, { NULL } }, }; /* The initial installation menu */ DMenu MenuInitial = { DMENU_NORMAL_TYPE, "/stand/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 by pressing [ENTER] or [TAB-ENTER] to exit the installation.", "Press F1 for Installation Guide", /* help line */ "install", /* help file */ { { "Select" }, { "Exit Install", NULL, NULL, dmenuExit }, { "1 Usage", "Quick start - How to use this menu system", NULL, dmenuDisplayFile, NULL, "usage" }, { "2 Novice", "Begin a novice installation (for beginners)", NULL, installNovice }, { "3 Express", "Begin a quick installation (for the impatient)", NULL, installExpress }, { "4 Custom", "Begin a custom installation (for experts)", NULL, dmenuSubmenu, NULL, &MenuInstallCustom }, { "5 Configure", "Do post-install configuration of FreeBSD", NULL, dmenuSubmenu, NULL, &MenuConfigure }, { "D Doc", "Installation instructions, README, etc.", NULL, dmenuSubmenu, NULL, &MenuDocumentation }, { "K Keymap", "Select keyboard type", NULL, dmenuSubmenu, NULL, &MenuSysconsKeymap }, { "O Options", "View/Set various installation options", NULL, optionsEditor }, { "F Fixit", "Enter repair mode with CDROM/floppy or start shell", NULL, dmenuSubmenu, NULL, &MenuFixit }, { "U Upgrade", "Upgrade an existing system", NULL, installUpgrade }, { "L Load Config","Load default install configuration", NULL, dispatch_load_floppy }, { "I 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", { { "1 README", "A general description of FreeBSD. Read this!", NULL, dmenuDisplayFile, NULL, "README" }, { "2 Hardware", "The FreeBSD survival guide for PC hardware.", NULL, dmenuDisplayFile, NULL, "HARDWARE" }, { "3 Install", "A step-by-step guide to installing FreeBSD.", NULL, dmenuDisplayFile, NULL, "INSTALL" }, { "4 Copyright", "The FreeBSD Copyright notices.", NULL, dmenuDisplayFile, NULL, "COPYRIGHT" }, { "5 Release" ,"The release notes for this version of FreeBSD.", NULL, dmenuDisplayFile, NULL, "RELNOTES" }, { "6 Shortcuts", "Creating shortcuts to sysinstall.", NULL, dmenuDisplayFile, NULL, "shortcuts" }, { "7 HTML Docs", "Go to the HTML documentation menu (post-install).", NULL, docBrowser }, { "0 Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { NULL } }, }; DMenu MenuMouseType = { DMENU_RADIO_TYPE | DMENU_SELECTION_RETURNS, "Select a protocol type for your mouse", "If you are not sure, choose \"Auto\". It should always work for bus\n" "and PS/2 style mice. It may not work for the serial mouse if the mouse\n" "does not support the PnP standard. But, it won't hurt. Many 2-button\n" "serial mice are compatible with \"Microsoft\" or \"MouseMan\". 3-button\n" "serial mice may be compatible with \"MouseSystems\" or \"MouseMan\". If\n" "the mouse has a wheel, it may be compatible with \"IntelliMouse\".", NULL, NULL, { { "Auto", "Bus mouse, PS/2 style mouse or PnP serial mouse", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=auto" }, { "GlidePoint", "ALPS GlidePoint pad (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=glidepoint" }, { "Hitachi","Hitachi tablet (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=mmhittab" }, { "IntelliMouse", "Microsoft IntelliMouse (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=intellimouse" }, { "Logitech", "Logitech protocol (old models) (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=logitech" }, { "Microsoft", "Microsoft protocol (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=microsoft" }, { "MM Series","MM Series protocol (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=mmseries" }, { "MouseMan", "Logitech MouseMan/TrackMan models (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=mouseman" }, { "MouseSystems", "MouseSystems protocol (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=mousesystems" }, { "ThinkingMouse","Kensington ThinkingMouse (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=thinkingmouse" }, { NULL } }, }; DMenu MenuMousePort = { DMENU_RADIO_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, { { "COM1", "Serial mouse on COM1 (/dev/cuaa0)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuaa0" }, { "COM2", "Serial mouse on COM2 (/dev/cuaa1)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuaa1" }, { "COM3", "Serial mouse on COM3 (/dev/cuaa2)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuaa2" }, { "COM4", "Serial mouse on COM4 (/dev/cuaa3)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuaa3" }, { "BusMouse", "Logitech, ATI or MS bus mouse (/dev/mse0)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/mse0" }, { "PS/2", "PS/2 style mouse (/dev/psm0)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/psm0" }, { 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 4 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, { { "1 Type", "Select mouse protocol type", NULL, dmenuSubmenu, NULL, &MenuMouseType }, { "2 Port", "Select mouse port", NULL, dmenuSubmenu, NULL, &MenuMousePort }, { "3 Enable", "Test and run the mouse daemon", NULL, mousedTest, NULL, NULL }, { "4 Disable", "Disable the mouse daemon", NULL, mousedDisable, NULL, NULL }, { "0 Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { NULL } }, }; DMenu MenuXF86Config = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Please select the XFree86 configuration tool you want to use.", "The first tool, XF86Setup, is fully graphical and requires the\n" "VGA16 server in order to work (should have been selected by\n" "default, but if you de-selected it then you won't be able to\n" "use this fancy setup tool). The second tool, 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 fancier one\n" "does not.", "Press F1 to read the XFree86 release notes for FreeBSD", "XF86", { { "XF86Setup", "Fully graphical XFree86 configuration tool.", NULL, dmenuSetVariable, NULL, VAR_XF86_CONFIG "=XF86Setup" }, { "xf86config", "Shell-script based XFree86 configuration tool.", NULL, dmenuSetVariable, NULL, VAR_XF86_CONFIG "=xf86config" }, { "XF98Setup", "Fully graphical XFree86 configuration tool (PC98).", NULL, dmenuSetVariable, NULL, VAR_XF86_CONFIG "=XF98Setup" }, { NULL } }, }; DMenu MenuMediaCDROM = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Choose a CDROM type", "FreeBSD can be installed directly from a CDROM containing a valid\n" "FreeBSD distribution. If you are seeing this menu it is because\n" "more than one CDROM drive was found on your system. Please select one\n" "of the following CDROM drives as your installation drive.", "Press F1 to read the installation guide", "install", { { NULL } }, }; DMenu MenuMediaFloppy = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Choose a Floppy drive", "You have more than one floppy drive. Please chose 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 _AS("=ftp://ftp.freebsd.org/pub/FreeBSD/releases/") }, { "URL", "Specify some other ftp site by URL", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=other" }, { "4.0 SNAP Server", "current.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AS("=ftp://current.freebsd.org/pub/FreeBSD/snapshots/") }, { "3.0 SNAP Server", "releng3.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AS("=ftp://releng3.freebsd.org/pub/FreeBSD/snapshots/") }, { "Argentina", "ftp.ar.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.ar.freebsd.org") }, { "Australia", "ftp.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.au.freebsd.org") }, { "Australia #2", "ftp2.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.au.freebsd.org") }, { "Australia #3", "ftp3.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp3.au.freebsd.org") }, { "Australia #4", "ftp4.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp4.au.freebsd.org") }, { "Australia #5", "ftp5.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp5.au.freebsd.org") }, { "Brazil", "ftp.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.br.freebsd.org") }, { "Brazil #2", "ftp2.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.br.freebsd.org") }, { "Brazil #3", "ftp3.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp3.br.freebsd.org") }, { "Brazil #4", "ftp4.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp4.br.freebsd.org") }, { "Brazil #5", "ftp5.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp5.br.freebsd.org") }, { "Brazil #6", "ftp6.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp6.br.freebsd.org") }, { "Brazil #7", "ftp7.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp7.br.freebsd.org") }, { "Canada", "ftp.ca.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.ca.freebsd.org") }, { "Czech Republic", "ftp.cz.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.cz.freebsd.org") }, { "Denmark", "ftp.dk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.dk.freebsd.org") }, { "Denmark #2", "ftp2.dk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.dk.freebsd.org") }, { "Estonia", "ftp.ee.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.ee.freebsd.org") }, { "Finland", "ftp.fi.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.fi.freebsd.org") }, { "France", "ftp.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.fr.freebsd.org") }, { "France #2", "ftp2.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.fr.freebsd.org") }, { "Germany", "ftp.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.de.freebsd.org") }, { "Germany #2", "ftp2.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.de.freebsd.org") }, { "Germany #3", "ftp3.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp3.de.freebsd.org") }, { "Germany #4", "ftp4.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp4.de.freebsd.org") }, { "Germany #5", "ftp5.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp5.de.freebsd.org") }, { "Germany #6", "ftp6.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp6.de.freebsd.org") }, { "Germany #7", "ftp7.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp7.de.freebsd.org") }, { "Holland", "ftp.nl.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.nl.freebsd.org") }, { "Hong Kong", "ftp.hk.super.net", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.hk.super.net") }, { "Iceland", "ftp.is.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.is.freebsd.org") }, { "Ireland", "ftp.ie.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.ie.freebsd.org") }, { "Israel", "ftp.il.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.il.freebsd.org") }, { "Israel #2", "ftp2.il.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.il.freebsd.org") }, { "Japan", "ftp.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.jp.freebsd.org") }, { "Japan #2", "ftp2.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.jp.freebsd.org") }, { "Japan #3", "ftp3.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp3.jp.freebsd.org") }, { "Japan #4", "ftp4.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp4.jp.freebsd.org") }, { "Japan #5", "ftp5.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp5.jp.freebsd.org") }, { "Japan #6", "ftp6.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp6.jp.freebsd.org") }, { "Korea", "ftp.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.kr.freebsd.org") }, { "Korea #2", "ftp2.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.kr.freebsd.org") }, { "Korea #3", "ftp3.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp3.kr.freebsd.org") }, { "Korea #4", "ftp4.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp4.kr.freebsd.org") }, { "Korea #5", "ftp5.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp5.kr.freebsd.org") }, { "Poland", "ftp.pl.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.pl.freebsd.org") }, { "Portugal", "ftp.pt.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.pt.freebsd.org") }, { "Portugal #2", "ftp2.pt.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.pt.freebsd.org") }, { "Russia", "ftp.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.ru.freebsd.org") }, { "Russia #2", "ftp2.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.ru.freebsd.org") }, { "Russia #3", "ftp3.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp3.ru.freebsd.org") }, { "Russia #4", "ftp4.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp4.ru.freebsd.org") }, { "South Africa", "ftp.za.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.za.freebsd.org") }, { "South Africa #2", "ftp2.za.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.za.freebsd.org") }, { "South Africa #3", "ftp3.za.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp3.za.freebsd.org") }, { "South Africa #4", "ftp4.za.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp4.za.freebsd.org") }, { "Spain", "ftp.es.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.es.freebsd.org") }, { "Spain #2", "ftp2.es.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.es.freebsd.org") }, { "Sweden", "ftp.se.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.se.freebsd.org") }, { "Sweden #2", "ftp2.se.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.se.freebsd.org") }, { "Sweden #3", "ftp3.se.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp3.se.freebsd.org") }, { "Taiwan", "ftp.tw.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.tw.freebsd.org") }, { "Taiwan #2", "ftp2.tw.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.tw.freebsd.org") }, { "Taiwan #3", "ftp3.tw.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp3.tw.freebsd.org") }, { "Thailand", "ftp.nectec.or.th", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AS("=ftp://ftp.nectec.or.th/pub/mirrors/FreeBSD/") }, { "UK", "ftp.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.uk.freebsd.org") }, { "UK #2", "ftp2.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.uk.freebsd.org") }, { "UK #3", "ftp3.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp3.uk.freebsd.org") }, { "UK #4", "ftp4.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp4.uk.freebsd.org") }, { "USA", "ftp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.freebsd.org") }, { "USA #2", "ftp2.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.freebsd.org") }, { "USA #3", "ftp3.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp3.freebsd.org") }, { "USA #4", "ftp4.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp4.freebsd.org") }, { "USA #5", "ftp5.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp5.freebsd.org") }, { "USA #6", "ftp6.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=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 } }, }; /* 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 CDROM 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 CDROM", "Install from a FreeBSD CDROM", 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 DOS", "Install from a DOS partition", NULL, mediaSetDOS }, { "5 NFS", "Install over NFS", NULL, mediaSetNFS }, { "6 File System", "Install from an existing filesystem", NULL, mediaSetUFS }, { "7 Floppy", "Install from a floppy disk set", NULL, mediaSetFloppy }, { "8 Tape", "Install from SCSI or QIC tape", NULL, mediaSetTape }, { "9 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]. When you are finished, chose the Exit\n" "item or press [ENTER].", "Press F1 for more information on these options.", "distributions", { { "1 Developer", "Full sources, binaries and doc but no games", checkDistDeveloper, distSetDeveloper }, { "2 X-Developer", "Same as above + X Window System", checkDistXDeveloper, distSetXDeveloper }, { "3 Kern-Developer", "Full binaries and doc, kernel sources only", checkDistKernDeveloper, distSetKernDeveloper }, { "4 X-Kern-Developer", "Same as above + X Window System", checkDistXKernDeveloper, distSetXKernDeveloper }, { "5 User", "Average user - binaries and doc only", checkDistUser, distSetUser }, { "6 X-User", "Same as above + X Window System", checkDistXUser, distSetXUser }, { "7 Minimal", "The smallest configuration possible", checkDistMinimum, distSetMinimum }, { "8 Custom", "Specify your own distribution set", NULL, dmenuSubmenu, NULL, &MenuSubDistributions, '>', '>', '>' }, { "8 All", "All sources and binaries (incl X Window System)", checkDistEverything, distSetEverything }, { "9 Clear", "Reset selected distribution list to nothing", NULL, distReset, NULL, NULL, ' ', ' ', ' ' }, { "0 Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { 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 \"bin\". WARNING: Do not export the\n" "DES distribution out of the U.S.! It is for U.S. customers only.", NULL, NULL, { { "bin", "Binary base distribution (required)", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_BIN }, { "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 { "DES", "DES encryption code - NOT FOR EXPORT!", DESFlagCheck, distSetDES }, { "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 but DES", srcFlagCheck, distSetSrc }, { "ports", "The FreeBSD Ports collection", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_PORTS }, { "XFree86", "The XFree86 3.3.3.1 distribution", x11FlagCheck, distSetXF86 }, { "All", "All sources, binaries and X Window System binaries", NULL, distSetEverything, NULL, NULL, ' ', ' ', ' ' }, { "Clear", "Reset all of the above", NULL, distReset, NULL, NULL, ' ', ' ', ' ' }, { "Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { NULL } }, }; DMenu MenuDESDistributions = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "Select the encryption facilities you wish to install.", "Please check off any special DES-based encryption distributions\n" "you would like to install. Please note that these services are NOT FOR\n" "EXPORT from the United States. For information on non-U.S. FTP\n" "distributions of this software, please consult the release notes.", NULL, NULL, { { "des", "Basic DES encryption services", dmenuFlagCheck, dmenuSetFlag, NULL, &DESDists, '[', 'X', ']', DIST_DES_DES, }, { "krb", "Kerberos encryption services", dmenuFlagCheck, dmenuSetFlag, NULL, &DESDists, '[', 'X', ']', DIST_DES_KERBEROS }, { "skerbero", "Sources for Kerberos IV", dmenuFlagCheck, dmenuSetFlag, NULL, &DESDists, '[', 'X', ']', DIST_DES_SKERBEROS }, { "ssecure", "Sources for DES", dmenuFlagCheck, dmenuSetFlag, NULL, &DESDists, '[', 'X', ']', DIST_DES_SSECURE }, { "scrypto", "Export controlled crypto sources", dmenuFlagCheck, dmenuSetFlag, NULL, &DESDists, '[', 'X', ']', DIST_DES_SCRYPTO }, { "Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { 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, { { "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 }, { "share", "/usr/src/share (documents and shared files)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_SHARE }, { "sys", "/usr/src/sys (FreeBSD kernel)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_SYS }, { "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 }, { "All", "Select all of the above", NULL, setSrc, NULL, NULL, ' ', ' ', ' ' }, { "Clear", "Reset all of the above", NULL, clearSrc, NULL, NULL, ' ', ' ', ' ' }, { "Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { NULL } }, }; DMenu MenuXF86Select = { DMENU_NORMAL_TYPE, "XFree86 3.3.3.1 Distribution", "Please select the components you need from the XFree86 3.3.3.1\n" "distribution sets.", "Press F1 to read the XFree86 release notes for FreeBSD", "XF86", { { "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 }, { "All", "Select all XFree86 distribution sets", NULL, setX11All }, { "Clear", "Reset XFree86 distribution list", NULL, clearX11All }, { "Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { NULL } }, }; DMenu MenuXF86SelectCore = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "XFree86 3.3.3.1 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.", "Press F1 to read the XFree86 release notes for FreeBSD", "XF86", { { "bin", "Client applications and shared libs", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_BIN }, { "cfg", "Configuration files", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_CFG }, { "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 }, { "lib", "Data files needed at runtime", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_LIB }, { "lk98", "Server link kit for PC98 machines", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_LKIT98 }, { "lkit", "Server link kit for all other machines", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_LKIT }, { "man", "Manual pages", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_MAN }, { "prog", "Programmer's header and library files", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_PROG }, { "set", "XFree86 Setup Utility", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_SET }, { "9set", "XFree86 Setup Utility for PC98 machines", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_9SET }, { "sources", "XFree86 3.3.3.1 standard sources", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_SRC }, { "csources", "XFree86 3.3.3.1 contrib sources", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_CSRC }, { "All", "Select all of the above", NULL, setX11Misc, NULL, NULL, ' ', ' ', ' ' }, { "Clear", "Reset all of the above", NULL, clearX11Misc, NULL, NULL, ' ', ' ', ' ' }, { "Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { 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).", "Press F1 to read the XFree86 release notes for FreeBSD", "XF86", { { "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 }, { "All", "All fonts", NULL, setX11Fonts, NULL, NULL, ' ', ' ', ' ' }, { "Clear", "Reset font selections", NULL, clearX11Fonts, NULL, NULL, ' ', ' ', ' ' }, { "Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { 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.", "Press F1 to read the XFree86 release notes for FreeBSD", "XF86", { { "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 }, { "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 }, { "nest", "A nested server for testing purposes", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_NEST }, { "PC98", "Select an X server for a NEC PC98 [Submenu]", NULL, dmenuSubmenu, NULL, &MenuXF86SelectPC98Server, '>', ' ', '>', 0 }, { "All", "Select all of the above", NULL, setX11Servers, NULL, NULL, ' ', ' ', ' ' }, { "Clear", "Reset all of the above", NULL, clearX11Servers, NULL, NULL, ' ', ' ', ' ' }, { "Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { NULL } }, }; 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).", "Press F1 to read the XFree86 release notes for FreeBSD", "XF86", { { "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 }, { "Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { NULL } } }; 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]. To de-select it, press [SPACE] again.\n\n" "Select OK or Cancel to 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 chose \"other\"\n" "to enter an arbitrary URL for browsing.", "Press F1 for more help on what you see here.", "html", { { "Handbook", "The FreeBSD Handbook.", NULL, docShowDocument }, { "FAQ", "The Frequently Asked Questions guide.", NULL, docShowDocument }, { "Home", "The Home Pages for the FreeBSD Project (requires net)", NULL, docShowDocument }, { "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", { { "1 Options", "View/Set various installation options", NULL, optionsEditor }, #ifdef __alpha__ { "2 Label", "Label disk partitions", NULL, diskLabelEditor }, { "3 Distributions", "Select distribution(s) to extract", NULL, dmenuSubmenu, NULL, &MenuDistributions }, { "4 Media", "Choose the installation media type", NULL, dmenuSubmenu, NULL, &MenuMedia }, { "5 Commit", "Perform any pending Partition/Label/Extract actions", NULL, installCustomCommit }, #else { "2 Partition", "Allocate disk space for FreeBSD", NULL, diskPartitionEditor }, { "3 Label", "Label allocated 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 }, #endif { "0 Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { NULL } }, }; /* MBR type menu */ DMenu MenuMBRType = { DMENU_RADIO_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 }, { "Standard", "Install a standard MBR (no boot manager)", dmenuRadioCheck, dmenuSetValue, NULL, &BootMgr, '(', '*', ')', 1 }, { "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", { { "D Distributions", "Install additional distribution sets", NULL, distExtractAll }, { "P Packages", "Install pre-packaged software for FreeBSD", NULL, configPackages }, { "R Root Password", "Set the system manager's password", NULL, dmenuSystemCommand, NULL, "passwd root" }, { "L Label", "The disk Label editor", NULL, diskLabelEditor }, { "F Fdisk", "The disk Slice (PC-style partition) Editor", NULL, diskPartitionEditor }, { "1 User Management", "Add user and group information", NULL, dmenuSubmenu, NULL, &MenuUsermgmt }, { "2 Console", "Customize system console behavior", NULL, dmenuSubmenu, NULL, &MenuSyscons }, { "3 Time Zone", "Set which time zone you're in", NULL, dmenuSystemCommand, NULL, "tzsetup" }, { "4 Media", "Change the installation media type", NULL, dmenuSubmenu, NULL, &MenuMedia }, { "5 Mouse", "Configure your mouse", NULL, dmenuSubmenu, NULL, &MenuMouse, NULL }, { "6 Networking", "Configure additional network services", NULL, dmenuSubmenu, NULL, &MenuNetworking }, { "7 Startup", "Configure system startup options", NULL, dmenuSubmenu, NULL, &MenuStartup }, { "8 Options", "View/Set various installation options", NULL, optionsEditor }, { "D HTML Docs", "Go to the HTML documentation menu (post-install)", NULL, docBrowser }, { "X XFree86", "Configure XFree86", NULL, configXEnvironment }, - { "U Register", "Register yourself or company as a FreeBSD user.", NULL, configRegister }, { "E Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { 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. Remember to use SPACE to select items! The\n" "RETURN key will leave this menu (as with all checkbox menus).", NULL, NULL, { { "APM", "Auto-power management services (typically laptops)", dmenuVarCheck, dmenuToggleVariable, NULL, "apm_enable=YES" }, { "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" }, { " ", " -- ", 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 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" }, { "linux", "This host wants to be able to run linux binaries.", dmenuVarCheck, dmenuToggleVariable, NULL, "linux_enable=YES" }, { "quotas", "This host wishes to check quotas on startup.", dmenuVarCheck, dmenuToggleVariable, NULL, "check_quotas=YES" }, { "SCO", "This host wants to be able to run IBCS2 binaries.", dmenuVarCheck, dmenuToggleVariable, NULL, "ibcs2_enable=YES" }, { "Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { 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, { { "Interfaces", "Configure additional network interfaces", NULL, tcpMenuSelect }, { "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" }, { "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" }, { "TCP Extensions", "Allow RFC1323 and RFC1644 TCP extensions?", dmenuVarCheck, dmenuToggleVariable, NULL, "tcp_extensions=YES" }, { "Gateway", "This machine will route packets between interfaces", dmenuVarCheck, dmenuToggleVariable, NULL, "gateway_enable=YES" }, { "Ntpdate", "Select a clock-synchronization server", dmenuVarCheck, dmenuSubmenu, NULL, &MenuNTP, '[', 'X', ']', "ntpdate_enable=YES" }, { "router", "Select routing daemon (default: routed)", dmenuVarCheck, configRouter, NULL, "router" }, { "Rwhod", "This machine wants to run the rwho daemon", dmenuVarCheck, dmenuToggleVariable, NULL, "rwhod_enable=YES" }, { "Anon FTP", "This machine wishes to allow anonymous FTP.", dmenuVarCheck, configAnonFTP, NULL, "anon_ftp" }, { "PCNFSD", "Run authentication server for clients with PC-NFS.", dmenuVarCheck, configPCNFSD, NULL, "pcnfsd" }, { "Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { NULL } }, }; DMenu MenuNTP = { DMENU_RADIO_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 }, { "Australia", "ntp.syd.dms.csiro.au (HP 5061 Cesium Beam)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.syd.dms.csiro.au" }, { "Canada", "tick.usask.ca (GOES clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tick.usask.ca" }, { "France", "canon.inria.fr (TDF clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=canon.inria.fr" }, { "Germany", "ntps1-{0,1,2}.uni-erlangen.de (GPS)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntps1-0.uni-erlangen.de" }, { "Germany #2", "ntps1-0.cs.tu-berlin.de (GPS)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntps1-0.cs.tu-berlin.de" }, { "Japan", "clock.nc.fukuoka-u.ac.jp (GPS clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock.nc.fukuoka-u.ac.jp" }, { "Japan #2", "clock.tl.fukuoka-u.ac.jp (GPS clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock.tl.fukuoka-u.ac.jp" }, { "Netherlands", "ntp0.nl.net (GPS clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp0.nl.net" }, { "Norway", "timer.unik.no (NTP clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=timer.unik.no" }, { "Sweden", "Time1.Stupi.SE (Cesium/GPS)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=Time1.Stupi.SE" }, { "Switzerland", "swisstime.ethz.ch (DCF77 clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=swisstime.ethz.ch" }, { "U.S. East Coast", "bitsy.mit.edu (WWV clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=bitsy.mit.edu" }, { "U.S. East Coast #2", "otc1.psu.edu (WWV clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=otc1.psu.edu" }, { "U.S. West Coast", "apple.com (WWV clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=apple.com" }, { "U.S. West Coast #2", "clepsydra.dec.com (GOES clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clepsydra.dec.com" }, { "U.S. West Coast #3", "clock.llnl.gov (WWVB clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock.llnl.gov" }, { "U.S. Midwest", "ncar.ucar.edu (WWVB clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ncar.ucar.edu" }, { "U.S. Pacific", "chantry.hawaii.net (WWV/H clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=chantry.hawaii.net" }, { "U.S. Southwest", "shorty.chpc.utexas.edu (WWV clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=shorty.chpc.utexas.edu" }, { 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, { { "Font", "Choose an alternate screen font", NULL, dmenuSubmenu, NULL, &MenuSysconsFont }, { "Keymap", "Choose an alternate keyboard map", NULL, dmenuSubmenu, NULL, &MenuSysconsKeymap }, { "Repeat", "Set the rate at which keys repeat", NULL, dmenuSubmenu, NULL, &MenuSysconsKeyrate }, { "Saver", "Configure the screen saver", NULL, dmenuSubmenu, NULL, &MenuSysconsSaver }, { "Screenmap", "Choose an alternate screenmap", NULL, dmenuSubmenu, NULL, &MenuSysconsScrnmap }, { "Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { NULL } }, }; DMenu MenuSysconsKeymap = { DMENU_RADIO_TYPE | DMENU_SELECTION_RETURNS, "System Console Keymap", "The default system console driver for FreeBSD (syscons) defaults\n" "to a standard \"American\" keyboard map. Users in other countries\n" "(or with different keyboard preferences) may wish to choose one of\n" "the other keymaps below.\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" }, { "Croatian ISO", "Croatian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=hr.iso" }, { "Danish CP865", "Danish Code Page 865 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=danish.cp865" }, { "Danish ISO", "Danish ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=danish.iso" }, { "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" }, { "Latin American", "Latin American ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=lat-amer" }, { "Japanese 106", "Japanese 106 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=jp.106" }, { "Norway ISO", "Norwegian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=norwegian.iso" }, { "Polish ISO", "Polish ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=pl_PL.ISO_8859-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 CP866", "Russian CP866 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=ru.cp866" }, { "Russia KOI8-R", "Russian KOI8-R keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=ru.koi8-r" }, { "Slovenian", "Slovenian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=si.iso.acc" }, { "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", "Swiss French ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swissfrench.iso" }, { "Swiss German", "Swiss German ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swissgerman.iso" }, { "U.K. CP850", "United Kingdom Code Page 850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=uk.cp850" }, { "U.K. ISO", "United Kingdom ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=uk.iso" }, { "U.S. Dvorak", "United States Dvorak keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=us.dvorak" }, { "U.S. ISO", "United States ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=us.iso" }, { NULL } }, }; DMenu MenuSysconsKeyrate = { DMENU_RADIO_TYPE | DMENU_SELECTION_RETURNS, "System Console Keyboard Repeat Rate", "This menu allows you to set the speed at which keys repeat\n" "when held down.", "Choose a keyboard repeat rate", NULL, { { "Slow", "Slow keyboard repeat rate", 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_RADIO_TYPE | DMENU_SELECTION_RETURNS, "System Console Screen Saver", "By default, the console driver will not attempt to do anything\n" "special with your screen when it's idle. If you expect to leave your\n" "monitor switched on and idle for long periods of time then you should\n" "probably enable one of these screen savers to prevent phosphor burn-in.", "Choose a nifty-looking screen saver", NULL, { { "Blank", "Simply blank the screen", dmenuVarCheck, configSaver, NULL, "saver=blank" }, { "Daemon", "\"BSD Daemon\" animated screen saver (text)", dmenuVarCheck, configSaver, NULL, "saver=daemon" }, { "Fade", "Fade out effect screen saver", dmenuVarCheck, configSaver, NULL, "saver=fade" }, { "Green", "\"Green\" power saving mode (if supported by monitor)", dmenuVarCheck, configSaver, NULL, "saver=green" }, { "Logo", "\"BSD Daemon\" animated screen saver (graphics)", dmenuVarCheck, configSaver, NULL, "saver=logo" }, { "Rain", "Rain drops screen saver", dmenuVarCheck, configSaver, NULL, "saver=rain" }, { "Snake", "Draw a FreeBSD \"snake\" on your screen", dmenuVarCheck, configSaver, NULL, "saver=snake" }, { "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_RADIO_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, { { "None", "No screenmap, use default font", dmenuVarCheck, dmenuSetVariable, NULL, "scrnmap=NO" }, { "KOI8-R to IBM866", "Russian KOI8-R to IBM 866 screenmap", dmenuVarCheck, dmenuSetVariable, NULL, "scrnmap=koi8-r2cp866" }, { "ISO 8859-1 to IBM437", "W-Europe ISO 8859-1 to IBM 437 screenmap", dmenuVarCheck, dmenuSetVariable, NULL, "scrnmap=iso-8859-1_to_cp437" }, { NULL } }, }; DMenu MenuSysconsFont = { DMENU_RADIO_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, { { "None", "Use default font", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=NO,font8x14=NO,font8x16=NO" }, { "IBM 437", "English", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp437-8x8,font8x14=cp437-8x14,font8x16=cp437-8x16" }, { "IBM 850", "Western Europe, IBM encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp850-8x8,font8x14=cp850-8x14,font8x16=cp850-8x16" }, { "IBM 865", "Norwegian, IBM encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp865-8x8,font8x14=cp865-8x14,font8x16=cp865-8x16" }, { "IBM 866", "Russian, IBM encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp866-8x8,font8x14=cp866-8x14,font8x16=cp866-8x16" }, { "ISO 8859-1", "Western Europe, ISO encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=iso-8x8,font8x14=iso-8x14,font8x16=iso-8x16" }, { "KOI8-R", "Russian, KOI8-R encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=koi8-r-8x8,font8x14=koi8-r-8x14,font8x16=koi8-r-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, { { "Add user", "Add a new user to the system.", NULL, userAddUser }, { "Add group", "Add a new user group to the system.", NULL, userAddGroup }, { "Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { 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 2nd FreeBSD CDROM, 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", { { "1 CDROM", "Use the 2nd \"live\" CDROM from the distribution", NULL, installFixitCDROM }, { "2 Floppy", "Use a floppy generated from the fixit image", NULL, installFixitFloppy }, { "3 Shell", "Start an Emergency Holographic Shell", NULL, installFixitHoloShell }, { NULL } }, }; diff --git a/release/sysinstall/register.c b/release/sysinstall/register.c deleted file mode 100644 index c3e3bf13b250..000000000000 --- a/release/sysinstall/register.c +++ /dev/null @@ -1,353 +0,0 @@ -/* - * The new sysinstall program. - * - * This is probably the last program in the `sysinstall' line - the next - * generation being essentially a complete rewrite. - * - * $Id: register.c,v 1.8 1997/08/18 21:47:34 jkh Exp $ - * - * Copyright (c) 1997 - * 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 - -#define REGISTER_HELPFILE "register" -#define REGISTRATION_FNAME "/new-registration" -#define REGISTRATION_ADDRESS "register@freebsd.org" -#define MAJORDOMO_ADDRESS "majordomo@freebsd.org" - -#define FIRSTNAME_FIELD_LEN 25 -#define LASTNAME_FIELD_LEN 30 -#define EMAIL_FIELD_LEN 61 -#define ADDRESS_FIELD_LEN 160 -#define CITY_FIELD_LEN 20 -#define STATE_FIELD_LEN 15 -#define ZIP_FIELD_LEN 15 - -static char firstname[FIRSTNAME_FIELD_LEN], lastname[LASTNAME_FIELD_LEN], - email[EMAIL_FIELD_LEN], address[ADDRESS_FIELD_LEN], - city[CITY_FIELD_LEN], state[STATE_FIELD_LEN], zip[ZIP_FIELD_LEN]; - -static int okbutton, cancelbutton; - -/* What the screen size is meant to be */ -#define REGISTER_DIALOG_Y 0 -#define REGISTER_DIALOG_X 2 -#define REGISTER_DIALOG_WIDTH COLS - 4 -#define REGISTER_DIALOG_HEIGHT LINES - 2 - -static Layout layout[] = { -#define LAYOUT_LASTNAME 0 - { 1, 2, LASTNAME_FIELD_LEN - 1, LASTNAME_FIELD_LEN - 1, - "Last Name:", "Your surname (family name) or company name should go here.", - lastname, STRINGOBJ, NULL }, -#define LAYOUT_FIRSTNAME 1 - { 1, 36, FIRSTNAME_FIELD_LEN - 1, FIRSTNAME_FIELD_LEN - 1, - "First Name:", "Your given name or a contact name if registering for a company.", - firstname, STRINGOBJ, NULL }, -#define LAYOUT_EMAIL 2 - { 6, 2, EMAIL_FIELD_LEN - 1, EMAIL_FIELD_LEN - 1, - "EMail Address:", - "Where you'd like any announcement email sent, e.g. bsdmail@someplace.com", - email, STRINGOBJ, NULL }, -#define LAYOUT_ADDRESS 3 - { 10, 2, 60, ADDRESS_FIELD_LEN - 1, - "Street address:", "Your street address, all in one line (optional).", - address, STRINGOBJ, NULL }, -#define LAYOUT_CITY 4 - { 14, 2, CITY_FIELD_LEN - 1, CITY_FIELD_LEN - 1, - "City:", "Your city name (optional)", - city, STRINGOBJ, NULL }, -#define LAYOUT_STATE 5 - { 14, 26, STATE_FIELD_LEN - 1, STATE_FIELD_LEN - 1, - "State / Province:", - "Your local state or province.", - state, STRINGOBJ, NULL }, -#define LAYOUT_ZIP 5 - { 14, 50, ZIP_FIELD_LEN - 1, ZIP_FIELD_LEN - 1, - "Zip / Country Code:", - "Your U.S. Zip code or International country code (optional).", - zip, STRINGOBJ, NULL }, -#define LAYOUT_OKBUTTON 7 - { 18, 20, 0, 0, - "OK", "Select this if you are happy with these settings", - &okbutton, BUTTONOBJ, NULL }, -#define LAYOUT_CANCELBUTTON 8 - { 18, 40, 0, 0, - "CANCEL", "Select this if you wish to cancel this registration", - &cancelbutton, BUTTONOBJ, NULL }, - { NULL }, -}; - -/* Submenu selections */ -#define COMMERCE_MAIL 0 -#define COMMERCE_EMAIL 1 -#define ANNOUNCE_LIST 2 -#define NEWSLETTER 3 - -static struct { int y, x, sel; char *desc, *allowed; } hotspots[] = { - { 5, 35, 0, "Do you wish to receive FreeBSD [ONLY!] related commercial mail?", "Y" }, - { 5, 57, 0, "Do you wish to receive FreeBSD [ONLY!] related commercial email?", "Y" }, - { 6, 35, 0, "Sign up (with majordomo@FreeBSD.org) for important announcements?", "Y" }, - { 10, 35, 0, "Sign up for the FreeBSD Newsletter? P = Postal (paper) copy, E = Email", "PE" }, -}; - -/* Check the accuracy of user's choices before letting them move on */ -static int -verifySettings(void) -{ - if (!lastname[0]) { - msgConfirm("Missing last name / company name field."); - return 0; - } - else if (email[0] && !index(email, '@')) - return !msgYesNo("Hmmmm, this email address has no `@' in it. Are you\n" - "sure that %s is a valid address?"); - else if (address[0] && !city[0]) { - msgConfirm("Missing City name."); - return 0; - } - else if (!email[0] && (hotspots[COMMERCE_EMAIL].sel || hotspots[NEWSLETTER].sel == 2)) { - msgConfirm("You've signed up to receive commercial email or the newsletter by\n" - "email but have no email address specified!"); - return 0; - } - else if (!address[0] && (hotspots[COMMERCE_MAIL].sel || hotspots[NEWSLETTER].sel == 1)) { - msgConfirm("You've signed up to receive commercial mail or the newsletter by\n" - "post but have no postal address specified!"); - return 0; - } - return 1; -} - -/* Do the actual work of mailing out the registration once all is filled in */ -static void -handle_registration(void) -{ - FILE *fp; - WINDOW *save = savescr(); - - dialog_clear_norefresh(); - (void)unlink(REGISTRATION_FNAME); - fp = fopen(REGISTRATION_FNAME, "w"); - if (!fp) { - msgConfirm("Unable to open %s for the new registration.\n" - "That's pretty bad! Please fix whatever's wrong\n" - "and try this registration again."); - restorescr(save); - return; - } - fprintf(fp, "\n"); - fprintf(fp, "%s\n", firstname); - fprintf(fp, "%s\n", lastname); - fprintf(fp, "%s\n", email); - fprintf(fp, "
%s
\n", address); - fprintf(fp, "%s\n", city); - fprintf(fp, "%s\n", state); - fprintf(fp, "%s\n", zip); - fprintf(fp, "\n", - hotspots[COMMERCE_EMAIL].sel ? "yes" : "no", hotspots[COMMERCE_MAIL].sel ? "yes" : "no", - hotspots[ANNOUNCE_LIST].sel ? "yes" : "no", - hotspots[NEWSLETTER].sel == 0 ? "no" : hotspots[NEWSLETTER].sel == 1 ? "postal" : "email"); - fprintf(fp, "%s\n", variable_get(VAR_RELNAME)); - fprintf(fp, "
\n"); - fclose(fp); - dialog_clear_norefresh(); - if (!msgYesNo("Do you have a working network connection and outgoing email\n" - "enabled at this time? I need to be able to reach freebsd.org\n" - "in order to submit your registration.")) { - dialog_clear_norefresh(); - if (!vsystem("mail %s < %s", REGISTRATION_ADDRESS, REGISTRATION_FNAME)) { - msgConfirm("Thank you! Your registration has been sent in successfully.\n"); - (void)unlink(REGISTRATION_FNAME); - } - else { - msgConfirm("Argh! The mail program returned a bad status - there\n" - "must be something still not quite configured correctly.\n" - "leaving the registration in: %s\n" - "When you're connected to the net and ready to send it,\n" - "simply type: mail %s < %s\n", REGISTRATION_ADDRESS, REGISTRATION_FNAME, - REGISTRATION_FNAME); - } - if (hotspots[ANNOUNCE_LIST].sel) { - char *cp; - - dialog_clear_norefresh(); - cp = msgGetInput(email, "What email address would you like to subscribe under?\n" - "This is a fairly low-traffic mailing list and only generates\n" - "around 5 messages a month, so it's also safe to receive at your\n" - "standard email address."); - if (!cp) - msgConfirm("OK, I won't subscribe to announce at this time. To do it manually\n" - "yourself, simply send mail to %s.", MAJORDOMO_ADDRESS); - else { - dialog_clear_norefresh(); - if (!vsystem("echo subscribe freebsd-announce %s | mail %s", email, MAJORDOMO_ADDRESS)) - msgConfirm("Your request to join the announce mailing list has been sent.\n" - "you should receive notification back in 24 hours or less, otherwise\n" - "something has gone wrong and you should try this again by sending\n" - "a message to %s which contains the line:\n\n" - "subscribe freebsd-announce %s\n", MAJORDOMO_ADDRESS, email); - else - msgConfirm("Argh! The mail program returned a bad status - there\n" - "must be something still not quite configured correctly.\n" - "Please fix this then try again by sending a message to\n" - "to %s which contains the line:\n\n" - "subscribe freebsd-announce %s\n", MAJORDOMO_ADDRESS, email); - } - } - } - else { - dialog_clear_norefresh(); - msgConfirm("OK, your registration has been left in the file %s\n" - "When you're connected to the net and ready to send it,\n" - "simply type: mail %s < %s\n", REGISTRATION_FNAME, - REGISTRATION_ADDRESS, REGISTRATION_FNAME); - } - restorescr(save); -} - -/* Put up a subdialog for the registration options */ -static void -subdialog(WINDOW *win) -{ - int i, j, attrs; - char help_line[80]; - - attrs = getattrs(win); - mvwaddstr(win, hotspots[COMMERCE_MAIL].y, hotspots[COMMERCE_MAIL].x - 1, "[ ] Postal Adverts"); - mvwaddstr(win, hotspots[COMMERCE_EMAIL].y, hotspots[COMMERCE_EMAIL].x - 1, "[ ] Email Adverts"); - mvwaddstr(win, hotspots[ANNOUNCE_LIST].y, hotspots[ANNOUNCE_LIST].x - 1, - "[ ] The announce@FreeBSD.ORG mailing list."); - mvwaddstr(win, hotspots[NEWSLETTER].y, hotspots[NEWSLETTER].x - 1, "[ ] The FreeBSD Newsletter."); - /* Tack up the initial values */ - for (i = 0; i < sizeof(hotspots) / sizeof(hotspots[0]); i++) { - wattrset(win, attrs | A_BOLD); - mvwaddch(win, hotspots[i].y, hotspots[i].x, hotspots[i].sel ? hotspots[i].allowed[hotspots[i].sel - 1] : 'N'); - } - wattrset(win, attrs); - wrefresh(win); - - for (i = 0; i < sizeof(hotspots) / sizeof(hotspots[0]);) { - int ch, len = strlen(hotspots[i].desc); - char *cp; - - /* Display the help line at the bottom of the screen */ - for (j = 0; j < 79; j++) - help_line[j] = (j < len) ? hotspots[i].desc[j] : ' '; - help_line[j] = '\0'; - use_helpline(help_line); - display_helpline(win, LINES - 1, COLS - 1); - wmove(win, hotspots[i].y, hotspots[i].x); - wrefresh(win); - switch(ch = toupper(getch())) { - case KEY_UP: - if (i) - i--; - continue; - - case KEY_DOWN: - case '\011': /* TAB */ - case '\012': /* ^J */ - case '\014': /* ^M */ - /* Treat as a no-change op */ - ++i; - break; - - case 'N': /* No is generic to all */ - hotspots[i].sel = 0; - wattrset(win, attrs | A_BOLD); - mvwaddch(win, hotspots[i].y, hotspots[i].x, 'N'); - wattrset(win, attrs); - wrefresh(win); - ++i; - break; - - default: - cp = index(hotspots[i].allowed, ch); - if (cp) { - hotspots[i].sel = (cp - hotspots[i].allowed) + 1; - wattrset(win, attrs | A_BOLD); - mvwaddch(win, hotspots[i].y, hotspots[i].x, *cp); - wattrset(win, attrs); - wrefresh(win); - ++i; - } - else - beep(); - break; - } - } -} - -/* Register a user */ -int -registerOpenDialog(void) -{ - WINDOW *ds_win, *save = savescr(); - ComposeObj *obj = NULL; - int n = 0, cancel = FALSE; - int max, ret = DITEM_SUCCESS; - - dialog_clear_norefresh(); - /* We need a curses window */ - if (!(ds_win = openLayoutDialog(REGISTER_HELPFILE, " FreeBSD Registration Form: Press F1 for Help / General Info ", - REGISTER_DIALOG_X, REGISTER_DIALOG_Y, - REGISTER_DIALOG_WIDTH, REGISTER_DIALOG_HEIGHT))) { - beep(); - msgConfirm("Cannot open registration dialog window!!"); - restorescr(save); - return DITEM_FAILURE; - } - - /* Some more initialisation before we go into the main input loop */ - obj = initLayoutDialog(ds_win, layout, REGISTER_DIALOG_X, REGISTER_DIALOG_Y, &max); - -reenter: - cancelbutton = okbutton = 0; - while (layoutDialogLoop(ds_win, layout, &obj, &n, max, &cancelbutton, &cancel)) { - if (n == LAYOUT_ADDRESS) - subdialog(ds_win); - } - - if (!cancel && !verifySettings()) - goto reenter; - - /* OK, we've got a valid registration, now push it out */ - if (!cancel) - handle_registration(); - - /* Clear this crap off the screen */ - delwin(ds_win); - dialog_clear_norefresh(); - use_helpfile(NULL); - - restorescr(save); - return ret; -} diff --git a/release/sysinstall/sysinstall.8 b/release/sysinstall/sysinstall.8 index c6e7fcbc9126..054c5cbf4194 100644 --- a/release/sysinstall/sysinstall.8 +++ b/release/sysinstall/sysinstall.8 @@ -1,802 +1,794 @@ .\" Copyright (c) 1997 .\" 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. .\" 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 AND CONTRIBUTORS ``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 CONTRIBUTORS 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, 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. .\" -.\" $Id: sysinstall.8,v 1.15 1999/02/05 09:28:16 jkh Exp $ +.\" $Id: sysinstall.8,v 1.16 1999/02/18 23:59:58 jkh Exp $ .\" .Dd August 9, 1997 .Dt SYSINSTALL 8 .Os .Sh NAME .Nm sysinstall .Nd system installation and configuration tool .Sh SYNOPSIS .Nm .Op Ar var=value .Op Ar function .Op Ar ... .Sh DESCRIPTION .Nm is a utility for installing and configuring FreeBSD systems. It is the first utility invoked by the FreeBSD installation boot floppy and is also copied into .Pa /stand/sysinstall on newly installed FreeBSD systems for use in later configuring the system. .Pp The .Nm program is generally invoked without arguments for the default behavior, where the main installation/configuration menu is presented. On those occasions where it is deemed necessary to invoke a subsystem of sysinstall directly, however, it is also possible to do so by naming the appropriate function entry points on the command line. Since this action is essentially identical to running an installation script, each command-line argument corresponding to a line of script, the reader is encouraged to read the section on scripting for more information on this feature. .Pp .Sh NOTES .Nm is essentially nothing more than a monolithic C program with the ability to write MBRs and disk labels (through the services of the .Xr libdisk 3 library) and install distributions or packages onto new and existing FreeBSD systems. It also contains some extra intelligence for running as a replacement for .Xr init 8 when it's invoked by the FreeBSD installation boot procedure. It assumes very little in the way of additional utility support and performs most file system operations by calling the relevant syscalls (such as .Xr mount 2 ) directly. .Pp .Nm currently uses the .Xr libdialog 3 library to do user interaction with simple ANSI line graphics, color support for which is enabled by either running on a syscons VTY or some other color-capable terminal emulator (newer versions of xterm will support color when using the ``xterm-color'' termcap entry). .Pp This product is currently at the end of its life cycle and will be replaced in FreeBSD 3.1 (hopefully) by the .Xr setup 1 utility. .Sh RUNNING SCRIPTS .Nm may be either driven interactively through its various internal menus or run in batch mode, driven by an external script. Such a script may be loaded and executed in one of 3 ways: .Bl -tag -width Ds -compact .It Sy "LOAD_CONFIG_FILE" If .Nm is compiled with LOAD_CONFIG_FILE set in the environment (or in the Makefile) to some value, then that value will be used as the filename to automatically look for and load when .Nm starts up and with no user interaction required. This option is aimed primarily at large sites who wish to create a single prototype install for multiple machines with largely identical configurations and/or installation options. .It Sy "MAIN MENU" If .Nm is run interactively, that is to say in the default manner, it will bring up a main menu which contains a "load config file" option. Selecting this option will prompt for the name of a script file which it then will attempt to load from a DOS or UFS formatted floppy. .It Sy "COMMAND LINE" Each command line argument is treated as a script directive when .Nm is run in multi-user mode. Execution ends either by explicit request (e.g. calling the .Ar shutdown directive), upon reaching the end of the argument list or on error. .Pp For example: .nf /stand/sysinstall _ftpPath=ftp:/ziggy/pub/ mediaSetFTP configPackages .fi Would initialize .Nm for FTP installation media (using the server `ziggy') and then bring up the package installation editor, exiting when finished. .El .Pp .Sh SCRIPT SYNTAX A script is a list of one or more directives, each directive taking the form of: .Ar var=value .Pp .Ar function .Pp or .Ar #somecomment Where .Ar var=value is the assignment of some internal .Nm variable, e.g. "ftpPass=FuNkYChiKn", and .Ar function is the name of an internal .Nm function, e.g. "mediaSetFTP", and .Ar #comment is a single-line comment for documentation purposes (ignored by sysinstall). Each directive must be by itself on a single line, functions taking their arguments by examining known variable names. This requires that you be sure to assign the relevant variables before calling a function which requires them. When and where a function depends on the settings of one or more variables will be noted in the following table: .Pp \fBFunction Glossary:\fR .Pp .Bl -tag -width indent .It configAnonFTP Invoke the Anonymous FTP configuration menu. .Pp \fBVariables:\fR None .It configRouter Select which routing daemon you wish to use, potentially loading any required 3rd-party routing daemons as necessary. .Pp \fBVariables:\fR .Bl -tag -width indent .It router can be set to the name of the desired routing daemon, e.g. ``routed'' or ``gated'', otherwise it is prompted for. .El .It configNFSServer Configure host as an NFS server. .Pp \fBVariables:\fR None .It configNTP Configure host as a user of the Network Time Protocol. .Pp \fBVariables:\fR .Bl -tag -width indent .It ntpdate_flags The flags to .Xr ntpdate 8 , that is to say the name of the server to sync from. .El .It configPCNFSD Configure host to support PC NFS. .Pp \fBVariables:\fR .Bl -tag -width indent .It pcnfsd_pkg The name of the PCNFSD package to load if necessary (defaults to hard coded version). .El .It configPackages Bring up the interactive package management menu. .Pp \fBVariables:\fR None -.It configRegister -Register the user with the FreeBSD counter. -.Pp -\fBVariables:\fR None .It configUsers Add users and/or groups to the system. .Pp \fBVariables:\fR None .It configXEnvironment Configure the X display subsystem. .Pp \fBVariables:\fR None .It diskPartitionEditor Invokes the disk partition (MBR) editor. .Pp \fBVariables:\fR .Bl -tag -width findx .It geometry The disk geometry, as a cyls/heads/sectors formatted string. Default: no change to geometry. .It partition Set to disk partitioning type or size, its value being .Ar free in order to use only remaining free space for FreeBSD, .Ar all to use the entire disk for FreeBSD but maintain a proper partition table, .Ar existing to use an existing FreeBSD partition (first found), .Ar exclusive to use the disk in ``dangerously dedicated'' mode or, finally, .Ar somenumber to allocate .Ar somenumber blocks of available free space to a new FreeBSD partition. Default: Interactive mode. .It bootManager is set to one of .Ar boot to signify the installation of a boot manager, .Ar standard to signify installation of a "standard" non-boot MGR DOS MBR or .Ar none to indicate that no change to the boot manager is desired. Default: none. .El .Pp Note: Nothing is actually written to disk by this function, a explicit call to .Ar diskPartitionWrite being required for that to happen. .It diskPartitionWrite Causes any pending MBR changes (typically from the .Ar diskPartitionEditor function) to be written out. .Pp \fBVariables:\fR None .It diskLabelEditor Invokes the disk label editor. This is a bit trickier from a script since you need to essentially label everything inside each FreeBSD (type 0xA5) partition created by the .Ar diskPartitionEditor function, and that requires knowing a few rules about how things are laid out. When creating a script to automatically allocate disk space and partition it up, it is suggested that you first perform the installation interactively at least once and take careful notes as to what the slice names will be, then and only then hardwiring them into the script. .Pp For example, let's say you have a SCSI disk on which you've created a new FreeBSD partition in slice 2 (your DOS partition residing in slice 1). The slice name would be .Ar da0s2 for the whole FreeBSD partition ( .Ar da0s1 being your DOS primary partition). Now let's further assume that you have 500MB in this partition and you want to sub-partition that space into root, swap, var and usr file systems for FreeBSD. Your invocation of the .Ar diskLabelEditor function might involve setting the following variables: .Bl -tag -width findx .It Li "da0s2-1=ufs 40960 /" A 20MB root file system (all sizes are in 512 byte blocks). .It Li "da0s2-2=swap 131072 /" A 64MB swap partition. .It Li "da0s2-3=ufs 204800 /var" A 100MB /var file system. .It Li "da0s2-4=ufs 0 /usr" With the balance of free space (around 316MB) going to the /usr file system. .El One can also use the .Ar diskLabelEditor for mounting or erasing existing partitions as well as creating new ones. Using the previous example again, let's say that we also wanted to mount our DOS partition and make sure that an .Pa /etc/fstab entry is created for it in the new installation. Before calling the .Ar diskLabelEditor function, we simply add an additional line: .nf da0s1=/dos_c N .fi before the call. This tells the label editor that you want to mount the first slice on .Pa /dos_c and not to attempt to newfs it (not that .Nm would attempt this for a DOS partition in any case, but it could just as easily be an existing UFS partition being named here and the 2nd field is non-optional). .Pp Note: No file system data is actually written to disk until an explicit call to .Ar diskLabelCommit is made. .It diskLabelCommit Writes out all pending disklabel information and creates and/or mounts any file systems which have requests pending from the .Ar diskLabelEditor function. .Pp \fBVariables:\fR None .It distReset Resets all selected distributions to the empty set (no distributions selected). .Pp \fBVariables:\fR None .It distSetCustom Allows the selection of a custom distribution set (e.g. not just on of the existing "canned" sets) with no user interaction. \fBVariables:\fR .Bl -tag -width indent .It dists List of distributions to load. Possible distribution values are: .Bl -tag -width indent .It Li bin The base binary distribution. .It Li doc Miscellaneous documentation .It Li games Games .It Li manpages Manual pages (unformatted) .It Li catpages Pre-formatted manual pages .It Li proflibs Profiled libraries for developers. .It Li dict Dictionary information (for tools like spell). .It Li info GNU info files and other extra docs. .It Li des DES encryption binaries and libraries. .It Li compat1x Compatibility with FreeBSD 1.x .It Li compat20 Compatibility with FreeBSD 2.0 .It Li compat21 Compatibility with FreeBSD 2.1 .It Li ports The ports collection. .It Li krb Kerberos binaries. .It Li ssecure /usr/src/secure .It Li sebones /usr/src/eBones .It Li sbase /usr/src/[top level files] .It Li scontrib /usr/src/contrib .It Li sgnu /usr/src/gnu .It Li setc /usr/src/etc .It Li sgames /usr/src/games .It Li sinclude /usr/src/include .It Li slib /usr/src/lib .It Li slibexec /usr/src/libexec .It Li srelease /usr/src/release .It Li sbin /usr/src/bin .It Li ssbin /usr/src/sbin .It Li sshare /usr/src/share .It Li ssys /usr/src/sys .It Li subin /usr/src/usr.bin .It Li susbin /usr/src/usr.sbin .It Li ssmailcf /usr/src/usr.sbin/sendmail/cf .It Li XF86-xc XFree86 official sources. .It Li XF86-co XFree86 contributed sources. .It Li Xbin XFree86 3.3.3.1 binaries. .It Li Xcfg XFree86 3.3.3.1 configuration files. .It Li Xdoc XFree86 3.3.3.1 documentation. .It Li Xhtml XFree86 3.3.3.1 HTML documentation. .It Li Xlib XFree86 3.3.3.1 libraries. .It Li Xlk98 XFree86 3.3.3.1 server link-kit for PC98 machines. .It Li Xlkit XFree86 3.3.3.1 server link-kit for standard machines. .It Li Xman XFree86 3.3.3.1 manual pages. .It Li Xprog XFree86 3.3.3.1 programmer's distribution. .It Li Xps XFree86 3.3.3.1 postscript documentation. .It Li Xset XFree86 3.3.3.1 graphical setup tool. .It Li X8514 XFree86 3.3.3.1 8514 server. .It Li X9480 XFree86 3.3.3.1 PC98 8-bit (256 color) PEGC-480 server. .It Li X9EGC XFree86 3.3.3.1 PC98 4-bit (16 color) EGC server. .It Li X9GA9 XFree86 3.3.3.1 PC98 GA-968V4/PCI (S3 968) server. .It Li X9GAN XFree86 3.3.3.1 PC98 GANB-WAP (cirrus) server. .It Li X9LPW XFree86 3.3.3.1 PC98 PowerWindowLB (S3) server. .It Li X9NKV XFree86 3.3.3.1 PC98 NKV-NEC (cirrus) server. .It Li X9NS3 XFree86 3.3.3.1 PC98 NEC (S3) server. .It Li X9SPW XFree86 3.3.3.1 PC98 SKB-PowerWindow (S3) server. .It Li X9TGU XFree86 3.3.3.1 PC98 Cyber9320 and TGUI9680 server. .It Li X9WEP XFree86 3.3.3.1 PC98 WAB-EP (cirrus) server. .It Li X9WS XFree86 3.3.3.1 PC98 WABS (cirrus) server. .It Li X9WSN XFree86 3.3.3.1 PC98 WSN-A2F (cirrus) server. .It Li XAGX XFree86 3.3.3.1 8 bit AGX server. .It Li XI128 XFree86 3.3.3.1 #9 Imagine I128 server. .It Li XMa8 XFree86 3.3.3.1 ATI Mach8 server. .It Li XMa32 XFree86 3.3.3.1 ATI Mach32 server. .It Li XMa64 XFree86 3.3.3.1 ATI Mach64 server. .It Li XMono XFree86 3.3.3.1 monochrome server. .It Li XP9K XFree86 3.3.3.1 P9000 server. .It Li XS3 XFree86 3.3.3.1 S3 server. .It Li XS3V XFree86 3.3.3.1 S3 Virge server. .It Li XSVGA XFree86 3.3.3.1 SVGA server. .It Li XVG16 XFree86 3.3.3.1 VGA16 server. .It Li XW32 XFree86 3.3.3.1 ET4000/W32, /W32i and /W32p server. .It Li Xnest XFree86 3.3.3.1 nested X server. .It Li Xvfb XFree86 3.3.3.1 virtual frame-buffer X server. .It Li Xfnts XFree86 3.3.3.1 base font set. .It Li Xf100 XFree86 3.3.3.1 100DPI font set. .It Li Xfcyr XFree86 3.3.3.1 Cyrillic font set. .It Li Xfscl XFree86 3.3.3.1 scalable font set. .It Li Xfnon XFree86 3.3.3.1 non-english font set. .It Li Xfsrv XFree86 3.3.3.1 font server. .El .It distSetDeveloper Selects the standard Developer's distribution set. .Pp \fBVariables:\fR None .It distSetXDeveloper Selects the standard X Developer's distribution set. .Pp \fBVariables:\fR None .It distSetKernDeveloper Selects the standard kernel Developer's distribution set. .Pp \fBVariables:\fR None .It distSetUser Selects the standard user distribution set. .Pp \fBVariables:\fR None .It distSetXUser Selects the standard X user's distribution set. .Pp \fBVariables:\fR None .It distSetMinimum Selects the very minimum distribution set. .Pp \fBVariables:\fR None .It distSetEverything Selects the full whack - all available distributions. .Pp \fBVariables:\fR None .It distSetDES Interactively select DES subcomponents. .Pp \fBVariables:\fR None .It distSetSrc Interactively select source subcomponents. .Pp \fBVariables:\fR None .It distSetXF86 Interactively select XFree86 3.3.3.1 subcomponents. .Pp \fBVariables:\fR None .It distExtractAll Install all currently selected distributions (requires that media device also be selected). .Pp \fBVariables:\fR None .It docBrowser Install (if necessary) an HTML documentation browser and go to the HTML documentation submenu. .Pp \fBVariables:\fR .Bl -tag -width indent .It browserPackage The name of the browser package to try and install as necessary. Defaults to latest lynx package. .It browserBinary The name of the browser binary itself (if overriding the .Ar browserPackage variable). Defaults to lynx. .El .It installCommit .Pp Commit any and all pending changes to disk. This function is essentially shorthand for a number of more granular "commit" functions. \fBVariables:\fR None .It installExpress Start an "express" installation, asking few questions of the user. .Pp \fBVariables:\fR None .It installNovice Start a "novice" installation, the most user-friendly installation type available. .Pp \fBVariables:\fR None .It installUpgrade Start an upgrade installation. .Pp \fBVariables:\fR None .It installFixitHoloShell Start up the "emergency holographic shell" over on VTY4 if running as init. .Pp \fBVariables:\fR None .It installFixitCDROM Go into "fixit" mode, assuming a live file system CDROM currently in the drive. .Pp \fBVariables:\fR None .It installFixitFloppy Go into "fixit" mode, assuming an available fixit floppy disk (user will be prompted for it). .Pp \fBVariables:\fR None .It installFilesystems Do just the file system initialization part of an install. .Pp \fBVariables:\fR None .It installVarDefaults Initialize all variables to their defaults, overriding any previous settings. .Pp \fBVariables:\fR None .It loadConfig Sort of like an #include statement, it allows you to load one configuration file from another. .Pp \fBVariables:\fR .Bl -tag -width indent .It file The fully pathname of the file to load. .El .It mediaSetCDROM Select a FreeBSD CDROM as the installation media. .Pp \fBVariables:\fR None .It mediaSetFloppy Select a pre-made floppy installation set as the installation media. .Pp \fBVariables:\fR None .It mediaSetDOS Select an existing DOS primary partition as the installation media. The first primary partition found is used (e.g. C:). .Pp \fBVariables:\fR None .It mediaSetTape Select a tape device as the installation media. .Pp \fBVariables:\fR None .It mediaSetFTP Select an FTP site as the installation media. .Pp \fBVariables:\fR .Bl -tag -width indent .It hostname The name of the host being installed (non-optional). .It domainname The domain name of the host being installed (optional). .It defaultrouter The default router for this host (non-optional). .It netDev Which host interface to use ( .Ar ed0 or .Ar ep0 , for example. Non-optional). .It netInteractive If set, bring up the interactive network setup form even if all relevant configuration variables are already set (optional). .It ipaddr The IP address for the selected host interface (non-optional). .It netmask The netmask for the selected host interface (non-optional). .It _ftpPath The fully qualified URL of the FTP site containing the FreeBSD distribution you're interested in, e.g. .Ar ftp://ftp.freebsd.org/pub/FreeBSD/ . .El .It mediaSetFTPActive Alias for .Ar mediaSetFTP using "active" FTP transfer mode. .Pp \fBVariables:\fR Same as for .Ar mediaSetFTP . .It mediaSetFTPPassive Alias for .Ar mediaSetFTP using "passive" FTP transfer mode. .Pp \fBVariables:\fR Same as for .Ar mediaSetFTP . .It mediaSetUFS Select an existing UFS partition (mounted with the label editor) as the installation media. .Pp \fBVariables:\fR .Bl -tag -width indent .It ufs full /path to directory containing the FreeBSD distribution you're interested in. .El .It mediaSetNFS .Pp \fBVariables:\fR .Bl -tag -width indent .It hostname The name of the host being installed (non-optional). .It domainname The domain name of the host being installed (optional). .It defaultrouter The default router for this host (non-optional). .It netDev Which host interface to use ( .Ar ed0 or .Ar ep0 , for example. Non-optional). .It netInteractive If set, bring up the interactive network setup form even if all relevant configuration variables are already set (optional). .It ipaddr The IP address for the selected host interface (non-optional). .It netmask The netmask for the selected host interface (non-optional). .It nfs full hostname:/path specification for directory containing the FreeBSD distribution you're interested in. .El .It mediaSetFTPUserPass .Pp \fBVariables:\fR .Bl -tag -width indent .It ftpUser The username to log in as on the ftp server site. Default: ftp .It ftpPass The password to use for this username on the ftp server site. Default: user@host .El .It mediaSetCPIOVerbosity .Pp \fBVariables:\fR .Bl -tag -width indent .It cpioVerbose Can be used to set the verbosity of cpio extractions to low, medium or high. .El .It mediaGetType Interactively get the user to specify some type of media. .Pp \fBVariables:\fR None .It optionsEditor Invoke the interactive options editor. .Pp \fBVariables:\fR None -.It register -Bring up the FreeBSD registration form. -.Pp -\fBVariables:\fR None .It packageAdd Try to fetch and add a package to the system (requires that a media type be set), .Pp \fBVariables:\fR .Bl -tag -width indent .It package The name of the package to add, e.g. bash-1.14.7 or ncftp-2.4.2. .El .It addGroup Invoke the interactive group editor. .Pp \fBVariables:\fR None .It addUser Invoke the interactive user editor. .Pp \fBVariables:\fR None .It shutdown Stop the script and terminate sysinstall. .Pp \fBVariables:\fR None .It system Execute an arbitrary command with .Xr system 3 .Pp \fBVariables:\fR .Bl -tag -width indent .It command The name of the command to execute. When running from a boot floppy, very minimal expectations should be made as to what's available until/unless a relatively full system installation has just been done. .El .El .Sh FILES This utility may edit the contents of .Pa /etc/rc.conf , .Pa /etc/hosts , and .Pa /etc/resolv.conf as necessary to reflect changes in the network configuration. .Sh SEE ALSO If you have a reasonably complete source tree online, take a look at .Pa /usr/src/release/sysinstall/install.cfg for a sample installation script. .Sh BUGS This utility is a prototype which lasted approximately 3 years past its expiration date and is greatly in need of death. .Sh AUTHOR Jordan K. Hubbard .Sh HISTORY This version of .Nm first appeared in .Fx 2.0 . diff --git a/release/sysinstall/sysinstall.h b/release/sysinstall/sysinstall.h index 8f171d1c8dc4..bc7f6732981e 100644 --- a/release/sysinstall/sysinstall.h +++ b/release/sysinstall/sysinstall.h @@ -1,722 +1,718 @@ /* * The new sysinstall program. * * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: sysinstall.h,v 1.159 1999/03/19 10:54:38 jkh Exp $ + * $Id: sysinstall.h,v 1.160 1999/04/06 08:25:53 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer, * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * 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 _SYSINSTALL_H_INCLUDE #define _SYSINSTALL_H_INCLUDE #include #include #include #include #include #include #include #include #include #include "ui_objects.h" #include "dir.h" #include "colors.h" #include "libdisk.h" #include "dist.h" /*** Defines ***/ /* device limits */ #define DEV_NAME_MAX 64 /* The maximum length of a device name */ #define DEV_MAX 100 /* The maximum number of devices we'll deal with */ #define INTERFACE_MAX 50 /* Maximum number of network interfaces we'll deal with */ #define IO_ERROR -2 /* Status code for I/O error rather than normal EOF */ /* Number of seconds to wait for data to come off even the slowest media */ #define MEDIA_TIMEOUT 300 /* * I make some pretty gross assumptions about having a max of 50 chunks * total - 8 slices and 42 partitions. I can't easily display many more * than that on the screen at once! * * For 2.1 I'll revisit this and try to make it more dynamic, but since * this will catch 99.99% of all possible cases, I'm not too worried. */ #define MAX_CHUNKS 40 /* Internal environment variable names */ #define DISK_PARTITIONED "_diskPartitioned" #define DISK_LABELLED "_diskLabelled" #define DISK_SELECTED "_diskSelected" #define SYSTEM_STATE "_systemState" #define RUNNING_ON_ROOT "_runningOnRoot" #define TCP_CONFIGURED "_tcpConfigured" /* Ones that can be tweaked from config files */ #define VAR_BLANKTIME "blanktime" #define VAR_BOOTMGR "bootManager" #define VAR_BROWSER_BINARY "browserBinary" #define VAR_BROWSER_PACKAGE "browserPackage" #define VAR_CPIO_VERBOSITY "cpioVerbose" #define VAR_DEBUG "debug" #define VAR_DISK "disk" #define VAR_DISTS "dists" #define VAR_DIST_MAIN "distMain" #define VAR_DIST_DES "distDES" #define VAR_DIST_SRC "distSRC" #define VAR_DIST_X11 "distX11" #define VAR_DIST_XSERVER "distXserver" #define VAR_DIST_XFONTS "distXfonts" #define VAR_DEDICATE_DISK "dedicateDisk" #define VAR_DOMAINNAME "domainname" #define VAR_EDITOR "editor" #define VAR_EXTRAS "ifconfig_" #define VAR_COMMAND "command" #define VAR_CONFIG_FILE "configFile" #define VAR_FTP_DIR "ftpDirectory" #define VAR_FTP_PASS "ftpPass" #define VAR_FTP_PATH "_ftpPath" #define VAR_FTP_PORT "ftpPort" #define VAR_FTP_STATE "ftpState" #define VAR_FTP_USER "ftpUser" #define VAR_FTP_HOST "ftpHost" #define VAR_GATED_PKG "gated_pkg" #define VAR_GATEWAY "defaultrouter" #define VAR_GEOMETRY "geometry" #define VAR_HOSTNAME "hostname" #define VAR_IFCONFIG "ifconfig_" #define VAR_INTERFACES "network_interfaces" #define VAR_INSTALL_CFG "installConfig" #define VAR_INSTALL_ROOT "installRoot" #define VAR_IPADDR "ipaddr" #define VAR_KEYMAP "keymap" #define VAR_LABEL "label" #define VAR_LABEL_COUNT "labelCount" #define VAR_MEDIA_TYPE "mediaType" #define VAR_MEDIA_TIMEOUT "MEDIA_TIMEOUT" #define VAR_MOUSED "moused_enable" #define VAR_MOUSED_PORT "moused_port" #define VAR_MOUSED_TYPE "moused_type" #define VAR_NAMESERVER "nameserver" #define VAR_NETINTERACTIVE "netInteractive" #define VAR_NETMASK "netmask" #define VAR_NETWORK_DEVICE "netDev" #define VAR_NFS_PATH "nfs" #define VAR_NFS_HOST "nfsHost" #define VAR_NFS_SECURE "nfs_reserved_port_only" #define VAR_NFS_SERVER "nfs_server_enable" #define VAR_NO_CONFIRM "noConfirm" #define VAR_NO_ERROR "noError" #define VAR_NO_WARN "noWarn" #define VAR_NO_USR "noUsr" #define VAR_NONINTERACTIVE "nonInteractive" #define VAR_NOVELL "novell" #define VAR_NTPDATE_FLAGS "ntpdate_flags" #define VAR_PACKAGE "package" #define VAR_PARTITION "partition" #define VAR_PCNFSD "pcnfsd" #define VAR_PCNFSD_PKG "pcnfsd_pkg" #define VAR_PKG_TMPDIR "PKG_TMPDIR" #define VAR_PORTS_PATH "ports" #define VAR_RELNAME "releaseName" #define VAR_ROOT_SIZE "rootSize" #define VAR_ROUTER "router" #define VAR_ROUTER_ENABLE "router_enable" #define VAR_ROUTERFLAGS "routerflags" #define VAR_SERIAL_SPEED "serialSpeed" #define VAR_SLOW_ETHER "slowEthernetCard" #define VAR_SWAP_SIZE "swapSize" #define VAR_TAPE_BLOCKSIZE "tapeBlocksize" #define VAR_UFS_PATH "ufs" #define VAR_USR_SIZE "usrSize" #define VAR_VAR_SIZE "varSize" #define VAR_XF86_CONFIG "_xf86config" #define DEFAULT_TAPE_BLOCKSIZE "20" /* One MB worth of blocks */ #define ONE_MEG 2048 /* Which selection attributes to use */ #define ATTR_SELECTED (ColorDisplay ? item_selected_attr : item_attr) #define ATTR_TITLE button_active_attr /* Handy strncpy() macro */ #define SAFE_STRCPY(to, from) sstrncpy((to), (from), sizeof (to) - 1) /*** Types ***/ typedef unsigned int Boolean; typedef struct disk Disk; typedef struct chunk Chunk; /* Bitfields for menu options */ #define DMENU_NORMAL_TYPE 0x1 /* Normal dialog menu */ #define DMENU_RADIO_TYPE 0x2 /* Radio dialog menu */ #define DMENU_CHECKLIST_TYPE 0x4 /* Multiple choice menu */ #define DMENU_SELECTION_RETURNS 0x8 /* Immediate return on item selection */ typedef struct _dmenu { int type; /* What sort of menu we are */ char *title; /* Our title */ char *prompt; /* Our prompt */ char *helpline; /* Line of help at bottom */ char *helpfile; /* Help file for "F1" */ dialogMenuItem items[0]; /* Array of menu items */ } DMenu; /* An rc.conf variable */ typedef struct _variable { struct _variable *next; char *name; char *value; int dirty; } Variable; #define NO_ECHO_OBJ(type) ((type) | (DITEM_NO_ECHO << 16)) #define TYPE_OF_OBJ(type) ((type) & 0xff) #define ATTR_OF_OBJ(type) ((type) >> 16) /* A screen layout structure */ typedef struct _layout { int y; /* x & Y co-ordinates */ int x; int len; /* The size of the dialog on the screen */ int maxlen; /* How much the user can type in ... */ char *prompt; /* The string for the prompt */ char *help; /* The display for the help line */ void *var; /* The var to set when this changes */ int type; /* The type of the dialog to create */ void *obj; /* The obj pointer returned by libdialog */ } Layout; typedef enum { DEVICE_TYPE_NONE, DEVICE_TYPE_DISK, DEVICE_TYPE_FLOPPY, DEVICE_TYPE_FTP, DEVICE_TYPE_NETWORK, DEVICE_TYPE_CDROM, DEVICE_TYPE_TAPE, DEVICE_TYPE_DOS, DEVICE_TYPE_UFS, DEVICE_TYPE_NFS, DEVICE_TYPE_ANY, } DeviceType; /* CDROM mount codes */ #define CD_UNMOUNTED 0 #define CD_ALREADY_MOUNTED 1 #define CD_WE_MOUNTED_IT 2 /* A "device" from sysinstall's point of view */ typedef struct _device { char name[DEV_NAME_MAX]; char *description; char *devname; DeviceType type; Boolean enabled; Boolean (*init)(struct _device *dev); FILE * (*get)(struct _device *dev, char *file, Boolean probe); void (*shutdown)(struct _device *dev); void *private; unsigned int flags; } Device; /* Some internal representations of partitions */ typedef enum { PART_NONE, PART_SLICE, PART_SWAP, PART_FILESYSTEM, PART_FAT, } PartType; /* The longest newfs command we'll hand to system() */ #define NEWFS_CMD_MAX 256 typedef struct _part_info { Boolean newfs; char mountpoint[FILENAME_MAX]; char newfs_cmd[NEWFS_CMD_MAX]; } PartInfo; /* An option */ typedef struct _opt { char *name; char *desc; enum { OPT_IS_STRING, OPT_IS_INT, OPT_IS_FUNC, OPT_IS_VAR } type; void *data; void *aux; char *(*check)(); } Option; /* Weird index nodey things we use for keeping track of package information */ typedef enum { PACKAGE, PLACE } node_type; /* Types of nodes */ typedef struct _pkgnode { /* A node in the reconstructed hierarchy */ struct _pkgnode *next; /* My next sibling */ node_type type; /* What am I? */ char *name; /* My name */ char *desc; /* My description (Hook) */ struct _pkgnode *kids; /* My little children */ void *data; /* A place to hang my data */ } PkgNode; typedef PkgNode *PkgNodePtr; /* A single package */ typedef struct _indexEntry { /* A single entry in an INDEX file */ char *name; /* name */ char *path; /* full path to port */ char *prefix; /* port prefix */ char *comment; /* one line description */ char *descrfile; /* path to description file */ char *deps; /* packages this depends on */ int depc; /* how many depend on me */ int installed; /* indicates if it is installed */ char *maintainer; /* maintainer */ } IndexEntry; typedef IndexEntry *IndexEntryPtr; typedef int (*commandFunc)(char *key, void *data); #define HOSTNAME_FIELD_LEN 128 #define IPADDR_FIELD_LEN 16 #define EXTRAS_FIELD_LEN 128 /* This is the structure that Network devices carry around in their private, erm, structures */ typedef struct _devPriv { char ipaddr[IPADDR_FIELD_LEN]; char netmask[IPADDR_FIELD_LEN]; char extras[EXTRAS_FIELD_LEN]; } DevInfo; /*** Externs ***/ extern jmp_buf BailOut; /* Used to get the heck out */ extern int DebugFD; /* Where diagnostic output goes */ extern Boolean Fake; /* Don't actually modify anything - testing */ extern Boolean SystemWasInstalled; /* Did we install it? */ extern Boolean RunningAsInit; /* Are we running stand-alone? */ extern Boolean DialogActive; /* Is the dialog() stuff up? */ extern Boolean ColorDisplay; /* Are we on a color display? */ extern Boolean OnVTY; /* On a syscons VTY? */ extern Variable *VarHead; /* The head of the variable chain */ extern Device *mediaDevice; /* Where we're getting our distribution from */ extern unsigned int Dists; /* Which distributions we want */ extern unsigned int DESDists; /* Which naughty distributions we want */ extern unsigned int SrcDists; /* Which src distributions we want */ extern unsigned int XF86Dists; /* Which XFree86 dists we want */ extern unsigned int XF86ServerDists; /* The XFree86 servers we want */ extern unsigned int XF86FontDists; /* The XFree86 fonts we want */ extern int BootMgr; /* Which boot manager to use */ extern int StatusLine; /* Where to print our status messages */ extern DMenu MenuInitial; /* Initial installation menu */ extern DMenu MenuFixit; /* Fixit repair menu */ extern DMenu MenuMBRType; /* Type of MBR to write on the disk */ extern DMenu MenuConfigure; /* Final configuration menu */ extern DMenu MenuDocumentation; /* Documentation menu */ extern DMenu MenuFTPOptions; /* FTP Installation options */ extern DMenu MenuIndex; /* Index menu */ extern DMenu MenuOptions; /* Installation options */ extern DMenu MenuOptionsLanguage; /* Language options menu */ extern DMenu MenuMedia; /* Media type menu */ extern DMenu MenuMouse; /* Mouse type menu */ extern DMenu MenuMediaCDROM; /* CDROM media menu */ extern DMenu MenuMediaDOS; /* DOS media menu */ extern DMenu MenuMediaFloppy; /* Floppy media menu */ extern DMenu MenuMediaFTP; /* FTP media menu */ extern DMenu MenuMediaTape; /* Tape media menu */ extern DMenu MenuNetworkDevice; /* Network device menu */ extern DMenu MenuNTP; /* NTP time server menu */ extern DMenu MenuStartup; /* Startup services menu */ extern DMenu MenuSyscons; /* System console configuration menu */ extern DMenu MenuSysconsFont; /* System console font configuration menu */ extern DMenu MenuSysconsKeymap; /* System console keymap configuration menu */ extern DMenu MenuSysconsKeyrate; /* System console keyrate configuration menu */ extern DMenu MenuSysconsSaver; /* System console saver configuration menu */ extern DMenu MenuSysconsScrnmap; /* System console screenmap configuration menu */ extern DMenu MenuNetworking; /* Network configuration menu */ extern DMenu MenuInstallCustom; /* Custom Installation menu */ extern DMenu MenuDistributions; /* Distribution menu */ extern DMenu MenuSubDistributions; /* Custom distribution menu */ extern DMenu MenuDESDistributions; /* DES distribution menu */ extern DMenu MenuSrcDistributions; /* Source distribution menu */ extern DMenu MenuXF86; /* XFree86 main menu */ extern DMenu MenuXF86Select; /* XFree86 distribution selection menu */ extern DMenu MenuXF86SelectCore; /* XFree86 core distribution menu */ extern DMenu MenuXF86SelectServer; /* XFree86 server distribution menu */ extern DMenu MenuXF86SelectPC98Server; /* XFree86 server distribution menu */ extern DMenu MenuXF86SelectFonts; /* XFree86 font selection menu */ extern DMenu MenuDiskDevices; /* Disk devices menu */ extern DMenu MenuHTMLDoc; /* HTML Documentation menu */ extern DMenu MenuUsermgmt; /* User management menu */ extern DMenu MenuFixit; /* Fixit floppy/CDROM/shell menu */ extern DMenu MenuXF86Config; /* Select XFree86 configuration type */ /* Stuff from libdialog which isn't properly declared outside */ extern void display_helpfile(void); extern void display_helpline(WINDOW *w, int y, int width); /*** Prototypes ***/ /* anonFTP.c */ extern int configAnonFTP(dialogMenuItem *self); /* cdrom.c */ extern Boolean mediaInitCDROM(Device *dev); extern FILE *mediaGetCDROM(Device *dev, char *file, Boolean probe); extern void mediaShutdownCDROM(Device *dev); /* command.c */ extern void command_clear(void); extern void command_sort(void); extern void command_execute(void); extern void command_shell_add(char *key, char *fmt, ...); extern void command_func_add(char *key, commandFunc func, void *data); /* config.c */ extern void configEnvironmentRC_conf(void); extern void configEnvironmentResolv(char *config); extern void configRC_conf(void); extern int configFstab(dialogMenuItem *self); extern int configRC(dialogMenuItem *self); -extern int configRegister(dialogMenuItem *self); extern int configResolv(dialogMenuItem *self); extern int configPackages(dialogMenuItem *self); extern int configSaver(dialogMenuItem *self); extern int configSaverTimeout(dialogMenuItem *self); extern int configNTP(dialogMenuItem *self); extern int configUsers(dialogMenuItem *self); extern int configXEnvironment(dialogMenuItem *self); extern int configRouter(dialogMenuItem *self); extern int configPCNFSD(dialogMenuItem *self); extern int configNFSServer(dialogMenuItem *self); extern int configWriteRC_conf(dialogMenuItem *self); /* crc.c */ extern int crc(int, unsigned long *, unsigned long *); /* devices.c */ extern DMenu *deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)(dialogMenuItem *d), int (*check)(dialogMenuItem *d)); extern void deviceGetAll(void); extern void deviceReset(void); extern void deviceRescan(void); extern Device **deviceFind(char *name, DeviceType type); extern Device **deviceFindDescr(char *name, char *desc, DeviceType class); extern int deviceCount(Device **devs); extern Device *new_device(char *name); extern Device *deviceRegister(char *name, char *desc, char *devname, DeviceType type, Boolean enabled, Boolean (*init)(Device *mediadev), FILE * (*get)(Device *dev, char *file, Boolean probe), void (*shutDown)(Device *mediadev), void *private); extern Boolean dummyInit(Device *dev); extern FILE *dummyGet(Device *dev, char *dist, Boolean probe); extern void dummyShutdown(Device *dev); /* disks.c */ extern int diskPartitionEditor(dialogMenuItem *self); extern int diskPartitionWrite(dialogMenuItem *self); extern int diskGetSelectCount(Device ***devs); extern void diskPartition(Device *dev); /* dispatch.c */ extern int dispatchCommand(char *command); extern int dispatch_load_floppy(dialogMenuItem *self); extern int dispatch_load_file_int(int); extern int dispatch_load_file(dialogMenuItem *self); /* dist.c */ extern int distReset(dialogMenuItem *self); extern int distConfig(dialogMenuItem *self); extern int distSetCustom(dialogMenuItem *self); extern int distSetDeveloper(dialogMenuItem *self); extern int distSetXDeveloper(dialogMenuItem *self); extern int distSetKernDeveloper(dialogMenuItem *self); extern int distSetXKernDeveloper(dialogMenuItem *self); extern int distSetUser(dialogMenuItem *self); extern int distSetXUser(dialogMenuItem *self); extern int distSetMinimum(dialogMenuItem *self); extern int distSetEverything(dialogMenuItem *self); extern int distSetDES(dialogMenuItem *self); extern int distSetSrc(dialogMenuItem *self); extern int distSetXF86(dialogMenuItem *self); extern int distExtractAll(dialogMenuItem *self); /* dmenu.c */ extern int dmenuDisplayFile(dialogMenuItem *tmp); extern int dmenuSubmenu(dialogMenuItem *tmp); extern int dmenuSystemCommand(dialogMenuItem *tmp); extern int dmenuSystemCommandBox(dialogMenuItem *tmp); extern int dmenuExit(dialogMenuItem *tmp); extern int dmenuISetVariable(dialogMenuItem *tmp); extern int dmenuSetVariable(dialogMenuItem *tmp); extern int dmenuSetKmapVariable(dialogMenuItem *tmp); extern int dmenuSetVariables(dialogMenuItem *tmp); extern int dmenuToggleVariable(dialogMenuItem *tmp); extern int dmenuSetFlag(dialogMenuItem *tmp); extern int dmenuSetValue(dialogMenuItem *tmp); extern Boolean dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max, Boolean buttons); extern Boolean dmenuOpenSimple(DMenu *menu, Boolean buttons); extern int dmenuVarCheck(dialogMenuItem *item); extern int dmenuVarsCheck(dialogMenuItem *item); extern int dmenuFlagCheck(dialogMenuItem *item); extern int dmenuRadioCheck(dialogMenuItem *item); /* doc.c */ extern int docBrowser(dialogMenuItem *self); extern int docShowDocument(dialogMenuItem *self); /* dos.c */ extern Boolean mediaCloseDOS(Device *dev, FILE *fp); extern Boolean mediaInitDOS(Device *dev); extern FILE *mediaGetDOS(Device *dev, char *file, Boolean probe); extern void mediaShutdownDOS(Device *dev); /* floppy.c */ extern int getRootFloppy(void); extern Boolean mediaInitFloppy(Device *dev); extern FILE *mediaGetFloppy(Device *dev, char *file, Boolean probe); extern void mediaShutdownFloppy(Device *dev); /* ftp_strat.c */ extern Boolean mediaCloseFTP(Device *dev, FILE *fp); extern Boolean mediaInitFTP(Device *dev); extern FILE *mediaGetFTP(Device *dev, char *file, Boolean probe); extern void mediaShutdownFTP(Device *dev); /* globals.c */ extern void globalsInit(void); /* index.c */ int index_read(FILE *fp, PkgNodePtr papa); int index_menu(PkgNodePtr root, PkgNodePtr top, PkgNodePtr plist, int *pos, int *scroll); void index_init(PkgNodePtr top, PkgNodePtr plist); void index_node_free(PkgNodePtr top, PkgNodePtr plist); void index_sort(PkgNodePtr top); void index_print(PkgNodePtr top, int level); int index_extract(Device *dev, PkgNodePtr top, PkgNodePtr plist); /* install.c */ extern Boolean checkLabels(Boolean whinge, Chunk **rdev, Chunk **sdev, Chunk **udev, Chunk **vdev); extern int installCommit(dialogMenuItem *self); extern int installCustomCommit(dialogMenuItem *self); extern int installExpress(dialogMenuItem *self); extern int installNovice(dialogMenuItem *self); extern int installFixitHoloShell(dialogMenuItem *self); extern int installFixitCDROM(dialogMenuItem *self); extern int installFixitFloppy(dialogMenuItem *self); extern int installFixupBin(dialogMenuItem *self); extern int installFixupXFree(dialogMenuItem *self); extern int installUpgrade(dialogMenuItem *self); extern int installFilesystems(dialogMenuItem *self); extern int installVarDefaults(dialogMenuItem *self); extern void installEnvironment(void); extern Boolean copySelf(void); /* kget.c */ extern int kget(char *out); /* keymap.c */ extern int loadKeymap(const char *lang); /* label.c */ extern int diskLabelEditor(dialogMenuItem *self); extern int diskLabelCommit(dialogMenuItem *self); /* lndir.c */ extern int lndir(char *from, char *to); /* makedevs.c (auto-generated) */ extern const char termcap_ansi[]; extern const char termcap_vt100[]; extern const char termcap_cons25[]; extern const char termcap_cons25_m[]; extern const char termcap_cons25r[]; extern const char termcap_cons25r_m[]; extern const char termcap_cons25l1[]; extern const char termcap_cons25l1_m[]; extern const u_char font_iso_8x16[]; extern const u_char font_cp850_8x16[]; extern const u_char font_cp866_8x16[]; extern const u_char koi8_r2cp866[]; extern u_char default_scrnmap[]; /* media.c */ extern char *cpioVerbosity(void); extern void mediaClose(void); extern int mediaTimeout(void); extern int mediaSetCDROM(dialogMenuItem *self); extern int mediaSetFloppy(dialogMenuItem *self); extern int mediaSetDOS(dialogMenuItem *self); extern int mediaSetTape(dialogMenuItem *self); extern int mediaSetFTP(dialogMenuItem *self); extern int mediaSetFTPActive(dialogMenuItem *self); extern int mediaSetFTPPassive(dialogMenuItem *self); extern int mediaSetUFS(dialogMenuItem *self); extern int mediaSetNFS(dialogMenuItem *self); extern int mediaSetFTPUserPass(dialogMenuItem *self); extern int mediaSetCPIOVerbosity(dialogMenuItem *self); extern int mediaGetType(dialogMenuItem *self); extern Boolean mediaExtractDist(char *dir, char *dist, FILE *fp); extern Boolean mediaExtractDistBegin(char *dir, int *fd, int *zpid, int *cpic); extern Boolean mediaExtractDistEnd(int zpid, int cpid); extern Boolean mediaVerify(void); extern FILE *mediaGenericGet(char *base, const char *file); /* misc.c */ extern Boolean file_readable(char *fname); extern Boolean file_executable(char *fname); extern Boolean directory_exists(const char *dirname); extern char *root_bias(char *path); extern char *itoa(int value); extern char *string_concat(char *p1, char *p2); extern char *string_concat3(char *p1, char *p2, char *p3); extern char *string_prune(char *str); extern char *string_skipwhite(char *str); extern char *string_copy(char *s1, char *s2); extern char *pathBaseName(const char *path); extern void safe_free(void *ptr); extern void *safe_malloc(size_t size); extern void *safe_realloc(void *orig, size_t size); extern dialogMenuItem *item_add(dialogMenuItem *list, char *prompt, char *title, int (*checked)(dialogMenuItem *self), int (*fire)(dialogMenuItem *self), void (*selected)(dialogMenuItem *self, int is_selected), void *data, int aux, int *curr, int *max); extern void items_free(dialogMenuItem *list, int *curr, int *max); extern int Mkdir(char *); extern int Mount(char *, void *data); extern WINDOW *openLayoutDialog(char *helpfile, char *title, int x, int y, int width, int height); extern ComposeObj *initLayoutDialog(WINDOW *win, Layout *layout, int x, int y, int *max); extern int layoutDialogLoop(WINDOW *win, Layout *layout, ComposeObj **obj, int *n, int max, int *cbutton, int *cancel); extern WINDOW *savescr(void); extern void restorescr(WINDOW *w); extern char *sstrncpy(char *dst, const char *src, int size); /* mouse.c */ extern int mousedTest(dialogMenuItem *self); extern int mousedDisable(dialogMenuItem *self); /* msg.c */ extern Boolean isDebug(void); extern void msgInfo(char *fmt, ...); extern void msgYap(char *fmt, ...); extern void msgWarn(char *fmt, ...); extern void msgDebug(char *fmt, ...); extern void msgError(char *fmt, ...); extern void msgFatal(char *fmt, ...); extern void msgConfirm(char *fmt, ...); extern void msgNotify(char *fmt, ...); extern void msgWeHaveOutput(char *fmt, ...); extern int msgYesNo(char *fmt, ...); extern char *msgGetInput(char *buf, char *fmt, ...); extern int msgSimpleConfirm(char *); extern int msgSimpleNotify(char *); /* network.c */ extern Boolean mediaInitNetwork(Device *dev); extern void mediaShutdownNetwork(Device *dev); /* nfs.c */ extern Boolean mediaInitNFS(Device *dev); extern FILE *mediaGetNFS(Device *dev, char *file, Boolean probe); extern void mediaShutdownNFS(Device *dev); /* options.c */ extern int optionsEditor(dialogMenuItem *self); /* package.c */ extern int packageAdd(dialogMenuItem *self); extern int package_add(char *name); extern int package_extract(Device *dev, char *name, Boolean depended); extern Boolean package_exists(char *name); -/* register.c */ -extern int registerOpenDialog(void); - /* system.c */ extern void systemInitialize(int argc, char **argv); extern void systemShutdown(int status); extern int execExecute(char *cmd, char *name); extern int systemExecute(char *cmd); extern int systemDisplayHelp(char *file); extern char *systemHelpFile(char *file, char *buf); extern void systemChangeFont(const u_char font[]); extern void systemChangeLang(char *lang); extern void systemChangeTerminal(char *color, const u_char c_termcap[], char *mono, const u_char m_termcap[]); extern void systemChangeScreenmap(const u_char newmap[]); extern void systemCreateHoloshell(void); extern int vsystem(char *fmt, ...); /* tape.c */ extern char *mediaTapeBlocksize(void); extern Boolean mediaInitTape(Device *dev); extern FILE *mediaGetTape(Device *dev, char *file, Boolean probe); extern void mediaShutdownTape(Device *dev); /* tcpip.c */ extern int tcpOpenDialog(Device *dev); extern int tcpMenuSelect(dialogMenuItem *self); extern Device *tcpDeviceSelect(void); /* termcap.c */ extern int set_termcap(void); /* ufs.c */ extern void mediaShutdownUFS(Device *dev); extern Boolean mediaInitUFS(Device *dev); extern FILE *mediaGetUFS(Device *dev, char *file, Boolean probe); /* user.c */ extern int userAddGroup(dialogMenuItem *self); extern int userAddUser(dialogMenuItem *self); /* variable.c */ extern void variable_set(char *var, int dirty); extern void variable_set2(char *name, char *value, int dirty); extern char *variable_get(char *var); extern int variable_cmp(char *var, char *value); extern void variable_unset(char *var); extern char *variable_get_value(char *var, char *prompt, int dirty); extern int variable_check(char *data); extern int dump_variables(dialogMenuItem *self); /* wizard.c */ extern void slice_wizard(Disk *d); #endif /* _SYSINSTALL_H_INCLUDE */ diff --git a/usr.sbin/sade/Makefile b/usr.sbin/sade/Makefile index 0be2955ec6aa..e837479c6334 100644 --- a/usr.sbin/sade/Makefile +++ b/usr.sbin/sade/Makefile @@ -1,85 +1,85 @@ PROG= sysinstall MAN8= sysinstall.8 BINDIR=/stand NOSHARED=YES CLEANFILES+= makedevs.c rtermcap rtermcap.tmp dumpnlist CLEANFILES+= keymap.tmp keymap.h .PATH: ${.CURDIR}/../disklabel ${.CURDIR}/../../usr.bin/cksum SRCS= anonFTP.c cdrom.c command.c config.c devices.c kget.c \ disks.c dispatch.c dist.c dmenu.c doc.c dos.c floppy.c \ ftp.c globals.c index.c install.c installUpgrade.c keymap.c \ label.c lndir.c main.c makedevs.c media.c menus.c misc.c mouse.c \ - msg.c network.c nfs.c options.c package.c register.c system.c \ + msg.c network.c nfs.c options.c package.c system.c \ tape.c tcpip.c termcap.c ufs.c user.c variable.c wizard.c \ keymap.h CFLAGS+= -Wall -I${.CURDIR}/../../gnu/lib/libdialog -I${.OBJDIR} CFLAGS+= -I${.CURDIR}/../../sys CFLAGS+= -DUC_PRIVATE -DKERN_NO_SYMBOLS DPADD= ${LIBDIALOG} ${LIBNCURSES} ${LIBMYTINFO} ${LIBUTIL} ${LIBDISK} ${LIBFTPIO} LDADD= -ldialog -lncurses -lmytinfo -lutil -ldisk -lftpio makedevs.c: Makefile rtermcap keymap.h rm -f makedevs.tmp echo '#include ' > makedevs.tmp ./rtermcap ansi | \ file2c 'const char termcap_ansi[] = {' ',0};' \ >> makedevs.tmp ./rtermcap cons25 | \ file2c 'const char termcap_cons25[] = {' ',0};' \ >> makedevs.tmp ./rtermcap cons25-m | \ file2c 'const char termcap_cons25_m[] = {' ',0};' \ >> makedevs.tmp ./rtermcap cons25r | \ file2c 'const char termcap_cons25r[] = {' ',0};' \ >> makedevs.tmp ./rtermcap cons25r-m | \ file2c 'const char termcap_cons25r_m[] = {' ',0};' \ >> makedevs.tmp ./rtermcap cons25l1 | \ file2c 'const char termcap_cons25l1[] = {' ',0};' \ >> makedevs.tmp ./rtermcap cons25l1-m | \ file2c 'const char termcap_cons25l1_m[] = {' ',0};' \ >> makedevs.tmp ./rtermcap vt100 | \ file2c 'const char termcap_vt100[] = {' ',0};' \ >> makedevs.tmp .if ${MACHINE_ARCH} != "alpha" file2c 'u_char boot0[] = {' '};' < /boot/boot0 >> makedevs.tmp .endif mv makedevs.tmp makedevs.c rtermcap: ${.CURDIR}/rtermcap.c ${CC} -o rtermcap ${.CURDIR}/rtermcap.c -ltermcap KEYMAPS= be.iso br275.iso danish.iso finnish.iso fr.iso \ german.iso hr.iso hu.iso2.101keys it.iso icelandic.iso jp.106 \ norwegian.iso pl_PL.ISO_8859-2 pt.iso ru.koi8-r si.iso \ spanish.iso swedish.iso swissfrench.iso swissgerman.iso uk.iso \ us.dvorak us.iso keymap.h: rm -f keymap.tmp for map in ${KEYMAPS} ; do \ kbdcontrol -L $$map | \ sed -e '/^static accentmap_t/,$$d' >> keymap.tmp ; \ done echo "static struct keymapInfo keymapInfos[] = {" >> keymap.tmp for map in ${KEYMAPS} ; do \ echo -n ' { "'$$map'", ' >> keymap.tmp ; \ echo "&keymap_$$map }," | tr '[-.]' '_' >> keymap.tmp ; \ done ( echo " { 0 }"; echo "};" ; echo "" ) >> keymap.tmp mv keymap.tmp keymap.h .include diff --git a/usr.sbin/sade/config.c b/usr.sbin/sade/config.c index 74cd5155634d..3ae09a184796 100644 --- a/usr.sbin/sade/config.c +++ b/usr.sbin/sade/config.c @@ -1,741 +1,735 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: config.c,v 1.123 1999/02/14 07:35:27 jkh Exp $ + * $Id: config.c,v 1.124 1999/02/14 21:35:01 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer, * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * 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 #include #include static Chunk *chunk_list[MAX_CHUNKS]; static int nchunks; static int rootdev_is_od; /* arg to sort */ static int chunk_compare(Chunk *c1, Chunk *c2) { if (!c1 && !c2) return 0; else if (!c1 && c2) return 1; else if (c1 && !c2) return -1; else if (!c1->private_data && !c2->private_data) return 0; else if (c1->private_data && !c2->private_data) return 1; else if (!c1->private_data && c2->private_data) return -1; else return strcmp(((PartInfo *)(c1->private_data))->mountpoint, ((PartInfo *)(c2->private_data))->mountpoint); } static void chunk_sort(void) { int i, j; for (i = 0; i < nchunks; i++) { for (j = 0; j < nchunks; j++) { if (chunk_compare(chunk_list[j], chunk_list[j + 1]) > 0) { Chunk *tmp = chunk_list[j]; chunk_list[j] = chunk_list[j + 1]; chunk_list[j + 1] = tmp; } } } } static void check_rootdev(Chunk **list, int n) { int i; Chunk *c; rootdev_is_od = 0; for (i = 0; i < n; i++) { c = *list++; if (c->type == part && (c->flags & CHUNK_IS_ROOT) && strncmp(c->disk->name, "od", 2) == 0) rootdev_is_od = 1; } } static char * name_of(Chunk *c1) { return c1->name; } static char * mount_point(Chunk *c1) { if (c1->type == part && c1->subtype == FS_SWAP) return "none"; else if (c1->type == part || c1->type == fat) return ((PartInfo *)c1->private_data)->mountpoint; return "/bogus"; } static char * fstype(Chunk *c1) { if (c1->type == fat) return "msdos"; else if (c1->type == part) { if (c1->subtype != FS_SWAP) return "ufs"; else return "swap"; } return "bogus"; } static char * fstype_short(Chunk *c1) { if (c1->type == part) { if (c1->subtype != FS_SWAP) { if (rootdev_is_od == 0 && strncmp(c1->name, "od", 2) == 0) return "rw,noauto"; else return "rw"; } else return "sw"; } else if (c1->type == fat) { if (strncmp(c1->name, "od", 2) == 0) return "ro,noauto"; else return "ro"; } return "bog"; } static int seq_num(Chunk *c1) { if (c1->type == part && c1->subtype != FS_SWAP) { if (rootdev_is_od == 0 && strncmp(c1->name, "od", 2) == 0) return 0; else if (c1->flags & CHUNK_IS_ROOT) return 1; else return 2; } return 0; } int configFstab(dialogMenuItem *self) { Device **devs; Disk *disk; FILE *fstab; int i, cnt; Chunk *c1, *c2; if (!RunningAsInit) { if (file_readable("/etc/fstab")) return DITEM_SUCCESS; else { msgConfirm("Attempting to rebuild your /etc/fstab file. Warning: If you had\n" "any CD devices in use before running sysinstall then they may NOT\n" "be found by this run!"); } } devs = deviceFind(NULL, DEVICE_TYPE_DISK); if (!devs) { msgConfirm("No disks found!"); return DITEM_FAILURE; } /* Record all the chunks */ nchunks = 0; for (i = 0; devs[i]; i++) { if (!devs[i]->enabled) continue; disk = (Disk *)devs[i]->private; 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)) chunk_list[nchunks++] = c2; } } else if (c1->type == fat && c1->private_data) chunk_list[nchunks++] = c1; } } chunk_list[nchunks] = 0; chunk_sort(); fstab = fopen("/etc/fstab", "w"); if (!fstab) { msgConfirm("Unable to create a new /etc/fstab file! Manual intervention\n" "will be required."); return DITEM_FAILURE; } check_rootdev(chunk_list, nchunks); /* Go for the burn */ msgDebug("Generating /etc/fstab file\n"); fprintf(fstab, "# Device\t\tMountpoint\tFStype\tOptions\t\tDump\tPass#\n"); for (i = 0; i < nchunks; i++) fprintf(fstab, "/dev/%s\t\t%s\t\t%s\t%s\t\t%d\t%d\n", name_of(chunk_list[i]), mount_point(chunk_list[i]), fstype(chunk_list[i]), fstype_short(chunk_list[i]), seq_num(chunk_list[i]), seq_num(chunk_list[i])); /* Now look for the CDROMs */ devs = deviceFind(NULL, DEVICE_TYPE_CDROM); cnt = deviceCount(devs); /* Write out the CDROM entries */ for (i = 0; i < cnt; i++) { char cdname[10]; sprintf(cdname, "/cdrom%s", i ? itoa(i) : ""); if (Mkdir(cdname)) msgConfirm("Unable to make mount point for: %s", cdname); else fprintf(fstab, "/dev/%s\t\t%s\tcd9660\tro,noauto\t0\t0\n", devs[i]->name, cdname); } /* And finally, a /proc. */ fprintf(fstab, "proc\t\t\t/proc\t\tprocfs\trw\t\t0\t0\n"); Mkdir("/proc"); fclose(fstab); if (isDebug()) msgDebug("Wrote out /etc/fstab file\n"); return DITEM_SUCCESS; } /* Do the work of sucking in a config file. * config is the filename to read in. * lines is a fixed (max) sized array of char* * returns number of lines read. line contents * are malloc'd and must be freed by the caller. */ int readConfig(char *config, char **lines, int max) { FILE *fp; char line[256]; int i, nlines; fp = fopen(config, "r"); if (!fp) return -1; nlines = 0; /* Read in the entire file */ for (i = 0; i < max; i++) { if (!fgets(line, sizeof line, fp)) break; lines[nlines++] = strdup(line); } fclose(fp); if (isDebug()) msgDebug("readConfig: Read %d lines from %s.\n", nlines, config); return nlines; } #define MAX_LINES 2000 /* Some big number we're not likely to ever reach - I'm being really lazy here, I know */ static void readConfigFile(char *config, int marked) { char *lines[MAX_LINES], *cp, *cp2; int i, nlines; nlines = readConfig(config, lines, MAX_LINES); if (nlines == -1) return; for (i = 0; i < nlines; i++) { /* Skip the comments & non-variable settings */ if (lines[i][0] == '#' || !(cp = index(lines[i], '='))) { free(lines[i]); continue; } *cp++ = '\0'; /* Find quotes */ if ((cp2 = index(cp, '"')) || (cp2 = index(cp, '\047'))) { cp = cp2 + 1; cp2 = index(cp, *cp2); } /* If valid quotes, use it */ if (cp2) { *cp2 = '\0'; /* If we have a legit value, set it */ if (strlen(cp)) variable_set2(lines[i], cp, marked); } free(lines[i]); } } /* Load the environment from rc.conf file(s) */ void configEnvironmentRC_conf(void) { static struct { char *fname; int marked; } configs[] = { { "/etc/defaults/rc.conf", 0 }, { "/etc/rc.conf", 0 }, { "/etc/rc.conf.local", 0 }, { NULL, 0 }, }; int i; for (i = 0; configs[i].fname; i++) { if (file_readable(configs[i].fname)) readConfigFile(configs[i].fname, configs[i].marked); } } /* Load the environment from a resolv.conf file */ void configEnvironmentResolv(char *config) { char *lines[MAX_LINES]; int i, nlines; nlines = readConfig(config, lines, MAX_LINES); if (nlines == -1) return; for (i = 0; i < nlines; i++) { Boolean name_set = (Boolean)variable_get(VAR_NAMESERVER); if (!strncmp(lines[i], "domain", 6) && !variable_get(VAR_DOMAINNAME)) variable_set2(VAR_DOMAINNAME, string_skipwhite(string_prune(lines[i] + 6)), 0); else if (!name_set && !strncmp(lines[i], "nameserver", 10)) { /* Only take the first nameserver setting - we're lame */ variable_set2(VAR_NAMESERVER, string_skipwhite(string_prune(lines[i] + 10)), 0); } free(lines[i]); } } /* Version of below for dispatch routines */ int configRC(dialogMenuItem *unused) { configRC_conf(); return DITEM_SUCCESS; } void configRC_conf(void) { FILE *rcSite; Variable *v; int write_header; static int did_marker = 0; write_header = !file_readable("/etc/rc.conf"); rcSite = fopen("/etc/rc.conf", "a"); if (!rcSite) return; if (write_header) { fprintf(rcSite, "# This file now contains just the overrides from /etc/defaults/rc.conf\n"); fprintf(rcSite, "# please make all changes to this file.\n\n"); } /* Now do variable substitutions */ for (v = VarHead; v; v = v->next) { if (v->dirty) { if (!did_marker) { fprintf(rcSite, "# -- sysinstall generated deltas -- #\n"); did_marker = 1; } fprintf(rcSite, "%s=\"%s\"\n", v->name, v->value); v->dirty = 0; } } fclose(rcSite); } int configSaver(dialogMenuItem *self) { variable_set((char *)self->data, 1); if (!variable_get(VAR_BLANKTIME)) variable_set2(VAR_BLANKTIME, "300", 1); return DITEM_SUCCESS; } int configSaverTimeout(dialogMenuItem *self) { return (variable_get_value(VAR_BLANKTIME, "Enter time-out period in seconds for screen saver", 1) ? DITEM_SUCCESS : DITEM_FAILURE) | DITEM_RESTORE; } -int -configRegister(dialogMenuItem *self) -{ - return DITEM_STATUS(registerOpenDialog()) | DITEM_RESTORE; -} - int configNTP(dialogMenuItem *self) { int status; status = variable_get_value(VAR_NTPDATE_FLAGS, "Enter the name of an NTP server", 1) ? DITEM_SUCCESS : DITEM_FAILURE; if (status == DITEM_SUCCESS) { static char tmp[255]; snprintf(tmp, sizeof(tmp), "ntpdate_enable=YES,ntpdate_flags=%s", variable_get(VAR_NTPDATE_FLAGS)); self->data = tmp; dmenuSetVariables(self); } return status | DITEM_RESTORE; } int configUsers(dialogMenuItem *self) { dialog_clear_norefresh(); dmenuOpenSimple(&MenuUsermgmt, FALSE); dialog_clear(); return DITEM_SUCCESS | DITEM_RESTORE; } int configXEnvironment(dialogMenuItem *self) { char *config, *execfile; char *moused; tryagain: dialog_clear_norefresh(); if (!dmenuOpenSimple(&MenuXF86Config, FALSE)) return DITEM_FAILURE | DITEM_RESTORE; if (file_readable("/var/run/ld.so.hints")) systemExecute("/sbin/ldconfig -m /usr/lib /usr/X11R6/lib /usr/local/lib /usr/lib/compat"); else systemExecute("/sbin/ldconfig /usr/lib /usr/X11R6/lib /usr/local/lib /usr/lib/compat"); config = variable_get(VAR_XF86_CONFIG); if (!config) return DITEM_FAILURE | DITEM_RESTORE; execfile = string_concat("/usr/X11R6/bin/", config); if (file_executable(execfile)) { dialog_clear_norefresh(); moused = variable_get(VAR_MOUSED); while (!moused || strcmp(moused, "YES")) { if (msgYesNo("The X server may access the mouse in two ways: direct access\n" "or indirect access via the mouse daemon. You have not\n" "configured the mouse daemon. Would you like to configure it\n" "now? If you intend to let the X server access the mouse\n" "directly, choose \"No\" at this time.")) break; dmenuOpenSimple(&MenuMouse, FALSE); dialog_clear(); moused = variable_get(VAR_MOUSED); } if (moused && !strcmp(moused, "YES")) msgConfirm("You have configured and are now running the mouse daemon.\n" "Choose \"/dev/sysmouse\" as the mouse port and \"SysMouse\" or\n" "\"MouseSystems\" as the mouse protocol in the X configuration\n" "utility."); dialog_clear(); systemExecute(execfile); if (!file_readable("/etc/XF86Config") && !msgYesNo("The XFree86 configuration process seems to have\nfailed. Would you like to try again?")) goto tryagain; return DITEM_SUCCESS | DITEM_RESTORE; } else { dialog_clear_norefresh(); msgConfirm("The XFree86 setup utility you chose does not appear to be installed!\n" "Please install this before attempting to configure XFree86."); return DITEM_FAILURE | DITEM_RESTORE; } } int configResolv(dialogMenuItem *ditem) { FILE *fp; char *cp, *dp, *hp; cp = variable_get(VAR_NAMESERVER); if (!cp || !*cp) goto skip; Mkdir("/etc"); fp = fopen("/etc/resolv.conf", "w"); if (!fp) return DITEM_FAILURE; if (variable_get(VAR_DOMAINNAME)) fprintf(fp, "domain\t%s\n", variable_get(VAR_DOMAINNAME)); fprintf(fp, "nameserver\t%s\n", cp); fclose(fp); if (isDebug()) msgDebug("Wrote out /etc/resolv.conf\n"); skip: dp = variable_get(VAR_DOMAINNAME); cp = variable_get(VAR_IPADDR); hp = variable_get(VAR_HOSTNAME); /* Tack ourselves into /etc/hosts */ fp = fopen("/etc/hosts", "w"); if (!fp) return DITEM_FAILURE; /* Add an entry for localhost */ if (dp) fprintf(fp, "127.0.0.1\t\tlocalhost.%s localhost\n", dp); else fprintf(fp, "127.0.0.1\t\tlocalhost\n"); /* Now the host entries, if applicable */ if (cp && cp[0] != '0' && hp) { char cp2[255]; if (!index(hp, '.')) cp2[0] = '\0'; else { SAFE_STRCPY(cp2, hp); *(index(cp2, '.')) = '\0'; } fprintf(fp, "%s\t\t%s %s\n", cp, hp, cp2); fprintf(fp, "%s\t\t%s.\n", cp, hp); } fclose(fp); if (isDebug()) msgDebug("Wrote out /etc/hosts\n"); return DITEM_SUCCESS; } int configRouter(dialogMenuItem *self) { int ret; ret = variable_get_value(VAR_ROUTER, "Please specify the router you wish to use. Routed is\n" "provided with the stock system and gated is provided\n" "as an optional package which this installation system\n" "will attempt to load if you select gated. Any other\n" "choice of routing daemon will be assumed to be something\n" "the user intends to install themselves before rebooting\n" "the system. If you don't want any routing daemon, choose NO", 1) ? DITEM_SUCCESS : DITEM_FAILURE; if (ret == DITEM_SUCCESS) { char *cp = variable_get(VAR_ROUTER); if (cp && strcmp(cp, "NO")) { variable_set2(VAR_ROUTER_ENABLE, "YES", 1); if (!strcmp(cp, "gated")) { if (package_add(variable_get(VAR_GATED_PKG)) != DITEM_SUCCESS) { msgConfirm("Unable to load gated package. Falling back to no router."); variable_unset(VAR_ROUTER); variable_unset(VAR_ROUTERFLAGS); variable_set2(VAR_ROUTER_ENABLE, "NO", 1); cp = NULL; } } if (cp) { /* Now get the flags, if they chose a router */ ret = variable_get_value(VAR_ROUTERFLAGS, "Please Specify the routing daemon flags; if you're running routed\n" "then -q is the right choice for nodes and -s for gateway hosts.\n", 1) ? DITEM_SUCCESS : DITEM_FAILURE; if (ret != DITEM_SUCCESS) variable_unset(VAR_ROUTERFLAGS); } } else { /* No router case */ variable_set2(VAR_ROUTER_ENABLE, "NO", 1); variable_unset(VAR_ROUTERFLAGS); variable_unset(VAR_ROUTER); } } return ret | DITEM_RESTORE; } int configPackages(dialogMenuItem *self) { static PkgNode top, plist; static Boolean index_initted = FALSE; PkgNodePtr tmp; FILE *fp; if (!mediaVerify()) return DITEM_FAILURE; if (!mediaDevice->init(mediaDevice)) return DITEM_FAILURE; if (!index_initted) { msgNotify("Attempting to fetch packages/INDEX file from selected media."); fp = mediaDevice->get(mediaDevice, "packages/INDEX", TRUE); if (!fp) { dialog_clear_norefresh(); msgConfirm("Unable to get packages/INDEX file from selected media.\n" "This may be because the packages collection is not available at\n" "on the distribution media you've chosen (most likely an FTP site\n" "without the packages collection mirrored). Please verify media\n" "(or path to media) and try again. If your local site does not\n" "carry the packages collection, then we recommend either a CD\n" "distribution or the master distribution on ftp.freebsd.org."); mediaDevice->shutdown(mediaDevice); return DITEM_FAILURE | DITEM_RESTORE; } msgNotify("Located INDEX, now reading package data from it..."); index_init(&top, &plist); if (index_read(fp, &top)) { msgConfirm("I/O or format error on packages/INDEX file.\n" "Please verify media (or path to media) and try again."); fclose(fp); return DITEM_FAILURE | DITEM_RESTORE; } fclose(fp); index_sort(&top); index_initted = TRUE; } while (1) { int ret, pos, scroll; /* Bring up the packages menu */ pos = scroll = 0; index_menu(&top, &top, &plist, &pos, &scroll); if (plist.kids && plist.kids->name) { /* Now show the packing list menu */ pos = scroll = 0; ret = index_menu(&plist, &plist, NULL, &pos, &scroll); if (ret & DITEM_LEAVE_MENU) break; else if (DITEM_STATUS(ret) != DITEM_FAILURE) { index_extract(mediaDevice, &top, &plist); break; } } else { dialog_clear_norefresh(); msgConfirm("No packages were selected for extraction."); break; } } tmp = plist.kids; while (tmp) { PkgNodePtr tmp2 = tmp->next; safe_free(tmp); tmp = tmp2; } index_init(NULL, &plist); return DITEM_SUCCESS | DITEM_RESTORE; } /* Load pcnfsd package */ int configPCNFSD(dialogMenuItem *self) { int ret = DITEM_SUCCESS; if (variable_get(VAR_PCNFSD)) variable_unset(VAR_PCNFSD); else { ret = package_add(variable_get(VAR_PCNFSD_PKG)); if (DITEM_STATUS(ret) == DITEM_SUCCESS) { variable_set2(VAR_PCNFSD, "YES", 0); variable_set2("mountd_flags", "-n", 1); } } return ret; } int configNFSServer(dialogMenuItem *self) { char cmd[256]; /* If we're an NFS server, we need an exports file */ if (!file_readable("/etc/exports")) { WINDOW *w = savescr(); if (file_readable("/etc/exports.disabled")) vsystem("mv /etc/exports.disabled /etc/exports"); else { dialog_clear_norefresh(); msgConfirm("Operating as an NFS server means that you must first configure\n" "an /etc/exports file to indicate which hosts are allowed certain\n" "kinds of access to your local file systems.\n" "Press [ENTER] now to invoke an editor on /etc/exports\n"); vsystem("echo '#The following examples export /usr to 3 machines named after ducks,' > /etc/exports"); vsystem("echo '#/home and all directories under it to machines named after dead rock stars' >> /etc/exports"); vsystem("echo '#and, finally, /a to 2 privileged machines allowed to write on it as root.' >> /etc/exports"); vsystem("echo '#/usr huey louie dewie' >> /etc/exports"); vsystem("echo '#/home -alldirs janice jimmy frank' >> /etc/exports"); vsystem("echo '#/a -maproot=0 bill albert' >> /etc/exports"); vsystem("echo '#' >> /etc/exports"); vsystem("echo '# You should replace these lines with your actual exported filesystems.' >> /etc/exports"); vsystem("echo >> /etc/exports"); sprintf(cmd, "%s /etc/exports", variable_get(VAR_EDITOR)); dialog_clear(); systemExecute(cmd); restorescr(w); } variable_set2(VAR_NFS_SERVER, "YES", 1); } else if (variable_get(VAR_NFS_SERVER)) { /* We want to turn it off again? */ vsystem("mv -f /etc/exports /etc/exports.disabled"); variable_unset(VAR_NFS_SERVER); } return DITEM_SUCCESS; } diff --git a/usr.sbin/sade/dispatch.c b/usr.sbin/sade/dispatch.c index 8d289e4207fc..7582b3698220 100644 --- a/usr.sbin/sade/dispatch.c +++ b/usr.sbin/sade/dispatch.c @@ -1,436 +1,434 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: dispatch.c,v 1.26 1998/11/15 09:06:19 jkh Exp $ + * $Id: dispatch.c,v 1.27 1999/02/05 22:15:48 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer, * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * 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 "list.h" static int dispatch_shutdown(dialogMenuItem *unused); static int dispatch_systemExecute(dialogMenuItem *unused); static int dispatch_msgConfirm(dialogMenuItem *unused); static struct _word { char *name; int (*handler)(dialogMenuItem *self); } resWords[] = { { "configAnonFTP", configAnonFTP }, { "configRouter", configRouter }, { "configNFSServer", configNFSServer }, { "configNTP", configNTP }, { "configPCNFSD", configPCNFSD }, { "configPackages", configPackages }, - { "configRegister", configRegister }, { "configUsers", configUsers }, { "configXEnvironment", configXEnvironment }, { "diskPartitionEditor", diskPartitionEditor }, { "diskPartitionWrite", diskPartitionWrite }, { "diskLabelEditor", diskLabelEditor }, { "diskLabelCommit", diskLabelCommit }, { "distReset", distReset }, { "distSetCustom", distSetCustom }, { "distSetDeveloper", distSetDeveloper }, { "distSetXDeveloper", distSetXDeveloper }, { "distSetKernDeveloper", distSetKernDeveloper }, { "distSetUser", distSetUser }, { "distSetXUser", distSetXUser }, { "distSetMinimum", distSetMinimum }, { "distSetEverything", distSetEverything }, { "distSetDES", distSetDES }, { "distSetSrc", distSetSrc }, { "distSetXF86", distSetXF86 }, { "distExtractAll", distExtractAll }, { "docBrowser", docBrowser }, { "docShowDocument", docShowDocument }, { "installCommit", installCommit }, { "installExpress", installExpress }, { "installNovice", installNovice }, { "installUpgrade", installUpgrade }, { "installFixupBin", installFixupBin }, { "installFixupXFree", installFixupXFree }, { "installFixitHoloShell", installFixitHoloShell }, { "installFixitCDROM", installFixitCDROM }, { "installFixitFloppy", installFixitFloppy }, { "installFilesystems", installFilesystems }, { "installVarDefaults", installVarDefaults }, { "loadConfig", dispatch_load_file }, { "loadFloppyConfig", dispatch_load_floppy }, { "mediaSetCDROM", mediaSetCDROM }, { "mediaSetFloppy", mediaSetFloppy }, { "mediaSetDOS", mediaSetDOS }, { "mediaSetTape", mediaSetTape }, { "mediaSetFTP", mediaSetFTP }, { "mediaSetFTPActive", mediaSetFTPActive }, { "mediaSetFTPPassive", mediaSetFTPPassive }, { "mediaSetUFS", mediaSetUFS }, { "mediaSetNFS", mediaSetNFS }, { "mediaSetFTPUserPass", mediaSetFTPUserPass }, { "mediaSetCPIOVerbosity", mediaSetCPIOVerbosity }, { "mediaGetType", mediaGetType }, { "msgConfirm", dispatch_msgConfirm }, { "optionsEditor", optionsEditor }, - { "register", configRegister }, /* Alias */ { "packageAdd", packageAdd }, { "addGroup", userAddGroup }, { "addUser", userAddUser }, { "shutdown", dispatch_shutdown }, { "system", dispatch_systemExecute }, { "dumpVariables", dump_variables }, { "tcpMenuSelect", tcpMenuSelect }, { NULL, NULL }, }; /* * Helper routines for buffering data. * * We read an entire configuration into memory before executing it * so that we are truely standalone and can do things like nuke the * file or disk we're working on. */ typedef struct command_buffer_ { qelement queue; char * string; } command_buffer; static void dispatch_free_command(command_buffer *item) { REMQUE(item); free(item->string); free(item); } static void dispatch_free_all(qelement *head) { command_buffer *item; while (!EMPTYQUE(*head)) { item = (command_buffer *) head->q_forw; dispatch_free_command(item); } } static command_buffer * dispatch_add_command(qelement *head, char *string) { command_buffer *new; new = malloc(sizeof(command_buffer)); if (!new) return NULL; new->string = strdup(string); INSQUEUE(new, head->q_back); return new; } /* * Command processing */ /* Just convenience */ static int dispatch_shutdown(dialogMenuItem *unused) { systemShutdown(0); return DITEM_FAILURE; } static int dispatch_systemExecute(dialogMenuItem *unused) { char *cmd = variable_get(VAR_COMMAND); if (cmd) return systemExecute(cmd) ? DITEM_FAILURE : DITEM_SUCCESS; else msgDebug("_systemExecute: No command passed in `command' variable.\n"); return DITEM_FAILURE; } static int dispatch_msgConfirm(dialogMenuItem *unused) { char *msg = variable_get(VAR_COMMAND); if (msg) { msgConfirm(msg); return DITEM_SUCCESS; } msgDebug("_msgConfirm: No message passed in `command' variable.\n"); return DITEM_FAILURE; } static int call_possible_resword(char *name, dialogMenuItem *value, int *status) { int i, rval; rval = 0; for (i = 0; resWords[i].name; i++) { if (!strcmp(name, resWords[i].name)) { *status = resWords[i].handler(value); rval = 1; break; } } return rval; } /* For a given string, call it or spit out an undefined command diagnostic */ int dispatchCommand(char *str) { int i; char *cp; if (!str || !*str) { msgConfirm("Null or zero-length string passed to dispatchCommand"); return DITEM_FAILURE; } /* If it's got a newline, trim it */ if ((cp = index(str, '\n')) != NULL) *cp = '\0'; /* If it's got a `=' sign in there, assume it's a variable setting */ if (index(str, '=')) { if (isDebug()) msgDebug("dispatch: setting variable `%s'\n", str); variable_set(str, 0); i = DITEM_SUCCESS; } else { /* A command might be a pathname if it's encoded in argv[0], which we also support */ if ((cp = rindex(str, '/')) != NULL) str = cp + 1; if (isDebug()) msgDebug("dispatch: calling resword `%s'\n", str); if (!call_possible_resword(str, NULL, &i)) { msgNotify("Warning: No such command ``%s''", str); i = DITEM_FAILURE; } } return i; } /* * File processing */ static qelement * dispatch_load_fp(FILE *fp) { qelement *head; char buf[BUFSIZ], *cp; head = malloc(sizeof(qelement)); if (!head) return NULL; INITQUE(*head); while (fgets(buf, sizeof buf, fp)) { if ((cp = strchr(buf, '\n')) != NULL) *cp = '\0'; if (*buf == '\0' || *buf == '#') continue; if (!dispatch_add_command(head, buf)) return NULL; } return head; } static int dispatch_execute(qelement *head) { int result = DITEM_SUCCESS; command_buffer *item; char *old_interactive; if (!head) return result | DITEM_FAILURE; old_interactive = variable_get(VAR_NONINTERACTIVE); if (old_interactive) old_interactive = strdup(old_interactive); /* save copy */ /* Hint to others that we're running from a script, should they care */ variable_set2(VAR_NONINTERACTIVE, "yes", 0); while (!EMPTYQUE(*head)) { item = (command_buffer *) head->q_forw; if (DITEM_STATUS(dispatchCommand(item->string)) != DITEM_SUCCESS) { /* * Allow a user to prefix a command with "noError" to cause * us to ignore any errors for that one command. */ if (variable_get(VAR_NO_ERROR)) variable_unset(VAR_NO_ERROR); else { msgConfirm("Command `%s' failed - rest of script aborted.\n", item->string); result |= DITEM_FAILURE; break; } } dispatch_free_command(item); } dispatch_free_all(head); if (!old_interactive) variable_unset(VAR_NONINTERACTIVE); else { variable_set2(VAR_NONINTERACTIVE, old_interactive, 0); free(old_interactive); } return result; } int dispatch_load_file_int(int quiet) { FILE *fp; char *cp; int i; qelement *list; static const char *names[] = { "install.cfg", "/stand/install.cfg", "/tmp/install.cfg", NULL }; fp = NULL; cp = variable_get(VAR_CONFIG_FILE); if (!cp) { for (i = 0; names[i]; i++) if ((fp = fopen(names[i], "r")) != NULL) break; } else fp = fopen(cp, "r"); if (!fp) { if (!quiet) msgConfirm("Unable to open %s: %s", cp, strerror(errno)); return DITEM_FAILURE; } list = dispatch_load_fp(fp); fclose(fp); return dispatch_execute(list); } int dispatch_load_file(dialogMenuItem *self) { return dispatch_load_file_int(FALSE); } int dispatch_load_floppy(dialogMenuItem *self) { int what = DITEM_RESTORE | DITEM_SUCCESS; extern char *distWanted; char *cp; FILE *fp; qelement *list; mediaClose(); dialog_clear_norefresh(); cp = variable_get_value(VAR_INSTALL_CFG, "Specify the name of a configuration file\n" "residing on a MSDOS or UFS floppy.", 0); if (!cp || !*cp) { variable_unset(VAR_INSTALL_CFG); what |= DITEM_FAILURE; return what; } distWanted = cp; /* Try to open the floppy drive */ if (DITEM_STATUS(mediaSetFloppy(NULL)) == DITEM_FAILURE) { msgConfirm("Unable to set media device to floppy."); what |= DITEM_FAILURE; mediaClose(); return what; } if (!mediaDevice->init(mediaDevice)) { msgConfirm("Unable to mount floppy filesystem."); what |= DITEM_FAILURE; mediaClose(); return what; } fp = mediaDevice->get(mediaDevice, cp, TRUE); if (fp) { list = dispatch_load_fp(fp); fclose(fp); mediaClose(); what |= dispatch_execute(list); } else { if (!variable_get(VAR_NO_ERROR)) msgConfirm("Configuration file '%s' not found.", cp); variable_unset(VAR_INSTALL_CFG); what |= DITEM_FAILURE; mediaClose(); } return what; } diff --git a/usr.sbin/sade/install.c b/usr.sbin/sade/install.c index f8a6d59faee6..81d3ddccb1c1 100644 --- a/usr.sbin/sade/install.c +++ b/usr.sbin/sade/install.c @@ -1,1134 +1,1119 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: install.c,v 1.229 1999/02/15 00:49:33 jkh Exp $ + * $Id: install.c,v 1.230 1999/03/11 09:38:06 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer, * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * 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 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) { Device **devs; Boolean status; Disk *disk; Chunk *c1, *c2, *rootdev, *swapdev, *usrdev, *vardev; int i; /* Don't allow whinging if noWarn is set */ if (variable_get(VAR_NO_WARN)) whinge = FALSE; status = TRUE; *rdev = *sdev = *udev = *vdev = rootdev = swapdev = usrdev = vardev = 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); } } } } } } } /* 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 */ *rdev = rootdev; *sdev = swapdev; *udev = usrdev; *vdev = vardev; 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; } if (!usrdev && whinge && !variable_get(VAR_NO_USR)) { msgConfirm("WARNING: No /usr filesystem found. This is not technically\n" "an error if your root filesystem is big enough (or you later\n" "intend to mount your /usr filesystem over NFS), but it may otherwise\n" "cause you trouble if you're not exactly sure what you are doing!"); } if (!vardev && whinge && variable_cmp(SYSTEM_STATE, "upgrade")) { msgConfirm("WARNING: No /var filesystem found. This is not technically\n" "an error if your root filesystem is big enough (or you later\n" "intend to link /var to someplace else), but it may otherwise\n" "cause your root filesystem to fill up if you receive lots of mail\n" "or edit large temporary files."); } 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 | DITEM_RESTORE; 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 (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 */ systemCreateHoloshell(); alreadyDone = TRUE; return status; } int installFixitHoloShell(dialogMenuItem *self) { systemCreateHoloshell(); return DITEM_SUCCESS; } 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 CDROM and press return"); if (DITEM_STATUS(mediaSetCDROM(NULL)) != DITEM_SUCCESS || !mediaDevice || !mediaDevice->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 CDROM - 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 CDROM 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 CDROM likely won't work."); } } /* Yet more iggly hardcoded pathnames. */ Mkdir("/usr/libexec"); if (!file_readable("/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 CDROM 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 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 (!mediaDevice->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/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 (!(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); 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); /* use the .profile from the fixit medium */ setenv("HOME", "/mnt2", 1); chdir("/mnt2"); execlp("sh", "-sh", 0); msgDebug("fixit shell: Failed to execute shell!\n"); _exit(1);; } else { 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."); (void)waitpid(child, &waitstatus, 0); } dialog_clear(); } int installExpress(dialogMenuItem *self) { int i; variable_set2(SYSTEM_STATE, "express", 0); #ifndef __alpha__ if (DITEM_STATUS((i = diskPartitionEditor(self))) == DITEM_FAILURE) return i; #endif if (DITEM_STATUS((i = diskLabelEditor(self))) == DITEM_FAILURE) return i; dialog_clear_norefresh(); if (DITEM_STATUS((i = installCommit(self))) == DITEM_SUCCESS) { i |= DITEM_LEAVE_MENU; /* Give user the option of one last configuration spree */ installConfigure(); } return i | DITEM_RESTORE; } /* Novice mode installation */ int installNovice(dialogMenuItem *self) { int i, tries = 0; Device **devs; variable_set2(SYSTEM_STATE, "novice", 0); #ifndef __alpha__ dialog_clear_norefresh(); 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 dialog_clear_norefresh(); #ifdef __alpha__ msgConfirm("First, 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."); #else msgConfirm("First, 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."); #endif if (DITEM_STATUS(diskLabelEditor(self)) == DITEM_FAILURE) return DITEM_FAILURE; dialog_clear_norefresh(); if (DITEM_STATUS((i = installCommit(self))) == DITEM_FAILURE) { dialog_clear_norefresh(); 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 chose \"No\" at the next\n" "prompt and go back into the installation menus to try and retry\n" "whichever operations have failed."); return i | DITEM_RESTORE; } else { dialog_clear_norefresh(); 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: /stand/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; dialog_clear_norefresh(); tmp = tcpDeviceSelect(); dialog_clear_norefresh(); if (tmp && !msgYesNo("Would you like to bring the %s interface up right now?", tmp->name)) if (!tmp->init(tmp)) msgConfirm("Initialization of %s device failed.", tmp->name); } } dialog_clear_norefresh(); if (!msgYesNo("Will this machine be an IP gateway (e.g. will it forward packets\n" "between interfaces)?")) variable_set2("gateway_enable", "YES", 1); dialog_clear_norefresh(); if (!msgYesNo("Do you want to allow anonymous FTP connections to this machine?")) configAnonFTP(self); dialog_clear_norefresh(); if (!msgYesNo("Do you want to configure this machine as an NFS server?")) configNFSServer(self); dialog_clear_norefresh(); if (!msgYesNo("Do you want to configure this machine as an NFS client?")) variable_set2("nfs_client_enable", "YES", 1); dialog_clear_norefresh(); if (!msgYesNo("Would you like to customize your system console settings?")) { WINDOW *w = savescr(); dmenuOpenSimple(&MenuSyscons, FALSE); restorescr(w); } dialog_clear_norefresh(); if (!msgYesNo("Would you like to set this machine's time zone now?")) { WINDOW *w = savescr(); dialog_clear(); systemExecute("tzsetup"); restorescr(w); } dialog_clear_norefresh(); if (!msgYesNo("Does this system have a mouse attached to it?")) { WINDOW *w = savescr(); dmenuOpenSimple(&MenuMouse, FALSE); restorescr(w); } /* 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?")) configXEnvironment(self); } dialog_clear_norefresh(); if (!msgYesNo("The FreeBSD package collection is a collection of hundreds 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?")) configPackages(self); dialog_clear_norefresh(); 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).")) configUsers(self); dialog_clear_norefresh(); msgConfirm("Now you must set the system manager's password.\n" "This is the password you'll use to log in as \"root\"."); { WINDOW *w = savescr(); if (!systemExecute("passwd root")) variable_set2("root_password", "YES", 0); restorescr(w); } - dialog_clear_norefresh(); - if (!msgYesNo("Would you like to register your FreeBSD system at this time?\n\n" - "PLEASE, take just 5 minutes to do this. If we're ever to get any\n" - "significant base of commercial software for FreeBSD, we need to\n" - "be able to provide more information about the size of our user community.\n" - "This is where your registration can really help us, and you can also\n" - "sign up for the new FreeBSD newsletter (its free!) at the same time.\n")) - configRegister(NULL); - else { - dialog_clear_norefresh(); - msgConfirm("OK, but if you should change your mind then you always can register\n" - "later by typing ``/stand/sysinstall register'' or by simply visiting our\n" - "web site at http://www.freebsd.org/register.html"); - - } /* 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 | DITEM_RESTORE; } /* The version of commit we call from the Install Custom menu */ int installCustomCommit(dialogMenuItem *self) { int i; dialog_clear_norefresh(); i = installCommit(self); if (DITEM_STATUS(i) == DITEM_SUCCESS) { /* 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 DES dist. */ int installCommit(dialogMenuItem *self) { int i; char *str; if (!Dists) distConfig(NULL); if (!Dists) if (!dmenuOpenSimple(&MenuDistributions, FALSE) && !Dists) return DITEM_FAILURE | DITEM_RESTORE; if (!mediaVerify()) return DITEM_FAILURE | DITEM_RESTORE; 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 (!mediaDevice->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 | DITEM_RESTORE; else goto try_media; } else return DITEM_FAILURE | DITEM_RESTORE; } /* 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 | DITEM_RESTORE; } static void installConfigure(void) { /* Final menu of last resort */ dialog_clear_norefresh(); if (!msgYesNo("Visit the general configuration menu for a chance to set\n" "any last options?")) { WINDOW *w = savescr(); dmenuOpenSimple(&MenuConfigure, FALSE); restorescr(w); } configRC_conf(); sync(); } int installFixupBin(dialogMenuItem *self) { Device **devs; int i; /* All of this is done only as init, just to be safe */ if (RunningAsInit) { /* Fix up kernel first */ if (!file_readable("/kernel")) { if (file_readable("/kernel.GENERIC")) { if (vsystem("cp -p /kernel.GENERIC /kernel")) { msgConfirm("Unable to copy /kernel into place!"); return DITEM_FAILURE; } #ifndef __alpha__ /* Snapshot any boot -c changes back to the new kernel */ if (kget("/boot/kernel.conf")) { msgConfirm("Kernel copied OK, but unable to save boot -c changes\n" "to it. See the debug screen (ALT-F2) for details."); } else { if (!file_readable("/boot/loader.rc")) { FILE *fp; if ((fp = fopen("/boot/loader.rc", "w")) != NULL) { fprintf(fp, "load /kernel\n"); fprintf(fp, "load -t userconfig_script /boot/kernel.conf\n"); fprintf(fp, "autoboot 5\n"); fclose(fp); } } else { msgConfirm("You already have a /boot/loader.rc file so I won't touch it.\n" "You will need to add a: load -t userconfig_script /boot/kernel.conf\n" "line to your /boot/loader.rc before your saved kernel changes\n" "(if any) can go into effect."); } } #endif } else { msgConfirm("Can't find a kernel image to link to on the root file system!\n" "You're going to have a hard time getting this system to\n" "boot from the hard disk, I'm afraid!"); return DITEM_FAILURE; } } /* BOGON #1: Resurrect /dev after bin distribution screws it up */ msgNotify("Remaking all devices.. Please wait!"); if (vsystem("cd /dev; sh MAKEDEV all")) { msgConfirm("MAKEDEV returned non-zero status"); return DITEM_FAILURE; } 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) { 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; } } } } /* 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; } /* Fix side-effects from the the XFree86 installation */ int installFixupXFree(dialogMenuItem *self) { /* BOGON #1: XFree86 requires various specialized fixups */ if (directory_exists("/usr/X11R6")) { msgNotify("Fixing permissions in XFree86 tree.."); vsystem("chmod -R a+r /usr/X11R6"); vsystem("find /usr/X11R6 -type d | xargs chmod a+x"); /* Also do bogus minimal package registration so ports don't whine */ if (file_readable("/usr/X11R6/lib/X11/pkgreg.tar.gz")) { msgNotify("Installing package metainfo.."); vsystem("tar xpzf /usr/X11R6/lib/X11/pkgreg.tar.gz -C / && rm /usr/X11R6/lib/X11/pkgreg.tar.gz"); } } return DITEM_SUCCESS; } /* Go newfs and/or mount all the filesystems we've been asked to */ int installFilesystems(dialogMenuItem *self) { int i; Disk *disk; Chunk *c1, *c2, *rootdev, *swapdev, *usrdev, *vardev; 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, &usrdev, &vardev)) 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)) 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/r%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; } 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 || !msgYesNo("You are upgrading - are you SURE you want to newfs the root partition?"))) { int i; 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; } } else { if (!upgrade) { msgConfirm("Warning: Using existing root partition. It will be assumed\n" "that you have the appropriate device entries already in /dev."); } msgNotify("Checking integrity of existing %s filesystem.", dname); i = vsystem("fsck -y %s", dname); if (i) msgConfirm("Warning: fsck returned status of %d for %s.\n" "This partition may be unsafe to use.", i, 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; } } /* 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; } 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 || !msgYesNo("You are upgrading - are you SURE you want to newfs /dev/%s?", c2->name))) command_shell_add(tmp->mountpoint, "%s %s/dev/r%s", tmp->newfs_cmd, RunningAsInit ? "/mnt" : "", c2->name); else command_shell_add(tmp->mountpoint, "fsck -y %s/dev/r%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) 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); } } } if (RunningAsInit) { 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; } } command_sort(); command_execute(); return DITEM_SUCCESS; } static char * getRelname(void) { static char buf[64]; int 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, "lynx", 0); variable_set2(VAR_BROWSER_BINARY, "/usr/local/bin/lynx", 0); variable_set2(VAR_FTP_STATE, "passive", 0); variable_set2(VAR_NFS_SECURE, "YES", 0); variable_set2(VAR_PKG_TMPDIR, "/usr/tmp", 0); variable_set2(VAR_GATED_PKG, "gated", 0); variable_set2(VAR_PCNFSD_PKG, "pcnfsd", 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); 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, 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); } } diff --git a/usr.sbin/sade/menus.c b/usr.sbin/sade/menus.c index d03b76d3489b..5d7fb7ac4d34 100644 --- a/usr.sbin/sade/menus.c +++ b/usr.sbin/sade/menus.c @@ -1,1528 +1,1526 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: menus.c,v 1.193 1999/03/19 10:54:37 jkh Exp $ + * $Id: menus.c,v 1.194 1999/04/21 07:22:37 obrien Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer, * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * 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" #ifdef __alpha__ #define _AS(str) str "alpha/" #else /* i386 */ #define _AS(str) str "i386/" #endif #define _AP(str) _AS(str "/pub/FreeBSD/releases/") /* Miscellaneous work routines for menus */ static int setSrc(dialogMenuItem *self) { Dists |= DIST_SRC; SrcDists = DIST_SRC_ALL; return DITEM_SUCCESS | DITEM_REDRAW; } static int clearSrc(dialogMenuItem *self) { Dists &= ~DIST_SRC; SrcDists = 0; return DITEM_SUCCESS | DITEM_REDRAW; } static int setX11All(dialogMenuItem *self) { XF86Dists = DIST_XF86_ALL; XF86ServerDists = DIST_XF86_SERVER_ALL; XF86FontDists = DIST_XF86_FONTS_ALL; Dists |= DIST_XF86; return DITEM_SUCCESS | DITEM_REDRAW; } static int clearX11All(dialogMenuItem *self) { XF86Dists = 0; XF86ServerDists = 0; XF86FontDists = 0; Dists &= ~DIST_XF86; 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 | DIST_DES | extra)) #define IS_USER(dist, extra) (_IS_SET(dist, _DIST_USER | extra) || \ _IS_SET(dist, _DIST_USER | DIST_DES | 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_BIN; } static int checkDistEverything(dialogMenuItem *self) { return Dists == DIST_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 DESFlagCheck(dialogMenuItem *item) { return DESDists; } 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 [ENTER].\n" "Leave the index page by selecting Cancel [TAB-ENTER].", "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, DES", "DES distribution menu.", NULL, dmenuSubmenu, NULL, &MenuDESDistributions }, { "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, 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 }, { "Fdisk", "The disk Partition Editor", NULL, diskPartitionEditor }, { "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 }, { "Install, Novice", "A novice system installation.", NULL, installNovice }, { "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", "Select CDROM 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 }, { "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" }, - { "Register", "Register yourself or company as a FreeBSD user.", dmenuVarCheck, configRegister, NULL, "registered" }, { "Root Password", "Set the system manager's password.", NULL, dmenuSystemCommand, NULL, "passwd root" }, { "Router", "Select routing daemon (default: routed)", NULL, configRouter, NULL, "router" }, { "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 }, { "Time Zone", "Set the system's time zone.", NULL, dmenuSystemCommand, NULL, "tzsetup" }, { "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 }, { "XFree86, PC98 Server", "XFree86 PC98 Server selection menu.", NULL, dmenuSubmenu, NULL, &MenuXF86SelectPC98Server }, { NULL } }, }; /* The initial installation menu */ DMenu MenuInitial = { DMENU_NORMAL_TYPE, "/stand/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 by pressing [ENTER] or [TAB-ENTER] to exit the installation.", "Press F1 for Installation Guide", /* help line */ "install", /* help file */ { { "Select" }, { "Exit Install", NULL, NULL, dmenuExit }, { "1 Usage", "Quick start - How to use this menu system", NULL, dmenuDisplayFile, NULL, "usage" }, { "2 Novice", "Begin a novice installation (for beginners)", NULL, installNovice }, { "3 Express", "Begin a quick installation (for the impatient)", NULL, installExpress }, { "4 Custom", "Begin a custom installation (for experts)", NULL, dmenuSubmenu, NULL, &MenuInstallCustom }, { "5 Configure", "Do post-install configuration of FreeBSD", NULL, dmenuSubmenu, NULL, &MenuConfigure }, { "D Doc", "Installation instructions, README, etc.", NULL, dmenuSubmenu, NULL, &MenuDocumentation }, { "K Keymap", "Select keyboard type", NULL, dmenuSubmenu, NULL, &MenuSysconsKeymap }, { "O Options", "View/Set various installation options", NULL, optionsEditor }, { "F Fixit", "Enter repair mode with CDROM/floppy or start shell", NULL, dmenuSubmenu, NULL, &MenuFixit }, { "U Upgrade", "Upgrade an existing system", NULL, installUpgrade }, { "L Load Config","Load default install configuration", NULL, dispatch_load_floppy }, { "I 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", { { "1 README", "A general description of FreeBSD. Read this!", NULL, dmenuDisplayFile, NULL, "README" }, { "2 Hardware", "The FreeBSD survival guide for PC hardware.", NULL, dmenuDisplayFile, NULL, "HARDWARE" }, { "3 Install", "A step-by-step guide to installing FreeBSD.", NULL, dmenuDisplayFile, NULL, "INSTALL" }, { "4 Copyright", "The FreeBSD Copyright notices.", NULL, dmenuDisplayFile, NULL, "COPYRIGHT" }, { "5 Release" ,"The release notes for this version of FreeBSD.", NULL, dmenuDisplayFile, NULL, "RELNOTES" }, { "6 Shortcuts", "Creating shortcuts to sysinstall.", NULL, dmenuDisplayFile, NULL, "shortcuts" }, { "7 HTML Docs", "Go to the HTML documentation menu (post-install).", NULL, docBrowser }, { "0 Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { NULL } }, }; DMenu MenuMouseType = { DMENU_RADIO_TYPE | DMENU_SELECTION_RETURNS, "Select a protocol type for your mouse", "If you are not sure, choose \"Auto\". It should always work for bus\n" "and PS/2 style mice. It may not work for the serial mouse if the mouse\n" "does not support the PnP standard. But, it won't hurt. Many 2-button\n" "serial mice are compatible with \"Microsoft\" or \"MouseMan\". 3-button\n" "serial mice may be compatible with \"MouseSystems\" or \"MouseMan\". If\n" "the mouse has a wheel, it may be compatible with \"IntelliMouse\".", NULL, NULL, { { "Auto", "Bus mouse, PS/2 style mouse or PnP serial mouse", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=auto" }, { "GlidePoint", "ALPS GlidePoint pad (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=glidepoint" }, { "Hitachi","Hitachi tablet (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=mmhittab" }, { "IntelliMouse", "Microsoft IntelliMouse (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=intellimouse" }, { "Logitech", "Logitech protocol (old models) (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=logitech" }, { "Microsoft", "Microsoft protocol (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=microsoft" }, { "MM Series","MM Series protocol (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=mmseries" }, { "MouseMan", "Logitech MouseMan/TrackMan models (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=mouseman" }, { "MouseSystems", "MouseSystems protocol (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=mousesystems" }, { "ThinkingMouse","Kensington ThinkingMouse (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=thinkingmouse" }, { NULL } }, }; DMenu MenuMousePort = { DMENU_RADIO_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, { { "COM1", "Serial mouse on COM1 (/dev/cuaa0)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuaa0" }, { "COM2", "Serial mouse on COM2 (/dev/cuaa1)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuaa1" }, { "COM3", "Serial mouse on COM3 (/dev/cuaa2)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuaa2" }, { "COM4", "Serial mouse on COM4 (/dev/cuaa3)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuaa3" }, { "BusMouse", "Logitech, ATI or MS bus mouse (/dev/mse0)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/mse0" }, { "PS/2", "PS/2 style mouse (/dev/psm0)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/psm0" }, { 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 4 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, { { "1 Type", "Select mouse protocol type", NULL, dmenuSubmenu, NULL, &MenuMouseType }, { "2 Port", "Select mouse port", NULL, dmenuSubmenu, NULL, &MenuMousePort }, { "3 Enable", "Test and run the mouse daemon", NULL, mousedTest, NULL, NULL }, { "4 Disable", "Disable the mouse daemon", NULL, mousedDisable, NULL, NULL }, { "0 Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { NULL } }, }; DMenu MenuXF86Config = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Please select the XFree86 configuration tool you want to use.", "The first tool, XF86Setup, is fully graphical and requires the\n" "VGA16 server in order to work (should have been selected by\n" "default, but if you de-selected it then you won't be able to\n" "use this fancy setup tool). The second tool, 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 fancier one\n" "does not.", "Press F1 to read the XFree86 release notes for FreeBSD", "XF86", { { "XF86Setup", "Fully graphical XFree86 configuration tool.", NULL, dmenuSetVariable, NULL, VAR_XF86_CONFIG "=XF86Setup" }, { "xf86config", "Shell-script based XFree86 configuration tool.", NULL, dmenuSetVariable, NULL, VAR_XF86_CONFIG "=xf86config" }, { "XF98Setup", "Fully graphical XFree86 configuration tool (PC98).", NULL, dmenuSetVariable, NULL, VAR_XF86_CONFIG "=XF98Setup" }, { NULL } }, }; DMenu MenuMediaCDROM = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Choose a CDROM type", "FreeBSD can be installed directly from a CDROM containing a valid\n" "FreeBSD distribution. If you are seeing this menu it is because\n" "more than one CDROM drive was found on your system. Please select one\n" "of the following CDROM drives as your installation drive.", "Press F1 to read the installation guide", "install", { { NULL } }, }; DMenu MenuMediaFloppy = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Choose a Floppy drive", "You have more than one floppy drive. Please chose 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 _AS("=ftp://ftp.freebsd.org/pub/FreeBSD/releases/") }, { "URL", "Specify some other ftp site by URL", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=other" }, { "4.0 SNAP Server", "current.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AS("=ftp://current.freebsd.org/pub/FreeBSD/snapshots/") }, { "3.0 SNAP Server", "releng3.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AS("=ftp://releng3.freebsd.org/pub/FreeBSD/snapshots/") }, { "Argentina", "ftp.ar.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.ar.freebsd.org") }, { "Australia", "ftp.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.au.freebsd.org") }, { "Australia #2", "ftp2.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.au.freebsd.org") }, { "Australia #3", "ftp3.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp3.au.freebsd.org") }, { "Australia #4", "ftp4.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp4.au.freebsd.org") }, { "Australia #5", "ftp5.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp5.au.freebsd.org") }, { "Brazil", "ftp.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.br.freebsd.org") }, { "Brazil #2", "ftp2.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.br.freebsd.org") }, { "Brazil #3", "ftp3.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp3.br.freebsd.org") }, { "Brazil #4", "ftp4.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp4.br.freebsd.org") }, { "Brazil #5", "ftp5.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp5.br.freebsd.org") }, { "Brazil #6", "ftp6.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp6.br.freebsd.org") }, { "Brazil #7", "ftp7.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp7.br.freebsd.org") }, { "Canada", "ftp.ca.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.ca.freebsd.org") }, { "Czech Republic", "ftp.cz.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.cz.freebsd.org") }, { "Denmark", "ftp.dk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.dk.freebsd.org") }, { "Denmark #2", "ftp2.dk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.dk.freebsd.org") }, { "Estonia", "ftp.ee.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.ee.freebsd.org") }, { "Finland", "ftp.fi.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.fi.freebsd.org") }, { "France", "ftp.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.fr.freebsd.org") }, { "France #2", "ftp2.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.fr.freebsd.org") }, { "Germany", "ftp.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.de.freebsd.org") }, { "Germany #2", "ftp2.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.de.freebsd.org") }, { "Germany #3", "ftp3.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp3.de.freebsd.org") }, { "Germany #4", "ftp4.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp4.de.freebsd.org") }, { "Germany #5", "ftp5.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp5.de.freebsd.org") }, { "Germany #6", "ftp6.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp6.de.freebsd.org") }, { "Germany #7", "ftp7.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp7.de.freebsd.org") }, { "Holland", "ftp.nl.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.nl.freebsd.org") }, { "Hong Kong", "ftp.hk.super.net", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.hk.super.net") }, { "Iceland", "ftp.is.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.is.freebsd.org") }, { "Ireland", "ftp.ie.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.ie.freebsd.org") }, { "Israel", "ftp.il.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.il.freebsd.org") }, { "Israel #2", "ftp2.il.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.il.freebsd.org") }, { "Japan", "ftp.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.jp.freebsd.org") }, { "Japan #2", "ftp2.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.jp.freebsd.org") }, { "Japan #3", "ftp3.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp3.jp.freebsd.org") }, { "Japan #4", "ftp4.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp4.jp.freebsd.org") }, { "Japan #5", "ftp5.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp5.jp.freebsd.org") }, { "Japan #6", "ftp6.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp6.jp.freebsd.org") }, { "Korea", "ftp.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.kr.freebsd.org") }, { "Korea #2", "ftp2.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.kr.freebsd.org") }, { "Korea #3", "ftp3.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp3.kr.freebsd.org") }, { "Korea #4", "ftp4.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp4.kr.freebsd.org") }, { "Korea #5", "ftp5.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp5.kr.freebsd.org") }, { "Poland", "ftp.pl.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.pl.freebsd.org") }, { "Portugal", "ftp.pt.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.pt.freebsd.org") }, { "Portugal #2", "ftp2.pt.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.pt.freebsd.org") }, { "Russia", "ftp.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.ru.freebsd.org") }, { "Russia #2", "ftp2.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.ru.freebsd.org") }, { "Russia #3", "ftp3.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp3.ru.freebsd.org") }, { "Russia #4", "ftp4.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp4.ru.freebsd.org") }, { "South Africa", "ftp.za.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.za.freebsd.org") }, { "South Africa #2", "ftp2.za.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.za.freebsd.org") }, { "South Africa #3", "ftp3.za.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp3.za.freebsd.org") }, { "South Africa #4", "ftp4.za.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp4.za.freebsd.org") }, { "Spain", "ftp.es.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.es.freebsd.org") }, { "Spain #2", "ftp2.es.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.es.freebsd.org") }, { "Sweden", "ftp.se.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.se.freebsd.org") }, { "Sweden #2", "ftp2.se.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.se.freebsd.org") }, { "Sweden #3", "ftp3.se.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp3.se.freebsd.org") }, { "Taiwan", "ftp.tw.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.tw.freebsd.org") }, { "Taiwan #2", "ftp2.tw.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.tw.freebsd.org") }, { "Taiwan #3", "ftp3.tw.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp3.tw.freebsd.org") }, { "Thailand", "ftp.nectec.or.th", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AS("=ftp://ftp.nectec.or.th/pub/mirrors/FreeBSD/") }, { "UK", "ftp.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.uk.freebsd.org") }, { "UK #2", "ftp2.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.uk.freebsd.org") }, { "UK #3", "ftp3.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp3.uk.freebsd.org") }, { "UK #4", "ftp4.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp4.uk.freebsd.org") }, { "USA", "ftp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.freebsd.org") }, { "USA #2", "ftp2.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.freebsd.org") }, { "USA #3", "ftp3.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp3.freebsd.org") }, { "USA #4", "ftp4.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp4.freebsd.org") }, { "USA #5", "ftp5.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp5.freebsd.org") }, { "USA #6", "ftp6.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=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 } }, }; /* 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 CDROM 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 CDROM", "Install from a FreeBSD CDROM", 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 DOS", "Install from a DOS partition", NULL, mediaSetDOS }, { "5 NFS", "Install over NFS", NULL, mediaSetNFS }, { "6 File System", "Install from an existing filesystem", NULL, mediaSetUFS }, { "7 Floppy", "Install from a floppy disk set", NULL, mediaSetFloppy }, { "8 Tape", "Install from SCSI or QIC tape", NULL, mediaSetTape }, { "9 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]. When you are finished, chose the Exit\n" "item or press [ENTER].", "Press F1 for more information on these options.", "distributions", { { "1 Developer", "Full sources, binaries and doc but no games", checkDistDeveloper, distSetDeveloper }, { "2 X-Developer", "Same as above + X Window System", checkDistXDeveloper, distSetXDeveloper }, { "3 Kern-Developer", "Full binaries and doc, kernel sources only", checkDistKernDeveloper, distSetKernDeveloper }, { "4 X-Kern-Developer", "Same as above + X Window System", checkDistXKernDeveloper, distSetXKernDeveloper }, { "5 User", "Average user - binaries and doc only", checkDistUser, distSetUser }, { "6 X-User", "Same as above + X Window System", checkDistXUser, distSetXUser }, { "7 Minimal", "The smallest configuration possible", checkDistMinimum, distSetMinimum }, { "8 Custom", "Specify your own distribution set", NULL, dmenuSubmenu, NULL, &MenuSubDistributions, '>', '>', '>' }, { "8 All", "All sources and binaries (incl X Window System)", checkDistEverything, distSetEverything }, { "9 Clear", "Reset selected distribution list to nothing", NULL, distReset, NULL, NULL, ' ', ' ', ' ' }, { "0 Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { 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 \"bin\". WARNING: Do not export the\n" "DES distribution out of the U.S.! It is for U.S. customers only.", NULL, NULL, { { "bin", "Binary base distribution (required)", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_BIN }, { "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 { "DES", "DES encryption code - NOT FOR EXPORT!", DESFlagCheck, distSetDES }, { "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 but DES", srcFlagCheck, distSetSrc }, { "ports", "The FreeBSD Ports collection", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_PORTS }, { "XFree86", "The XFree86 3.3.3.1 distribution", x11FlagCheck, distSetXF86 }, { "All", "All sources, binaries and X Window System binaries", NULL, distSetEverything, NULL, NULL, ' ', ' ', ' ' }, { "Clear", "Reset all of the above", NULL, distReset, NULL, NULL, ' ', ' ', ' ' }, { "Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { NULL } }, }; DMenu MenuDESDistributions = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "Select the encryption facilities you wish to install.", "Please check off any special DES-based encryption distributions\n" "you would like to install. Please note that these services are NOT FOR\n" "EXPORT from the United States. For information on non-U.S. FTP\n" "distributions of this software, please consult the release notes.", NULL, NULL, { { "des", "Basic DES encryption services", dmenuFlagCheck, dmenuSetFlag, NULL, &DESDists, '[', 'X', ']', DIST_DES_DES, }, { "krb", "Kerberos encryption services", dmenuFlagCheck, dmenuSetFlag, NULL, &DESDists, '[', 'X', ']', DIST_DES_KERBEROS }, { "skerbero", "Sources for Kerberos IV", dmenuFlagCheck, dmenuSetFlag, NULL, &DESDists, '[', 'X', ']', DIST_DES_SKERBEROS }, { "ssecure", "Sources for DES", dmenuFlagCheck, dmenuSetFlag, NULL, &DESDists, '[', 'X', ']', DIST_DES_SSECURE }, { "scrypto", "Export controlled crypto sources", dmenuFlagCheck, dmenuSetFlag, NULL, &DESDists, '[', 'X', ']', DIST_DES_SCRYPTO }, { "Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { 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, { { "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 }, { "share", "/usr/src/share (documents and shared files)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_SHARE }, { "sys", "/usr/src/sys (FreeBSD kernel)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_SYS }, { "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 }, { "All", "Select all of the above", NULL, setSrc, NULL, NULL, ' ', ' ', ' ' }, { "Clear", "Reset all of the above", NULL, clearSrc, NULL, NULL, ' ', ' ', ' ' }, { "Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { NULL } }, }; DMenu MenuXF86Select = { DMENU_NORMAL_TYPE, "XFree86 3.3.3.1 Distribution", "Please select the components you need from the XFree86 3.3.3.1\n" "distribution sets.", "Press F1 to read the XFree86 release notes for FreeBSD", "XF86", { { "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 }, { "All", "Select all XFree86 distribution sets", NULL, setX11All }, { "Clear", "Reset XFree86 distribution list", NULL, clearX11All }, { "Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { NULL } }, }; DMenu MenuXF86SelectCore = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "XFree86 3.3.3.1 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.", "Press F1 to read the XFree86 release notes for FreeBSD", "XF86", { { "bin", "Client applications and shared libs", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_BIN }, { "cfg", "Configuration files", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_CFG }, { "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 }, { "lib", "Data files needed at runtime", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_LIB }, { "lk98", "Server link kit for PC98 machines", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_LKIT98 }, { "lkit", "Server link kit for all other machines", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_LKIT }, { "man", "Manual pages", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_MAN }, { "prog", "Programmer's header and library files", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_PROG }, { "set", "XFree86 Setup Utility", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_SET }, { "9set", "XFree86 Setup Utility for PC98 machines", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_9SET }, { "sources", "XFree86 3.3.3.1 standard sources", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_SRC }, { "csources", "XFree86 3.3.3.1 contrib sources", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_CSRC }, { "All", "Select all of the above", NULL, setX11Misc, NULL, NULL, ' ', ' ', ' ' }, { "Clear", "Reset all of the above", NULL, clearX11Misc, NULL, NULL, ' ', ' ', ' ' }, { "Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { 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).", "Press F1 to read the XFree86 release notes for FreeBSD", "XF86", { { "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 }, { "All", "All fonts", NULL, setX11Fonts, NULL, NULL, ' ', ' ', ' ' }, { "Clear", "Reset font selections", NULL, clearX11Fonts, NULL, NULL, ' ', ' ', ' ' }, { "Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { 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.", "Press F1 to read the XFree86 release notes for FreeBSD", "XF86", { { "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 }, { "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 }, { "nest", "A nested server for testing purposes", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_NEST }, { "PC98", "Select an X server for a NEC PC98 [Submenu]", NULL, dmenuSubmenu, NULL, &MenuXF86SelectPC98Server, '>', ' ', '>', 0 }, { "All", "Select all of the above", NULL, setX11Servers, NULL, NULL, ' ', ' ', ' ' }, { "Clear", "Reset all of the above", NULL, clearX11Servers, NULL, NULL, ' ', ' ', ' ' }, { "Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { NULL } }, }; 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).", "Press F1 to read the XFree86 release notes for FreeBSD", "XF86", { { "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 }, { "Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { NULL } } }; 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]. To de-select it, press [SPACE] again.\n\n" "Select OK or Cancel to 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 chose \"other\"\n" "to enter an arbitrary URL for browsing.", "Press F1 for more help on what you see here.", "html", { { "Handbook", "The FreeBSD Handbook.", NULL, docShowDocument }, { "FAQ", "The Frequently Asked Questions guide.", NULL, docShowDocument }, { "Home", "The Home Pages for the FreeBSD Project (requires net)", NULL, docShowDocument }, { "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", { { "1 Options", "View/Set various installation options", NULL, optionsEditor }, #ifdef __alpha__ { "2 Label", "Label disk partitions", NULL, diskLabelEditor }, { "3 Distributions", "Select distribution(s) to extract", NULL, dmenuSubmenu, NULL, &MenuDistributions }, { "4 Media", "Choose the installation media type", NULL, dmenuSubmenu, NULL, &MenuMedia }, { "5 Commit", "Perform any pending Partition/Label/Extract actions", NULL, installCustomCommit }, #else { "2 Partition", "Allocate disk space for FreeBSD", NULL, diskPartitionEditor }, { "3 Label", "Label allocated 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 }, #endif { "0 Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { NULL } }, }; /* MBR type menu */ DMenu MenuMBRType = { DMENU_RADIO_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 }, { "Standard", "Install a standard MBR (no boot manager)", dmenuRadioCheck, dmenuSetValue, NULL, &BootMgr, '(', '*', ')', 1 }, { "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", { { "D Distributions", "Install additional distribution sets", NULL, distExtractAll }, { "P Packages", "Install pre-packaged software for FreeBSD", NULL, configPackages }, { "R Root Password", "Set the system manager's password", NULL, dmenuSystemCommand, NULL, "passwd root" }, { "L Label", "The disk Label editor", NULL, diskLabelEditor }, { "F Fdisk", "The disk Slice (PC-style partition) Editor", NULL, diskPartitionEditor }, { "1 User Management", "Add user and group information", NULL, dmenuSubmenu, NULL, &MenuUsermgmt }, { "2 Console", "Customize system console behavior", NULL, dmenuSubmenu, NULL, &MenuSyscons }, { "3 Time Zone", "Set which time zone you're in", NULL, dmenuSystemCommand, NULL, "tzsetup" }, { "4 Media", "Change the installation media type", NULL, dmenuSubmenu, NULL, &MenuMedia }, { "5 Mouse", "Configure your mouse", NULL, dmenuSubmenu, NULL, &MenuMouse, NULL }, { "6 Networking", "Configure additional network services", NULL, dmenuSubmenu, NULL, &MenuNetworking }, { "7 Startup", "Configure system startup options", NULL, dmenuSubmenu, NULL, &MenuStartup }, { "8 Options", "View/Set various installation options", NULL, optionsEditor }, { "D HTML Docs", "Go to the HTML documentation menu (post-install)", NULL, docBrowser }, { "X XFree86", "Configure XFree86", NULL, configXEnvironment }, - { "U Register", "Register yourself or company as a FreeBSD user.", NULL, configRegister }, { "E Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { 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. Remember to use SPACE to select items! The\n" "RETURN key will leave this menu (as with all checkbox menus).", NULL, NULL, { { "APM", "Auto-power management services (typically laptops)", dmenuVarCheck, dmenuToggleVariable, NULL, "apm_enable=YES" }, { "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" }, { " ", " -- ", 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 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" }, { "linux", "This host wants to be able to run linux binaries.", dmenuVarCheck, dmenuToggleVariable, NULL, "linux_enable=YES" }, { "quotas", "This host wishes to check quotas on startup.", dmenuVarCheck, dmenuToggleVariable, NULL, "check_quotas=YES" }, { "SCO", "This host wants to be able to run IBCS2 binaries.", dmenuVarCheck, dmenuToggleVariable, NULL, "ibcs2_enable=YES" }, { "Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { 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, { { "Interfaces", "Configure additional network interfaces", NULL, tcpMenuSelect }, { "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" }, { "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" }, { "TCP Extensions", "Allow RFC1323 and RFC1644 TCP extensions?", dmenuVarCheck, dmenuToggleVariable, NULL, "tcp_extensions=YES" }, { "Gateway", "This machine will route packets between interfaces", dmenuVarCheck, dmenuToggleVariable, NULL, "gateway_enable=YES" }, { "Ntpdate", "Select a clock-synchronization server", dmenuVarCheck, dmenuSubmenu, NULL, &MenuNTP, '[', 'X', ']', "ntpdate_enable=YES" }, { "router", "Select routing daemon (default: routed)", dmenuVarCheck, configRouter, NULL, "router" }, { "Rwhod", "This machine wants to run the rwho daemon", dmenuVarCheck, dmenuToggleVariable, NULL, "rwhod_enable=YES" }, { "Anon FTP", "This machine wishes to allow anonymous FTP.", dmenuVarCheck, configAnonFTP, NULL, "anon_ftp" }, { "PCNFSD", "Run authentication server for clients with PC-NFS.", dmenuVarCheck, configPCNFSD, NULL, "pcnfsd" }, { "Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { NULL } }, }; DMenu MenuNTP = { DMENU_RADIO_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 }, { "Australia", "ntp.syd.dms.csiro.au (HP 5061 Cesium Beam)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.syd.dms.csiro.au" }, { "Canada", "tick.usask.ca (GOES clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tick.usask.ca" }, { "France", "canon.inria.fr (TDF clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=canon.inria.fr" }, { "Germany", "ntps1-{0,1,2}.uni-erlangen.de (GPS)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntps1-0.uni-erlangen.de" }, { "Germany #2", "ntps1-0.cs.tu-berlin.de (GPS)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntps1-0.cs.tu-berlin.de" }, { "Japan", "clock.nc.fukuoka-u.ac.jp (GPS clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock.nc.fukuoka-u.ac.jp" }, { "Japan #2", "clock.tl.fukuoka-u.ac.jp (GPS clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock.tl.fukuoka-u.ac.jp" }, { "Netherlands", "ntp0.nl.net (GPS clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp0.nl.net" }, { "Norway", "timer.unik.no (NTP clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=timer.unik.no" }, { "Sweden", "Time1.Stupi.SE (Cesium/GPS)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=Time1.Stupi.SE" }, { "Switzerland", "swisstime.ethz.ch (DCF77 clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=swisstime.ethz.ch" }, { "U.S. East Coast", "bitsy.mit.edu (WWV clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=bitsy.mit.edu" }, { "U.S. East Coast #2", "otc1.psu.edu (WWV clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=otc1.psu.edu" }, { "U.S. West Coast", "apple.com (WWV clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=apple.com" }, { "U.S. West Coast #2", "clepsydra.dec.com (GOES clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clepsydra.dec.com" }, { "U.S. West Coast #3", "clock.llnl.gov (WWVB clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock.llnl.gov" }, { "U.S. Midwest", "ncar.ucar.edu (WWVB clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ncar.ucar.edu" }, { "U.S. Pacific", "chantry.hawaii.net (WWV/H clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=chantry.hawaii.net" }, { "U.S. Southwest", "shorty.chpc.utexas.edu (WWV clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=shorty.chpc.utexas.edu" }, { 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, { { "Font", "Choose an alternate screen font", NULL, dmenuSubmenu, NULL, &MenuSysconsFont }, { "Keymap", "Choose an alternate keyboard map", NULL, dmenuSubmenu, NULL, &MenuSysconsKeymap }, { "Repeat", "Set the rate at which keys repeat", NULL, dmenuSubmenu, NULL, &MenuSysconsKeyrate }, { "Saver", "Configure the screen saver", NULL, dmenuSubmenu, NULL, &MenuSysconsSaver }, { "Screenmap", "Choose an alternate screenmap", NULL, dmenuSubmenu, NULL, &MenuSysconsScrnmap }, { "Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { NULL } }, }; DMenu MenuSysconsKeymap = { DMENU_RADIO_TYPE | DMENU_SELECTION_RETURNS, "System Console Keymap", "The default system console driver for FreeBSD (syscons) defaults\n" "to a standard \"American\" keyboard map. Users in other countries\n" "(or with different keyboard preferences) may wish to choose one of\n" "the other keymaps below.\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" }, { "Croatian ISO", "Croatian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=hr.iso" }, { "Danish CP865", "Danish Code Page 865 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=danish.cp865" }, { "Danish ISO", "Danish ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=danish.iso" }, { "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" }, { "Latin American", "Latin American ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=lat-amer" }, { "Japanese 106", "Japanese 106 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=jp.106" }, { "Norway ISO", "Norwegian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=norwegian.iso" }, { "Polish ISO", "Polish ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=pl_PL.ISO_8859-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 CP866", "Russian CP866 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=ru.cp866" }, { "Russia KOI8-R", "Russian KOI8-R keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=ru.koi8-r" }, { "Slovenian", "Slovenian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=si.iso.acc" }, { "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", "Swiss French ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swissfrench.iso" }, { "Swiss German", "Swiss German ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swissgerman.iso" }, { "U.K. CP850", "United Kingdom Code Page 850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=uk.cp850" }, { "U.K. ISO", "United Kingdom ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=uk.iso" }, { "U.S. Dvorak", "United States Dvorak keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=us.dvorak" }, { "U.S. ISO", "United States ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=us.iso" }, { NULL } }, }; DMenu MenuSysconsKeyrate = { DMENU_RADIO_TYPE | DMENU_SELECTION_RETURNS, "System Console Keyboard Repeat Rate", "This menu allows you to set the speed at which keys repeat\n" "when held down.", "Choose a keyboard repeat rate", NULL, { { "Slow", "Slow keyboard repeat rate", 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_RADIO_TYPE | DMENU_SELECTION_RETURNS, "System Console Screen Saver", "By default, the console driver will not attempt to do anything\n" "special with your screen when it's idle. If you expect to leave your\n" "monitor switched on and idle for long periods of time then you should\n" "probably enable one of these screen savers to prevent phosphor burn-in.", "Choose a nifty-looking screen saver", NULL, { { "Blank", "Simply blank the screen", dmenuVarCheck, configSaver, NULL, "saver=blank" }, { "Daemon", "\"BSD Daemon\" animated screen saver (text)", dmenuVarCheck, configSaver, NULL, "saver=daemon" }, { "Fade", "Fade out effect screen saver", dmenuVarCheck, configSaver, NULL, "saver=fade" }, { "Green", "\"Green\" power saving mode (if supported by monitor)", dmenuVarCheck, configSaver, NULL, "saver=green" }, { "Logo", "\"BSD Daemon\" animated screen saver (graphics)", dmenuVarCheck, configSaver, NULL, "saver=logo" }, { "Rain", "Rain drops screen saver", dmenuVarCheck, configSaver, NULL, "saver=rain" }, { "Snake", "Draw a FreeBSD \"snake\" on your screen", dmenuVarCheck, configSaver, NULL, "saver=snake" }, { "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_RADIO_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, { { "None", "No screenmap, use default font", dmenuVarCheck, dmenuSetVariable, NULL, "scrnmap=NO" }, { "KOI8-R to IBM866", "Russian KOI8-R to IBM 866 screenmap", dmenuVarCheck, dmenuSetVariable, NULL, "scrnmap=koi8-r2cp866" }, { "ISO 8859-1 to IBM437", "W-Europe ISO 8859-1 to IBM 437 screenmap", dmenuVarCheck, dmenuSetVariable, NULL, "scrnmap=iso-8859-1_to_cp437" }, { NULL } }, }; DMenu MenuSysconsFont = { DMENU_RADIO_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, { { "None", "Use default font", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=NO,font8x14=NO,font8x16=NO" }, { "IBM 437", "English", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp437-8x8,font8x14=cp437-8x14,font8x16=cp437-8x16" }, { "IBM 850", "Western Europe, IBM encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp850-8x8,font8x14=cp850-8x14,font8x16=cp850-8x16" }, { "IBM 865", "Norwegian, IBM encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp865-8x8,font8x14=cp865-8x14,font8x16=cp865-8x16" }, { "IBM 866", "Russian, IBM encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp866-8x8,font8x14=cp866-8x14,font8x16=cp866-8x16" }, { "ISO 8859-1", "Western Europe, ISO encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=iso-8x8,font8x14=iso-8x14,font8x16=iso-8x16" }, { "KOI8-R", "Russian, KOI8-R encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=koi8-r-8x8,font8x14=koi8-r-8x14,font8x16=koi8-r-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, { { "Add user", "Add a new user to the system.", NULL, userAddUser }, { "Add group", "Add a new user group to the system.", NULL, userAddGroup }, { "Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { 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 2nd FreeBSD CDROM, 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", { { "1 CDROM", "Use the 2nd \"live\" CDROM from the distribution", NULL, installFixitCDROM }, { "2 Floppy", "Use a floppy generated from the fixit image", NULL, installFixitFloppy }, { "3 Shell", "Start an Emergency Holographic Shell", NULL, installFixitHoloShell }, { NULL } }, }; diff --git a/usr.sbin/sade/sade.8 b/usr.sbin/sade/sade.8 index c6e7fcbc9126..054c5cbf4194 100644 --- a/usr.sbin/sade/sade.8 +++ b/usr.sbin/sade/sade.8 @@ -1,802 +1,794 @@ .\" Copyright (c) 1997 .\" 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. .\" 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 AND CONTRIBUTORS ``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 CONTRIBUTORS 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, 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. .\" -.\" $Id: sysinstall.8,v 1.15 1999/02/05 09:28:16 jkh Exp $ +.\" $Id: sysinstall.8,v 1.16 1999/02/18 23:59:58 jkh Exp $ .\" .Dd August 9, 1997 .Dt SYSINSTALL 8 .Os .Sh NAME .Nm sysinstall .Nd system installation and configuration tool .Sh SYNOPSIS .Nm .Op Ar var=value .Op Ar function .Op Ar ... .Sh DESCRIPTION .Nm is a utility for installing and configuring FreeBSD systems. It is the first utility invoked by the FreeBSD installation boot floppy and is also copied into .Pa /stand/sysinstall on newly installed FreeBSD systems for use in later configuring the system. .Pp The .Nm program is generally invoked without arguments for the default behavior, where the main installation/configuration menu is presented. On those occasions where it is deemed necessary to invoke a subsystem of sysinstall directly, however, it is also possible to do so by naming the appropriate function entry points on the command line. Since this action is essentially identical to running an installation script, each command-line argument corresponding to a line of script, the reader is encouraged to read the section on scripting for more information on this feature. .Pp .Sh NOTES .Nm is essentially nothing more than a monolithic C program with the ability to write MBRs and disk labels (through the services of the .Xr libdisk 3 library) and install distributions or packages onto new and existing FreeBSD systems. It also contains some extra intelligence for running as a replacement for .Xr init 8 when it's invoked by the FreeBSD installation boot procedure. It assumes very little in the way of additional utility support and performs most file system operations by calling the relevant syscalls (such as .Xr mount 2 ) directly. .Pp .Nm currently uses the .Xr libdialog 3 library to do user interaction with simple ANSI line graphics, color support for which is enabled by either running on a syscons VTY or some other color-capable terminal emulator (newer versions of xterm will support color when using the ``xterm-color'' termcap entry). .Pp This product is currently at the end of its life cycle and will be replaced in FreeBSD 3.1 (hopefully) by the .Xr setup 1 utility. .Sh RUNNING SCRIPTS .Nm may be either driven interactively through its various internal menus or run in batch mode, driven by an external script. Such a script may be loaded and executed in one of 3 ways: .Bl -tag -width Ds -compact .It Sy "LOAD_CONFIG_FILE" If .Nm is compiled with LOAD_CONFIG_FILE set in the environment (or in the Makefile) to some value, then that value will be used as the filename to automatically look for and load when .Nm starts up and with no user interaction required. This option is aimed primarily at large sites who wish to create a single prototype install for multiple machines with largely identical configurations and/or installation options. .It Sy "MAIN MENU" If .Nm is run interactively, that is to say in the default manner, it will bring up a main menu which contains a "load config file" option. Selecting this option will prompt for the name of a script file which it then will attempt to load from a DOS or UFS formatted floppy. .It Sy "COMMAND LINE" Each command line argument is treated as a script directive when .Nm is run in multi-user mode. Execution ends either by explicit request (e.g. calling the .Ar shutdown directive), upon reaching the end of the argument list or on error. .Pp For example: .nf /stand/sysinstall _ftpPath=ftp:/ziggy/pub/ mediaSetFTP configPackages .fi Would initialize .Nm for FTP installation media (using the server `ziggy') and then bring up the package installation editor, exiting when finished. .El .Pp .Sh SCRIPT SYNTAX A script is a list of one or more directives, each directive taking the form of: .Ar var=value .Pp .Ar function .Pp or .Ar #somecomment Where .Ar var=value is the assignment of some internal .Nm variable, e.g. "ftpPass=FuNkYChiKn", and .Ar function is the name of an internal .Nm function, e.g. "mediaSetFTP", and .Ar #comment is a single-line comment for documentation purposes (ignored by sysinstall). Each directive must be by itself on a single line, functions taking their arguments by examining known variable names. This requires that you be sure to assign the relevant variables before calling a function which requires them. When and where a function depends on the settings of one or more variables will be noted in the following table: .Pp \fBFunction Glossary:\fR .Pp .Bl -tag -width indent .It configAnonFTP Invoke the Anonymous FTP configuration menu. .Pp \fBVariables:\fR None .It configRouter Select which routing daemon you wish to use, potentially loading any required 3rd-party routing daemons as necessary. .Pp \fBVariables:\fR .Bl -tag -width indent .It router can be set to the name of the desired routing daemon, e.g. ``routed'' or ``gated'', otherwise it is prompted for. .El .It configNFSServer Configure host as an NFS server. .Pp \fBVariables:\fR None .It configNTP Configure host as a user of the Network Time Protocol. .Pp \fBVariables:\fR .Bl -tag -width indent .It ntpdate_flags The flags to .Xr ntpdate 8 , that is to say the name of the server to sync from. .El .It configPCNFSD Configure host to support PC NFS. .Pp \fBVariables:\fR .Bl -tag -width indent .It pcnfsd_pkg The name of the PCNFSD package to load if necessary (defaults to hard coded version). .El .It configPackages Bring up the interactive package management menu. .Pp \fBVariables:\fR None -.It configRegister -Register the user with the FreeBSD counter. -.Pp -\fBVariables:\fR None .It configUsers Add users and/or groups to the system. .Pp \fBVariables:\fR None .It configXEnvironment Configure the X display subsystem. .Pp \fBVariables:\fR None .It diskPartitionEditor Invokes the disk partition (MBR) editor. .Pp \fBVariables:\fR .Bl -tag -width findx .It geometry The disk geometry, as a cyls/heads/sectors formatted string. Default: no change to geometry. .It partition Set to disk partitioning type or size, its value being .Ar free in order to use only remaining free space for FreeBSD, .Ar all to use the entire disk for FreeBSD but maintain a proper partition table, .Ar existing to use an existing FreeBSD partition (first found), .Ar exclusive to use the disk in ``dangerously dedicated'' mode or, finally, .Ar somenumber to allocate .Ar somenumber blocks of available free space to a new FreeBSD partition. Default: Interactive mode. .It bootManager is set to one of .Ar boot to signify the installation of a boot manager, .Ar standard to signify installation of a "standard" non-boot MGR DOS MBR or .Ar none to indicate that no change to the boot manager is desired. Default: none. .El .Pp Note: Nothing is actually written to disk by this function, a explicit call to .Ar diskPartitionWrite being required for that to happen. .It diskPartitionWrite Causes any pending MBR changes (typically from the .Ar diskPartitionEditor function) to be written out. .Pp \fBVariables:\fR None .It diskLabelEditor Invokes the disk label editor. This is a bit trickier from a script since you need to essentially label everything inside each FreeBSD (type 0xA5) partition created by the .Ar diskPartitionEditor function, and that requires knowing a few rules about how things are laid out. When creating a script to automatically allocate disk space and partition it up, it is suggested that you first perform the installation interactively at least once and take careful notes as to what the slice names will be, then and only then hardwiring them into the script. .Pp For example, let's say you have a SCSI disk on which you've created a new FreeBSD partition in slice 2 (your DOS partition residing in slice 1). The slice name would be .Ar da0s2 for the whole FreeBSD partition ( .Ar da0s1 being your DOS primary partition). Now let's further assume that you have 500MB in this partition and you want to sub-partition that space into root, swap, var and usr file systems for FreeBSD. Your invocation of the .Ar diskLabelEditor function might involve setting the following variables: .Bl -tag -width findx .It Li "da0s2-1=ufs 40960 /" A 20MB root file system (all sizes are in 512 byte blocks). .It Li "da0s2-2=swap 131072 /" A 64MB swap partition. .It Li "da0s2-3=ufs 204800 /var" A 100MB /var file system. .It Li "da0s2-4=ufs 0 /usr" With the balance of free space (around 316MB) going to the /usr file system. .El One can also use the .Ar diskLabelEditor for mounting or erasing existing partitions as well as creating new ones. Using the previous example again, let's say that we also wanted to mount our DOS partition and make sure that an .Pa /etc/fstab entry is created for it in the new installation. Before calling the .Ar diskLabelEditor function, we simply add an additional line: .nf da0s1=/dos_c N .fi before the call. This tells the label editor that you want to mount the first slice on .Pa /dos_c and not to attempt to newfs it (not that .Nm would attempt this for a DOS partition in any case, but it could just as easily be an existing UFS partition being named here and the 2nd field is non-optional). .Pp Note: No file system data is actually written to disk until an explicit call to .Ar diskLabelCommit is made. .It diskLabelCommit Writes out all pending disklabel information and creates and/or mounts any file systems which have requests pending from the .Ar diskLabelEditor function. .Pp \fBVariables:\fR None .It distReset Resets all selected distributions to the empty set (no distributions selected). .Pp \fBVariables:\fR None .It distSetCustom Allows the selection of a custom distribution set (e.g. not just on of the existing "canned" sets) with no user interaction. \fBVariables:\fR .Bl -tag -width indent .It dists List of distributions to load. Possible distribution values are: .Bl -tag -width indent .It Li bin The base binary distribution. .It Li doc Miscellaneous documentation .It Li games Games .It Li manpages Manual pages (unformatted) .It Li catpages Pre-formatted manual pages .It Li proflibs Profiled libraries for developers. .It Li dict Dictionary information (for tools like spell). .It Li info GNU info files and other extra docs. .It Li des DES encryption binaries and libraries. .It Li compat1x Compatibility with FreeBSD 1.x .It Li compat20 Compatibility with FreeBSD 2.0 .It Li compat21 Compatibility with FreeBSD 2.1 .It Li ports The ports collection. .It Li krb Kerberos binaries. .It Li ssecure /usr/src/secure .It Li sebones /usr/src/eBones .It Li sbase /usr/src/[top level files] .It Li scontrib /usr/src/contrib .It Li sgnu /usr/src/gnu .It Li setc /usr/src/etc .It Li sgames /usr/src/games .It Li sinclude /usr/src/include .It Li slib /usr/src/lib .It Li slibexec /usr/src/libexec .It Li srelease /usr/src/release .It Li sbin /usr/src/bin .It Li ssbin /usr/src/sbin .It Li sshare /usr/src/share .It Li ssys /usr/src/sys .It Li subin /usr/src/usr.bin .It Li susbin /usr/src/usr.sbin .It Li ssmailcf /usr/src/usr.sbin/sendmail/cf .It Li XF86-xc XFree86 official sources. .It Li XF86-co XFree86 contributed sources. .It Li Xbin XFree86 3.3.3.1 binaries. .It Li Xcfg XFree86 3.3.3.1 configuration files. .It Li Xdoc XFree86 3.3.3.1 documentation. .It Li Xhtml XFree86 3.3.3.1 HTML documentation. .It Li Xlib XFree86 3.3.3.1 libraries. .It Li Xlk98 XFree86 3.3.3.1 server link-kit for PC98 machines. .It Li Xlkit XFree86 3.3.3.1 server link-kit for standard machines. .It Li Xman XFree86 3.3.3.1 manual pages. .It Li Xprog XFree86 3.3.3.1 programmer's distribution. .It Li Xps XFree86 3.3.3.1 postscript documentation. .It Li Xset XFree86 3.3.3.1 graphical setup tool. .It Li X8514 XFree86 3.3.3.1 8514 server. .It Li X9480 XFree86 3.3.3.1 PC98 8-bit (256 color) PEGC-480 server. .It Li X9EGC XFree86 3.3.3.1 PC98 4-bit (16 color) EGC server. .It Li X9GA9 XFree86 3.3.3.1 PC98 GA-968V4/PCI (S3 968) server. .It Li X9GAN XFree86 3.3.3.1 PC98 GANB-WAP (cirrus) server. .It Li X9LPW XFree86 3.3.3.1 PC98 PowerWindowLB (S3) server. .It Li X9NKV XFree86 3.3.3.1 PC98 NKV-NEC (cirrus) server. .It Li X9NS3 XFree86 3.3.3.1 PC98 NEC (S3) server. .It Li X9SPW XFree86 3.3.3.1 PC98 SKB-PowerWindow (S3) server. .It Li X9TGU XFree86 3.3.3.1 PC98 Cyber9320 and TGUI9680 server. .It Li X9WEP XFree86 3.3.3.1 PC98 WAB-EP (cirrus) server. .It Li X9WS XFree86 3.3.3.1 PC98 WABS (cirrus) server. .It Li X9WSN XFree86 3.3.3.1 PC98 WSN-A2F (cirrus) server. .It Li XAGX XFree86 3.3.3.1 8 bit AGX server. .It Li XI128 XFree86 3.3.3.1 #9 Imagine I128 server. .It Li XMa8 XFree86 3.3.3.1 ATI Mach8 server. .It Li XMa32 XFree86 3.3.3.1 ATI Mach32 server. .It Li XMa64 XFree86 3.3.3.1 ATI Mach64 server. .It Li XMono XFree86 3.3.3.1 monochrome server. .It Li XP9K XFree86 3.3.3.1 P9000 server. .It Li XS3 XFree86 3.3.3.1 S3 server. .It Li XS3V XFree86 3.3.3.1 S3 Virge server. .It Li XSVGA XFree86 3.3.3.1 SVGA server. .It Li XVG16 XFree86 3.3.3.1 VGA16 server. .It Li XW32 XFree86 3.3.3.1 ET4000/W32, /W32i and /W32p server. .It Li Xnest XFree86 3.3.3.1 nested X server. .It Li Xvfb XFree86 3.3.3.1 virtual frame-buffer X server. .It Li Xfnts XFree86 3.3.3.1 base font set. .It Li Xf100 XFree86 3.3.3.1 100DPI font set. .It Li Xfcyr XFree86 3.3.3.1 Cyrillic font set. .It Li Xfscl XFree86 3.3.3.1 scalable font set. .It Li Xfnon XFree86 3.3.3.1 non-english font set. .It Li Xfsrv XFree86 3.3.3.1 font server. .El .It distSetDeveloper Selects the standard Developer's distribution set. .Pp \fBVariables:\fR None .It distSetXDeveloper Selects the standard X Developer's distribution set. .Pp \fBVariables:\fR None .It distSetKernDeveloper Selects the standard kernel Developer's distribution set. .Pp \fBVariables:\fR None .It distSetUser Selects the standard user distribution set. .Pp \fBVariables:\fR None .It distSetXUser Selects the standard X user's distribution set. .Pp \fBVariables:\fR None .It distSetMinimum Selects the very minimum distribution set. .Pp \fBVariables:\fR None .It distSetEverything Selects the full whack - all available distributions. .Pp \fBVariables:\fR None .It distSetDES Interactively select DES subcomponents. .Pp \fBVariables:\fR None .It distSetSrc Interactively select source subcomponents. .Pp \fBVariables:\fR None .It distSetXF86 Interactively select XFree86 3.3.3.1 subcomponents. .Pp \fBVariables:\fR None .It distExtractAll Install all currently selected distributions (requires that media device also be selected). .Pp \fBVariables:\fR None .It docBrowser Install (if necessary) an HTML documentation browser and go to the HTML documentation submenu. .Pp \fBVariables:\fR .Bl -tag -width indent .It browserPackage The name of the browser package to try and install as necessary. Defaults to latest lynx package. .It browserBinary The name of the browser binary itself (if overriding the .Ar browserPackage variable). Defaults to lynx. .El .It installCommit .Pp Commit any and all pending changes to disk. This function is essentially shorthand for a number of more granular "commit" functions. \fBVariables:\fR None .It installExpress Start an "express" installation, asking few questions of the user. .Pp \fBVariables:\fR None .It installNovice Start a "novice" installation, the most user-friendly installation type available. .Pp \fBVariables:\fR None .It installUpgrade Start an upgrade installation. .Pp \fBVariables:\fR None .It installFixitHoloShell Start up the "emergency holographic shell" over on VTY4 if running as init. .Pp \fBVariables:\fR None .It installFixitCDROM Go into "fixit" mode, assuming a live file system CDROM currently in the drive. .Pp \fBVariables:\fR None .It installFixitFloppy Go into "fixit" mode, assuming an available fixit floppy disk (user will be prompted for it). .Pp \fBVariables:\fR None .It installFilesystems Do just the file system initialization part of an install. .Pp \fBVariables:\fR None .It installVarDefaults Initialize all variables to their defaults, overriding any previous settings. .Pp \fBVariables:\fR None .It loadConfig Sort of like an #include statement, it allows you to load one configuration file from another. .Pp \fBVariables:\fR .Bl -tag -width indent .It file The fully pathname of the file to load. .El .It mediaSetCDROM Select a FreeBSD CDROM as the installation media. .Pp \fBVariables:\fR None .It mediaSetFloppy Select a pre-made floppy installation set as the installation media. .Pp \fBVariables:\fR None .It mediaSetDOS Select an existing DOS primary partition as the installation media. The first primary partition found is used (e.g. C:). .Pp \fBVariables:\fR None .It mediaSetTape Select a tape device as the installation media. .Pp \fBVariables:\fR None .It mediaSetFTP Select an FTP site as the installation media. .Pp \fBVariables:\fR .Bl -tag -width indent .It hostname The name of the host being installed (non-optional). .It domainname The domain name of the host being installed (optional). .It defaultrouter The default router for this host (non-optional). .It netDev Which host interface to use ( .Ar ed0 or .Ar ep0 , for example. Non-optional). .It netInteractive If set, bring up the interactive network setup form even if all relevant configuration variables are already set (optional). .It ipaddr The IP address for the selected host interface (non-optional). .It netmask The netmask for the selected host interface (non-optional). .It _ftpPath The fully qualified URL of the FTP site containing the FreeBSD distribution you're interested in, e.g. .Ar ftp://ftp.freebsd.org/pub/FreeBSD/ . .El .It mediaSetFTPActive Alias for .Ar mediaSetFTP using "active" FTP transfer mode. .Pp \fBVariables:\fR Same as for .Ar mediaSetFTP . .It mediaSetFTPPassive Alias for .Ar mediaSetFTP using "passive" FTP transfer mode. .Pp \fBVariables:\fR Same as for .Ar mediaSetFTP . .It mediaSetUFS Select an existing UFS partition (mounted with the label editor) as the installation media. .Pp \fBVariables:\fR .Bl -tag -width indent .It ufs full /path to directory containing the FreeBSD distribution you're interested in. .El .It mediaSetNFS .Pp \fBVariables:\fR .Bl -tag -width indent .It hostname The name of the host being installed (non-optional). .It domainname The domain name of the host being installed (optional). .It defaultrouter The default router for this host (non-optional). .It netDev Which host interface to use ( .Ar ed0 or .Ar ep0 , for example. Non-optional). .It netInteractive If set, bring up the interactive network setup form even if all relevant configuration variables are already set (optional). .It ipaddr The IP address for the selected host interface (non-optional). .It netmask The netmask for the selected host interface (non-optional). .It nfs full hostname:/path specification for directory containing the FreeBSD distribution you're interested in. .El .It mediaSetFTPUserPass .Pp \fBVariables:\fR .Bl -tag -width indent .It ftpUser The username to log in as on the ftp server site. Default: ftp .It ftpPass The password to use for this username on the ftp server site. Default: user@host .El .It mediaSetCPIOVerbosity .Pp \fBVariables:\fR .Bl -tag -width indent .It cpioVerbose Can be used to set the verbosity of cpio extractions to low, medium or high. .El .It mediaGetType Interactively get the user to specify some type of media. .Pp \fBVariables:\fR None .It optionsEditor Invoke the interactive options editor. .Pp \fBVariables:\fR None -.It register -Bring up the FreeBSD registration form. -.Pp -\fBVariables:\fR None .It packageAdd Try to fetch and add a package to the system (requires that a media type be set), .Pp \fBVariables:\fR .Bl -tag -width indent .It package The name of the package to add, e.g. bash-1.14.7 or ncftp-2.4.2. .El .It addGroup Invoke the interactive group editor. .Pp \fBVariables:\fR None .It addUser Invoke the interactive user editor. .Pp \fBVariables:\fR None .It shutdown Stop the script and terminate sysinstall. .Pp \fBVariables:\fR None .It system Execute an arbitrary command with .Xr system 3 .Pp \fBVariables:\fR .Bl -tag -width indent .It command The name of the command to execute. When running from a boot floppy, very minimal expectations should be made as to what's available until/unless a relatively full system installation has just been done. .El .El .Sh FILES This utility may edit the contents of .Pa /etc/rc.conf , .Pa /etc/hosts , and .Pa /etc/resolv.conf as necessary to reflect changes in the network configuration. .Sh SEE ALSO If you have a reasonably complete source tree online, take a look at .Pa /usr/src/release/sysinstall/install.cfg for a sample installation script. .Sh BUGS This utility is a prototype which lasted approximately 3 years past its expiration date and is greatly in need of death. .Sh AUTHOR Jordan K. Hubbard .Sh HISTORY This version of .Nm first appeared in .Fx 2.0 . diff --git a/usr.sbin/sade/sade.h b/usr.sbin/sade/sade.h index 8f171d1c8dc4..bc7f6732981e 100644 --- a/usr.sbin/sade/sade.h +++ b/usr.sbin/sade/sade.h @@ -1,722 +1,718 @@ /* * The new sysinstall program. * * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: sysinstall.h,v 1.159 1999/03/19 10:54:38 jkh Exp $ + * $Id: sysinstall.h,v 1.160 1999/04/06 08:25:53 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer, * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * 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 _SYSINSTALL_H_INCLUDE #define _SYSINSTALL_H_INCLUDE #include #include #include #include #include #include #include #include #include #include "ui_objects.h" #include "dir.h" #include "colors.h" #include "libdisk.h" #include "dist.h" /*** Defines ***/ /* device limits */ #define DEV_NAME_MAX 64 /* The maximum length of a device name */ #define DEV_MAX 100 /* The maximum number of devices we'll deal with */ #define INTERFACE_MAX 50 /* Maximum number of network interfaces we'll deal with */ #define IO_ERROR -2 /* Status code for I/O error rather than normal EOF */ /* Number of seconds to wait for data to come off even the slowest media */ #define MEDIA_TIMEOUT 300 /* * I make some pretty gross assumptions about having a max of 50 chunks * total - 8 slices and 42 partitions. I can't easily display many more * than that on the screen at once! * * For 2.1 I'll revisit this and try to make it more dynamic, but since * this will catch 99.99% of all possible cases, I'm not too worried. */ #define MAX_CHUNKS 40 /* Internal environment variable names */ #define DISK_PARTITIONED "_diskPartitioned" #define DISK_LABELLED "_diskLabelled" #define DISK_SELECTED "_diskSelected" #define SYSTEM_STATE "_systemState" #define RUNNING_ON_ROOT "_runningOnRoot" #define TCP_CONFIGURED "_tcpConfigured" /* Ones that can be tweaked from config files */ #define VAR_BLANKTIME "blanktime" #define VAR_BOOTMGR "bootManager" #define VAR_BROWSER_BINARY "browserBinary" #define VAR_BROWSER_PACKAGE "browserPackage" #define VAR_CPIO_VERBOSITY "cpioVerbose" #define VAR_DEBUG "debug" #define VAR_DISK "disk" #define VAR_DISTS "dists" #define VAR_DIST_MAIN "distMain" #define VAR_DIST_DES "distDES" #define VAR_DIST_SRC "distSRC" #define VAR_DIST_X11 "distX11" #define VAR_DIST_XSERVER "distXserver" #define VAR_DIST_XFONTS "distXfonts" #define VAR_DEDICATE_DISK "dedicateDisk" #define VAR_DOMAINNAME "domainname" #define VAR_EDITOR "editor" #define VAR_EXTRAS "ifconfig_" #define VAR_COMMAND "command" #define VAR_CONFIG_FILE "configFile" #define VAR_FTP_DIR "ftpDirectory" #define VAR_FTP_PASS "ftpPass" #define VAR_FTP_PATH "_ftpPath" #define VAR_FTP_PORT "ftpPort" #define VAR_FTP_STATE "ftpState" #define VAR_FTP_USER "ftpUser" #define VAR_FTP_HOST "ftpHost" #define VAR_GATED_PKG "gated_pkg" #define VAR_GATEWAY "defaultrouter" #define VAR_GEOMETRY "geometry" #define VAR_HOSTNAME "hostname" #define VAR_IFCONFIG "ifconfig_" #define VAR_INTERFACES "network_interfaces" #define VAR_INSTALL_CFG "installConfig" #define VAR_INSTALL_ROOT "installRoot" #define VAR_IPADDR "ipaddr" #define VAR_KEYMAP "keymap" #define VAR_LABEL "label" #define VAR_LABEL_COUNT "labelCount" #define VAR_MEDIA_TYPE "mediaType" #define VAR_MEDIA_TIMEOUT "MEDIA_TIMEOUT" #define VAR_MOUSED "moused_enable" #define VAR_MOUSED_PORT "moused_port" #define VAR_MOUSED_TYPE "moused_type" #define VAR_NAMESERVER "nameserver" #define VAR_NETINTERACTIVE "netInteractive" #define VAR_NETMASK "netmask" #define VAR_NETWORK_DEVICE "netDev" #define VAR_NFS_PATH "nfs" #define VAR_NFS_HOST "nfsHost" #define VAR_NFS_SECURE "nfs_reserved_port_only" #define VAR_NFS_SERVER "nfs_server_enable" #define VAR_NO_CONFIRM "noConfirm" #define VAR_NO_ERROR "noError" #define VAR_NO_WARN "noWarn" #define VAR_NO_USR "noUsr" #define VAR_NONINTERACTIVE "nonInteractive" #define VAR_NOVELL "novell" #define VAR_NTPDATE_FLAGS "ntpdate_flags" #define VAR_PACKAGE "package" #define VAR_PARTITION "partition" #define VAR_PCNFSD "pcnfsd" #define VAR_PCNFSD_PKG "pcnfsd_pkg" #define VAR_PKG_TMPDIR "PKG_TMPDIR" #define VAR_PORTS_PATH "ports" #define VAR_RELNAME "releaseName" #define VAR_ROOT_SIZE "rootSize" #define VAR_ROUTER "router" #define VAR_ROUTER_ENABLE "router_enable" #define VAR_ROUTERFLAGS "routerflags" #define VAR_SERIAL_SPEED "serialSpeed" #define VAR_SLOW_ETHER "slowEthernetCard" #define VAR_SWAP_SIZE "swapSize" #define VAR_TAPE_BLOCKSIZE "tapeBlocksize" #define VAR_UFS_PATH "ufs" #define VAR_USR_SIZE "usrSize" #define VAR_VAR_SIZE "varSize" #define VAR_XF86_CONFIG "_xf86config" #define DEFAULT_TAPE_BLOCKSIZE "20" /* One MB worth of blocks */ #define ONE_MEG 2048 /* Which selection attributes to use */ #define ATTR_SELECTED (ColorDisplay ? item_selected_attr : item_attr) #define ATTR_TITLE button_active_attr /* Handy strncpy() macro */ #define SAFE_STRCPY(to, from) sstrncpy((to), (from), sizeof (to) - 1) /*** Types ***/ typedef unsigned int Boolean; typedef struct disk Disk; typedef struct chunk Chunk; /* Bitfields for menu options */ #define DMENU_NORMAL_TYPE 0x1 /* Normal dialog menu */ #define DMENU_RADIO_TYPE 0x2 /* Radio dialog menu */ #define DMENU_CHECKLIST_TYPE 0x4 /* Multiple choice menu */ #define DMENU_SELECTION_RETURNS 0x8 /* Immediate return on item selection */ typedef struct _dmenu { int type; /* What sort of menu we are */ char *title; /* Our title */ char *prompt; /* Our prompt */ char *helpline; /* Line of help at bottom */ char *helpfile; /* Help file for "F1" */ dialogMenuItem items[0]; /* Array of menu items */ } DMenu; /* An rc.conf variable */ typedef struct _variable { struct _variable *next; char *name; char *value; int dirty; } Variable; #define NO_ECHO_OBJ(type) ((type) | (DITEM_NO_ECHO << 16)) #define TYPE_OF_OBJ(type) ((type) & 0xff) #define ATTR_OF_OBJ(type) ((type) >> 16) /* A screen layout structure */ typedef struct _layout { int y; /* x & Y co-ordinates */ int x; int len; /* The size of the dialog on the screen */ int maxlen; /* How much the user can type in ... */ char *prompt; /* The string for the prompt */ char *help; /* The display for the help line */ void *var; /* The var to set when this changes */ int type; /* The type of the dialog to create */ void *obj; /* The obj pointer returned by libdialog */ } Layout; typedef enum { DEVICE_TYPE_NONE, DEVICE_TYPE_DISK, DEVICE_TYPE_FLOPPY, DEVICE_TYPE_FTP, DEVICE_TYPE_NETWORK, DEVICE_TYPE_CDROM, DEVICE_TYPE_TAPE, DEVICE_TYPE_DOS, DEVICE_TYPE_UFS, DEVICE_TYPE_NFS, DEVICE_TYPE_ANY, } DeviceType; /* CDROM mount codes */ #define CD_UNMOUNTED 0 #define CD_ALREADY_MOUNTED 1 #define CD_WE_MOUNTED_IT 2 /* A "device" from sysinstall's point of view */ typedef struct _device { char name[DEV_NAME_MAX]; char *description; char *devname; DeviceType type; Boolean enabled; Boolean (*init)(struct _device *dev); FILE * (*get)(struct _device *dev, char *file, Boolean probe); void (*shutdown)(struct _device *dev); void *private; unsigned int flags; } Device; /* Some internal representations of partitions */ typedef enum { PART_NONE, PART_SLICE, PART_SWAP, PART_FILESYSTEM, PART_FAT, } PartType; /* The longest newfs command we'll hand to system() */ #define NEWFS_CMD_MAX 256 typedef struct _part_info { Boolean newfs; char mountpoint[FILENAME_MAX]; char newfs_cmd[NEWFS_CMD_MAX]; } PartInfo; /* An option */ typedef struct _opt { char *name; char *desc; enum { OPT_IS_STRING, OPT_IS_INT, OPT_IS_FUNC, OPT_IS_VAR } type; void *data; void *aux; char *(*check)(); } Option; /* Weird index nodey things we use for keeping track of package information */ typedef enum { PACKAGE, PLACE } node_type; /* Types of nodes */ typedef struct _pkgnode { /* A node in the reconstructed hierarchy */ struct _pkgnode *next; /* My next sibling */ node_type type; /* What am I? */ char *name; /* My name */ char *desc; /* My description (Hook) */ struct _pkgnode *kids; /* My little children */ void *data; /* A place to hang my data */ } PkgNode; typedef PkgNode *PkgNodePtr; /* A single package */ typedef struct _indexEntry { /* A single entry in an INDEX file */ char *name; /* name */ char *path; /* full path to port */ char *prefix; /* port prefix */ char *comment; /* one line description */ char *descrfile; /* path to description file */ char *deps; /* packages this depends on */ int depc; /* how many depend on me */ int installed; /* indicates if it is installed */ char *maintainer; /* maintainer */ } IndexEntry; typedef IndexEntry *IndexEntryPtr; typedef int (*commandFunc)(char *key, void *data); #define HOSTNAME_FIELD_LEN 128 #define IPADDR_FIELD_LEN 16 #define EXTRAS_FIELD_LEN 128 /* This is the structure that Network devices carry around in their private, erm, structures */ typedef struct _devPriv { char ipaddr[IPADDR_FIELD_LEN]; char netmask[IPADDR_FIELD_LEN]; char extras[EXTRAS_FIELD_LEN]; } DevInfo; /*** Externs ***/ extern jmp_buf BailOut; /* Used to get the heck out */ extern int DebugFD; /* Where diagnostic output goes */ extern Boolean Fake; /* Don't actually modify anything - testing */ extern Boolean SystemWasInstalled; /* Did we install it? */ extern Boolean RunningAsInit; /* Are we running stand-alone? */ extern Boolean DialogActive; /* Is the dialog() stuff up? */ extern Boolean ColorDisplay; /* Are we on a color display? */ extern Boolean OnVTY; /* On a syscons VTY? */ extern Variable *VarHead; /* The head of the variable chain */ extern Device *mediaDevice; /* Where we're getting our distribution from */ extern unsigned int Dists; /* Which distributions we want */ extern unsigned int DESDists; /* Which naughty distributions we want */ extern unsigned int SrcDists; /* Which src distributions we want */ extern unsigned int XF86Dists; /* Which XFree86 dists we want */ extern unsigned int XF86ServerDists; /* The XFree86 servers we want */ extern unsigned int XF86FontDists; /* The XFree86 fonts we want */ extern int BootMgr; /* Which boot manager to use */ extern int StatusLine; /* Where to print our status messages */ extern DMenu MenuInitial; /* Initial installation menu */ extern DMenu MenuFixit; /* Fixit repair menu */ extern DMenu MenuMBRType; /* Type of MBR to write on the disk */ extern DMenu MenuConfigure; /* Final configuration menu */ extern DMenu MenuDocumentation; /* Documentation menu */ extern DMenu MenuFTPOptions; /* FTP Installation options */ extern DMenu MenuIndex; /* Index menu */ extern DMenu MenuOptions; /* Installation options */ extern DMenu MenuOptionsLanguage; /* Language options menu */ extern DMenu MenuMedia; /* Media type menu */ extern DMenu MenuMouse; /* Mouse type menu */ extern DMenu MenuMediaCDROM; /* CDROM media menu */ extern DMenu MenuMediaDOS; /* DOS media menu */ extern DMenu MenuMediaFloppy; /* Floppy media menu */ extern DMenu MenuMediaFTP; /* FTP media menu */ extern DMenu MenuMediaTape; /* Tape media menu */ extern DMenu MenuNetworkDevice; /* Network device menu */ extern DMenu MenuNTP; /* NTP time server menu */ extern DMenu MenuStartup; /* Startup services menu */ extern DMenu MenuSyscons; /* System console configuration menu */ extern DMenu MenuSysconsFont; /* System console font configuration menu */ extern DMenu MenuSysconsKeymap; /* System console keymap configuration menu */ extern DMenu MenuSysconsKeyrate; /* System console keyrate configuration menu */ extern DMenu MenuSysconsSaver; /* System console saver configuration menu */ extern DMenu MenuSysconsScrnmap; /* System console screenmap configuration menu */ extern DMenu MenuNetworking; /* Network configuration menu */ extern DMenu MenuInstallCustom; /* Custom Installation menu */ extern DMenu MenuDistributions; /* Distribution menu */ extern DMenu MenuSubDistributions; /* Custom distribution menu */ extern DMenu MenuDESDistributions; /* DES distribution menu */ extern DMenu MenuSrcDistributions; /* Source distribution menu */ extern DMenu MenuXF86; /* XFree86 main menu */ extern DMenu MenuXF86Select; /* XFree86 distribution selection menu */ extern DMenu MenuXF86SelectCore; /* XFree86 core distribution menu */ extern DMenu MenuXF86SelectServer; /* XFree86 server distribution menu */ extern DMenu MenuXF86SelectPC98Server; /* XFree86 server distribution menu */ extern DMenu MenuXF86SelectFonts; /* XFree86 font selection menu */ extern DMenu MenuDiskDevices; /* Disk devices menu */ extern DMenu MenuHTMLDoc; /* HTML Documentation menu */ extern DMenu MenuUsermgmt; /* User management menu */ extern DMenu MenuFixit; /* Fixit floppy/CDROM/shell menu */ extern DMenu MenuXF86Config; /* Select XFree86 configuration type */ /* Stuff from libdialog which isn't properly declared outside */ extern void display_helpfile(void); extern void display_helpline(WINDOW *w, int y, int width); /*** Prototypes ***/ /* anonFTP.c */ extern int configAnonFTP(dialogMenuItem *self); /* cdrom.c */ extern Boolean mediaInitCDROM(Device *dev); extern FILE *mediaGetCDROM(Device *dev, char *file, Boolean probe); extern void mediaShutdownCDROM(Device *dev); /* command.c */ extern void command_clear(void); extern void command_sort(void); extern void command_execute(void); extern void command_shell_add(char *key, char *fmt, ...); extern void command_func_add(char *key, commandFunc func, void *data); /* config.c */ extern void configEnvironmentRC_conf(void); extern void configEnvironmentResolv(char *config); extern void configRC_conf(void); extern int configFstab(dialogMenuItem *self); extern int configRC(dialogMenuItem *self); -extern int configRegister(dialogMenuItem *self); extern int configResolv(dialogMenuItem *self); extern int configPackages(dialogMenuItem *self); extern int configSaver(dialogMenuItem *self); extern int configSaverTimeout(dialogMenuItem *self); extern int configNTP(dialogMenuItem *self); extern int configUsers(dialogMenuItem *self); extern int configXEnvironment(dialogMenuItem *self); extern int configRouter(dialogMenuItem *self); extern int configPCNFSD(dialogMenuItem *self); extern int configNFSServer(dialogMenuItem *self); extern int configWriteRC_conf(dialogMenuItem *self); /* crc.c */ extern int crc(int, unsigned long *, unsigned long *); /* devices.c */ extern DMenu *deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)(dialogMenuItem *d), int (*check)(dialogMenuItem *d)); extern void deviceGetAll(void); extern void deviceReset(void); extern void deviceRescan(void); extern Device **deviceFind(char *name, DeviceType type); extern Device **deviceFindDescr(char *name, char *desc, DeviceType class); extern int deviceCount(Device **devs); extern Device *new_device(char *name); extern Device *deviceRegister(char *name, char *desc, char *devname, DeviceType type, Boolean enabled, Boolean (*init)(Device *mediadev), FILE * (*get)(Device *dev, char *file, Boolean probe), void (*shutDown)(Device *mediadev), void *private); extern Boolean dummyInit(Device *dev); extern FILE *dummyGet(Device *dev, char *dist, Boolean probe); extern void dummyShutdown(Device *dev); /* disks.c */ extern int diskPartitionEditor(dialogMenuItem *self); extern int diskPartitionWrite(dialogMenuItem *self); extern int diskGetSelectCount(Device ***devs); extern void diskPartition(Device *dev); /* dispatch.c */ extern int dispatchCommand(char *command); extern int dispatch_load_floppy(dialogMenuItem *self); extern int dispatch_load_file_int(int); extern int dispatch_load_file(dialogMenuItem *self); /* dist.c */ extern int distReset(dialogMenuItem *self); extern int distConfig(dialogMenuItem *self); extern int distSetCustom(dialogMenuItem *self); extern int distSetDeveloper(dialogMenuItem *self); extern int distSetXDeveloper(dialogMenuItem *self); extern int distSetKernDeveloper(dialogMenuItem *self); extern int distSetXKernDeveloper(dialogMenuItem *self); extern int distSetUser(dialogMenuItem *self); extern int distSetXUser(dialogMenuItem *self); extern int distSetMinimum(dialogMenuItem *self); extern int distSetEverything(dialogMenuItem *self); extern int distSetDES(dialogMenuItem *self); extern int distSetSrc(dialogMenuItem *self); extern int distSetXF86(dialogMenuItem *self); extern int distExtractAll(dialogMenuItem *self); /* dmenu.c */ extern int dmenuDisplayFile(dialogMenuItem *tmp); extern int dmenuSubmenu(dialogMenuItem *tmp); extern int dmenuSystemCommand(dialogMenuItem *tmp); extern int dmenuSystemCommandBox(dialogMenuItem *tmp); extern int dmenuExit(dialogMenuItem *tmp); extern int dmenuISetVariable(dialogMenuItem *tmp); extern int dmenuSetVariable(dialogMenuItem *tmp); extern int dmenuSetKmapVariable(dialogMenuItem *tmp); extern int dmenuSetVariables(dialogMenuItem *tmp); extern int dmenuToggleVariable(dialogMenuItem *tmp); extern int dmenuSetFlag(dialogMenuItem *tmp); extern int dmenuSetValue(dialogMenuItem *tmp); extern Boolean dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max, Boolean buttons); extern Boolean dmenuOpenSimple(DMenu *menu, Boolean buttons); extern int dmenuVarCheck(dialogMenuItem *item); extern int dmenuVarsCheck(dialogMenuItem *item); extern int dmenuFlagCheck(dialogMenuItem *item); extern int dmenuRadioCheck(dialogMenuItem *item); /* doc.c */ extern int docBrowser(dialogMenuItem *self); extern int docShowDocument(dialogMenuItem *self); /* dos.c */ extern Boolean mediaCloseDOS(Device *dev, FILE *fp); extern Boolean mediaInitDOS(Device *dev); extern FILE *mediaGetDOS(Device *dev, char *file, Boolean probe); extern void mediaShutdownDOS(Device *dev); /* floppy.c */ extern int getRootFloppy(void); extern Boolean mediaInitFloppy(Device *dev); extern FILE *mediaGetFloppy(Device *dev, char *file, Boolean probe); extern void mediaShutdownFloppy(Device *dev); /* ftp_strat.c */ extern Boolean mediaCloseFTP(Device *dev, FILE *fp); extern Boolean mediaInitFTP(Device *dev); extern FILE *mediaGetFTP(Device *dev, char *file, Boolean probe); extern void mediaShutdownFTP(Device *dev); /* globals.c */ extern void globalsInit(void); /* index.c */ int index_read(FILE *fp, PkgNodePtr papa); int index_menu(PkgNodePtr root, PkgNodePtr top, PkgNodePtr plist, int *pos, int *scroll); void index_init(PkgNodePtr top, PkgNodePtr plist); void index_node_free(PkgNodePtr top, PkgNodePtr plist); void index_sort(PkgNodePtr top); void index_print(PkgNodePtr top, int level); int index_extract(Device *dev, PkgNodePtr top, PkgNodePtr plist); /* install.c */ extern Boolean checkLabels(Boolean whinge, Chunk **rdev, Chunk **sdev, Chunk **udev, Chunk **vdev); extern int installCommit(dialogMenuItem *self); extern int installCustomCommit(dialogMenuItem *self); extern int installExpress(dialogMenuItem *self); extern int installNovice(dialogMenuItem *self); extern int installFixitHoloShell(dialogMenuItem *self); extern int installFixitCDROM(dialogMenuItem *self); extern int installFixitFloppy(dialogMenuItem *self); extern int installFixupBin(dialogMenuItem *self); extern int installFixupXFree(dialogMenuItem *self); extern int installUpgrade(dialogMenuItem *self); extern int installFilesystems(dialogMenuItem *self); extern int installVarDefaults(dialogMenuItem *self); extern void installEnvironment(void); extern Boolean copySelf(void); /* kget.c */ extern int kget(char *out); /* keymap.c */ extern int loadKeymap(const char *lang); /* label.c */ extern int diskLabelEditor(dialogMenuItem *self); extern int diskLabelCommit(dialogMenuItem *self); /* lndir.c */ extern int lndir(char *from, char *to); /* makedevs.c (auto-generated) */ extern const char termcap_ansi[]; extern const char termcap_vt100[]; extern const char termcap_cons25[]; extern const char termcap_cons25_m[]; extern const char termcap_cons25r[]; extern const char termcap_cons25r_m[]; extern const char termcap_cons25l1[]; extern const char termcap_cons25l1_m[]; extern const u_char font_iso_8x16[]; extern const u_char font_cp850_8x16[]; extern const u_char font_cp866_8x16[]; extern const u_char koi8_r2cp866[]; extern u_char default_scrnmap[]; /* media.c */ extern char *cpioVerbosity(void); extern void mediaClose(void); extern int mediaTimeout(void); extern int mediaSetCDROM(dialogMenuItem *self); extern int mediaSetFloppy(dialogMenuItem *self); extern int mediaSetDOS(dialogMenuItem *self); extern int mediaSetTape(dialogMenuItem *self); extern int mediaSetFTP(dialogMenuItem *self); extern int mediaSetFTPActive(dialogMenuItem *self); extern int mediaSetFTPPassive(dialogMenuItem *self); extern int mediaSetUFS(dialogMenuItem *self); extern int mediaSetNFS(dialogMenuItem *self); extern int mediaSetFTPUserPass(dialogMenuItem *self); extern int mediaSetCPIOVerbosity(dialogMenuItem *self); extern int mediaGetType(dialogMenuItem *self); extern Boolean mediaExtractDist(char *dir, char *dist, FILE *fp); extern Boolean mediaExtractDistBegin(char *dir, int *fd, int *zpid, int *cpic); extern Boolean mediaExtractDistEnd(int zpid, int cpid); extern Boolean mediaVerify(void); extern FILE *mediaGenericGet(char *base, const char *file); /* misc.c */ extern Boolean file_readable(char *fname); extern Boolean file_executable(char *fname); extern Boolean directory_exists(const char *dirname); extern char *root_bias(char *path); extern char *itoa(int value); extern char *string_concat(char *p1, char *p2); extern char *string_concat3(char *p1, char *p2, char *p3); extern char *string_prune(char *str); extern char *string_skipwhite(char *str); extern char *string_copy(char *s1, char *s2); extern char *pathBaseName(const char *path); extern void safe_free(void *ptr); extern void *safe_malloc(size_t size); extern void *safe_realloc(void *orig, size_t size); extern dialogMenuItem *item_add(dialogMenuItem *list, char *prompt, char *title, int (*checked)(dialogMenuItem *self), int (*fire)(dialogMenuItem *self), void (*selected)(dialogMenuItem *self, int is_selected), void *data, int aux, int *curr, int *max); extern void items_free(dialogMenuItem *list, int *curr, int *max); extern int Mkdir(char *); extern int Mount(char *, void *data); extern WINDOW *openLayoutDialog(char *helpfile, char *title, int x, int y, int width, int height); extern ComposeObj *initLayoutDialog(WINDOW *win, Layout *layout, int x, int y, int *max); extern int layoutDialogLoop(WINDOW *win, Layout *layout, ComposeObj **obj, int *n, int max, int *cbutton, int *cancel); extern WINDOW *savescr(void); extern void restorescr(WINDOW *w); extern char *sstrncpy(char *dst, const char *src, int size); /* mouse.c */ extern int mousedTest(dialogMenuItem *self); extern int mousedDisable(dialogMenuItem *self); /* msg.c */ extern Boolean isDebug(void); extern void msgInfo(char *fmt, ...); extern void msgYap(char *fmt, ...); extern void msgWarn(char *fmt, ...); extern void msgDebug(char *fmt, ...); extern void msgError(char *fmt, ...); extern void msgFatal(char *fmt, ...); extern void msgConfirm(char *fmt, ...); extern void msgNotify(char *fmt, ...); extern void msgWeHaveOutput(char *fmt, ...); extern int msgYesNo(char *fmt, ...); extern char *msgGetInput(char *buf, char *fmt, ...); extern int msgSimpleConfirm(char *); extern int msgSimpleNotify(char *); /* network.c */ extern Boolean mediaInitNetwork(Device *dev); extern void mediaShutdownNetwork(Device *dev); /* nfs.c */ extern Boolean mediaInitNFS(Device *dev); extern FILE *mediaGetNFS(Device *dev, char *file, Boolean probe); extern void mediaShutdownNFS(Device *dev); /* options.c */ extern int optionsEditor(dialogMenuItem *self); /* package.c */ extern int packageAdd(dialogMenuItem *self); extern int package_add(char *name); extern int package_extract(Device *dev, char *name, Boolean depended); extern Boolean package_exists(char *name); -/* register.c */ -extern int registerOpenDialog(void); - /* system.c */ extern void systemInitialize(int argc, char **argv); extern void systemShutdown(int status); extern int execExecute(char *cmd, char *name); extern int systemExecute(char *cmd); extern int systemDisplayHelp(char *file); extern char *systemHelpFile(char *file, char *buf); extern void systemChangeFont(const u_char font[]); extern void systemChangeLang(char *lang); extern void systemChangeTerminal(char *color, const u_char c_termcap[], char *mono, const u_char m_termcap[]); extern void systemChangeScreenmap(const u_char newmap[]); extern void systemCreateHoloshell(void); extern int vsystem(char *fmt, ...); /* tape.c */ extern char *mediaTapeBlocksize(void); extern Boolean mediaInitTape(Device *dev); extern FILE *mediaGetTape(Device *dev, char *file, Boolean probe); extern void mediaShutdownTape(Device *dev); /* tcpip.c */ extern int tcpOpenDialog(Device *dev); extern int tcpMenuSelect(dialogMenuItem *self); extern Device *tcpDeviceSelect(void); /* termcap.c */ extern int set_termcap(void); /* ufs.c */ extern void mediaShutdownUFS(Device *dev); extern Boolean mediaInitUFS(Device *dev); extern FILE *mediaGetUFS(Device *dev, char *file, Boolean probe); /* user.c */ extern int userAddGroup(dialogMenuItem *self); extern int userAddUser(dialogMenuItem *self); /* variable.c */ extern void variable_set(char *var, int dirty); extern void variable_set2(char *name, char *value, int dirty); extern char *variable_get(char *var); extern int variable_cmp(char *var, char *value); extern void variable_unset(char *var); extern char *variable_get_value(char *var, char *prompt, int dirty); extern int variable_check(char *data); extern int dump_variables(dialogMenuItem *self); /* wizard.c */ extern void slice_wizard(Disk *d); #endif /* _SYSINSTALL_H_INCLUDE */ diff --git a/usr.sbin/sysinstall/Makefile b/usr.sbin/sysinstall/Makefile index 0be2955ec6aa..e837479c6334 100644 --- a/usr.sbin/sysinstall/Makefile +++ b/usr.sbin/sysinstall/Makefile @@ -1,85 +1,85 @@ PROG= sysinstall MAN8= sysinstall.8 BINDIR=/stand NOSHARED=YES CLEANFILES+= makedevs.c rtermcap rtermcap.tmp dumpnlist CLEANFILES+= keymap.tmp keymap.h .PATH: ${.CURDIR}/../disklabel ${.CURDIR}/../../usr.bin/cksum SRCS= anonFTP.c cdrom.c command.c config.c devices.c kget.c \ disks.c dispatch.c dist.c dmenu.c doc.c dos.c floppy.c \ ftp.c globals.c index.c install.c installUpgrade.c keymap.c \ label.c lndir.c main.c makedevs.c media.c menus.c misc.c mouse.c \ - msg.c network.c nfs.c options.c package.c register.c system.c \ + msg.c network.c nfs.c options.c package.c system.c \ tape.c tcpip.c termcap.c ufs.c user.c variable.c wizard.c \ keymap.h CFLAGS+= -Wall -I${.CURDIR}/../../gnu/lib/libdialog -I${.OBJDIR} CFLAGS+= -I${.CURDIR}/../../sys CFLAGS+= -DUC_PRIVATE -DKERN_NO_SYMBOLS DPADD= ${LIBDIALOG} ${LIBNCURSES} ${LIBMYTINFO} ${LIBUTIL} ${LIBDISK} ${LIBFTPIO} LDADD= -ldialog -lncurses -lmytinfo -lutil -ldisk -lftpio makedevs.c: Makefile rtermcap keymap.h rm -f makedevs.tmp echo '#include ' > makedevs.tmp ./rtermcap ansi | \ file2c 'const char termcap_ansi[] = {' ',0};' \ >> makedevs.tmp ./rtermcap cons25 | \ file2c 'const char termcap_cons25[] = {' ',0};' \ >> makedevs.tmp ./rtermcap cons25-m | \ file2c 'const char termcap_cons25_m[] = {' ',0};' \ >> makedevs.tmp ./rtermcap cons25r | \ file2c 'const char termcap_cons25r[] = {' ',0};' \ >> makedevs.tmp ./rtermcap cons25r-m | \ file2c 'const char termcap_cons25r_m[] = {' ',0};' \ >> makedevs.tmp ./rtermcap cons25l1 | \ file2c 'const char termcap_cons25l1[] = {' ',0};' \ >> makedevs.tmp ./rtermcap cons25l1-m | \ file2c 'const char termcap_cons25l1_m[] = {' ',0};' \ >> makedevs.tmp ./rtermcap vt100 | \ file2c 'const char termcap_vt100[] = {' ',0};' \ >> makedevs.tmp .if ${MACHINE_ARCH} != "alpha" file2c 'u_char boot0[] = {' '};' < /boot/boot0 >> makedevs.tmp .endif mv makedevs.tmp makedevs.c rtermcap: ${.CURDIR}/rtermcap.c ${CC} -o rtermcap ${.CURDIR}/rtermcap.c -ltermcap KEYMAPS= be.iso br275.iso danish.iso finnish.iso fr.iso \ german.iso hr.iso hu.iso2.101keys it.iso icelandic.iso jp.106 \ norwegian.iso pl_PL.ISO_8859-2 pt.iso ru.koi8-r si.iso \ spanish.iso swedish.iso swissfrench.iso swissgerman.iso uk.iso \ us.dvorak us.iso keymap.h: rm -f keymap.tmp for map in ${KEYMAPS} ; do \ kbdcontrol -L $$map | \ sed -e '/^static accentmap_t/,$$d' >> keymap.tmp ; \ done echo "static struct keymapInfo keymapInfos[] = {" >> keymap.tmp for map in ${KEYMAPS} ; do \ echo -n ' { "'$$map'", ' >> keymap.tmp ; \ echo "&keymap_$$map }," | tr '[-.]' '_' >> keymap.tmp ; \ done ( echo " { 0 }"; echo "};" ; echo "" ) >> keymap.tmp mv keymap.tmp keymap.h .include diff --git a/usr.sbin/sysinstall/config.c b/usr.sbin/sysinstall/config.c index 74cd5155634d..3ae09a184796 100644 --- a/usr.sbin/sysinstall/config.c +++ b/usr.sbin/sysinstall/config.c @@ -1,741 +1,735 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: config.c,v 1.123 1999/02/14 07:35:27 jkh Exp $ + * $Id: config.c,v 1.124 1999/02/14 21:35:01 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer, * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * 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 #include #include static Chunk *chunk_list[MAX_CHUNKS]; static int nchunks; static int rootdev_is_od; /* arg to sort */ static int chunk_compare(Chunk *c1, Chunk *c2) { if (!c1 && !c2) return 0; else if (!c1 && c2) return 1; else if (c1 && !c2) return -1; else if (!c1->private_data && !c2->private_data) return 0; else if (c1->private_data && !c2->private_data) return 1; else if (!c1->private_data && c2->private_data) return -1; else return strcmp(((PartInfo *)(c1->private_data))->mountpoint, ((PartInfo *)(c2->private_data))->mountpoint); } static void chunk_sort(void) { int i, j; for (i = 0; i < nchunks; i++) { for (j = 0; j < nchunks; j++) { if (chunk_compare(chunk_list[j], chunk_list[j + 1]) > 0) { Chunk *tmp = chunk_list[j]; chunk_list[j] = chunk_list[j + 1]; chunk_list[j + 1] = tmp; } } } } static void check_rootdev(Chunk **list, int n) { int i; Chunk *c; rootdev_is_od = 0; for (i = 0; i < n; i++) { c = *list++; if (c->type == part && (c->flags & CHUNK_IS_ROOT) && strncmp(c->disk->name, "od", 2) == 0) rootdev_is_od = 1; } } static char * name_of(Chunk *c1) { return c1->name; } static char * mount_point(Chunk *c1) { if (c1->type == part && c1->subtype == FS_SWAP) return "none"; else if (c1->type == part || c1->type == fat) return ((PartInfo *)c1->private_data)->mountpoint; return "/bogus"; } static char * fstype(Chunk *c1) { if (c1->type == fat) return "msdos"; else if (c1->type == part) { if (c1->subtype != FS_SWAP) return "ufs"; else return "swap"; } return "bogus"; } static char * fstype_short(Chunk *c1) { if (c1->type == part) { if (c1->subtype != FS_SWAP) { if (rootdev_is_od == 0 && strncmp(c1->name, "od", 2) == 0) return "rw,noauto"; else return "rw"; } else return "sw"; } else if (c1->type == fat) { if (strncmp(c1->name, "od", 2) == 0) return "ro,noauto"; else return "ro"; } return "bog"; } static int seq_num(Chunk *c1) { if (c1->type == part && c1->subtype != FS_SWAP) { if (rootdev_is_od == 0 && strncmp(c1->name, "od", 2) == 0) return 0; else if (c1->flags & CHUNK_IS_ROOT) return 1; else return 2; } return 0; } int configFstab(dialogMenuItem *self) { Device **devs; Disk *disk; FILE *fstab; int i, cnt; Chunk *c1, *c2; if (!RunningAsInit) { if (file_readable("/etc/fstab")) return DITEM_SUCCESS; else { msgConfirm("Attempting to rebuild your /etc/fstab file. Warning: If you had\n" "any CD devices in use before running sysinstall then they may NOT\n" "be found by this run!"); } } devs = deviceFind(NULL, DEVICE_TYPE_DISK); if (!devs) { msgConfirm("No disks found!"); return DITEM_FAILURE; } /* Record all the chunks */ nchunks = 0; for (i = 0; devs[i]; i++) { if (!devs[i]->enabled) continue; disk = (Disk *)devs[i]->private; 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)) chunk_list[nchunks++] = c2; } } else if (c1->type == fat && c1->private_data) chunk_list[nchunks++] = c1; } } chunk_list[nchunks] = 0; chunk_sort(); fstab = fopen("/etc/fstab", "w"); if (!fstab) { msgConfirm("Unable to create a new /etc/fstab file! Manual intervention\n" "will be required."); return DITEM_FAILURE; } check_rootdev(chunk_list, nchunks); /* Go for the burn */ msgDebug("Generating /etc/fstab file\n"); fprintf(fstab, "# Device\t\tMountpoint\tFStype\tOptions\t\tDump\tPass#\n"); for (i = 0; i < nchunks; i++) fprintf(fstab, "/dev/%s\t\t%s\t\t%s\t%s\t\t%d\t%d\n", name_of(chunk_list[i]), mount_point(chunk_list[i]), fstype(chunk_list[i]), fstype_short(chunk_list[i]), seq_num(chunk_list[i]), seq_num(chunk_list[i])); /* Now look for the CDROMs */ devs = deviceFind(NULL, DEVICE_TYPE_CDROM); cnt = deviceCount(devs); /* Write out the CDROM entries */ for (i = 0; i < cnt; i++) { char cdname[10]; sprintf(cdname, "/cdrom%s", i ? itoa(i) : ""); if (Mkdir(cdname)) msgConfirm("Unable to make mount point for: %s", cdname); else fprintf(fstab, "/dev/%s\t\t%s\tcd9660\tro,noauto\t0\t0\n", devs[i]->name, cdname); } /* And finally, a /proc. */ fprintf(fstab, "proc\t\t\t/proc\t\tprocfs\trw\t\t0\t0\n"); Mkdir("/proc"); fclose(fstab); if (isDebug()) msgDebug("Wrote out /etc/fstab file\n"); return DITEM_SUCCESS; } /* Do the work of sucking in a config file. * config is the filename to read in. * lines is a fixed (max) sized array of char* * returns number of lines read. line contents * are malloc'd and must be freed by the caller. */ int readConfig(char *config, char **lines, int max) { FILE *fp; char line[256]; int i, nlines; fp = fopen(config, "r"); if (!fp) return -1; nlines = 0; /* Read in the entire file */ for (i = 0; i < max; i++) { if (!fgets(line, sizeof line, fp)) break; lines[nlines++] = strdup(line); } fclose(fp); if (isDebug()) msgDebug("readConfig: Read %d lines from %s.\n", nlines, config); return nlines; } #define MAX_LINES 2000 /* Some big number we're not likely to ever reach - I'm being really lazy here, I know */ static void readConfigFile(char *config, int marked) { char *lines[MAX_LINES], *cp, *cp2; int i, nlines; nlines = readConfig(config, lines, MAX_LINES); if (nlines == -1) return; for (i = 0; i < nlines; i++) { /* Skip the comments & non-variable settings */ if (lines[i][0] == '#' || !(cp = index(lines[i], '='))) { free(lines[i]); continue; } *cp++ = '\0'; /* Find quotes */ if ((cp2 = index(cp, '"')) || (cp2 = index(cp, '\047'))) { cp = cp2 + 1; cp2 = index(cp, *cp2); } /* If valid quotes, use it */ if (cp2) { *cp2 = '\0'; /* If we have a legit value, set it */ if (strlen(cp)) variable_set2(lines[i], cp, marked); } free(lines[i]); } } /* Load the environment from rc.conf file(s) */ void configEnvironmentRC_conf(void) { static struct { char *fname; int marked; } configs[] = { { "/etc/defaults/rc.conf", 0 }, { "/etc/rc.conf", 0 }, { "/etc/rc.conf.local", 0 }, { NULL, 0 }, }; int i; for (i = 0; configs[i].fname; i++) { if (file_readable(configs[i].fname)) readConfigFile(configs[i].fname, configs[i].marked); } } /* Load the environment from a resolv.conf file */ void configEnvironmentResolv(char *config) { char *lines[MAX_LINES]; int i, nlines; nlines = readConfig(config, lines, MAX_LINES); if (nlines == -1) return; for (i = 0; i < nlines; i++) { Boolean name_set = (Boolean)variable_get(VAR_NAMESERVER); if (!strncmp(lines[i], "domain", 6) && !variable_get(VAR_DOMAINNAME)) variable_set2(VAR_DOMAINNAME, string_skipwhite(string_prune(lines[i] + 6)), 0); else if (!name_set && !strncmp(lines[i], "nameserver", 10)) { /* Only take the first nameserver setting - we're lame */ variable_set2(VAR_NAMESERVER, string_skipwhite(string_prune(lines[i] + 10)), 0); } free(lines[i]); } } /* Version of below for dispatch routines */ int configRC(dialogMenuItem *unused) { configRC_conf(); return DITEM_SUCCESS; } void configRC_conf(void) { FILE *rcSite; Variable *v; int write_header; static int did_marker = 0; write_header = !file_readable("/etc/rc.conf"); rcSite = fopen("/etc/rc.conf", "a"); if (!rcSite) return; if (write_header) { fprintf(rcSite, "# This file now contains just the overrides from /etc/defaults/rc.conf\n"); fprintf(rcSite, "# please make all changes to this file.\n\n"); } /* Now do variable substitutions */ for (v = VarHead; v; v = v->next) { if (v->dirty) { if (!did_marker) { fprintf(rcSite, "# -- sysinstall generated deltas -- #\n"); did_marker = 1; } fprintf(rcSite, "%s=\"%s\"\n", v->name, v->value); v->dirty = 0; } } fclose(rcSite); } int configSaver(dialogMenuItem *self) { variable_set((char *)self->data, 1); if (!variable_get(VAR_BLANKTIME)) variable_set2(VAR_BLANKTIME, "300", 1); return DITEM_SUCCESS; } int configSaverTimeout(dialogMenuItem *self) { return (variable_get_value(VAR_BLANKTIME, "Enter time-out period in seconds for screen saver", 1) ? DITEM_SUCCESS : DITEM_FAILURE) | DITEM_RESTORE; } -int -configRegister(dialogMenuItem *self) -{ - return DITEM_STATUS(registerOpenDialog()) | DITEM_RESTORE; -} - int configNTP(dialogMenuItem *self) { int status; status = variable_get_value(VAR_NTPDATE_FLAGS, "Enter the name of an NTP server", 1) ? DITEM_SUCCESS : DITEM_FAILURE; if (status == DITEM_SUCCESS) { static char tmp[255]; snprintf(tmp, sizeof(tmp), "ntpdate_enable=YES,ntpdate_flags=%s", variable_get(VAR_NTPDATE_FLAGS)); self->data = tmp; dmenuSetVariables(self); } return status | DITEM_RESTORE; } int configUsers(dialogMenuItem *self) { dialog_clear_norefresh(); dmenuOpenSimple(&MenuUsermgmt, FALSE); dialog_clear(); return DITEM_SUCCESS | DITEM_RESTORE; } int configXEnvironment(dialogMenuItem *self) { char *config, *execfile; char *moused; tryagain: dialog_clear_norefresh(); if (!dmenuOpenSimple(&MenuXF86Config, FALSE)) return DITEM_FAILURE | DITEM_RESTORE; if (file_readable("/var/run/ld.so.hints")) systemExecute("/sbin/ldconfig -m /usr/lib /usr/X11R6/lib /usr/local/lib /usr/lib/compat"); else systemExecute("/sbin/ldconfig /usr/lib /usr/X11R6/lib /usr/local/lib /usr/lib/compat"); config = variable_get(VAR_XF86_CONFIG); if (!config) return DITEM_FAILURE | DITEM_RESTORE; execfile = string_concat("/usr/X11R6/bin/", config); if (file_executable(execfile)) { dialog_clear_norefresh(); moused = variable_get(VAR_MOUSED); while (!moused || strcmp(moused, "YES")) { if (msgYesNo("The X server may access the mouse in two ways: direct access\n" "or indirect access via the mouse daemon. You have not\n" "configured the mouse daemon. Would you like to configure it\n" "now? If you intend to let the X server access the mouse\n" "directly, choose \"No\" at this time.")) break; dmenuOpenSimple(&MenuMouse, FALSE); dialog_clear(); moused = variable_get(VAR_MOUSED); } if (moused && !strcmp(moused, "YES")) msgConfirm("You have configured and are now running the mouse daemon.\n" "Choose \"/dev/sysmouse\" as the mouse port and \"SysMouse\" or\n" "\"MouseSystems\" as the mouse protocol in the X configuration\n" "utility."); dialog_clear(); systemExecute(execfile); if (!file_readable("/etc/XF86Config") && !msgYesNo("The XFree86 configuration process seems to have\nfailed. Would you like to try again?")) goto tryagain; return DITEM_SUCCESS | DITEM_RESTORE; } else { dialog_clear_norefresh(); msgConfirm("The XFree86 setup utility you chose does not appear to be installed!\n" "Please install this before attempting to configure XFree86."); return DITEM_FAILURE | DITEM_RESTORE; } } int configResolv(dialogMenuItem *ditem) { FILE *fp; char *cp, *dp, *hp; cp = variable_get(VAR_NAMESERVER); if (!cp || !*cp) goto skip; Mkdir("/etc"); fp = fopen("/etc/resolv.conf", "w"); if (!fp) return DITEM_FAILURE; if (variable_get(VAR_DOMAINNAME)) fprintf(fp, "domain\t%s\n", variable_get(VAR_DOMAINNAME)); fprintf(fp, "nameserver\t%s\n", cp); fclose(fp); if (isDebug()) msgDebug("Wrote out /etc/resolv.conf\n"); skip: dp = variable_get(VAR_DOMAINNAME); cp = variable_get(VAR_IPADDR); hp = variable_get(VAR_HOSTNAME); /* Tack ourselves into /etc/hosts */ fp = fopen("/etc/hosts", "w"); if (!fp) return DITEM_FAILURE; /* Add an entry for localhost */ if (dp) fprintf(fp, "127.0.0.1\t\tlocalhost.%s localhost\n", dp); else fprintf(fp, "127.0.0.1\t\tlocalhost\n"); /* Now the host entries, if applicable */ if (cp && cp[0] != '0' && hp) { char cp2[255]; if (!index(hp, '.')) cp2[0] = '\0'; else { SAFE_STRCPY(cp2, hp); *(index(cp2, '.')) = '\0'; } fprintf(fp, "%s\t\t%s %s\n", cp, hp, cp2); fprintf(fp, "%s\t\t%s.\n", cp, hp); } fclose(fp); if (isDebug()) msgDebug("Wrote out /etc/hosts\n"); return DITEM_SUCCESS; } int configRouter(dialogMenuItem *self) { int ret; ret = variable_get_value(VAR_ROUTER, "Please specify the router you wish to use. Routed is\n" "provided with the stock system and gated is provided\n" "as an optional package which this installation system\n" "will attempt to load if you select gated. Any other\n" "choice of routing daemon will be assumed to be something\n" "the user intends to install themselves before rebooting\n" "the system. If you don't want any routing daemon, choose NO", 1) ? DITEM_SUCCESS : DITEM_FAILURE; if (ret == DITEM_SUCCESS) { char *cp = variable_get(VAR_ROUTER); if (cp && strcmp(cp, "NO")) { variable_set2(VAR_ROUTER_ENABLE, "YES", 1); if (!strcmp(cp, "gated")) { if (package_add(variable_get(VAR_GATED_PKG)) != DITEM_SUCCESS) { msgConfirm("Unable to load gated package. Falling back to no router."); variable_unset(VAR_ROUTER); variable_unset(VAR_ROUTERFLAGS); variable_set2(VAR_ROUTER_ENABLE, "NO", 1); cp = NULL; } } if (cp) { /* Now get the flags, if they chose a router */ ret = variable_get_value(VAR_ROUTERFLAGS, "Please Specify the routing daemon flags; if you're running routed\n" "then -q is the right choice for nodes and -s for gateway hosts.\n", 1) ? DITEM_SUCCESS : DITEM_FAILURE; if (ret != DITEM_SUCCESS) variable_unset(VAR_ROUTERFLAGS); } } else { /* No router case */ variable_set2(VAR_ROUTER_ENABLE, "NO", 1); variable_unset(VAR_ROUTERFLAGS); variable_unset(VAR_ROUTER); } } return ret | DITEM_RESTORE; } int configPackages(dialogMenuItem *self) { static PkgNode top, plist; static Boolean index_initted = FALSE; PkgNodePtr tmp; FILE *fp; if (!mediaVerify()) return DITEM_FAILURE; if (!mediaDevice->init(mediaDevice)) return DITEM_FAILURE; if (!index_initted) { msgNotify("Attempting to fetch packages/INDEX file from selected media."); fp = mediaDevice->get(mediaDevice, "packages/INDEX", TRUE); if (!fp) { dialog_clear_norefresh(); msgConfirm("Unable to get packages/INDEX file from selected media.\n" "This may be because the packages collection is not available at\n" "on the distribution media you've chosen (most likely an FTP site\n" "without the packages collection mirrored). Please verify media\n" "(or path to media) and try again. If your local site does not\n" "carry the packages collection, then we recommend either a CD\n" "distribution or the master distribution on ftp.freebsd.org."); mediaDevice->shutdown(mediaDevice); return DITEM_FAILURE | DITEM_RESTORE; } msgNotify("Located INDEX, now reading package data from it..."); index_init(&top, &plist); if (index_read(fp, &top)) { msgConfirm("I/O or format error on packages/INDEX file.\n" "Please verify media (or path to media) and try again."); fclose(fp); return DITEM_FAILURE | DITEM_RESTORE; } fclose(fp); index_sort(&top); index_initted = TRUE; } while (1) { int ret, pos, scroll; /* Bring up the packages menu */ pos = scroll = 0; index_menu(&top, &top, &plist, &pos, &scroll); if (plist.kids && plist.kids->name) { /* Now show the packing list menu */ pos = scroll = 0; ret = index_menu(&plist, &plist, NULL, &pos, &scroll); if (ret & DITEM_LEAVE_MENU) break; else if (DITEM_STATUS(ret) != DITEM_FAILURE) { index_extract(mediaDevice, &top, &plist); break; } } else { dialog_clear_norefresh(); msgConfirm("No packages were selected for extraction."); break; } } tmp = plist.kids; while (tmp) { PkgNodePtr tmp2 = tmp->next; safe_free(tmp); tmp = tmp2; } index_init(NULL, &plist); return DITEM_SUCCESS | DITEM_RESTORE; } /* Load pcnfsd package */ int configPCNFSD(dialogMenuItem *self) { int ret = DITEM_SUCCESS; if (variable_get(VAR_PCNFSD)) variable_unset(VAR_PCNFSD); else { ret = package_add(variable_get(VAR_PCNFSD_PKG)); if (DITEM_STATUS(ret) == DITEM_SUCCESS) { variable_set2(VAR_PCNFSD, "YES", 0); variable_set2("mountd_flags", "-n", 1); } } return ret; } int configNFSServer(dialogMenuItem *self) { char cmd[256]; /* If we're an NFS server, we need an exports file */ if (!file_readable("/etc/exports")) { WINDOW *w = savescr(); if (file_readable("/etc/exports.disabled")) vsystem("mv /etc/exports.disabled /etc/exports"); else { dialog_clear_norefresh(); msgConfirm("Operating as an NFS server means that you must first configure\n" "an /etc/exports file to indicate which hosts are allowed certain\n" "kinds of access to your local file systems.\n" "Press [ENTER] now to invoke an editor on /etc/exports\n"); vsystem("echo '#The following examples export /usr to 3 machines named after ducks,' > /etc/exports"); vsystem("echo '#/home and all directories under it to machines named after dead rock stars' >> /etc/exports"); vsystem("echo '#and, finally, /a to 2 privileged machines allowed to write on it as root.' >> /etc/exports"); vsystem("echo '#/usr huey louie dewie' >> /etc/exports"); vsystem("echo '#/home -alldirs janice jimmy frank' >> /etc/exports"); vsystem("echo '#/a -maproot=0 bill albert' >> /etc/exports"); vsystem("echo '#' >> /etc/exports"); vsystem("echo '# You should replace these lines with your actual exported filesystems.' >> /etc/exports"); vsystem("echo >> /etc/exports"); sprintf(cmd, "%s /etc/exports", variable_get(VAR_EDITOR)); dialog_clear(); systemExecute(cmd); restorescr(w); } variable_set2(VAR_NFS_SERVER, "YES", 1); } else if (variable_get(VAR_NFS_SERVER)) { /* We want to turn it off again? */ vsystem("mv -f /etc/exports /etc/exports.disabled"); variable_unset(VAR_NFS_SERVER); } return DITEM_SUCCESS; } diff --git a/usr.sbin/sysinstall/dispatch.c b/usr.sbin/sysinstall/dispatch.c index 8d289e4207fc..7582b3698220 100644 --- a/usr.sbin/sysinstall/dispatch.c +++ b/usr.sbin/sysinstall/dispatch.c @@ -1,436 +1,434 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: dispatch.c,v 1.26 1998/11/15 09:06:19 jkh Exp $ + * $Id: dispatch.c,v 1.27 1999/02/05 22:15:48 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer, * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * 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 "list.h" static int dispatch_shutdown(dialogMenuItem *unused); static int dispatch_systemExecute(dialogMenuItem *unused); static int dispatch_msgConfirm(dialogMenuItem *unused); static struct _word { char *name; int (*handler)(dialogMenuItem *self); } resWords[] = { { "configAnonFTP", configAnonFTP }, { "configRouter", configRouter }, { "configNFSServer", configNFSServer }, { "configNTP", configNTP }, { "configPCNFSD", configPCNFSD }, { "configPackages", configPackages }, - { "configRegister", configRegister }, { "configUsers", configUsers }, { "configXEnvironment", configXEnvironment }, { "diskPartitionEditor", diskPartitionEditor }, { "diskPartitionWrite", diskPartitionWrite }, { "diskLabelEditor", diskLabelEditor }, { "diskLabelCommit", diskLabelCommit }, { "distReset", distReset }, { "distSetCustom", distSetCustom }, { "distSetDeveloper", distSetDeveloper }, { "distSetXDeveloper", distSetXDeveloper }, { "distSetKernDeveloper", distSetKernDeveloper }, { "distSetUser", distSetUser }, { "distSetXUser", distSetXUser }, { "distSetMinimum", distSetMinimum }, { "distSetEverything", distSetEverything }, { "distSetDES", distSetDES }, { "distSetSrc", distSetSrc }, { "distSetXF86", distSetXF86 }, { "distExtractAll", distExtractAll }, { "docBrowser", docBrowser }, { "docShowDocument", docShowDocument }, { "installCommit", installCommit }, { "installExpress", installExpress }, { "installNovice", installNovice }, { "installUpgrade", installUpgrade }, { "installFixupBin", installFixupBin }, { "installFixupXFree", installFixupXFree }, { "installFixitHoloShell", installFixitHoloShell }, { "installFixitCDROM", installFixitCDROM }, { "installFixitFloppy", installFixitFloppy }, { "installFilesystems", installFilesystems }, { "installVarDefaults", installVarDefaults }, { "loadConfig", dispatch_load_file }, { "loadFloppyConfig", dispatch_load_floppy }, { "mediaSetCDROM", mediaSetCDROM }, { "mediaSetFloppy", mediaSetFloppy }, { "mediaSetDOS", mediaSetDOS }, { "mediaSetTape", mediaSetTape }, { "mediaSetFTP", mediaSetFTP }, { "mediaSetFTPActive", mediaSetFTPActive }, { "mediaSetFTPPassive", mediaSetFTPPassive }, { "mediaSetUFS", mediaSetUFS }, { "mediaSetNFS", mediaSetNFS }, { "mediaSetFTPUserPass", mediaSetFTPUserPass }, { "mediaSetCPIOVerbosity", mediaSetCPIOVerbosity }, { "mediaGetType", mediaGetType }, { "msgConfirm", dispatch_msgConfirm }, { "optionsEditor", optionsEditor }, - { "register", configRegister }, /* Alias */ { "packageAdd", packageAdd }, { "addGroup", userAddGroup }, { "addUser", userAddUser }, { "shutdown", dispatch_shutdown }, { "system", dispatch_systemExecute }, { "dumpVariables", dump_variables }, { "tcpMenuSelect", tcpMenuSelect }, { NULL, NULL }, }; /* * Helper routines for buffering data. * * We read an entire configuration into memory before executing it * so that we are truely standalone and can do things like nuke the * file or disk we're working on. */ typedef struct command_buffer_ { qelement queue; char * string; } command_buffer; static void dispatch_free_command(command_buffer *item) { REMQUE(item); free(item->string); free(item); } static void dispatch_free_all(qelement *head) { command_buffer *item; while (!EMPTYQUE(*head)) { item = (command_buffer *) head->q_forw; dispatch_free_command(item); } } static command_buffer * dispatch_add_command(qelement *head, char *string) { command_buffer *new; new = malloc(sizeof(command_buffer)); if (!new) return NULL; new->string = strdup(string); INSQUEUE(new, head->q_back); return new; } /* * Command processing */ /* Just convenience */ static int dispatch_shutdown(dialogMenuItem *unused) { systemShutdown(0); return DITEM_FAILURE; } static int dispatch_systemExecute(dialogMenuItem *unused) { char *cmd = variable_get(VAR_COMMAND); if (cmd) return systemExecute(cmd) ? DITEM_FAILURE : DITEM_SUCCESS; else msgDebug("_systemExecute: No command passed in `command' variable.\n"); return DITEM_FAILURE; } static int dispatch_msgConfirm(dialogMenuItem *unused) { char *msg = variable_get(VAR_COMMAND); if (msg) { msgConfirm(msg); return DITEM_SUCCESS; } msgDebug("_msgConfirm: No message passed in `command' variable.\n"); return DITEM_FAILURE; } static int call_possible_resword(char *name, dialogMenuItem *value, int *status) { int i, rval; rval = 0; for (i = 0; resWords[i].name; i++) { if (!strcmp(name, resWords[i].name)) { *status = resWords[i].handler(value); rval = 1; break; } } return rval; } /* For a given string, call it or spit out an undefined command diagnostic */ int dispatchCommand(char *str) { int i; char *cp; if (!str || !*str) { msgConfirm("Null or zero-length string passed to dispatchCommand"); return DITEM_FAILURE; } /* If it's got a newline, trim it */ if ((cp = index(str, '\n')) != NULL) *cp = '\0'; /* If it's got a `=' sign in there, assume it's a variable setting */ if (index(str, '=')) { if (isDebug()) msgDebug("dispatch: setting variable `%s'\n", str); variable_set(str, 0); i = DITEM_SUCCESS; } else { /* A command might be a pathname if it's encoded in argv[0], which we also support */ if ((cp = rindex(str, '/')) != NULL) str = cp + 1; if (isDebug()) msgDebug("dispatch: calling resword `%s'\n", str); if (!call_possible_resword(str, NULL, &i)) { msgNotify("Warning: No such command ``%s''", str); i = DITEM_FAILURE; } } return i; } /* * File processing */ static qelement * dispatch_load_fp(FILE *fp) { qelement *head; char buf[BUFSIZ], *cp; head = malloc(sizeof(qelement)); if (!head) return NULL; INITQUE(*head); while (fgets(buf, sizeof buf, fp)) { if ((cp = strchr(buf, '\n')) != NULL) *cp = '\0'; if (*buf == '\0' || *buf == '#') continue; if (!dispatch_add_command(head, buf)) return NULL; } return head; } static int dispatch_execute(qelement *head) { int result = DITEM_SUCCESS; command_buffer *item; char *old_interactive; if (!head) return result | DITEM_FAILURE; old_interactive = variable_get(VAR_NONINTERACTIVE); if (old_interactive) old_interactive = strdup(old_interactive); /* save copy */ /* Hint to others that we're running from a script, should they care */ variable_set2(VAR_NONINTERACTIVE, "yes", 0); while (!EMPTYQUE(*head)) { item = (command_buffer *) head->q_forw; if (DITEM_STATUS(dispatchCommand(item->string)) != DITEM_SUCCESS) { /* * Allow a user to prefix a command with "noError" to cause * us to ignore any errors for that one command. */ if (variable_get(VAR_NO_ERROR)) variable_unset(VAR_NO_ERROR); else { msgConfirm("Command `%s' failed - rest of script aborted.\n", item->string); result |= DITEM_FAILURE; break; } } dispatch_free_command(item); } dispatch_free_all(head); if (!old_interactive) variable_unset(VAR_NONINTERACTIVE); else { variable_set2(VAR_NONINTERACTIVE, old_interactive, 0); free(old_interactive); } return result; } int dispatch_load_file_int(int quiet) { FILE *fp; char *cp; int i; qelement *list; static const char *names[] = { "install.cfg", "/stand/install.cfg", "/tmp/install.cfg", NULL }; fp = NULL; cp = variable_get(VAR_CONFIG_FILE); if (!cp) { for (i = 0; names[i]; i++) if ((fp = fopen(names[i], "r")) != NULL) break; } else fp = fopen(cp, "r"); if (!fp) { if (!quiet) msgConfirm("Unable to open %s: %s", cp, strerror(errno)); return DITEM_FAILURE; } list = dispatch_load_fp(fp); fclose(fp); return dispatch_execute(list); } int dispatch_load_file(dialogMenuItem *self) { return dispatch_load_file_int(FALSE); } int dispatch_load_floppy(dialogMenuItem *self) { int what = DITEM_RESTORE | DITEM_SUCCESS; extern char *distWanted; char *cp; FILE *fp; qelement *list; mediaClose(); dialog_clear_norefresh(); cp = variable_get_value(VAR_INSTALL_CFG, "Specify the name of a configuration file\n" "residing on a MSDOS or UFS floppy.", 0); if (!cp || !*cp) { variable_unset(VAR_INSTALL_CFG); what |= DITEM_FAILURE; return what; } distWanted = cp; /* Try to open the floppy drive */ if (DITEM_STATUS(mediaSetFloppy(NULL)) == DITEM_FAILURE) { msgConfirm("Unable to set media device to floppy."); what |= DITEM_FAILURE; mediaClose(); return what; } if (!mediaDevice->init(mediaDevice)) { msgConfirm("Unable to mount floppy filesystem."); what |= DITEM_FAILURE; mediaClose(); return what; } fp = mediaDevice->get(mediaDevice, cp, TRUE); if (fp) { list = dispatch_load_fp(fp); fclose(fp); mediaClose(); what |= dispatch_execute(list); } else { if (!variable_get(VAR_NO_ERROR)) msgConfirm("Configuration file '%s' not found.", cp); variable_unset(VAR_INSTALL_CFG); what |= DITEM_FAILURE; mediaClose(); } return what; } diff --git a/usr.sbin/sysinstall/install.c b/usr.sbin/sysinstall/install.c index f8a6d59faee6..81d3ddccb1c1 100644 --- a/usr.sbin/sysinstall/install.c +++ b/usr.sbin/sysinstall/install.c @@ -1,1134 +1,1119 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: install.c,v 1.229 1999/02/15 00:49:33 jkh Exp $ + * $Id: install.c,v 1.230 1999/03/11 09:38:06 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer, * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * 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 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) { Device **devs; Boolean status; Disk *disk; Chunk *c1, *c2, *rootdev, *swapdev, *usrdev, *vardev; int i; /* Don't allow whinging if noWarn is set */ if (variable_get(VAR_NO_WARN)) whinge = FALSE; status = TRUE; *rdev = *sdev = *udev = *vdev = rootdev = swapdev = usrdev = vardev = 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); } } } } } } } /* 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 */ *rdev = rootdev; *sdev = swapdev; *udev = usrdev; *vdev = vardev; 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; } if (!usrdev && whinge && !variable_get(VAR_NO_USR)) { msgConfirm("WARNING: No /usr filesystem found. This is not technically\n" "an error if your root filesystem is big enough (or you later\n" "intend to mount your /usr filesystem over NFS), but it may otherwise\n" "cause you trouble if you're not exactly sure what you are doing!"); } if (!vardev && whinge && variable_cmp(SYSTEM_STATE, "upgrade")) { msgConfirm("WARNING: No /var filesystem found. This is not technically\n" "an error if your root filesystem is big enough (or you later\n" "intend to link /var to someplace else), but it may otherwise\n" "cause your root filesystem to fill up if you receive lots of mail\n" "or edit large temporary files."); } 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 | DITEM_RESTORE; 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 (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 */ systemCreateHoloshell(); alreadyDone = TRUE; return status; } int installFixitHoloShell(dialogMenuItem *self) { systemCreateHoloshell(); return DITEM_SUCCESS; } 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 CDROM and press return"); if (DITEM_STATUS(mediaSetCDROM(NULL)) != DITEM_SUCCESS || !mediaDevice || !mediaDevice->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 CDROM - 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 CDROM 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 CDROM likely won't work."); } } /* Yet more iggly hardcoded pathnames. */ Mkdir("/usr/libexec"); if (!file_readable("/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 CDROM 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 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 (!mediaDevice->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/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 (!(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); 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); /* use the .profile from the fixit medium */ setenv("HOME", "/mnt2", 1); chdir("/mnt2"); execlp("sh", "-sh", 0); msgDebug("fixit shell: Failed to execute shell!\n"); _exit(1);; } else { 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."); (void)waitpid(child, &waitstatus, 0); } dialog_clear(); } int installExpress(dialogMenuItem *self) { int i; variable_set2(SYSTEM_STATE, "express", 0); #ifndef __alpha__ if (DITEM_STATUS((i = diskPartitionEditor(self))) == DITEM_FAILURE) return i; #endif if (DITEM_STATUS((i = diskLabelEditor(self))) == DITEM_FAILURE) return i; dialog_clear_norefresh(); if (DITEM_STATUS((i = installCommit(self))) == DITEM_SUCCESS) { i |= DITEM_LEAVE_MENU; /* Give user the option of one last configuration spree */ installConfigure(); } return i | DITEM_RESTORE; } /* Novice mode installation */ int installNovice(dialogMenuItem *self) { int i, tries = 0; Device **devs; variable_set2(SYSTEM_STATE, "novice", 0); #ifndef __alpha__ dialog_clear_norefresh(); 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 dialog_clear_norefresh(); #ifdef __alpha__ msgConfirm("First, 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."); #else msgConfirm("First, 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."); #endif if (DITEM_STATUS(diskLabelEditor(self)) == DITEM_FAILURE) return DITEM_FAILURE; dialog_clear_norefresh(); if (DITEM_STATUS((i = installCommit(self))) == DITEM_FAILURE) { dialog_clear_norefresh(); 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 chose \"No\" at the next\n" "prompt and go back into the installation menus to try and retry\n" "whichever operations have failed."); return i | DITEM_RESTORE; } else { dialog_clear_norefresh(); 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: /stand/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; dialog_clear_norefresh(); tmp = tcpDeviceSelect(); dialog_clear_norefresh(); if (tmp && !msgYesNo("Would you like to bring the %s interface up right now?", tmp->name)) if (!tmp->init(tmp)) msgConfirm("Initialization of %s device failed.", tmp->name); } } dialog_clear_norefresh(); if (!msgYesNo("Will this machine be an IP gateway (e.g. will it forward packets\n" "between interfaces)?")) variable_set2("gateway_enable", "YES", 1); dialog_clear_norefresh(); if (!msgYesNo("Do you want to allow anonymous FTP connections to this machine?")) configAnonFTP(self); dialog_clear_norefresh(); if (!msgYesNo("Do you want to configure this machine as an NFS server?")) configNFSServer(self); dialog_clear_norefresh(); if (!msgYesNo("Do you want to configure this machine as an NFS client?")) variable_set2("nfs_client_enable", "YES", 1); dialog_clear_norefresh(); if (!msgYesNo("Would you like to customize your system console settings?")) { WINDOW *w = savescr(); dmenuOpenSimple(&MenuSyscons, FALSE); restorescr(w); } dialog_clear_norefresh(); if (!msgYesNo("Would you like to set this machine's time zone now?")) { WINDOW *w = savescr(); dialog_clear(); systemExecute("tzsetup"); restorescr(w); } dialog_clear_norefresh(); if (!msgYesNo("Does this system have a mouse attached to it?")) { WINDOW *w = savescr(); dmenuOpenSimple(&MenuMouse, FALSE); restorescr(w); } /* 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?")) configXEnvironment(self); } dialog_clear_norefresh(); if (!msgYesNo("The FreeBSD package collection is a collection of hundreds 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?")) configPackages(self); dialog_clear_norefresh(); 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).")) configUsers(self); dialog_clear_norefresh(); msgConfirm("Now you must set the system manager's password.\n" "This is the password you'll use to log in as \"root\"."); { WINDOW *w = savescr(); if (!systemExecute("passwd root")) variable_set2("root_password", "YES", 0); restorescr(w); } - dialog_clear_norefresh(); - if (!msgYesNo("Would you like to register your FreeBSD system at this time?\n\n" - "PLEASE, take just 5 minutes to do this. If we're ever to get any\n" - "significant base of commercial software for FreeBSD, we need to\n" - "be able to provide more information about the size of our user community.\n" - "This is where your registration can really help us, and you can also\n" - "sign up for the new FreeBSD newsletter (its free!) at the same time.\n")) - configRegister(NULL); - else { - dialog_clear_norefresh(); - msgConfirm("OK, but if you should change your mind then you always can register\n" - "later by typing ``/stand/sysinstall register'' or by simply visiting our\n" - "web site at http://www.freebsd.org/register.html"); - - } /* 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 | DITEM_RESTORE; } /* The version of commit we call from the Install Custom menu */ int installCustomCommit(dialogMenuItem *self) { int i; dialog_clear_norefresh(); i = installCommit(self); if (DITEM_STATUS(i) == DITEM_SUCCESS) { /* 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 DES dist. */ int installCommit(dialogMenuItem *self) { int i; char *str; if (!Dists) distConfig(NULL); if (!Dists) if (!dmenuOpenSimple(&MenuDistributions, FALSE) && !Dists) return DITEM_FAILURE | DITEM_RESTORE; if (!mediaVerify()) return DITEM_FAILURE | DITEM_RESTORE; 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 (!mediaDevice->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 | DITEM_RESTORE; else goto try_media; } else return DITEM_FAILURE | DITEM_RESTORE; } /* 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 | DITEM_RESTORE; } static void installConfigure(void) { /* Final menu of last resort */ dialog_clear_norefresh(); if (!msgYesNo("Visit the general configuration menu for a chance to set\n" "any last options?")) { WINDOW *w = savescr(); dmenuOpenSimple(&MenuConfigure, FALSE); restorescr(w); } configRC_conf(); sync(); } int installFixupBin(dialogMenuItem *self) { Device **devs; int i; /* All of this is done only as init, just to be safe */ if (RunningAsInit) { /* Fix up kernel first */ if (!file_readable("/kernel")) { if (file_readable("/kernel.GENERIC")) { if (vsystem("cp -p /kernel.GENERIC /kernel")) { msgConfirm("Unable to copy /kernel into place!"); return DITEM_FAILURE; } #ifndef __alpha__ /* Snapshot any boot -c changes back to the new kernel */ if (kget("/boot/kernel.conf")) { msgConfirm("Kernel copied OK, but unable to save boot -c changes\n" "to it. See the debug screen (ALT-F2) for details."); } else { if (!file_readable("/boot/loader.rc")) { FILE *fp; if ((fp = fopen("/boot/loader.rc", "w")) != NULL) { fprintf(fp, "load /kernel\n"); fprintf(fp, "load -t userconfig_script /boot/kernel.conf\n"); fprintf(fp, "autoboot 5\n"); fclose(fp); } } else { msgConfirm("You already have a /boot/loader.rc file so I won't touch it.\n" "You will need to add a: load -t userconfig_script /boot/kernel.conf\n" "line to your /boot/loader.rc before your saved kernel changes\n" "(if any) can go into effect."); } } #endif } else { msgConfirm("Can't find a kernel image to link to on the root file system!\n" "You're going to have a hard time getting this system to\n" "boot from the hard disk, I'm afraid!"); return DITEM_FAILURE; } } /* BOGON #1: Resurrect /dev after bin distribution screws it up */ msgNotify("Remaking all devices.. Please wait!"); if (vsystem("cd /dev; sh MAKEDEV all")) { msgConfirm("MAKEDEV returned non-zero status"); return DITEM_FAILURE; } 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) { 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; } } } } /* 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; } /* Fix side-effects from the the XFree86 installation */ int installFixupXFree(dialogMenuItem *self) { /* BOGON #1: XFree86 requires various specialized fixups */ if (directory_exists("/usr/X11R6")) { msgNotify("Fixing permissions in XFree86 tree.."); vsystem("chmod -R a+r /usr/X11R6"); vsystem("find /usr/X11R6 -type d | xargs chmod a+x"); /* Also do bogus minimal package registration so ports don't whine */ if (file_readable("/usr/X11R6/lib/X11/pkgreg.tar.gz")) { msgNotify("Installing package metainfo.."); vsystem("tar xpzf /usr/X11R6/lib/X11/pkgreg.tar.gz -C / && rm /usr/X11R6/lib/X11/pkgreg.tar.gz"); } } return DITEM_SUCCESS; } /* Go newfs and/or mount all the filesystems we've been asked to */ int installFilesystems(dialogMenuItem *self) { int i; Disk *disk; Chunk *c1, *c2, *rootdev, *swapdev, *usrdev, *vardev; 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, &usrdev, &vardev)) 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)) 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/r%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; } 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 || !msgYesNo("You are upgrading - are you SURE you want to newfs the root partition?"))) { int i; 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; } } else { if (!upgrade) { msgConfirm("Warning: Using existing root partition. It will be assumed\n" "that you have the appropriate device entries already in /dev."); } msgNotify("Checking integrity of existing %s filesystem.", dname); i = vsystem("fsck -y %s", dname); if (i) msgConfirm("Warning: fsck returned status of %d for %s.\n" "This partition may be unsafe to use.", i, 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; } } /* 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; } 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 || !msgYesNo("You are upgrading - are you SURE you want to newfs /dev/%s?", c2->name))) command_shell_add(tmp->mountpoint, "%s %s/dev/r%s", tmp->newfs_cmd, RunningAsInit ? "/mnt" : "", c2->name); else command_shell_add(tmp->mountpoint, "fsck -y %s/dev/r%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) 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); } } } if (RunningAsInit) { 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; } } command_sort(); command_execute(); return DITEM_SUCCESS; } static char * getRelname(void) { static char buf[64]; int 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, "lynx", 0); variable_set2(VAR_BROWSER_BINARY, "/usr/local/bin/lynx", 0); variable_set2(VAR_FTP_STATE, "passive", 0); variable_set2(VAR_NFS_SECURE, "YES", 0); variable_set2(VAR_PKG_TMPDIR, "/usr/tmp", 0); variable_set2(VAR_GATED_PKG, "gated", 0); variable_set2(VAR_PCNFSD_PKG, "pcnfsd", 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); 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, 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); } } diff --git a/usr.sbin/sysinstall/menus.c b/usr.sbin/sysinstall/menus.c index d03b76d3489b..5d7fb7ac4d34 100644 --- a/usr.sbin/sysinstall/menus.c +++ b/usr.sbin/sysinstall/menus.c @@ -1,1528 +1,1526 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: menus.c,v 1.193 1999/03/19 10:54:37 jkh Exp $ + * $Id: menus.c,v 1.194 1999/04/21 07:22:37 obrien Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer, * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * 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" #ifdef __alpha__ #define _AS(str) str "alpha/" #else /* i386 */ #define _AS(str) str "i386/" #endif #define _AP(str) _AS(str "/pub/FreeBSD/releases/") /* Miscellaneous work routines for menus */ static int setSrc(dialogMenuItem *self) { Dists |= DIST_SRC; SrcDists = DIST_SRC_ALL; return DITEM_SUCCESS | DITEM_REDRAW; } static int clearSrc(dialogMenuItem *self) { Dists &= ~DIST_SRC; SrcDists = 0; return DITEM_SUCCESS | DITEM_REDRAW; } static int setX11All(dialogMenuItem *self) { XF86Dists = DIST_XF86_ALL; XF86ServerDists = DIST_XF86_SERVER_ALL; XF86FontDists = DIST_XF86_FONTS_ALL; Dists |= DIST_XF86; return DITEM_SUCCESS | DITEM_REDRAW; } static int clearX11All(dialogMenuItem *self) { XF86Dists = 0; XF86ServerDists = 0; XF86FontDists = 0; Dists &= ~DIST_XF86; 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 | DIST_DES | extra)) #define IS_USER(dist, extra) (_IS_SET(dist, _DIST_USER | extra) || \ _IS_SET(dist, _DIST_USER | DIST_DES | 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_BIN; } static int checkDistEverything(dialogMenuItem *self) { return Dists == DIST_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 DESFlagCheck(dialogMenuItem *item) { return DESDists; } 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 [ENTER].\n" "Leave the index page by selecting Cancel [TAB-ENTER].", "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, DES", "DES distribution menu.", NULL, dmenuSubmenu, NULL, &MenuDESDistributions }, { "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, 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 }, { "Fdisk", "The disk Partition Editor", NULL, diskPartitionEditor }, { "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 }, { "Install, Novice", "A novice system installation.", NULL, installNovice }, { "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", "Select CDROM 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 }, { "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" }, - { "Register", "Register yourself or company as a FreeBSD user.", dmenuVarCheck, configRegister, NULL, "registered" }, { "Root Password", "Set the system manager's password.", NULL, dmenuSystemCommand, NULL, "passwd root" }, { "Router", "Select routing daemon (default: routed)", NULL, configRouter, NULL, "router" }, { "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 }, { "Time Zone", "Set the system's time zone.", NULL, dmenuSystemCommand, NULL, "tzsetup" }, { "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 }, { "XFree86, PC98 Server", "XFree86 PC98 Server selection menu.", NULL, dmenuSubmenu, NULL, &MenuXF86SelectPC98Server }, { NULL } }, }; /* The initial installation menu */ DMenu MenuInitial = { DMENU_NORMAL_TYPE, "/stand/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 by pressing [ENTER] or [TAB-ENTER] to exit the installation.", "Press F1 for Installation Guide", /* help line */ "install", /* help file */ { { "Select" }, { "Exit Install", NULL, NULL, dmenuExit }, { "1 Usage", "Quick start - How to use this menu system", NULL, dmenuDisplayFile, NULL, "usage" }, { "2 Novice", "Begin a novice installation (for beginners)", NULL, installNovice }, { "3 Express", "Begin a quick installation (for the impatient)", NULL, installExpress }, { "4 Custom", "Begin a custom installation (for experts)", NULL, dmenuSubmenu, NULL, &MenuInstallCustom }, { "5 Configure", "Do post-install configuration of FreeBSD", NULL, dmenuSubmenu, NULL, &MenuConfigure }, { "D Doc", "Installation instructions, README, etc.", NULL, dmenuSubmenu, NULL, &MenuDocumentation }, { "K Keymap", "Select keyboard type", NULL, dmenuSubmenu, NULL, &MenuSysconsKeymap }, { "O Options", "View/Set various installation options", NULL, optionsEditor }, { "F Fixit", "Enter repair mode with CDROM/floppy or start shell", NULL, dmenuSubmenu, NULL, &MenuFixit }, { "U Upgrade", "Upgrade an existing system", NULL, installUpgrade }, { "L Load Config","Load default install configuration", NULL, dispatch_load_floppy }, { "I 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", { { "1 README", "A general description of FreeBSD. Read this!", NULL, dmenuDisplayFile, NULL, "README" }, { "2 Hardware", "The FreeBSD survival guide for PC hardware.", NULL, dmenuDisplayFile, NULL, "HARDWARE" }, { "3 Install", "A step-by-step guide to installing FreeBSD.", NULL, dmenuDisplayFile, NULL, "INSTALL" }, { "4 Copyright", "The FreeBSD Copyright notices.", NULL, dmenuDisplayFile, NULL, "COPYRIGHT" }, { "5 Release" ,"The release notes for this version of FreeBSD.", NULL, dmenuDisplayFile, NULL, "RELNOTES" }, { "6 Shortcuts", "Creating shortcuts to sysinstall.", NULL, dmenuDisplayFile, NULL, "shortcuts" }, { "7 HTML Docs", "Go to the HTML documentation menu (post-install).", NULL, docBrowser }, { "0 Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { NULL } }, }; DMenu MenuMouseType = { DMENU_RADIO_TYPE | DMENU_SELECTION_RETURNS, "Select a protocol type for your mouse", "If you are not sure, choose \"Auto\". It should always work for bus\n" "and PS/2 style mice. It may not work for the serial mouse if the mouse\n" "does not support the PnP standard. But, it won't hurt. Many 2-button\n" "serial mice are compatible with \"Microsoft\" or \"MouseMan\". 3-button\n" "serial mice may be compatible with \"MouseSystems\" or \"MouseMan\". If\n" "the mouse has a wheel, it may be compatible with \"IntelliMouse\".", NULL, NULL, { { "Auto", "Bus mouse, PS/2 style mouse or PnP serial mouse", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=auto" }, { "GlidePoint", "ALPS GlidePoint pad (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=glidepoint" }, { "Hitachi","Hitachi tablet (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=mmhittab" }, { "IntelliMouse", "Microsoft IntelliMouse (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=intellimouse" }, { "Logitech", "Logitech protocol (old models) (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=logitech" }, { "Microsoft", "Microsoft protocol (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=microsoft" }, { "MM Series","MM Series protocol (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=mmseries" }, { "MouseMan", "Logitech MouseMan/TrackMan models (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=mouseman" }, { "MouseSystems", "MouseSystems protocol (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=mousesystems" }, { "ThinkingMouse","Kensington ThinkingMouse (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=thinkingmouse" }, { NULL } }, }; DMenu MenuMousePort = { DMENU_RADIO_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, { { "COM1", "Serial mouse on COM1 (/dev/cuaa0)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuaa0" }, { "COM2", "Serial mouse on COM2 (/dev/cuaa1)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuaa1" }, { "COM3", "Serial mouse on COM3 (/dev/cuaa2)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuaa2" }, { "COM4", "Serial mouse on COM4 (/dev/cuaa3)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuaa3" }, { "BusMouse", "Logitech, ATI or MS bus mouse (/dev/mse0)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/mse0" }, { "PS/2", "PS/2 style mouse (/dev/psm0)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/psm0" }, { 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 4 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, { { "1 Type", "Select mouse protocol type", NULL, dmenuSubmenu, NULL, &MenuMouseType }, { "2 Port", "Select mouse port", NULL, dmenuSubmenu, NULL, &MenuMousePort }, { "3 Enable", "Test and run the mouse daemon", NULL, mousedTest, NULL, NULL }, { "4 Disable", "Disable the mouse daemon", NULL, mousedDisable, NULL, NULL }, { "0 Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { NULL } }, }; DMenu MenuXF86Config = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Please select the XFree86 configuration tool you want to use.", "The first tool, XF86Setup, is fully graphical and requires the\n" "VGA16 server in order to work (should have been selected by\n" "default, but if you de-selected it then you won't be able to\n" "use this fancy setup tool). The second tool, 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 fancier one\n" "does not.", "Press F1 to read the XFree86 release notes for FreeBSD", "XF86", { { "XF86Setup", "Fully graphical XFree86 configuration tool.", NULL, dmenuSetVariable, NULL, VAR_XF86_CONFIG "=XF86Setup" }, { "xf86config", "Shell-script based XFree86 configuration tool.", NULL, dmenuSetVariable, NULL, VAR_XF86_CONFIG "=xf86config" }, { "XF98Setup", "Fully graphical XFree86 configuration tool (PC98).", NULL, dmenuSetVariable, NULL, VAR_XF86_CONFIG "=XF98Setup" }, { NULL } }, }; DMenu MenuMediaCDROM = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Choose a CDROM type", "FreeBSD can be installed directly from a CDROM containing a valid\n" "FreeBSD distribution. If you are seeing this menu it is because\n" "more than one CDROM drive was found on your system. Please select one\n" "of the following CDROM drives as your installation drive.", "Press F1 to read the installation guide", "install", { { NULL } }, }; DMenu MenuMediaFloppy = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Choose a Floppy drive", "You have more than one floppy drive. Please chose 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 _AS("=ftp://ftp.freebsd.org/pub/FreeBSD/releases/") }, { "URL", "Specify some other ftp site by URL", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=other" }, { "4.0 SNAP Server", "current.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AS("=ftp://current.freebsd.org/pub/FreeBSD/snapshots/") }, { "3.0 SNAP Server", "releng3.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AS("=ftp://releng3.freebsd.org/pub/FreeBSD/snapshots/") }, { "Argentina", "ftp.ar.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.ar.freebsd.org") }, { "Australia", "ftp.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.au.freebsd.org") }, { "Australia #2", "ftp2.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.au.freebsd.org") }, { "Australia #3", "ftp3.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp3.au.freebsd.org") }, { "Australia #4", "ftp4.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp4.au.freebsd.org") }, { "Australia #5", "ftp5.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp5.au.freebsd.org") }, { "Brazil", "ftp.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.br.freebsd.org") }, { "Brazil #2", "ftp2.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.br.freebsd.org") }, { "Brazil #3", "ftp3.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp3.br.freebsd.org") }, { "Brazil #4", "ftp4.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp4.br.freebsd.org") }, { "Brazil #5", "ftp5.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp5.br.freebsd.org") }, { "Brazil #6", "ftp6.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp6.br.freebsd.org") }, { "Brazil #7", "ftp7.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp7.br.freebsd.org") }, { "Canada", "ftp.ca.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.ca.freebsd.org") }, { "Czech Republic", "ftp.cz.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.cz.freebsd.org") }, { "Denmark", "ftp.dk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.dk.freebsd.org") }, { "Denmark #2", "ftp2.dk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.dk.freebsd.org") }, { "Estonia", "ftp.ee.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.ee.freebsd.org") }, { "Finland", "ftp.fi.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.fi.freebsd.org") }, { "France", "ftp.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.fr.freebsd.org") }, { "France #2", "ftp2.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.fr.freebsd.org") }, { "Germany", "ftp.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.de.freebsd.org") }, { "Germany #2", "ftp2.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.de.freebsd.org") }, { "Germany #3", "ftp3.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp3.de.freebsd.org") }, { "Germany #4", "ftp4.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp4.de.freebsd.org") }, { "Germany #5", "ftp5.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp5.de.freebsd.org") }, { "Germany #6", "ftp6.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp6.de.freebsd.org") }, { "Germany #7", "ftp7.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp7.de.freebsd.org") }, { "Holland", "ftp.nl.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.nl.freebsd.org") }, { "Hong Kong", "ftp.hk.super.net", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.hk.super.net") }, { "Iceland", "ftp.is.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.is.freebsd.org") }, { "Ireland", "ftp.ie.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.ie.freebsd.org") }, { "Israel", "ftp.il.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.il.freebsd.org") }, { "Israel #2", "ftp2.il.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.il.freebsd.org") }, { "Japan", "ftp.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.jp.freebsd.org") }, { "Japan #2", "ftp2.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.jp.freebsd.org") }, { "Japan #3", "ftp3.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp3.jp.freebsd.org") }, { "Japan #4", "ftp4.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp4.jp.freebsd.org") }, { "Japan #5", "ftp5.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp5.jp.freebsd.org") }, { "Japan #6", "ftp6.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp6.jp.freebsd.org") }, { "Korea", "ftp.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.kr.freebsd.org") }, { "Korea #2", "ftp2.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.kr.freebsd.org") }, { "Korea #3", "ftp3.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp3.kr.freebsd.org") }, { "Korea #4", "ftp4.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp4.kr.freebsd.org") }, { "Korea #5", "ftp5.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp5.kr.freebsd.org") }, { "Poland", "ftp.pl.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.pl.freebsd.org") }, { "Portugal", "ftp.pt.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.pt.freebsd.org") }, { "Portugal #2", "ftp2.pt.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.pt.freebsd.org") }, { "Russia", "ftp.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.ru.freebsd.org") }, { "Russia #2", "ftp2.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.ru.freebsd.org") }, { "Russia #3", "ftp3.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp3.ru.freebsd.org") }, { "Russia #4", "ftp4.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp4.ru.freebsd.org") }, { "South Africa", "ftp.za.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.za.freebsd.org") }, { "South Africa #2", "ftp2.za.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.za.freebsd.org") }, { "South Africa #3", "ftp3.za.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp3.za.freebsd.org") }, { "South Africa #4", "ftp4.za.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp4.za.freebsd.org") }, { "Spain", "ftp.es.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.es.freebsd.org") }, { "Spain #2", "ftp2.es.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.es.freebsd.org") }, { "Sweden", "ftp.se.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.se.freebsd.org") }, { "Sweden #2", "ftp2.se.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.se.freebsd.org") }, { "Sweden #3", "ftp3.se.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp3.se.freebsd.org") }, { "Taiwan", "ftp.tw.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.tw.freebsd.org") }, { "Taiwan #2", "ftp2.tw.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.tw.freebsd.org") }, { "Taiwan #3", "ftp3.tw.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp3.tw.freebsd.org") }, { "Thailand", "ftp.nectec.or.th", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AS("=ftp://ftp.nectec.or.th/pub/mirrors/FreeBSD/") }, { "UK", "ftp.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.uk.freebsd.org") }, { "UK #2", "ftp2.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.uk.freebsd.org") }, { "UK #3", "ftp3.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp3.uk.freebsd.org") }, { "UK #4", "ftp4.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp4.uk.freebsd.org") }, { "USA", "ftp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp.freebsd.org") }, { "USA #2", "ftp2.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp2.freebsd.org") }, { "USA #3", "ftp3.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp3.freebsd.org") }, { "USA #4", "ftp4.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp4.freebsd.org") }, { "USA #5", "ftp5.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=ftp://ftp5.freebsd.org") }, { "USA #6", "ftp6.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AP("=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 } }, }; /* 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 CDROM 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 CDROM", "Install from a FreeBSD CDROM", 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 DOS", "Install from a DOS partition", NULL, mediaSetDOS }, { "5 NFS", "Install over NFS", NULL, mediaSetNFS }, { "6 File System", "Install from an existing filesystem", NULL, mediaSetUFS }, { "7 Floppy", "Install from a floppy disk set", NULL, mediaSetFloppy }, { "8 Tape", "Install from SCSI or QIC tape", NULL, mediaSetTape }, { "9 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]. When you are finished, chose the Exit\n" "item or press [ENTER].", "Press F1 for more information on these options.", "distributions", { { "1 Developer", "Full sources, binaries and doc but no games", checkDistDeveloper, distSetDeveloper }, { "2 X-Developer", "Same as above + X Window System", checkDistXDeveloper, distSetXDeveloper }, { "3 Kern-Developer", "Full binaries and doc, kernel sources only", checkDistKernDeveloper, distSetKernDeveloper }, { "4 X-Kern-Developer", "Same as above + X Window System", checkDistXKernDeveloper, distSetXKernDeveloper }, { "5 User", "Average user - binaries and doc only", checkDistUser, distSetUser }, { "6 X-User", "Same as above + X Window System", checkDistXUser, distSetXUser }, { "7 Minimal", "The smallest configuration possible", checkDistMinimum, distSetMinimum }, { "8 Custom", "Specify your own distribution set", NULL, dmenuSubmenu, NULL, &MenuSubDistributions, '>', '>', '>' }, { "8 All", "All sources and binaries (incl X Window System)", checkDistEverything, distSetEverything }, { "9 Clear", "Reset selected distribution list to nothing", NULL, distReset, NULL, NULL, ' ', ' ', ' ' }, { "0 Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { 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 \"bin\". WARNING: Do not export the\n" "DES distribution out of the U.S.! It is for U.S. customers only.", NULL, NULL, { { "bin", "Binary base distribution (required)", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_BIN }, { "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 { "DES", "DES encryption code - NOT FOR EXPORT!", DESFlagCheck, distSetDES }, { "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 but DES", srcFlagCheck, distSetSrc }, { "ports", "The FreeBSD Ports collection", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_PORTS }, { "XFree86", "The XFree86 3.3.3.1 distribution", x11FlagCheck, distSetXF86 }, { "All", "All sources, binaries and X Window System binaries", NULL, distSetEverything, NULL, NULL, ' ', ' ', ' ' }, { "Clear", "Reset all of the above", NULL, distReset, NULL, NULL, ' ', ' ', ' ' }, { "Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { NULL } }, }; DMenu MenuDESDistributions = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "Select the encryption facilities you wish to install.", "Please check off any special DES-based encryption distributions\n" "you would like to install. Please note that these services are NOT FOR\n" "EXPORT from the United States. For information on non-U.S. FTP\n" "distributions of this software, please consult the release notes.", NULL, NULL, { { "des", "Basic DES encryption services", dmenuFlagCheck, dmenuSetFlag, NULL, &DESDists, '[', 'X', ']', DIST_DES_DES, }, { "krb", "Kerberos encryption services", dmenuFlagCheck, dmenuSetFlag, NULL, &DESDists, '[', 'X', ']', DIST_DES_KERBEROS }, { "skerbero", "Sources for Kerberos IV", dmenuFlagCheck, dmenuSetFlag, NULL, &DESDists, '[', 'X', ']', DIST_DES_SKERBEROS }, { "ssecure", "Sources for DES", dmenuFlagCheck, dmenuSetFlag, NULL, &DESDists, '[', 'X', ']', DIST_DES_SSECURE }, { "scrypto", "Export controlled crypto sources", dmenuFlagCheck, dmenuSetFlag, NULL, &DESDists, '[', 'X', ']', DIST_DES_SCRYPTO }, { "Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { 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, { { "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 }, { "share", "/usr/src/share (documents and shared files)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_SHARE }, { "sys", "/usr/src/sys (FreeBSD kernel)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_SYS }, { "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 }, { "All", "Select all of the above", NULL, setSrc, NULL, NULL, ' ', ' ', ' ' }, { "Clear", "Reset all of the above", NULL, clearSrc, NULL, NULL, ' ', ' ', ' ' }, { "Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { NULL } }, }; DMenu MenuXF86Select = { DMENU_NORMAL_TYPE, "XFree86 3.3.3.1 Distribution", "Please select the components you need from the XFree86 3.3.3.1\n" "distribution sets.", "Press F1 to read the XFree86 release notes for FreeBSD", "XF86", { { "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 }, { "All", "Select all XFree86 distribution sets", NULL, setX11All }, { "Clear", "Reset XFree86 distribution list", NULL, clearX11All }, { "Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { NULL } }, }; DMenu MenuXF86SelectCore = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "XFree86 3.3.3.1 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.", "Press F1 to read the XFree86 release notes for FreeBSD", "XF86", { { "bin", "Client applications and shared libs", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_BIN }, { "cfg", "Configuration files", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_CFG }, { "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 }, { "lib", "Data files needed at runtime", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_LIB }, { "lk98", "Server link kit for PC98 machines", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_LKIT98 }, { "lkit", "Server link kit for all other machines", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_LKIT }, { "man", "Manual pages", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_MAN }, { "prog", "Programmer's header and library files", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_PROG }, { "set", "XFree86 Setup Utility", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_SET }, { "9set", "XFree86 Setup Utility for PC98 machines", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_9SET }, { "sources", "XFree86 3.3.3.1 standard sources", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_SRC }, { "csources", "XFree86 3.3.3.1 contrib sources", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_CSRC }, { "All", "Select all of the above", NULL, setX11Misc, NULL, NULL, ' ', ' ', ' ' }, { "Clear", "Reset all of the above", NULL, clearX11Misc, NULL, NULL, ' ', ' ', ' ' }, { "Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { 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).", "Press F1 to read the XFree86 release notes for FreeBSD", "XF86", { { "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 }, { "All", "All fonts", NULL, setX11Fonts, NULL, NULL, ' ', ' ', ' ' }, { "Clear", "Reset font selections", NULL, clearX11Fonts, NULL, NULL, ' ', ' ', ' ' }, { "Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { 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.", "Press F1 to read the XFree86 release notes for FreeBSD", "XF86", { { "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 }, { "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 }, { "nest", "A nested server for testing purposes", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_NEST }, { "PC98", "Select an X server for a NEC PC98 [Submenu]", NULL, dmenuSubmenu, NULL, &MenuXF86SelectPC98Server, '>', ' ', '>', 0 }, { "All", "Select all of the above", NULL, setX11Servers, NULL, NULL, ' ', ' ', ' ' }, { "Clear", "Reset all of the above", NULL, clearX11Servers, NULL, NULL, ' ', ' ', ' ' }, { "Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { NULL } }, }; 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).", "Press F1 to read the XFree86 release notes for FreeBSD", "XF86", { { "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 }, { "Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { NULL } } }; 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]. To de-select it, press [SPACE] again.\n\n" "Select OK or Cancel to 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 chose \"other\"\n" "to enter an arbitrary URL for browsing.", "Press F1 for more help on what you see here.", "html", { { "Handbook", "The FreeBSD Handbook.", NULL, docShowDocument }, { "FAQ", "The Frequently Asked Questions guide.", NULL, docShowDocument }, { "Home", "The Home Pages for the FreeBSD Project (requires net)", NULL, docShowDocument }, { "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", { { "1 Options", "View/Set various installation options", NULL, optionsEditor }, #ifdef __alpha__ { "2 Label", "Label disk partitions", NULL, diskLabelEditor }, { "3 Distributions", "Select distribution(s) to extract", NULL, dmenuSubmenu, NULL, &MenuDistributions }, { "4 Media", "Choose the installation media type", NULL, dmenuSubmenu, NULL, &MenuMedia }, { "5 Commit", "Perform any pending Partition/Label/Extract actions", NULL, installCustomCommit }, #else { "2 Partition", "Allocate disk space for FreeBSD", NULL, diskPartitionEditor }, { "3 Label", "Label allocated 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 }, #endif { "0 Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { NULL } }, }; /* MBR type menu */ DMenu MenuMBRType = { DMENU_RADIO_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 }, { "Standard", "Install a standard MBR (no boot manager)", dmenuRadioCheck, dmenuSetValue, NULL, &BootMgr, '(', '*', ')', 1 }, { "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", { { "D Distributions", "Install additional distribution sets", NULL, distExtractAll }, { "P Packages", "Install pre-packaged software for FreeBSD", NULL, configPackages }, { "R Root Password", "Set the system manager's password", NULL, dmenuSystemCommand, NULL, "passwd root" }, { "L Label", "The disk Label editor", NULL, diskLabelEditor }, { "F Fdisk", "The disk Slice (PC-style partition) Editor", NULL, diskPartitionEditor }, { "1 User Management", "Add user and group information", NULL, dmenuSubmenu, NULL, &MenuUsermgmt }, { "2 Console", "Customize system console behavior", NULL, dmenuSubmenu, NULL, &MenuSyscons }, { "3 Time Zone", "Set which time zone you're in", NULL, dmenuSystemCommand, NULL, "tzsetup" }, { "4 Media", "Change the installation media type", NULL, dmenuSubmenu, NULL, &MenuMedia }, { "5 Mouse", "Configure your mouse", NULL, dmenuSubmenu, NULL, &MenuMouse, NULL }, { "6 Networking", "Configure additional network services", NULL, dmenuSubmenu, NULL, &MenuNetworking }, { "7 Startup", "Configure system startup options", NULL, dmenuSubmenu, NULL, &MenuStartup }, { "8 Options", "View/Set various installation options", NULL, optionsEditor }, { "D HTML Docs", "Go to the HTML documentation menu (post-install)", NULL, docBrowser }, { "X XFree86", "Configure XFree86", NULL, configXEnvironment }, - { "U Register", "Register yourself or company as a FreeBSD user.", NULL, configRegister }, { "E Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { 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. Remember to use SPACE to select items! The\n" "RETURN key will leave this menu (as with all checkbox menus).", NULL, NULL, { { "APM", "Auto-power management services (typically laptops)", dmenuVarCheck, dmenuToggleVariable, NULL, "apm_enable=YES" }, { "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" }, { " ", " -- ", 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 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" }, { "linux", "This host wants to be able to run linux binaries.", dmenuVarCheck, dmenuToggleVariable, NULL, "linux_enable=YES" }, { "quotas", "This host wishes to check quotas on startup.", dmenuVarCheck, dmenuToggleVariable, NULL, "check_quotas=YES" }, { "SCO", "This host wants to be able to run IBCS2 binaries.", dmenuVarCheck, dmenuToggleVariable, NULL, "ibcs2_enable=YES" }, { "Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { 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, { { "Interfaces", "Configure additional network interfaces", NULL, tcpMenuSelect }, { "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" }, { "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" }, { "TCP Extensions", "Allow RFC1323 and RFC1644 TCP extensions?", dmenuVarCheck, dmenuToggleVariable, NULL, "tcp_extensions=YES" }, { "Gateway", "This machine will route packets between interfaces", dmenuVarCheck, dmenuToggleVariable, NULL, "gateway_enable=YES" }, { "Ntpdate", "Select a clock-synchronization server", dmenuVarCheck, dmenuSubmenu, NULL, &MenuNTP, '[', 'X', ']', "ntpdate_enable=YES" }, { "router", "Select routing daemon (default: routed)", dmenuVarCheck, configRouter, NULL, "router" }, { "Rwhod", "This machine wants to run the rwho daemon", dmenuVarCheck, dmenuToggleVariable, NULL, "rwhod_enable=YES" }, { "Anon FTP", "This machine wishes to allow anonymous FTP.", dmenuVarCheck, configAnonFTP, NULL, "anon_ftp" }, { "PCNFSD", "Run authentication server for clients with PC-NFS.", dmenuVarCheck, configPCNFSD, NULL, "pcnfsd" }, { "Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { NULL } }, }; DMenu MenuNTP = { DMENU_RADIO_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 }, { "Australia", "ntp.syd.dms.csiro.au (HP 5061 Cesium Beam)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.syd.dms.csiro.au" }, { "Canada", "tick.usask.ca (GOES clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tick.usask.ca" }, { "France", "canon.inria.fr (TDF clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=canon.inria.fr" }, { "Germany", "ntps1-{0,1,2}.uni-erlangen.de (GPS)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntps1-0.uni-erlangen.de" }, { "Germany #2", "ntps1-0.cs.tu-berlin.de (GPS)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntps1-0.cs.tu-berlin.de" }, { "Japan", "clock.nc.fukuoka-u.ac.jp (GPS clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock.nc.fukuoka-u.ac.jp" }, { "Japan #2", "clock.tl.fukuoka-u.ac.jp (GPS clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock.tl.fukuoka-u.ac.jp" }, { "Netherlands", "ntp0.nl.net (GPS clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp0.nl.net" }, { "Norway", "timer.unik.no (NTP clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=timer.unik.no" }, { "Sweden", "Time1.Stupi.SE (Cesium/GPS)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=Time1.Stupi.SE" }, { "Switzerland", "swisstime.ethz.ch (DCF77 clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=swisstime.ethz.ch" }, { "U.S. East Coast", "bitsy.mit.edu (WWV clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=bitsy.mit.edu" }, { "U.S. East Coast #2", "otc1.psu.edu (WWV clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=otc1.psu.edu" }, { "U.S. West Coast", "apple.com (WWV clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=apple.com" }, { "U.S. West Coast #2", "clepsydra.dec.com (GOES clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clepsydra.dec.com" }, { "U.S. West Coast #3", "clock.llnl.gov (WWVB clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock.llnl.gov" }, { "U.S. Midwest", "ncar.ucar.edu (WWVB clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ncar.ucar.edu" }, { "U.S. Pacific", "chantry.hawaii.net (WWV/H clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=chantry.hawaii.net" }, { "U.S. Southwest", "shorty.chpc.utexas.edu (WWV clock)", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=shorty.chpc.utexas.edu" }, { 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, { { "Font", "Choose an alternate screen font", NULL, dmenuSubmenu, NULL, &MenuSysconsFont }, { "Keymap", "Choose an alternate keyboard map", NULL, dmenuSubmenu, NULL, &MenuSysconsKeymap }, { "Repeat", "Set the rate at which keys repeat", NULL, dmenuSubmenu, NULL, &MenuSysconsKeyrate }, { "Saver", "Configure the screen saver", NULL, dmenuSubmenu, NULL, &MenuSysconsSaver }, { "Screenmap", "Choose an alternate screenmap", NULL, dmenuSubmenu, NULL, &MenuSysconsScrnmap }, { "Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { NULL } }, }; DMenu MenuSysconsKeymap = { DMENU_RADIO_TYPE | DMENU_SELECTION_RETURNS, "System Console Keymap", "The default system console driver for FreeBSD (syscons) defaults\n" "to a standard \"American\" keyboard map. Users in other countries\n" "(or with different keyboard preferences) may wish to choose one of\n" "the other keymaps below.\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" }, { "Croatian ISO", "Croatian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=hr.iso" }, { "Danish CP865", "Danish Code Page 865 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=danish.cp865" }, { "Danish ISO", "Danish ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=danish.iso" }, { "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" }, { "Latin American", "Latin American ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=lat-amer" }, { "Japanese 106", "Japanese 106 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=jp.106" }, { "Norway ISO", "Norwegian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=norwegian.iso" }, { "Polish ISO", "Polish ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=pl_PL.ISO_8859-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 CP866", "Russian CP866 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=ru.cp866" }, { "Russia KOI8-R", "Russian KOI8-R keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=ru.koi8-r" }, { "Slovenian", "Slovenian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=si.iso.acc" }, { "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", "Swiss French ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swissfrench.iso" }, { "Swiss German", "Swiss German ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swissgerman.iso" }, { "U.K. CP850", "United Kingdom Code Page 850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=uk.cp850" }, { "U.K. ISO", "United Kingdom ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=uk.iso" }, { "U.S. Dvorak", "United States Dvorak keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=us.dvorak" }, { "U.S. ISO", "United States ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=us.iso" }, { NULL } }, }; DMenu MenuSysconsKeyrate = { DMENU_RADIO_TYPE | DMENU_SELECTION_RETURNS, "System Console Keyboard Repeat Rate", "This menu allows you to set the speed at which keys repeat\n" "when held down.", "Choose a keyboard repeat rate", NULL, { { "Slow", "Slow keyboard repeat rate", 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_RADIO_TYPE | DMENU_SELECTION_RETURNS, "System Console Screen Saver", "By default, the console driver will not attempt to do anything\n" "special with your screen when it's idle. If you expect to leave your\n" "monitor switched on and idle for long periods of time then you should\n" "probably enable one of these screen savers to prevent phosphor burn-in.", "Choose a nifty-looking screen saver", NULL, { { "Blank", "Simply blank the screen", dmenuVarCheck, configSaver, NULL, "saver=blank" }, { "Daemon", "\"BSD Daemon\" animated screen saver (text)", dmenuVarCheck, configSaver, NULL, "saver=daemon" }, { "Fade", "Fade out effect screen saver", dmenuVarCheck, configSaver, NULL, "saver=fade" }, { "Green", "\"Green\" power saving mode (if supported by monitor)", dmenuVarCheck, configSaver, NULL, "saver=green" }, { "Logo", "\"BSD Daemon\" animated screen saver (graphics)", dmenuVarCheck, configSaver, NULL, "saver=logo" }, { "Rain", "Rain drops screen saver", dmenuVarCheck, configSaver, NULL, "saver=rain" }, { "Snake", "Draw a FreeBSD \"snake\" on your screen", dmenuVarCheck, configSaver, NULL, "saver=snake" }, { "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_RADIO_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, { { "None", "No screenmap, use default font", dmenuVarCheck, dmenuSetVariable, NULL, "scrnmap=NO" }, { "KOI8-R to IBM866", "Russian KOI8-R to IBM 866 screenmap", dmenuVarCheck, dmenuSetVariable, NULL, "scrnmap=koi8-r2cp866" }, { "ISO 8859-1 to IBM437", "W-Europe ISO 8859-1 to IBM 437 screenmap", dmenuVarCheck, dmenuSetVariable, NULL, "scrnmap=iso-8859-1_to_cp437" }, { NULL } }, }; DMenu MenuSysconsFont = { DMENU_RADIO_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, { { "None", "Use default font", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=NO,font8x14=NO,font8x16=NO" }, { "IBM 437", "English", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp437-8x8,font8x14=cp437-8x14,font8x16=cp437-8x16" }, { "IBM 850", "Western Europe, IBM encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp850-8x8,font8x14=cp850-8x14,font8x16=cp850-8x16" }, { "IBM 865", "Norwegian, IBM encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp865-8x8,font8x14=cp865-8x14,font8x16=cp865-8x16" }, { "IBM 866", "Russian, IBM encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp866-8x8,font8x14=cp866-8x14,font8x16=cp866-8x16" }, { "ISO 8859-1", "Western Europe, ISO encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=iso-8x8,font8x14=iso-8x14,font8x16=iso-8x16" }, { "KOI8-R", "Russian, KOI8-R encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=koi8-r-8x8,font8x14=koi8-r-8x14,font8x16=koi8-r-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, { { "Add user", "Add a new user to the system.", NULL, userAddUser }, { "Add group", "Add a new user group to the system.", NULL, userAddGroup }, { "Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { 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 2nd FreeBSD CDROM, 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", { { "1 CDROM", "Use the 2nd \"live\" CDROM from the distribution", NULL, installFixitCDROM }, { "2 Floppy", "Use a floppy generated from the fixit image", NULL, installFixitFloppy }, { "3 Shell", "Start an Emergency Holographic Shell", NULL, installFixitHoloShell }, { NULL } }, }; diff --git a/usr.sbin/sysinstall/sysinstall.8 b/usr.sbin/sysinstall/sysinstall.8 index c6e7fcbc9126..054c5cbf4194 100644 --- a/usr.sbin/sysinstall/sysinstall.8 +++ b/usr.sbin/sysinstall/sysinstall.8 @@ -1,802 +1,794 @@ .\" Copyright (c) 1997 .\" 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. .\" 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 AND CONTRIBUTORS ``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 CONTRIBUTORS 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, 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. .\" -.\" $Id: sysinstall.8,v 1.15 1999/02/05 09:28:16 jkh Exp $ +.\" $Id: sysinstall.8,v 1.16 1999/02/18 23:59:58 jkh Exp $ .\" .Dd August 9, 1997 .Dt SYSINSTALL 8 .Os .Sh NAME .Nm sysinstall .Nd system installation and configuration tool .Sh SYNOPSIS .Nm .Op Ar var=value .Op Ar function .Op Ar ... .Sh DESCRIPTION .Nm is a utility for installing and configuring FreeBSD systems. It is the first utility invoked by the FreeBSD installation boot floppy and is also copied into .Pa /stand/sysinstall on newly installed FreeBSD systems for use in later configuring the system. .Pp The .Nm program is generally invoked without arguments for the default behavior, where the main installation/configuration menu is presented. On those occasions where it is deemed necessary to invoke a subsystem of sysinstall directly, however, it is also possible to do so by naming the appropriate function entry points on the command line. Since this action is essentially identical to running an installation script, each command-line argument corresponding to a line of script, the reader is encouraged to read the section on scripting for more information on this feature. .Pp .Sh NOTES .Nm is essentially nothing more than a monolithic C program with the ability to write MBRs and disk labels (through the services of the .Xr libdisk 3 library) and install distributions or packages onto new and existing FreeBSD systems. It also contains some extra intelligence for running as a replacement for .Xr init 8 when it's invoked by the FreeBSD installation boot procedure. It assumes very little in the way of additional utility support and performs most file system operations by calling the relevant syscalls (such as .Xr mount 2 ) directly. .Pp .Nm currently uses the .Xr libdialog 3 library to do user interaction with simple ANSI line graphics, color support for which is enabled by either running on a syscons VTY or some other color-capable terminal emulator (newer versions of xterm will support color when using the ``xterm-color'' termcap entry). .Pp This product is currently at the end of its life cycle and will be replaced in FreeBSD 3.1 (hopefully) by the .Xr setup 1 utility. .Sh RUNNING SCRIPTS .Nm may be either driven interactively through its various internal menus or run in batch mode, driven by an external script. Such a script may be loaded and executed in one of 3 ways: .Bl -tag -width Ds -compact .It Sy "LOAD_CONFIG_FILE" If .Nm is compiled with LOAD_CONFIG_FILE set in the environment (or in the Makefile) to some value, then that value will be used as the filename to automatically look for and load when .Nm starts up and with no user interaction required. This option is aimed primarily at large sites who wish to create a single prototype install for multiple machines with largely identical configurations and/or installation options. .It Sy "MAIN MENU" If .Nm is run interactively, that is to say in the default manner, it will bring up a main menu which contains a "load config file" option. Selecting this option will prompt for the name of a script file which it then will attempt to load from a DOS or UFS formatted floppy. .It Sy "COMMAND LINE" Each command line argument is treated as a script directive when .Nm is run in multi-user mode. Execution ends either by explicit request (e.g. calling the .Ar shutdown directive), upon reaching the end of the argument list or on error. .Pp For example: .nf /stand/sysinstall _ftpPath=ftp:/ziggy/pub/ mediaSetFTP configPackages .fi Would initialize .Nm for FTP installation media (using the server `ziggy') and then bring up the package installation editor, exiting when finished. .El .Pp .Sh SCRIPT SYNTAX A script is a list of one or more directives, each directive taking the form of: .Ar var=value .Pp .Ar function .Pp or .Ar #somecomment Where .Ar var=value is the assignment of some internal .Nm variable, e.g. "ftpPass=FuNkYChiKn", and .Ar function is the name of an internal .Nm function, e.g. "mediaSetFTP", and .Ar #comment is a single-line comment for documentation purposes (ignored by sysinstall). Each directive must be by itself on a single line, functions taking their arguments by examining known variable names. This requires that you be sure to assign the relevant variables before calling a function which requires them. When and where a function depends on the settings of one or more variables will be noted in the following table: .Pp \fBFunction Glossary:\fR .Pp .Bl -tag -width indent .It configAnonFTP Invoke the Anonymous FTP configuration menu. .Pp \fBVariables:\fR None .It configRouter Select which routing daemon you wish to use, potentially loading any required 3rd-party routing daemons as necessary. .Pp \fBVariables:\fR .Bl -tag -width indent .It router can be set to the name of the desired routing daemon, e.g. ``routed'' or ``gated'', otherwise it is prompted for. .El .It configNFSServer Configure host as an NFS server. .Pp \fBVariables:\fR None .It configNTP Configure host as a user of the Network Time Protocol. .Pp \fBVariables:\fR .Bl -tag -width indent .It ntpdate_flags The flags to .Xr ntpdate 8 , that is to say the name of the server to sync from. .El .It configPCNFSD Configure host to support PC NFS. .Pp \fBVariables:\fR .Bl -tag -width indent .It pcnfsd_pkg The name of the PCNFSD package to load if necessary (defaults to hard coded version). .El .It configPackages Bring up the interactive package management menu. .Pp \fBVariables:\fR None -.It configRegister -Register the user with the FreeBSD counter. -.Pp -\fBVariables:\fR None .It configUsers Add users and/or groups to the system. .Pp \fBVariables:\fR None .It configXEnvironment Configure the X display subsystem. .Pp \fBVariables:\fR None .It diskPartitionEditor Invokes the disk partition (MBR) editor. .Pp \fBVariables:\fR .Bl -tag -width findx .It geometry The disk geometry, as a cyls/heads/sectors formatted string. Default: no change to geometry. .It partition Set to disk partitioning type or size, its value being .Ar free in order to use only remaining free space for FreeBSD, .Ar all to use the entire disk for FreeBSD but maintain a proper partition table, .Ar existing to use an existing FreeBSD partition (first found), .Ar exclusive to use the disk in ``dangerously dedicated'' mode or, finally, .Ar somenumber to allocate .Ar somenumber blocks of available free space to a new FreeBSD partition. Default: Interactive mode. .It bootManager is set to one of .Ar boot to signify the installation of a boot manager, .Ar standard to signify installation of a "standard" non-boot MGR DOS MBR or .Ar none to indicate that no change to the boot manager is desired. Default: none. .El .Pp Note: Nothing is actually written to disk by this function, a explicit call to .Ar diskPartitionWrite being required for that to happen. .It diskPartitionWrite Causes any pending MBR changes (typically from the .Ar diskPartitionEditor function) to be written out. .Pp \fBVariables:\fR None .It diskLabelEditor Invokes the disk label editor. This is a bit trickier from a script since you need to essentially label everything inside each FreeBSD (type 0xA5) partition created by the .Ar diskPartitionEditor function, and that requires knowing a few rules about how things are laid out. When creating a script to automatically allocate disk space and partition it up, it is suggested that you first perform the installation interactively at least once and take careful notes as to what the slice names will be, then and only then hardwiring them into the script. .Pp For example, let's say you have a SCSI disk on which you've created a new FreeBSD partition in slice 2 (your DOS partition residing in slice 1). The slice name would be .Ar da0s2 for the whole FreeBSD partition ( .Ar da0s1 being your DOS primary partition). Now let's further assume that you have 500MB in this partition and you want to sub-partition that space into root, swap, var and usr file systems for FreeBSD. Your invocation of the .Ar diskLabelEditor function might involve setting the following variables: .Bl -tag -width findx .It Li "da0s2-1=ufs 40960 /" A 20MB root file system (all sizes are in 512 byte blocks). .It Li "da0s2-2=swap 131072 /" A 64MB swap partition. .It Li "da0s2-3=ufs 204800 /var" A 100MB /var file system. .It Li "da0s2-4=ufs 0 /usr" With the balance of free space (around 316MB) going to the /usr file system. .El One can also use the .Ar diskLabelEditor for mounting or erasing existing partitions as well as creating new ones. Using the previous example again, let's say that we also wanted to mount our DOS partition and make sure that an .Pa /etc/fstab entry is created for it in the new installation. Before calling the .Ar diskLabelEditor function, we simply add an additional line: .nf da0s1=/dos_c N .fi before the call. This tells the label editor that you want to mount the first slice on .Pa /dos_c and not to attempt to newfs it (not that .Nm would attempt this for a DOS partition in any case, but it could just as easily be an existing UFS partition being named here and the 2nd field is non-optional). .Pp Note: No file system data is actually written to disk until an explicit call to .Ar diskLabelCommit is made. .It diskLabelCommit Writes out all pending disklabel information and creates and/or mounts any file systems which have requests pending from the .Ar diskLabelEditor function. .Pp \fBVariables:\fR None .It distReset Resets all selected distributions to the empty set (no distributions selected). .Pp \fBVariables:\fR None .It distSetCustom Allows the selection of a custom distribution set (e.g. not just on of the existing "canned" sets) with no user interaction. \fBVariables:\fR .Bl -tag -width indent .It dists List of distributions to load. Possible distribution values are: .Bl -tag -width indent .It Li bin The base binary distribution. .It Li doc Miscellaneous documentation .It Li games Games .It Li manpages Manual pages (unformatted) .It Li catpages Pre-formatted manual pages .It Li proflibs Profiled libraries for developers. .It Li dict Dictionary information (for tools like spell). .It Li info GNU info files and other extra docs. .It Li des DES encryption binaries and libraries. .It Li compat1x Compatibility with FreeBSD 1.x .It Li compat20 Compatibility with FreeBSD 2.0 .It Li compat21 Compatibility with FreeBSD 2.1 .It Li ports The ports collection. .It Li krb Kerberos binaries. .It Li ssecure /usr/src/secure .It Li sebones /usr/src/eBones .It Li sbase /usr/src/[top level files] .It Li scontrib /usr/src/contrib .It Li sgnu /usr/src/gnu .It Li setc /usr/src/etc .It Li sgames /usr/src/games .It Li sinclude /usr/src/include .It Li slib /usr/src/lib .It Li slibexec /usr/src/libexec .It Li srelease /usr/src/release .It Li sbin /usr/src/bin .It Li ssbin /usr/src/sbin .It Li sshare /usr/src/share .It Li ssys /usr/src/sys .It Li subin /usr/src/usr.bin .It Li susbin /usr/src/usr.sbin .It Li ssmailcf /usr/src/usr.sbin/sendmail/cf .It Li XF86-xc XFree86 official sources. .It Li XF86-co XFree86 contributed sources. .It Li Xbin XFree86 3.3.3.1 binaries. .It Li Xcfg XFree86 3.3.3.1 configuration files. .It Li Xdoc XFree86 3.3.3.1 documentation. .It Li Xhtml XFree86 3.3.3.1 HTML documentation. .It Li Xlib XFree86 3.3.3.1 libraries. .It Li Xlk98 XFree86 3.3.3.1 server link-kit for PC98 machines. .It Li Xlkit XFree86 3.3.3.1 server link-kit for standard machines. .It Li Xman XFree86 3.3.3.1 manual pages. .It Li Xprog XFree86 3.3.3.1 programmer's distribution. .It Li Xps XFree86 3.3.3.1 postscript documentation. .It Li Xset XFree86 3.3.3.1 graphical setup tool. .It Li X8514 XFree86 3.3.3.1 8514 server. .It Li X9480 XFree86 3.3.3.1 PC98 8-bit (256 color) PEGC-480 server. .It Li X9EGC XFree86 3.3.3.1 PC98 4-bit (16 color) EGC server. .It Li X9GA9 XFree86 3.3.3.1 PC98 GA-968V4/PCI (S3 968) server. .It Li X9GAN XFree86 3.3.3.1 PC98 GANB-WAP (cirrus) server. .It Li X9LPW XFree86 3.3.3.1 PC98 PowerWindowLB (S3) server. .It Li X9NKV XFree86 3.3.3.1 PC98 NKV-NEC (cirrus) server. .It Li X9NS3 XFree86 3.3.3.1 PC98 NEC (S3) server. .It Li X9SPW XFree86 3.3.3.1 PC98 SKB-PowerWindow (S3) server. .It Li X9TGU XFree86 3.3.3.1 PC98 Cyber9320 and TGUI9680 server. .It Li X9WEP XFree86 3.3.3.1 PC98 WAB-EP (cirrus) server. .It Li X9WS XFree86 3.3.3.1 PC98 WABS (cirrus) server. .It Li X9WSN XFree86 3.3.3.1 PC98 WSN-A2F (cirrus) server. .It Li XAGX XFree86 3.3.3.1 8 bit AGX server. .It Li XI128 XFree86 3.3.3.1 #9 Imagine I128 server. .It Li XMa8 XFree86 3.3.3.1 ATI Mach8 server. .It Li XMa32 XFree86 3.3.3.1 ATI Mach32 server. .It Li XMa64 XFree86 3.3.3.1 ATI Mach64 server. .It Li XMono XFree86 3.3.3.1 monochrome server. .It Li XP9K XFree86 3.3.3.1 P9000 server. .It Li XS3 XFree86 3.3.3.1 S3 server. .It Li XS3V XFree86 3.3.3.1 S3 Virge server. .It Li XSVGA XFree86 3.3.3.1 SVGA server. .It Li XVG16 XFree86 3.3.3.1 VGA16 server. .It Li XW32 XFree86 3.3.3.1 ET4000/W32, /W32i and /W32p server. .It Li Xnest XFree86 3.3.3.1 nested X server. .It Li Xvfb XFree86 3.3.3.1 virtual frame-buffer X server. .It Li Xfnts XFree86 3.3.3.1 base font set. .It Li Xf100 XFree86 3.3.3.1 100DPI font set. .It Li Xfcyr XFree86 3.3.3.1 Cyrillic font set. .It Li Xfscl XFree86 3.3.3.1 scalable font set. .It Li Xfnon XFree86 3.3.3.1 non-english font set. .It Li Xfsrv XFree86 3.3.3.1 font server. .El .It distSetDeveloper Selects the standard Developer's distribution set. .Pp \fBVariables:\fR None .It distSetXDeveloper Selects the standard X Developer's distribution set. .Pp \fBVariables:\fR None .It distSetKernDeveloper Selects the standard kernel Developer's distribution set. .Pp \fBVariables:\fR None .It distSetUser Selects the standard user distribution set. .Pp \fBVariables:\fR None .It distSetXUser Selects the standard X user's distribution set. .Pp \fBVariables:\fR None .It distSetMinimum Selects the very minimum distribution set. .Pp \fBVariables:\fR None .It distSetEverything Selects the full whack - all available distributions. .Pp \fBVariables:\fR None .It distSetDES Interactively select DES subcomponents. .Pp \fBVariables:\fR None .It distSetSrc Interactively select source subcomponents. .Pp \fBVariables:\fR None .It distSetXF86 Interactively select XFree86 3.3.3.1 subcomponents. .Pp \fBVariables:\fR None .It distExtractAll Install all currently selected distributions (requires that media device also be selected). .Pp \fBVariables:\fR None .It docBrowser Install (if necessary) an HTML documentation browser and go to the HTML documentation submenu. .Pp \fBVariables:\fR .Bl -tag -width indent .It browserPackage The name of the browser package to try and install as necessary. Defaults to latest lynx package. .It browserBinary The name of the browser binary itself (if overriding the .Ar browserPackage variable). Defaults to lynx. .El .It installCommit .Pp Commit any and all pending changes to disk. This function is essentially shorthand for a number of more granular "commit" functions. \fBVariables:\fR None .It installExpress Start an "express" installation, asking few questions of the user. .Pp \fBVariables:\fR None .It installNovice Start a "novice" installation, the most user-friendly installation type available. .Pp \fBVariables:\fR None .It installUpgrade Start an upgrade installation. .Pp \fBVariables:\fR None .It installFixitHoloShell Start up the "emergency holographic shell" over on VTY4 if running as init. .Pp \fBVariables:\fR None .It installFixitCDROM Go into "fixit" mode, assuming a live file system CDROM currently in the drive. .Pp \fBVariables:\fR None .It installFixitFloppy Go into "fixit" mode, assuming an available fixit floppy disk (user will be prompted for it). .Pp \fBVariables:\fR None .It installFilesystems Do just the file system initialization part of an install. .Pp \fBVariables:\fR None .It installVarDefaults Initialize all variables to their defaults, overriding any previous settings. .Pp \fBVariables:\fR None .It loadConfig Sort of like an #include statement, it allows you to load one configuration file from another. .Pp \fBVariables:\fR .Bl -tag -width indent .It file The fully pathname of the file to load. .El .It mediaSetCDROM Select a FreeBSD CDROM as the installation media. .Pp \fBVariables:\fR None .It mediaSetFloppy Select a pre-made floppy installation set as the installation media. .Pp \fBVariables:\fR None .It mediaSetDOS Select an existing DOS primary partition as the installation media. The first primary partition found is used (e.g. C:). .Pp \fBVariables:\fR None .It mediaSetTape Select a tape device as the installation media. .Pp \fBVariables:\fR None .It mediaSetFTP Select an FTP site as the installation media. .Pp \fBVariables:\fR .Bl -tag -width indent .It hostname The name of the host being installed (non-optional). .It domainname The domain name of the host being installed (optional). .It defaultrouter The default router for this host (non-optional). .It netDev Which host interface to use ( .Ar ed0 or .Ar ep0 , for example. Non-optional). .It netInteractive If set, bring up the interactive network setup form even if all relevant configuration variables are already set (optional). .It ipaddr The IP address for the selected host interface (non-optional). .It netmask The netmask for the selected host interface (non-optional). .It _ftpPath The fully qualified URL of the FTP site containing the FreeBSD distribution you're interested in, e.g. .Ar ftp://ftp.freebsd.org/pub/FreeBSD/ . .El .It mediaSetFTPActive Alias for .Ar mediaSetFTP using "active" FTP transfer mode. .Pp \fBVariables:\fR Same as for .Ar mediaSetFTP . .It mediaSetFTPPassive Alias for .Ar mediaSetFTP using "passive" FTP transfer mode. .Pp \fBVariables:\fR Same as for .Ar mediaSetFTP . .It mediaSetUFS Select an existing UFS partition (mounted with the label editor) as the installation media. .Pp \fBVariables:\fR .Bl -tag -width indent .It ufs full /path to directory containing the FreeBSD distribution you're interested in. .El .It mediaSetNFS .Pp \fBVariables:\fR .Bl -tag -width indent .It hostname The name of the host being installed (non-optional). .It domainname The domain name of the host being installed (optional). .It defaultrouter The default router for this host (non-optional). .It netDev Which host interface to use ( .Ar ed0 or .Ar ep0 , for example. Non-optional). .It netInteractive If set, bring up the interactive network setup form even if all relevant configuration variables are already set (optional). .It ipaddr The IP address for the selected host interface (non-optional). .It netmask The netmask for the selected host interface (non-optional). .It nfs full hostname:/path specification for directory containing the FreeBSD distribution you're interested in. .El .It mediaSetFTPUserPass .Pp \fBVariables:\fR .Bl -tag -width indent .It ftpUser The username to log in as on the ftp server site. Default: ftp .It ftpPass The password to use for this username on the ftp server site. Default: user@host .El .It mediaSetCPIOVerbosity .Pp \fBVariables:\fR .Bl -tag -width indent .It cpioVerbose Can be used to set the verbosity of cpio extractions to low, medium or high. .El .It mediaGetType Interactively get the user to specify some type of media. .Pp \fBVariables:\fR None .It optionsEditor Invoke the interactive options editor. .Pp \fBVariables:\fR None -.It register -Bring up the FreeBSD registration form. -.Pp -\fBVariables:\fR None .It packageAdd Try to fetch and add a package to the system (requires that a media type be set), .Pp \fBVariables:\fR .Bl -tag -width indent .It package The name of the package to add, e.g. bash-1.14.7 or ncftp-2.4.2. .El .It addGroup Invoke the interactive group editor. .Pp \fBVariables:\fR None .It addUser Invoke the interactive user editor. .Pp \fBVariables:\fR None .It shutdown Stop the script and terminate sysinstall. .Pp \fBVariables:\fR None .It system Execute an arbitrary command with .Xr system 3 .Pp \fBVariables:\fR .Bl -tag -width indent .It command The name of the command to execute. When running from a boot floppy, very minimal expectations should be made as to what's available until/unless a relatively full system installation has just been done. .El .El .Sh FILES This utility may edit the contents of .Pa /etc/rc.conf , .Pa /etc/hosts , and .Pa /etc/resolv.conf as necessary to reflect changes in the network configuration. .Sh SEE ALSO If you have a reasonably complete source tree online, take a look at .Pa /usr/src/release/sysinstall/install.cfg for a sample installation script. .Sh BUGS This utility is a prototype which lasted approximately 3 years past its expiration date and is greatly in need of death. .Sh AUTHOR Jordan K. Hubbard .Sh HISTORY This version of .Nm first appeared in .Fx 2.0 . diff --git a/usr.sbin/sysinstall/sysinstall.h b/usr.sbin/sysinstall/sysinstall.h index 8f171d1c8dc4..bc7f6732981e 100644 --- a/usr.sbin/sysinstall/sysinstall.h +++ b/usr.sbin/sysinstall/sysinstall.h @@ -1,722 +1,718 @@ /* * The new sysinstall program. * * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: sysinstall.h,v 1.159 1999/03/19 10:54:38 jkh Exp $ + * $Id: sysinstall.h,v 1.160 1999/04/06 08:25:53 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer, * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * 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 _SYSINSTALL_H_INCLUDE #define _SYSINSTALL_H_INCLUDE #include #include #include #include #include #include #include #include #include #include "ui_objects.h" #include "dir.h" #include "colors.h" #include "libdisk.h" #include "dist.h" /*** Defines ***/ /* device limits */ #define DEV_NAME_MAX 64 /* The maximum length of a device name */ #define DEV_MAX 100 /* The maximum number of devices we'll deal with */ #define INTERFACE_MAX 50 /* Maximum number of network interfaces we'll deal with */ #define IO_ERROR -2 /* Status code for I/O error rather than normal EOF */ /* Number of seconds to wait for data to come off even the slowest media */ #define MEDIA_TIMEOUT 300 /* * I make some pretty gross assumptions about having a max of 50 chunks * total - 8 slices and 42 partitions. I can't easily display many more * than that on the screen at once! * * For 2.1 I'll revisit this and try to make it more dynamic, but since * this will catch 99.99% of all possible cases, I'm not too worried. */ #define MAX_CHUNKS 40 /* Internal environment variable names */ #define DISK_PARTITIONED "_diskPartitioned" #define DISK_LABELLED "_diskLabelled" #define DISK_SELECTED "_diskSelected" #define SYSTEM_STATE "_systemState" #define RUNNING_ON_ROOT "_runningOnRoot" #define TCP_CONFIGURED "_tcpConfigured" /* Ones that can be tweaked from config files */ #define VAR_BLANKTIME "blanktime" #define VAR_BOOTMGR "bootManager" #define VAR_BROWSER_BINARY "browserBinary" #define VAR_BROWSER_PACKAGE "browserPackage" #define VAR_CPIO_VERBOSITY "cpioVerbose" #define VAR_DEBUG "debug" #define VAR_DISK "disk" #define VAR_DISTS "dists" #define VAR_DIST_MAIN "distMain" #define VAR_DIST_DES "distDES" #define VAR_DIST_SRC "distSRC" #define VAR_DIST_X11 "distX11" #define VAR_DIST_XSERVER "distXserver" #define VAR_DIST_XFONTS "distXfonts" #define VAR_DEDICATE_DISK "dedicateDisk" #define VAR_DOMAINNAME "domainname" #define VAR_EDITOR "editor" #define VAR_EXTRAS "ifconfig_" #define VAR_COMMAND "command" #define VAR_CONFIG_FILE "configFile" #define VAR_FTP_DIR "ftpDirectory" #define VAR_FTP_PASS "ftpPass" #define VAR_FTP_PATH "_ftpPath" #define VAR_FTP_PORT "ftpPort" #define VAR_FTP_STATE "ftpState" #define VAR_FTP_USER "ftpUser" #define VAR_FTP_HOST "ftpHost" #define VAR_GATED_PKG "gated_pkg" #define VAR_GATEWAY "defaultrouter" #define VAR_GEOMETRY "geometry" #define VAR_HOSTNAME "hostname" #define VAR_IFCONFIG "ifconfig_" #define VAR_INTERFACES "network_interfaces" #define VAR_INSTALL_CFG "installConfig" #define VAR_INSTALL_ROOT "installRoot" #define VAR_IPADDR "ipaddr" #define VAR_KEYMAP "keymap" #define VAR_LABEL "label" #define VAR_LABEL_COUNT "labelCount" #define VAR_MEDIA_TYPE "mediaType" #define VAR_MEDIA_TIMEOUT "MEDIA_TIMEOUT" #define VAR_MOUSED "moused_enable" #define VAR_MOUSED_PORT "moused_port" #define VAR_MOUSED_TYPE "moused_type" #define VAR_NAMESERVER "nameserver" #define VAR_NETINTERACTIVE "netInteractive" #define VAR_NETMASK "netmask" #define VAR_NETWORK_DEVICE "netDev" #define VAR_NFS_PATH "nfs" #define VAR_NFS_HOST "nfsHost" #define VAR_NFS_SECURE "nfs_reserved_port_only" #define VAR_NFS_SERVER "nfs_server_enable" #define VAR_NO_CONFIRM "noConfirm" #define VAR_NO_ERROR "noError" #define VAR_NO_WARN "noWarn" #define VAR_NO_USR "noUsr" #define VAR_NONINTERACTIVE "nonInteractive" #define VAR_NOVELL "novell" #define VAR_NTPDATE_FLAGS "ntpdate_flags" #define VAR_PACKAGE "package" #define VAR_PARTITION "partition" #define VAR_PCNFSD "pcnfsd" #define VAR_PCNFSD_PKG "pcnfsd_pkg" #define VAR_PKG_TMPDIR "PKG_TMPDIR" #define VAR_PORTS_PATH "ports" #define VAR_RELNAME "releaseName" #define VAR_ROOT_SIZE "rootSize" #define VAR_ROUTER "router" #define VAR_ROUTER_ENABLE "router_enable" #define VAR_ROUTERFLAGS "routerflags" #define VAR_SERIAL_SPEED "serialSpeed" #define VAR_SLOW_ETHER "slowEthernetCard" #define VAR_SWAP_SIZE "swapSize" #define VAR_TAPE_BLOCKSIZE "tapeBlocksize" #define VAR_UFS_PATH "ufs" #define VAR_USR_SIZE "usrSize" #define VAR_VAR_SIZE "varSize" #define VAR_XF86_CONFIG "_xf86config" #define DEFAULT_TAPE_BLOCKSIZE "20" /* One MB worth of blocks */ #define ONE_MEG 2048 /* Which selection attributes to use */ #define ATTR_SELECTED (ColorDisplay ? item_selected_attr : item_attr) #define ATTR_TITLE button_active_attr /* Handy strncpy() macro */ #define SAFE_STRCPY(to, from) sstrncpy((to), (from), sizeof (to) - 1) /*** Types ***/ typedef unsigned int Boolean; typedef struct disk Disk; typedef struct chunk Chunk; /* Bitfields for menu options */ #define DMENU_NORMAL_TYPE 0x1 /* Normal dialog menu */ #define DMENU_RADIO_TYPE 0x2 /* Radio dialog menu */ #define DMENU_CHECKLIST_TYPE 0x4 /* Multiple choice menu */ #define DMENU_SELECTION_RETURNS 0x8 /* Immediate return on item selection */ typedef struct _dmenu { int type; /* What sort of menu we are */ char *title; /* Our title */ char *prompt; /* Our prompt */ char *helpline; /* Line of help at bottom */ char *helpfile; /* Help file for "F1" */ dialogMenuItem items[0]; /* Array of menu items */ } DMenu; /* An rc.conf variable */ typedef struct _variable { struct _variable *next; char *name; char *value; int dirty; } Variable; #define NO_ECHO_OBJ(type) ((type) | (DITEM_NO_ECHO << 16)) #define TYPE_OF_OBJ(type) ((type) & 0xff) #define ATTR_OF_OBJ(type) ((type) >> 16) /* A screen layout structure */ typedef struct _layout { int y; /* x & Y co-ordinates */ int x; int len; /* The size of the dialog on the screen */ int maxlen; /* How much the user can type in ... */ char *prompt; /* The string for the prompt */ char *help; /* The display for the help line */ void *var; /* The var to set when this changes */ int type; /* The type of the dialog to create */ void *obj; /* The obj pointer returned by libdialog */ } Layout; typedef enum { DEVICE_TYPE_NONE, DEVICE_TYPE_DISK, DEVICE_TYPE_FLOPPY, DEVICE_TYPE_FTP, DEVICE_TYPE_NETWORK, DEVICE_TYPE_CDROM, DEVICE_TYPE_TAPE, DEVICE_TYPE_DOS, DEVICE_TYPE_UFS, DEVICE_TYPE_NFS, DEVICE_TYPE_ANY, } DeviceType; /* CDROM mount codes */ #define CD_UNMOUNTED 0 #define CD_ALREADY_MOUNTED 1 #define CD_WE_MOUNTED_IT 2 /* A "device" from sysinstall's point of view */ typedef struct _device { char name[DEV_NAME_MAX]; char *description; char *devname; DeviceType type; Boolean enabled; Boolean (*init)(struct _device *dev); FILE * (*get)(struct _device *dev, char *file, Boolean probe); void (*shutdown)(struct _device *dev); void *private; unsigned int flags; } Device; /* Some internal representations of partitions */ typedef enum { PART_NONE, PART_SLICE, PART_SWAP, PART_FILESYSTEM, PART_FAT, } PartType; /* The longest newfs command we'll hand to system() */ #define NEWFS_CMD_MAX 256 typedef struct _part_info { Boolean newfs; char mountpoint[FILENAME_MAX]; char newfs_cmd[NEWFS_CMD_MAX]; } PartInfo; /* An option */ typedef struct _opt { char *name; char *desc; enum { OPT_IS_STRING, OPT_IS_INT, OPT_IS_FUNC, OPT_IS_VAR } type; void *data; void *aux; char *(*check)(); } Option; /* Weird index nodey things we use for keeping track of package information */ typedef enum { PACKAGE, PLACE } node_type; /* Types of nodes */ typedef struct _pkgnode { /* A node in the reconstructed hierarchy */ struct _pkgnode *next; /* My next sibling */ node_type type; /* What am I? */ char *name; /* My name */ char *desc; /* My description (Hook) */ struct _pkgnode *kids; /* My little children */ void *data; /* A place to hang my data */ } PkgNode; typedef PkgNode *PkgNodePtr; /* A single package */ typedef struct _indexEntry { /* A single entry in an INDEX file */ char *name; /* name */ char *path; /* full path to port */ char *prefix; /* port prefix */ char *comment; /* one line description */ char *descrfile; /* path to description file */ char *deps; /* packages this depends on */ int depc; /* how many depend on me */ int installed; /* indicates if it is installed */ char *maintainer; /* maintainer */ } IndexEntry; typedef IndexEntry *IndexEntryPtr; typedef int (*commandFunc)(char *key, void *data); #define HOSTNAME_FIELD_LEN 128 #define IPADDR_FIELD_LEN 16 #define EXTRAS_FIELD_LEN 128 /* This is the structure that Network devices carry around in their private, erm, structures */ typedef struct _devPriv { char ipaddr[IPADDR_FIELD_LEN]; char netmask[IPADDR_FIELD_LEN]; char extras[EXTRAS_FIELD_LEN]; } DevInfo; /*** Externs ***/ extern jmp_buf BailOut; /* Used to get the heck out */ extern int DebugFD; /* Where diagnostic output goes */ extern Boolean Fake; /* Don't actually modify anything - testing */ extern Boolean SystemWasInstalled; /* Did we install it? */ extern Boolean RunningAsInit; /* Are we running stand-alone? */ extern Boolean DialogActive; /* Is the dialog() stuff up? */ extern Boolean ColorDisplay; /* Are we on a color display? */ extern Boolean OnVTY; /* On a syscons VTY? */ extern Variable *VarHead; /* The head of the variable chain */ extern Device *mediaDevice; /* Where we're getting our distribution from */ extern unsigned int Dists; /* Which distributions we want */ extern unsigned int DESDists; /* Which naughty distributions we want */ extern unsigned int SrcDists; /* Which src distributions we want */ extern unsigned int XF86Dists; /* Which XFree86 dists we want */ extern unsigned int XF86ServerDists; /* The XFree86 servers we want */ extern unsigned int XF86FontDists; /* The XFree86 fonts we want */ extern int BootMgr; /* Which boot manager to use */ extern int StatusLine; /* Where to print our status messages */ extern DMenu MenuInitial; /* Initial installation menu */ extern DMenu MenuFixit; /* Fixit repair menu */ extern DMenu MenuMBRType; /* Type of MBR to write on the disk */ extern DMenu MenuConfigure; /* Final configuration menu */ extern DMenu MenuDocumentation; /* Documentation menu */ extern DMenu MenuFTPOptions; /* FTP Installation options */ extern DMenu MenuIndex; /* Index menu */ extern DMenu MenuOptions; /* Installation options */ extern DMenu MenuOptionsLanguage; /* Language options menu */ extern DMenu MenuMedia; /* Media type menu */ extern DMenu MenuMouse; /* Mouse type menu */ extern DMenu MenuMediaCDROM; /* CDROM media menu */ extern DMenu MenuMediaDOS; /* DOS media menu */ extern DMenu MenuMediaFloppy; /* Floppy media menu */ extern DMenu MenuMediaFTP; /* FTP media menu */ extern DMenu MenuMediaTape; /* Tape media menu */ extern DMenu MenuNetworkDevice; /* Network device menu */ extern DMenu MenuNTP; /* NTP time server menu */ extern DMenu MenuStartup; /* Startup services menu */ extern DMenu MenuSyscons; /* System console configuration menu */ extern DMenu MenuSysconsFont; /* System console font configuration menu */ extern DMenu MenuSysconsKeymap; /* System console keymap configuration menu */ extern DMenu MenuSysconsKeyrate; /* System console keyrate configuration menu */ extern DMenu MenuSysconsSaver; /* System console saver configuration menu */ extern DMenu MenuSysconsScrnmap; /* System console screenmap configuration menu */ extern DMenu MenuNetworking; /* Network configuration menu */ extern DMenu MenuInstallCustom; /* Custom Installation menu */ extern DMenu MenuDistributions; /* Distribution menu */ extern DMenu MenuSubDistributions; /* Custom distribution menu */ extern DMenu MenuDESDistributions; /* DES distribution menu */ extern DMenu MenuSrcDistributions; /* Source distribution menu */ extern DMenu MenuXF86; /* XFree86 main menu */ extern DMenu MenuXF86Select; /* XFree86 distribution selection menu */ extern DMenu MenuXF86SelectCore; /* XFree86 core distribution menu */ extern DMenu MenuXF86SelectServer; /* XFree86 server distribution menu */ extern DMenu MenuXF86SelectPC98Server; /* XFree86 server distribution menu */ extern DMenu MenuXF86SelectFonts; /* XFree86 font selection menu */ extern DMenu MenuDiskDevices; /* Disk devices menu */ extern DMenu MenuHTMLDoc; /* HTML Documentation menu */ extern DMenu MenuUsermgmt; /* User management menu */ extern DMenu MenuFixit; /* Fixit floppy/CDROM/shell menu */ extern DMenu MenuXF86Config; /* Select XFree86 configuration type */ /* Stuff from libdialog which isn't properly declared outside */ extern void display_helpfile(void); extern void display_helpline(WINDOW *w, int y, int width); /*** Prototypes ***/ /* anonFTP.c */ extern int configAnonFTP(dialogMenuItem *self); /* cdrom.c */ extern Boolean mediaInitCDROM(Device *dev); extern FILE *mediaGetCDROM(Device *dev, char *file, Boolean probe); extern void mediaShutdownCDROM(Device *dev); /* command.c */ extern void command_clear(void); extern void command_sort(void); extern void command_execute(void); extern void command_shell_add(char *key, char *fmt, ...); extern void command_func_add(char *key, commandFunc func, void *data); /* config.c */ extern void configEnvironmentRC_conf(void); extern void configEnvironmentResolv(char *config); extern void configRC_conf(void); extern int configFstab(dialogMenuItem *self); extern int configRC(dialogMenuItem *self); -extern int configRegister(dialogMenuItem *self); extern int configResolv(dialogMenuItem *self); extern int configPackages(dialogMenuItem *self); extern int configSaver(dialogMenuItem *self); extern int configSaverTimeout(dialogMenuItem *self); extern int configNTP(dialogMenuItem *self); extern int configUsers(dialogMenuItem *self); extern int configXEnvironment(dialogMenuItem *self); extern int configRouter(dialogMenuItem *self); extern int configPCNFSD(dialogMenuItem *self); extern int configNFSServer(dialogMenuItem *self); extern int configWriteRC_conf(dialogMenuItem *self); /* crc.c */ extern int crc(int, unsigned long *, unsigned long *); /* devices.c */ extern DMenu *deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)(dialogMenuItem *d), int (*check)(dialogMenuItem *d)); extern void deviceGetAll(void); extern void deviceReset(void); extern void deviceRescan(void); extern Device **deviceFind(char *name, DeviceType type); extern Device **deviceFindDescr(char *name, char *desc, DeviceType class); extern int deviceCount(Device **devs); extern Device *new_device(char *name); extern Device *deviceRegister(char *name, char *desc, char *devname, DeviceType type, Boolean enabled, Boolean (*init)(Device *mediadev), FILE * (*get)(Device *dev, char *file, Boolean probe), void (*shutDown)(Device *mediadev), void *private); extern Boolean dummyInit(Device *dev); extern FILE *dummyGet(Device *dev, char *dist, Boolean probe); extern void dummyShutdown(Device *dev); /* disks.c */ extern int diskPartitionEditor(dialogMenuItem *self); extern int diskPartitionWrite(dialogMenuItem *self); extern int diskGetSelectCount(Device ***devs); extern void diskPartition(Device *dev); /* dispatch.c */ extern int dispatchCommand(char *command); extern int dispatch_load_floppy(dialogMenuItem *self); extern int dispatch_load_file_int(int); extern int dispatch_load_file(dialogMenuItem *self); /* dist.c */ extern int distReset(dialogMenuItem *self); extern int distConfig(dialogMenuItem *self); extern int distSetCustom(dialogMenuItem *self); extern int distSetDeveloper(dialogMenuItem *self); extern int distSetXDeveloper(dialogMenuItem *self); extern int distSetKernDeveloper(dialogMenuItem *self); extern int distSetXKernDeveloper(dialogMenuItem *self); extern int distSetUser(dialogMenuItem *self); extern int distSetXUser(dialogMenuItem *self); extern int distSetMinimum(dialogMenuItem *self); extern int distSetEverything(dialogMenuItem *self); extern int distSetDES(dialogMenuItem *self); extern int distSetSrc(dialogMenuItem *self); extern int distSetXF86(dialogMenuItem *self); extern int distExtractAll(dialogMenuItem *self); /* dmenu.c */ extern int dmenuDisplayFile(dialogMenuItem *tmp); extern int dmenuSubmenu(dialogMenuItem *tmp); extern int dmenuSystemCommand(dialogMenuItem *tmp); extern int dmenuSystemCommandBox(dialogMenuItem *tmp); extern int dmenuExit(dialogMenuItem *tmp); extern int dmenuISetVariable(dialogMenuItem *tmp); extern int dmenuSetVariable(dialogMenuItem *tmp); extern int dmenuSetKmapVariable(dialogMenuItem *tmp); extern int dmenuSetVariables(dialogMenuItem *tmp); extern int dmenuToggleVariable(dialogMenuItem *tmp); extern int dmenuSetFlag(dialogMenuItem *tmp); extern int dmenuSetValue(dialogMenuItem *tmp); extern Boolean dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max, Boolean buttons); extern Boolean dmenuOpenSimple(DMenu *menu, Boolean buttons); extern int dmenuVarCheck(dialogMenuItem *item); extern int dmenuVarsCheck(dialogMenuItem *item); extern int dmenuFlagCheck(dialogMenuItem *item); extern int dmenuRadioCheck(dialogMenuItem *item); /* doc.c */ extern int docBrowser(dialogMenuItem *self); extern int docShowDocument(dialogMenuItem *self); /* dos.c */ extern Boolean mediaCloseDOS(Device *dev, FILE *fp); extern Boolean mediaInitDOS(Device *dev); extern FILE *mediaGetDOS(Device *dev, char *file, Boolean probe); extern void mediaShutdownDOS(Device *dev); /* floppy.c */ extern int getRootFloppy(void); extern Boolean mediaInitFloppy(Device *dev); extern FILE *mediaGetFloppy(Device *dev, char *file, Boolean probe); extern void mediaShutdownFloppy(Device *dev); /* ftp_strat.c */ extern Boolean mediaCloseFTP(Device *dev, FILE *fp); extern Boolean mediaInitFTP(Device *dev); extern FILE *mediaGetFTP(Device *dev, char *file, Boolean probe); extern void mediaShutdownFTP(Device *dev); /* globals.c */ extern void globalsInit(void); /* index.c */ int index_read(FILE *fp, PkgNodePtr papa); int index_menu(PkgNodePtr root, PkgNodePtr top, PkgNodePtr plist, int *pos, int *scroll); void index_init(PkgNodePtr top, PkgNodePtr plist); void index_node_free(PkgNodePtr top, PkgNodePtr plist); void index_sort(PkgNodePtr top); void index_print(PkgNodePtr top, int level); int index_extract(Device *dev, PkgNodePtr top, PkgNodePtr plist); /* install.c */ extern Boolean checkLabels(Boolean whinge, Chunk **rdev, Chunk **sdev, Chunk **udev, Chunk **vdev); extern int installCommit(dialogMenuItem *self); extern int installCustomCommit(dialogMenuItem *self); extern int installExpress(dialogMenuItem *self); extern int installNovice(dialogMenuItem *self); extern int installFixitHoloShell(dialogMenuItem *self); extern int installFixitCDROM(dialogMenuItem *self); extern int installFixitFloppy(dialogMenuItem *self); extern int installFixupBin(dialogMenuItem *self); extern int installFixupXFree(dialogMenuItem *self); extern int installUpgrade(dialogMenuItem *self); extern int installFilesystems(dialogMenuItem *self); extern int installVarDefaults(dialogMenuItem *self); extern void installEnvironment(void); extern Boolean copySelf(void); /* kget.c */ extern int kget(char *out); /* keymap.c */ extern int loadKeymap(const char *lang); /* label.c */ extern int diskLabelEditor(dialogMenuItem *self); extern int diskLabelCommit(dialogMenuItem *self); /* lndir.c */ extern int lndir(char *from, char *to); /* makedevs.c (auto-generated) */ extern const char termcap_ansi[]; extern const char termcap_vt100[]; extern const char termcap_cons25[]; extern const char termcap_cons25_m[]; extern const char termcap_cons25r[]; extern const char termcap_cons25r_m[]; extern const char termcap_cons25l1[]; extern const char termcap_cons25l1_m[]; extern const u_char font_iso_8x16[]; extern const u_char font_cp850_8x16[]; extern const u_char font_cp866_8x16[]; extern const u_char koi8_r2cp866[]; extern u_char default_scrnmap[]; /* media.c */ extern char *cpioVerbosity(void); extern void mediaClose(void); extern int mediaTimeout(void); extern int mediaSetCDROM(dialogMenuItem *self); extern int mediaSetFloppy(dialogMenuItem *self); extern int mediaSetDOS(dialogMenuItem *self); extern int mediaSetTape(dialogMenuItem *self); extern int mediaSetFTP(dialogMenuItem *self); extern int mediaSetFTPActive(dialogMenuItem *self); extern int mediaSetFTPPassive(dialogMenuItem *self); extern int mediaSetUFS(dialogMenuItem *self); extern int mediaSetNFS(dialogMenuItem *self); extern int mediaSetFTPUserPass(dialogMenuItem *self); extern int mediaSetCPIOVerbosity(dialogMenuItem *self); extern int mediaGetType(dialogMenuItem *self); extern Boolean mediaExtractDist(char *dir, char *dist, FILE *fp); extern Boolean mediaExtractDistBegin(char *dir, int *fd, int *zpid, int *cpic); extern Boolean mediaExtractDistEnd(int zpid, int cpid); extern Boolean mediaVerify(void); extern FILE *mediaGenericGet(char *base, const char *file); /* misc.c */ extern Boolean file_readable(char *fname); extern Boolean file_executable(char *fname); extern Boolean directory_exists(const char *dirname); extern char *root_bias(char *path); extern char *itoa(int value); extern char *string_concat(char *p1, char *p2); extern char *string_concat3(char *p1, char *p2, char *p3); extern char *string_prune(char *str); extern char *string_skipwhite(char *str); extern char *string_copy(char *s1, char *s2); extern char *pathBaseName(const char *path); extern void safe_free(void *ptr); extern void *safe_malloc(size_t size); extern void *safe_realloc(void *orig, size_t size); extern dialogMenuItem *item_add(dialogMenuItem *list, char *prompt, char *title, int (*checked)(dialogMenuItem *self), int (*fire)(dialogMenuItem *self), void (*selected)(dialogMenuItem *self, int is_selected), void *data, int aux, int *curr, int *max); extern void items_free(dialogMenuItem *list, int *curr, int *max); extern int Mkdir(char *); extern int Mount(char *, void *data); extern WINDOW *openLayoutDialog(char *helpfile, char *title, int x, int y, int width, int height); extern ComposeObj *initLayoutDialog(WINDOW *win, Layout *layout, int x, int y, int *max); extern int layoutDialogLoop(WINDOW *win, Layout *layout, ComposeObj **obj, int *n, int max, int *cbutton, int *cancel); extern WINDOW *savescr(void); extern void restorescr(WINDOW *w); extern char *sstrncpy(char *dst, const char *src, int size); /* mouse.c */ extern int mousedTest(dialogMenuItem *self); extern int mousedDisable(dialogMenuItem *self); /* msg.c */ extern Boolean isDebug(void); extern void msgInfo(char *fmt, ...); extern void msgYap(char *fmt, ...); extern void msgWarn(char *fmt, ...); extern void msgDebug(char *fmt, ...); extern void msgError(char *fmt, ...); extern void msgFatal(char *fmt, ...); extern void msgConfirm(char *fmt, ...); extern void msgNotify(char *fmt, ...); extern void msgWeHaveOutput(char *fmt, ...); extern int msgYesNo(char *fmt, ...); extern char *msgGetInput(char *buf, char *fmt, ...); extern int msgSimpleConfirm(char *); extern int msgSimpleNotify(char *); /* network.c */ extern Boolean mediaInitNetwork(Device *dev); extern void mediaShutdownNetwork(Device *dev); /* nfs.c */ extern Boolean mediaInitNFS(Device *dev); extern FILE *mediaGetNFS(Device *dev, char *file, Boolean probe); extern void mediaShutdownNFS(Device *dev); /* options.c */ extern int optionsEditor(dialogMenuItem *self); /* package.c */ extern int packageAdd(dialogMenuItem *self); extern int package_add(char *name); extern int package_extract(Device *dev, char *name, Boolean depended); extern Boolean package_exists(char *name); -/* register.c */ -extern int registerOpenDialog(void); - /* system.c */ extern void systemInitialize(int argc, char **argv); extern void systemShutdown(int status); extern int execExecute(char *cmd, char *name); extern int systemExecute(char *cmd); extern int systemDisplayHelp(char *file); extern char *systemHelpFile(char *file, char *buf); extern void systemChangeFont(const u_char font[]); extern void systemChangeLang(char *lang); extern void systemChangeTerminal(char *color, const u_char c_termcap[], char *mono, const u_char m_termcap[]); extern void systemChangeScreenmap(const u_char newmap[]); extern void systemCreateHoloshell(void); extern int vsystem(char *fmt, ...); /* tape.c */ extern char *mediaTapeBlocksize(void); extern Boolean mediaInitTape(Device *dev); extern FILE *mediaGetTape(Device *dev, char *file, Boolean probe); extern void mediaShutdownTape(Device *dev); /* tcpip.c */ extern int tcpOpenDialog(Device *dev); extern int tcpMenuSelect(dialogMenuItem *self); extern Device *tcpDeviceSelect(void); /* termcap.c */ extern int set_termcap(void); /* ufs.c */ extern void mediaShutdownUFS(Device *dev); extern Boolean mediaInitUFS(Device *dev); extern FILE *mediaGetUFS(Device *dev, char *file, Boolean probe); /* user.c */ extern int userAddGroup(dialogMenuItem *self); extern int userAddUser(dialogMenuItem *self); /* variable.c */ extern void variable_set(char *var, int dirty); extern void variable_set2(char *name, char *value, int dirty); extern char *variable_get(char *var); extern int variable_cmp(char *var, char *value); extern void variable_unset(char *var); extern char *variable_get_value(char *var, char *prompt, int dirty); extern int variable_check(char *data); extern int dump_variables(dialogMenuItem *self); /* wizard.c */ extern void slice_wizard(Disk *d); #endif /* _SYSINSTALL_H_INCLUDE */