Index: stable/3/release/sysinstall/Makefile =================================================================== --- stable/3/release/sysinstall/Makefile (revision 44619) +++ stable/3/release/sysinstall/Makefile (revision 44620) @@ -1,83 +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 \ 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 fr.iso german.iso it.iso \ - icelandic.iso jp.106 norwegian.iso ru.koi8-r si.iso spanish.iso \ - swedish.iso swissgerman.iso uk.iso us.dvorak us.iso +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 Index: stable/3/release/sysinstall/config.c =================================================================== --- stable/3/release/sysinstall/config.c (revision 44619) +++ stable/3/release/sysinstall/config.c (revision 44620) @@ -1,741 +1,741 @@ /* * 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.115.2.7 1999/02/14 07:39:55 jkh Exp $ + * $Id: config.c,v 1.115.2.8 1999/02/14 21:35:55 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, &plist, &pos, &scroll); + 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, NULL, &pos, &scroll); + 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; } Index: stable/3/release/sysinstall/index.c =================================================================== --- stable/3/release/sysinstall/index.c (revision 44619) +++ stable/3/release/sysinstall/index.c (revision 44620) @@ -1,619 +1,703 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: index.c,v 1.60 1999/01/11 12:45:18 asami Exp $ + * $Id: index.c,v 1.60.2.1 1999/02/15 04:57:40 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 #include #include #include #include #include #include "sysinstall.h" /* Macros and magic values */ #define MAX_MENU 12 #define _MAX_DESC 55 +/* A structure holding the root, top and plist pointer at once */ +struct ListPtrs +{ + PkgNodePtr root; /* root of tree */ + PkgNodePtr top; /* part of tree we handle */ + PkgNodePtr plist; /* list of selected packages */ +}; +typedef struct ListPtrs* ListPtrsPtr; + static int index_extract_one(Device *dev, PkgNodePtr top, PkgNodePtr who, Boolean depended); +static void index_recorddeps(Boolean add, PkgNodePtr root, IndexEntryPtr ie); /* Smarter strdup */ inline char * _strdup(char *ptr) { return ptr ? strdup(ptr) : NULL; } static char *descrs[] = { "Package Selection", "To mark a package, move to it and press SPACE. If the package is\n" "already marked, it will be unmarked or deleted (if installed).\n" "To search for a package by name, press ESC. To select a category,\n" "press RETURN. NOTE: The All category selection creates a very large\n" "submenu. If you select it, please be patient while it comes up.", "Package Targets", "These are the packages you've selected for extraction.\n\n" "If you're sure of these choices, select OK.\n" "If not, select Cancel to go back to the package selection menu.\n", "All", "All available packages in all categories.", "afterstep", "Ports to support the AfterStep window manager.", "applications", "User application software.", "astro", "Applications related to astronomy.", "archivers", "Utilities for archiving and unarchiving data.", "audio", "Audio utilities - most require a supported sound card.", "biology", "Software related to biology.", "benchmarks", "Utilities for measuring system performance.", "cad", "Computer Aided Design utilities.", "chinese", "Ported software for the Chinese market.", "comms", "Communications utilities.", "converters", "Format conversion utilities.", "databases", "Database software.", "devel", "Software development utilities and libraries.", "deskutils", "Various Desktop utilities.", "documentation", "Document preparation utilities.", "editors", "Common text editors.", "elisp", "Things related to Emacs Lisp.", "elisp", "Emacs lisp ports.", "emulators", "Utilities for emulating other OS types.", "games", "Various and sundry amusements.", "german", "Ported software for Germanic countries.", "graphics", "Graphics libraries and utilities.", "gnome", "Components of the Gnome Desktop environment.", "japanese", "Ported software for the Japanese market.", "kde", "Software for the K Desktop Environment.", "korean", "Ported software for the Korean market.", "lang", "Computer languages.", "languages", "Computer languages.", "libraries", "Software development libraries.", "mail", "Electronic mail packages and utilities.", "math", "Mathematical computation software.", "mbone", "Applications and utilities for the MBONE.", "misc", "Miscellaneous utilities.", "net", "Networking utilities.", "news", "USENET News support software.", "numeric", "Mathematical computation software.", "offix", "An office automation suite of sorts.", "orphans", "Packages without a home elsewhere.", - "palm", "Software support for the 3Com Palm(tm) series.", + "palm", "Software support for the 3Com Palm Pilot(tm) series.", + "pilot", "Software support for the 3Com Palm Pilot(tm) series.", "perl5", "Utilities/modules for the PERL5 language.", "plan9", "Software from the Plan9 operating system.", "print", "Utilities for dealing with printing.", "printing", "Utilities for dealing with printing.", "programming", "Software development utilities and libraries.", "python", "Software related to the Python language.", "russian", "Ported software for the Russian market.", "security", "System security software.", "shells", "Various shells (tcsh, bash, etc).", "sysutils", "Various system utilities.", "textproc", "Text processing/search utilities.", "tcl75", "TCL v7.5 and packages that depend on it.", "tcl76", "TCL v7.6 and packages that depend on it.", "tcl80", "TCL v8.0 and packages that depend on it.", "tcl81", "TCL v8.1 and packages that depend on it.", "tk41", "Tk4.1 and packages that depend on it.", "tk42", "Tk4.2 and packages that depend on it.", "tk80", "Tk8.0 and packages that depend on it.", "tk81", "Tk8.1 and packages that depend on it.", "troff", "TROFF text formatting utilities.", "vietnamese", "Ported software for the Vietnamese market.", "windowmaker", "Ports to support the WindowMaker window manager.", "www", "WEB utilities (browers, HTTP servers, etc).", "x11", "X Window System based utilities.", "x11-clocks", "X Window System based clocks.", "x11-fm", "X Window System based file managers.", "x11-fonts", "X Window System fonts and font utilities.", "x11-toolkits", "X Window System based development toolkits.", "x11-wm", "X Window System window managers.", NULL, NULL, }; static char * fetch_desc(char *name) { int i; for (i = 0; descrs[i]; i += 2) { if (!strcmp(descrs[i], name)) return descrs[i + 1]; } return "No description provided"; } static PkgNodePtr new_pkg_node(char *name, node_type type) { PkgNodePtr tmp = safe_malloc(sizeof(PkgNode)); tmp->name = _strdup(name); tmp->type = type; return tmp; } static char * strip(char *buf) { int i; for (i = 0; buf[i]; i++) if (buf[i] == '\t' || buf[i] == '\n') buf[i] = ' '; return buf; } static IndexEntryPtr new_index(char *name, char *pathto, char *prefix, char *comment, char *descr, char *maint, char *deps) { IndexEntryPtr tmp = safe_malloc(sizeof(IndexEntry)); tmp->name = _strdup(name); tmp->path = _strdup(pathto); tmp->prefix = _strdup(prefix); tmp->comment = _strdup(comment); tmp->descrfile = strip(_strdup(descr)); tmp->maintainer = _strdup(maint); tmp->deps = _strdup(deps); + tmp->depc = 0; + tmp->installed = package_exists(name); return tmp; } static void index_register(PkgNodePtr top, char *where, IndexEntryPtr ptr) { PkgNodePtr p, q; for (q = NULL, p = top->kids; p; p = p->next) { if (!strcmp(p->name, where)) { q = p; break; } } if (!p) { /* Add new category */ q = new_pkg_node(where, PLACE); q->desc = fetch_desc(where); q->next = top->kids; top->kids = q; } p = new_pkg_node(ptr->name, PACKAGE); p->desc = ptr->comment; p->data = ptr; p->next = q->kids; q->kids = p; } static int copy_to_sep(char *to, char *from, int sep) { char *tok; tok = strchr(from, sep); if (!tok) { *to = '\0'; return 0; } *tok = '\0'; strcpy(to, from); return tok + 1 - from; } static int readline(FILE *fp, char *buf, int max) { int rv, i = 0; char ch; while ((rv = fread(&ch, 1, 1, fp)) == 1 && ch != '\n' && i < max) buf[i++] = ch; if (i < max) buf[i] = '\0'; return rv; } int index_parse(FILE *fp, char *name, char *pathto, char *prefix, char *comment, char *descr, char *maint, char *cats, char *rdeps) { char line[1024]; char junk[256]; char *cp; int i; i = readline(fp, line, 1024); if (i <= 0) return EOF; cp = line; cp += copy_to_sep(name, cp, '|'); cp += copy_to_sep(pathto, cp, '|'); cp += copy_to_sep(prefix, cp, '|'); cp += copy_to_sep(comment, cp, '|'); cp += copy_to_sep(descr, cp, '|'); cp += copy_to_sep(maint, cp, '|'); cp += copy_to_sep(cats, cp, '|'); cp += copy_to_sep(junk, cp, '|'); /* build deps - not used */ if (index(cp, '|')) copy_to_sep(rdeps, cp, '|'); else strncpy(rdeps, cp, 510); return 0; } int index_read(FILE *fp, PkgNodePtr papa) { char name[127], pathto[255], prefix[255], comment[255], descr[127], maint[127], cats[511], deps[511]; + PkgNodePtr i; while (index_parse(fp, name, pathto, prefix, comment, descr, maint, cats, deps) != EOF) { char *cp, *cp2, tmp[511]; IndexEntryPtr idx; idx = new_index(name, pathto, prefix, comment, descr, maint, deps); /* For now, we only add things to menus if they're in categories. Keywords are ignored */ for (cp = strcpy(tmp, cats); (cp2 = strchr(cp, ' ')) != NULL; cp = cp2 + 1) { *cp2 = '\0'; index_register(papa, cp, idx); } index_register(papa, cp, idx); /* Add to special "All" category */ index_register(papa, "All", idx); } + + /* Adjust dependency counts */ + for (i = papa->kids; i != NULL; i = i->next) + if (strcmp(i->name, "All") == 0) + break; + for (i = i->kids; i != NULL; i = i->next) + if (((IndexEntryPtr)i->data)->installed) + index_recorddeps(TRUE, papa, i->data); + return 0; } void index_init(PkgNodePtr top, PkgNodePtr plist) { if (top) { top->next = top->kids = NULL; top->name = "Package Selection"; top->type = PLACE; top->desc = fetch_desc(top->name); top->data = NULL; } if (plist) { plist->next = plist->kids = NULL; plist->name = "Package Targets"; plist->type = PLACE; plist->desc = fetch_desc(plist->name); plist->data = NULL; } } void index_print(PkgNodePtr top, int level) { int i; while (top) { for (i = 0; i < level; i++) putchar('\t'); printf("name [%s]: %s\n", top->type == PLACE ? "place" : "package", top->name); for (i = 0; i < level; i++) putchar('\t'); printf("desc: %s\n", top->desc); if (top->kids) index_print(top->kids, level + 1); top = top->next; } } /* Swap one node for another */ static void swap_nodes(PkgNodePtr a, PkgNodePtr b) { PkgNode tmp; tmp = *a; *a = *b; a->next = tmp.next; tmp.next = b->next; *b = tmp; } /* Use a disgustingly simplistic bubble sort to put our lists in order */ void index_sort(PkgNodePtr top) { PkgNodePtr p, q; /* Sort everything at the top level */ for (p = top->kids; p; p = p->next) { for (q = top->kids; q; q = q->next) { if (q->next && strcmp(q->name, q->next->name) > 0) swap_nodes(q, q->next); } } /* Now sub-sort everything n levels down */ for (p = top->kids; p; p = p->next) { if (p->kids) index_sort(p); } } /* Delete an entry out of the list it's in (only the plist, at present) */ void index_delete(PkgNodePtr n) { if (n->next) { PkgNodePtr p = n->next; *n = *(n->next); safe_free(p); } else /* Kludgy end sentinal */ n->name = NULL; } /* * Search for a given node by name, returning the category in if * tp is non-NULL. */ PkgNodePtr index_search(PkgNodePtr top, char *str, PkgNodePtr *tp) { PkgNodePtr p, sp; for (p = top->kids; p && p->name; p = p->next) { /* Subtract out the All category from searches */ if (!strcmp(p->name, "All")) continue; /* If tp == NULL, we're looking for an exact package match */ if (!tp && !strncmp(p->name, str, strlen(str))) return p; /* If tp, we're looking for both a package and a pointer to the place it's in */ if (tp && !strncmp(p->name, str, strlen(str))) { *tp = top; return p; } /* The usual recursion-out-of-laziness ploy */ if (p->kids) if ((sp = index_search(p, str, tp)) != NULL) return sp; } if (p && !p->name) p = NULL; return p; } int pkg_checked(dialogMenuItem *self) { - PkgNodePtr kp = self->data, plist = (PkgNodePtr)self->aux; + ListPtrsPtr lists = (ListPtrsPtr)self->aux; + PkgNodePtr kp = self->data, plist = lists->plist; int i; i = index_search(plist, kp->name, NULL) ? TRUE : FALSE; - if (kp->type == PACKAGE && plist) - return i || package_exists(kp->name); - else + if (kp->type == PACKAGE && plist) { + IndexEntryPtr ie = kp->data; + int markD, markX; + + markD = ie->depc > 0; /* needed as dependency */ + markX = i || ie->installed; /* selected or installed */ + self->mark = markX ? 'X' : 'D'; + return markD || markX; + } else return FALSE; } int pkg_fire(dialogMenuItem *self) { int ret; - PkgNodePtr sp, kp = self->data, plist = (PkgNodePtr)self->aux; + ListPtrsPtr lists = (ListPtrsPtr)self->aux; + PkgNodePtr sp, kp = self->data, plist = lists->plist; if (!plist) ret = DITEM_FAILURE; else if (kp->type == PACKAGE) { + IndexEntryPtr ie = kp->data; + sp = index_search(plist, kp->name, NULL); /* Not already selected? */ if (!sp) { - if (!package_exists(kp->name)) { + if (!ie->installed) { PkgNodePtr np = (PkgNodePtr)safe_malloc(sizeof(PkgNode)); *np = *kp; np->next = plist->kids; plist->kids = np; + index_recorddeps(TRUE, lists->root, ie); msgInfo("Added %s to selection list", kp->name); } - else { + else if (ie->depc == 0) { WINDOW *save = savescr(); if (!msgYesNo("Do you really want to delete %s from the system?", kp->name)) if (vsystem("pkg_delete %s %s", isDebug() ? "-v" : "", kp->name)) msgConfirm("Warning: pkg_delete of %s failed.\n Check debug output for details.", kp->name); + else { + ie->installed = 0; + index_recorddeps(FALSE, lists->root, ie); + } restorescr(save); } + else + msgConfirm("Warning: Package %s is needed by\n %d other installed package%s.", + kp->name, ie->depc, (ie->depc != 1) ? "s" : ""); } else { + index_recorddeps(FALSE, lists->root, ie); msgInfo("Removed %s from selection list", kp->name); index_delete(sp); } ret = DITEM_SUCCESS; + /* Mark menu for redraw if we had dependencies */ + if (strlen(ie->deps) > 0) + ret |= DITEM_REDRAW; } else { /* Not a package, must be a directory */ int p, s; p = s = 0; - index_menu(kp, plist, &p, &s); + index_menu(lists->root, kp, plist, &p, &s); ret = DITEM_SUCCESS | DITEM_CONTINUE; } return ret; } void pkg_selected(dialogMenuItem *self, int is_selected) { PkgNodePtr kp = self->data; if (!is_selected || kp->type != PACKAGE) return; msgInfo(kp->desc); } int -index_menu(PkgNodePtr top, PkgNodePtr plist, int *pos, int *scroll) +index_menu(PkgNodePtr root, PkgNodePtr top, PkgNodePtr plist, int *pos, int *scroll) { + struct ListPtrs lists; int n, rval, maxname; int curr, max; PkgNodePtr kp; dialogMenuItem *nitems; Boolean hasPackages; WINDOW *w; + lists.root = root; + lists.top = top; + lists.plist = plist; + hasPackages = FALSE; nitems = NULL; w = savescr(); n = maxname = 0; /* Figure out if this menu is full of "leaves" or "branches" */ for (kp = top->kids; kp && kp->name; kp = kp->next) { int len; ++n; if (kp->type == PACKAGE && plist) { hasPackages = TRUE; if ((len = strlen(kp->name)) > maxname) maxname = len; } } if (!n && plist) { msgConfirm("The %s menu is empty.", top->name); restorescr(w); return DITEM_LEAVE_MENU; } while (1) { n = 0; curr = max = 0; use_helpline(NULL); use_helpfile(NULL); kp = top->kids; if (!hasPackages && plist) { nitems = item_add(nitems, "OK", NULL, NULL, NULL, NULL, NULL, 0, &curr, &max); nitems = item_add(nitems, "Install", NULL, NULL, NULL, NULL, NULL, 0, &curr, &max); } while (kp && kp->name) { char buf[256]; IndexEntryPtr ie = kp->data; /* Brutally adjust description to fit in menu */ if (kp->type == PACKAGE) snprintf(buf, sizeof buf, "[%s]", ie->path ? ie->path : "External vendor"); else SAFE_STRCPY(buf, kp->desc); if (strlen(buf) > (_MAX_DESC - maxname)) buf[_MAX_DESC - maxname] = '\0'; - nitems = item_add(nitems, kp->name, buf, pkg_checked, pkg_fire, pkg_selected, kp, (int)plist, &curr, &max); + nitems = item_add(nitems, kp->name, buf, pkg_checked, pkg_fire, pkg_selected, kp, (int)&lists, &curr, &max); ++n; kp = kp->next; } /* NULL delimiter so item_free() knows when to stop later */ nitems = item_add(nitems, NULL, NULL, NULL, NULL, NULL, NULL, 0, &curr, &max); recycle: dialog_clear_norefresh(); if (hasPackages) rval = dialog_checklist(top->name, top->desc, -1, -1, n > MAX_MENU ? MAX_MENU : n, -n, nitems, NULL); else rval = dialog_menu(top->name, top->desc, -1, -1, n > MAX_MENU ? MAX_MENU : n, -n, nitems + (plist ? 2 : 0), (char *)plist, pos, scroll); if (rval == -1 && plist) { static char *cp; PkgNodePtr menu; /* Search */ if ((cp = msgGetInput(cp, "Search by package name. Please enter search string:")) != NULL) { PkgNodePtr p = index_search(top, cp, &menu); if (p) { int pos, scroll; /* These need to be set to point at the found item, actually. Hmmm! */ pos = scroll = 0; - index_menu(menu, plist, &pos, &scroll); + index_menu(root, menu, plist, &pos, &scroll); } else msgConfirm("Search string: %s yielded no hits.", cp); } goto recycle; } items_free(nitems, &curr, &max); restorescr(w); return rval ? DITEM_FAILURE : DITEM_SUCCESS; } } int index_extract(Device *dev, PkgNodePtr top, PkgNodePtr plist) { PkgNodePtr tmp; int status = DITEM_SUCCESS; for (tmp = plist->kids; tmp && tmp->name; tmp = tmp->next) status = index_extract_one(dev, top, tmp, FALSE); return status; } static int index_extract_one(Device *dev, PkgNodePtr top, PkgNodePtr who, Boolean depended) { int status = DITEM_SUCCESS; PkgNodePtr tmp2; IndexEntryPtr id = who->data; if (id && id->deps && strlen(id->deps)) { char t[1024], *cp, *cp2; SAFE_STRCPY(t, id->deps); cp = t; while (cp && DITEM_STATUS(status) == DITEM_SUCCESS) { if ((cp2 = index(cp, ' ')) != NULL) *cp2 = '\0'; if ((tmp2 = index_search(top, cp, NULL)) != NULL) { status = index_extract_one(dev, top, tmp2, TRUE); if (DITEM_STATUS(status) != DITEM_SUCCESS) { if (variable_get(VAR_NO_CONFIRM)) msgNotify("Loading of dependant package %s failed", cp); else msgConfirm("Loading of dependant package %s failed", cp); } } else if (!package_exists(cp)) { if (variable_get(VAR_NO_CONFIRM)) msgNotify("Warning: %s is a required package but was not found.", cp); else msgConfirm("Warning: %s is a required package but was not found.", cp); } if (cp2) cp = cp2 + 1; else cp = NULL; } } /* Done with the deps? Load the real m'coy */ - if (DITEM_STATUS(status) == DITEM_SUCCESS) + if (DITEM_STATUS(status) == DITEM_SUCCESS) { status = package_extract(dev, who->name, depended); + if (DITEM_STATUS(status) == DITEM_SUCCESS) + id->installed = 1; + } return status; +} + +static void +index_recorddeps(Boolean add, PkgNodePtr root, IndexEntryPtr ie) +{ + char depends[1024], *space, *todo; + PkgNodePtr found; + IndexEntryPtr found_ie; + + SAFE_STRCPY(depends, ie->deps); + for (todo = depends; todo != NULL; ) { + space = index(todo, ' '); + if (space != NULL) + *space = '\0'; + + if (strlen(todo) > 0) { /* only non-empty dependencies */ + found = index_search(root, todo, NULL); + if (found != NULL) { + found_ie = found->data; + if (add) + ++found_ie->depc; + else + --found_ie->depc; + } + } + + if (space != NULL) + todo = space + 1; + else + todo = NULL; + } } Index: stable/3/release/sysinstall/install.c =================================================================== --- stable/3/release/sysinstall/install.c (revision 44619) +++ stable/3/release/sysinstall/install.c (revision 44620) @@ -1,1107 +1,1127 @@ /* * 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.223.2.4 1999/02/14 21:26:52 jkh Exp $ + * $Id: install.c,v 1.223.2.5 1999/02/15 00:49:57 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 another iggly hardcoded pathname. */ if (!file_readable("/usr/libexec/ld.so")) { Mkdir("/usr/libexec"); if (symlink("/mnt2/usr/libexec/ld.so", "/usr/libexec/ld.so")) { msgConfirm("Warning: could not create the symlink for ld.so.\n" "Dynamic executables from the CDROM likely won't work."); } } 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("/kernel.config")) { + 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); } } Index: stable/3/release/sysinstall/label.c =================================================================== --- stable/3/release/sysinstall/label.c (revision 44619) +++ stable/3/release/sysinstall/label.c (revision 44620) @@ -1,1279 +1,1303 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: label.c,v 1.84.2.1 1999/02/05 22:20:15 jkh Exp $ + * $Id: label.c,v 1.84.2.2 1999/03/09 12:40:13 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 /* * Everything to do with editing the contents of disk labels. */ /* A nice message we use a lot in the disklabel editor */ #define MSG_NOT_APPLICABLE "That option is not applicable here" /* Where to start printing the freebsd slices */ #define CHUNK_SLICE_START_ROW 2 #define CHUNK_PART_START_ROW 11 /* The smallest filesystem we're willing to create */ #define FS_MIN_SIZE ONE_MEG /* The smallest root filesystem we're willing to create */ #ifdef __alpha__ #define ROOT_MIN_SIZE 32 #else #define ROOT_MIN_SIZE 20 #endif /* The default root filesystem size */ #ifdef __alpha__ #define ROOT_DEFAULT_SIZE 48 #else #define ROOT_DEFAULT_SIZE 32 #endif /* The smallest swap partition we want to create by default */ #define SWAP_MIN_SIZE 16 /* The smallest /usr partition we're willing to create by default */ #define USR_MIN_SIZE 80 /* The smallest /var partition we're willing to create by default */ #define VAR_MIN_SIZE 30 /* The bottom-most row we're allowed to scribble on */ #define CHUNK_ROW_MAX 16 /* All the chunks currently displayed on the screen */ static struct { struct chunk *c; PartType type; } label_chunk_info[MAX_CHUNKS + 1]; static int here; /*** with this value we try to track the most recently added label ***/ static int label_focus = 0, pslice_focus = 0; static int diskLabel(Device *dev); static int diskLabelNonInteractive(Device *dev); static int labelHook(dialogMenuItem *selected) { Device **devs = NULL; devs = deviceFind(selected->prompt, DEVICE_TYPE_DISK); if (!devs) { msgConfirm("Unable to find disk %s!", selected->prompt); return DITEM_FAILURE; } /* Toggle enabled status? */ if (!devs[0]->enabled) { devs[0]->enabled = TRUE; diskLabel(devs[0]); } else devs[0]->enabled = FALSE; return DITEM_SUCCESS | DITEM_RESTORE; } static int labelCheck(dialogMenuItem *selected) { Device **devs = NULL; devs = deviceFind(selected->prompt, DEVICE_TYPE_DISK); if (!devs || devs[0]->enabled == FALSE) return FALSE; return TRUE; } int diskLabelEditor(dialogMenuItem *self) { DMenu *menu; Device **devs; int i, cnt; i = 0; cnt = diskGetSelectCount(&devs); if (cnt == -1) { msgConfirm("No disks found! Please verify that your disk controller is being\n" "properly probed at boot time. See the Hardware Guide on the\n" "Documentation menu for clues on diagnosing this type of problem."); return DITEM_FAILURE; } else if (cnt) { /* Some are already selected */ if (variable_get(VAR_NONINTERACTIVE)) i = diskLabelNonInteractive(NULL); else i = diskLabel(NULL); } else { /* No disks are selected, fall-back case now */ cnt = deviceCount(devs); if (cnt == 1) { devs[0]->enabled = TRUE; if (variable_get(VAR_NONINTERACTIVE)) i = diskLabelNonInteractive(devs[0]); else i = diskLabel(devs[0]); } else { menu = deviceCreateMenu(&MenuDiskDevices, DEVICE_TYPE_DISK, labelHook, labelCheck); if (!menu) { msgConfirm("No devices suitable for installation found!\n\n" "Please verify that your disk controller (and attached drives)\n" "were detected properly. This can be done by pressing the\n" "[Scroll Lock] key and using the Arrow keys to move back to\n" "the boot messages. Press [Scroll Lock] again to return."); i = DITEM_FAILURE; } else { i = dmenuOpenSimple(menu, FALSE) ? DITEM_SUCCESS : DITEM_FAILURE; free(menu); } i |= DITEM_RESTORE; } } if (DITEM_STATUS(i) != DITEM_FAILURE) { char *cp; if (((cp = variable_get(DISK_LABELLED)) == NULL) || (strcmp(cp, "written"))) variable_set2(DISK_LABELLED, "yes", 0); } return i; } int diskLabelCommit(dialogMenuItem *self) { char *cp; int i; /* Already done? */ if ((cp = variable_get(DISK_LABELLED)) && strcmp(cp, "yes")) i = DITEM_SUCCESS; else if (!cp) { msgConfirm("You must assign disk labels before this option can be used."); i = DITEM_FAILURE; } /* The routine will guard against redundant writes, just as this one does */ else if (DITEM_STATUS(diskPartitionWrite(self)) != DITEM_SUCCESS) i = DITEM_FAILURE; else if (DITEM_STATUS(installFilesystems(self)) != DITEM_SUCCESS) i = DITEM_FAILURE; else { msgInfo("All filesystem information written successfully."); variable_set2(DISK_LABELLED, "written", 0); i = DITEM_SUCCESS; } return i; } /* See if we're already using a desired partition name */ static Boolean check_conflict(char *name) { int i; for (i = 0; label_chunk_info[i].c; i++) if ((label_chunk_info[i].type == PART_FILESYSTEM || label_chunk_info[i].type == PART_FAT) && label_chunk_info[i].c->private_data && !strcmp(((PartInfo *)label_chunk_info[i].c->private_data)->mountpoint, name)) return TRUE; return FALSE; } /* How much space is in this FreeBSD slice? */ static int space_free(struct chunk *c) { struct chunk *c1; int sz = c->size; for (c1 = c->part; c1; c1 = c1->next) { if (c1->type != unused) sz -= c1->size; } if (sz < 0) msgFatal("Partitions are larger than actual chunk??"); return sz; } /* Snapshot the current situation into the displayed chunks structure */ static void record_label_chunks(Device **devs, Device *dev) { int i, j, p; struct chunk *c1, *c2; Disk *d; j = p = 0; /* First buzz through and pick up the FreeBSD slices */ for (i = 0; devs[i]; i++) { if ((dev && devs[i] != dev) || !devs[i]->enabled) continue; d = (Disk *)devs[i]->private; if (!d->chunks) msgFatal("No chunk list found for %s!", d->name); /* Put the slice entries first */ for (c1 = d->chunks->part; c1; c1 = c1->next) { if (c1->type == freebsd) { label_chunk_info[j].type = PART_SLICE; label_chunk_info[j].c = c1; ++j; } } } /* Now run through again and get the FreeBSD partition entries */ for (i = 0; devs[i]; i++) { if (!devs[i]->enabled) continue; d = (Disk *)devs[i]->private; /* Then buzz through and pick up the partitions */ for (c1 = d->chunks->part; c1; c1 = c1->next) { if (c1->type == freebsd) { for (c2 = c1->part; c2; c2 = c2->next) { if (c2->type == part) { if (c2->subtype == FS_SWAP) label_chunk_info[j].type = PART_SWAP; else label_chunk_info[j].type = PART_FILESYSTEM; label_chunk_info[j].c = c2; ++j; } } } else if (c1->type == fat) { label_chunk_info[j].type = PART_FAT; label_chunk_info[j].c = c1; ++j; } } } label_chunk_info[j].c = NULL; if (here >= j) { here = j ? j - 1 : 0; } } /* A new partition entry */ static PartInfo * new_part(char *mpoint, Boolean newfs, u_long size) { PartInfo *ret; if (!mpoint) mpoint = "/change_me"; ret = (PartInfo *)safe_malloc(sizeof(PartInfo)); sstrncpy(ret->mountpoint, mpoint, FILENAME_MAX); strcpy(ret->newfs_cmd, "newfs -b 8192 -f 1024"); ret->newfs = newfs; if (!size) return ret; return ret; } /* Get the mountpoint for a partition and save it away */ static PartInfo * get_mountpoint(struct chunk *old) { char *val; PartInfo *tmp; if (old && old->private_data) tmp = old->private_data; else tmp = NULL; if (!old) { DialogX = 14; DialogY = 16; } val = msgGetInput(tmp ? tmp->mountpoint : NULL, "Please specify a mount point for the partition"); DialogX = DialogY = 0; if (!val || !*val) { if (!old) return NULL; else { free(old->private_data); old->private_data = NULL; } return NULL; } /* Is it just the same value? */ if (tmp && !strcmp(tmp->mountpoint, val)) return NULL; /* Did we use it already? */ if (check_conflict(val)) { msgConfirm("You already have a mount point for %s assigned!", val); return NULL; } /* Is it bogus? */ if (*val != '/') { msgConfirm("Mount point must start with a / character"); return NULL; } /* Is it going to be mounted on root? */ if (!strcmp(val, "/")) { if (old) old->flags |= CHUNK_IS_ROOT; } else if (old) old->flags &= ~CHUNK_IS_ROOT; safe_free(tmp); tmp = new_part(val, TRUE, 0); if (old) { old->private_data = tmp; old->private_free = safe_free; } return tmp; } /* Get the type of the new partiton */ static PartType get_partition_type(void) { char selection[20]; int i; static unsigned char *fs_types[] = { "FS", "A file system", "Swap", "A swap partition.", }; DialogX = 7; DialogY = 8; i = dialog_menu("Please choose a partition type", "If you want to use this partition for swap space, select Swap.\n" "If you want to put a filesystem on it, choose FS.", -1, -1, 2, 2, fs_types, selection, NULL, NULL); DialogX = DialogY = 0; if (!i) { if (!strcmp(selection, "FS")) return PART_FILESYSTEM; else if (!strcmp(selection, "Swap")) return PART_SWAP; } return PART_NONE; } /* If the user wants a special newfs command for this, set it */ static void getNewfsCmd(PartInfo *p) { char *val; val = msgGetInput(p->newfs_cmd, "Please enter the newfs command and options you'd like to use in\n" "creating this file system."); if (val) sstrncpy(p->newfs_cmd, val, NEWFS_CMD_MAX); } #define MAX_MOUNT_NAME 12 #define PART_PART_COL 0 #define PART_MOUNT_COL 8 #define PART_SIZE_COL (PART_MOUNT_COL + MAX_MOUNT_NAME + 3) #define PART_NEWFS_COL (PART_SIZE_COL + 7) #define PART_OFF 38 #define TOTAL_AVAIL_LINES (10) #define PSLICE_SHOWABLE (4) /* stick this all up on the screen */ static void print_label_chunks(void) { int i, j, srow, prow, pcol; int sz; char clrmsg[80]; int ChunkPartStartRow; WINDOW *ChunkWin; /********************************************************/ /*** These values are for controling screen resources ***/ /*** Each label line holds up to 2 labels, so beware! ***/ /*** strategy will be to try to always make sure the ***/ /*** highlighted label is in the active display area. ***/ /********************************************************/ int pslice_max, label_max; int pslice_count, label_count, label_focus_found, pslice_focus_found; attrset(A_REVERSE); mvaddstr(0, 25, "FreeBSD Disklabel Editor"); attrset(A_NORMAL); /*** Count the number of parition slices ***/ pslice_count = 0; for (i = 0; label_chunk_info[i].c ; i++) { if (label_chunk_info[i].type == PART_SLICE) ++pslice_count; } pslice_max = pslice_count; /*** 4 line max for partition slices ***/ if (pslice_max > PSLICE_SHOWABLE) { pslice_max = PSLICE_SHOWABLE; } ChunkPartStartRow = CHUNK_SLICE_START_ROW + 3 + pslice_max; /*** View partition slices modulo pslice_max ***/ label_max = TOTAL_AVAIL_LINES - pslice_max; for (i = 0; i < 2; i++) { mvaddstr(ChunkPartStartRow - 2, PART_PART_COL + (i * PART_OFF), "Part"); mvaddstr(ChunkPartStartRow - 1, PART_PART_COL + (i * PART_OFF), "----"); mvaddstr(ChunkPartStartRow - 2, PART_MOUNT_COL + (i * PART_OFF), "Mount"); mvaddstr(ChunkPartStartRow - 1, PART_MOUNT_COL + (i * PART_OFF), "-----"); mvaddstr(ChunkPartStartRow - 2, PART_SIZE_COL + (i * PART_OFF) + 2, "Size"); mvaddstr(ChunkPartStartRow - 1, PART_SIZE_COL + (i * PART_OFF) + 2, "----"); mvaddstr(ChunkPartStartRow - 2, PART_NEWFS_COL + (i * PART_OFF), "Newfs"); mvaddstr(ChunkPartStartRow - 1, PART_NEWFS_COL + (i * PART_OFF), "-----"); } srow = CHUNK_SLICE_START_ROW; prow = 0; pcol = 0; /*** these variables indicate that the focused item is shown currently ***/ label_focus_found = 0; pslice_focus_found = 0; label_count = 0; pslice_count = 0; mvprintw(CHUNK_SLICE_START_ROW - 1, 0, " "); mvprintw(CHUNK_SLICE_START_ROW + pslice_max, 0, " "); ChunkWin = newwin(CHUNK_ROW_MAX - ChunkPartStartRow, 76, ChunkPartStartRow, 0); wclear(ChunkWin); /*** wrefresh(ChunkWin); ***/ for (i = 0; label_chunk_info[i].c; i++) { /* Is it a slice entry displayed at the top? */ if (label_chunk_info[i].type == PART_SLICE) { /*** This causes the new pslice to replace the previous display ***/ /*** focus must remain on the most recently active pslice ***/ if (pslice_count == pslice_max) { if (pslice_focus_found) { /*** This is where we can mark the more following ***/ attrset(A_BOLD); mvprintw(CHUNK_SLICE_START_ROW + pslice_max, 0, "***MORE***"); attrset(A_NORMAL); continue; } else { /*** this is where we set the more previous ***/ attrset(A_BOLD); mvprintw(CHUNK_SLICE_START_ROW - 1, 0, "***MORE***"); attrset(A_NORMAL); pslice_count = 0; srow = CHUNK_SLICE_START_ROW; } } sz = space_free(label_chunk_info[i].c); if (i == here) attrset(ATTR_SELECTED); if (i == pslice_focus) pslice_focus_found = -1; mvprintw(srow++, 0, "Disk: %s\tPartition name: %s\tFree: %d blocks (%dMB)", label_chunk_info[i].c->disk->name, label_chunk_info[i].c->name, sz, (sz / ONE_MEG)); attrset(A_NORMAL); clrtoeol(); move(0, 0); /*** refresh(); ***/ ++pslice_count; } /* Otherwise it's a DOS, swap or filesystem entry in the Chunk window */ else { char onestr[PART_OFF], num[10], *mountpoint, *newfs; /* * We copy this into a blank-padded string so that it looks like * a solid bar in reverse-video */ memset(onestr, ' ', PART_OFF - 1); onestr[PART_OFF - 1] = '\0'; /*** Track how many labels have been displayed ***/ if (label_count == ((label_max - 1 ) * 2)) { if (label_focus_found) { continue; } else { label_count = 0; prow = 0; pcol = 0; } } /* Go for two columns if we've written one full columns worth */ /*** if (prow == (CHUNK_ROW_MAX - ChunkPartStartRow)) ***/ if (label_count == label_max - 1) { pcol = PART_OFF; prow = 0; } memcpy(onestr + PART_PART_COL, label_chunk_info[i].c->name, strlen(label_chunk_info[i].c->name)); /* If it's a filesystem, display the mountpoint */ if (label_chunk_info[i].c->private_data && (label_chunk_info[i].type == PART_FILESYSTEM || label_chunk_info[i].type == PART_FAT)) mountpoint = ((PartInfo *)label_chunk_info[i].c->private_data)->mountpoint; else if (label_chunk_info[i].type == PART_SWAP) mountpoint = "swap"; else mountpoint = ""; /* Now display the newfs field */ if (label_chunk_info[i].type == PART_FAT) newfs = "DOS"; else if (label_chunk_info[i].c->private_data && label_chunk_info[i].type == PART_FILESYSTEM) newfs = ((PartInfo *)label_chunk_info[i].c->private_data)->newfs ? "UFS Y" : "UFS N"; else if (label_chunk_info[i].type == PART_SWAP) newfs = "SWAP"; else newfs = "*"; for (j = 0; j < MAX_MOUNT_NAME && mountpoint[j]; j++) onestr[PART_MOUNT_COL + j] = mountpoint[j]; snprintf(num, 10, "%4ldMB", label_chunk_info[i].c->size ? label_chunk_info[i].c->size / ONE_MEG : 0); memcpy(onestr + PART_SIZE_COL, num, strlen(num)); memcpy(onestr + PART_NEWFS_COL, newfs, strlen(newfs)); onestr[PART_NEWFS_COL + strlen(newfs)] = '\0'; if (i == label_focus) { label_focus_found = -1; wattrset(ChunkWin, A_BOLD); } if (i == here) wattrset(ChunkWin, ATTR_SELECTED); /*** lazy man's way of padding this string ***/ while (strlen( onestr ) < 37) strcat(onestr, " "); mvwaddstr(ChunkWin, prow, pcol, onestr); wattrset(ChunkWin, A_NORMAL); move(0, 0); ++prow; ++label_count; } } /*** this will erase all the extra stuff ***/ memset(clrmsg, ' ', 37); clrmsg[37] = '\0'; while (pslice_count < pslice_max) { mvprintw(srow++, 0, clrmsg); clrtoeol(); ++pslice_count; } while (label_count < (2 * (label_max - 1))) { mvwaddstr(ChunkWin, prow++, pcol, clrmsg); ++label_count; if (prow == (label_max - 1)) { prow = 0; pcol = PART_OFF; } } refresh(); wrefresh(ChunkWin); } static void print_command_summary(void) { mvprintw(17, 0, "The following commands are valid here (upper or lower case):"); mvprintw(18, 0, "C = Create D = Delete M = Mount pt."); if (!RunningAsInit) mvprintw(18, 49, "W = Write"); mvprintw(19, 0, "N = Newfs Opts T = Newfs Toggle U = Undo Q = Finish"); mvprintw(20, 0, "A = Auto Defaults for all!"); mvprintw(22, 0, "Use F1 or ? to get more help, arrow keys to select."); move(0, 0); } static void clear_wins(void) { extern void print_label_chunks(); clear(); print_label_chunks(); } +#ifdef __alpha__ + +/* + * If there isn't a freebsd chunk already (i.e. there is no label), + * dedicate the disk. + */ +static void +maybe_dedicate(Disk* d) +{ + struct chunk *c; + + for (c = d->chunks->part; c; c = c->next) { + if (c->type == freebsd) + break; + } + + if (!c) { + msgDebug("dedicating disk"); + All_FreeBSD(d, 1); + } +} + +#endif + static int diskLabel(Device *dev) { int sz, key = 0; Boolean labeling; char *msg = NULL; PartInfo *p, *oldp; PartType type; Device **devs; #ifdef __alpha__ int i; #endif label_focus = 0; pslice_focus = 0; here = 0; devs = deviceFind(NULL, DEVICE_TYPE_DISK); if (!devs) { msgConfirm("No disks found!"); return DITEM_FAILURE; } labeling = TRUE; keypad(stdscr, TRUE); #ifdef __alpha__ for (i = 0; devs[i]; i++) { - All_FreeBSD((Disk*) devs[i]->private, 1); + maybe_dedicate((Disk*) devs[i]->private); } #endif record_label_chunks(devs, dev); clear(); while (labeling) { char *cp; print_label_chunks(); print_command_summary(); if (msg) { attrset(title_attr); mvprintw(23, 0, msg); attrset(A_NORMAL); clrtoeol(); beep(); msg = NULL; } else { move(23, 0); clrtoeol(); } refresh(); key = getch(); switch (toupper(key)) { int i; static char _msg[40]; case '\014': /* ^L */ clear_wins(); break; case '\020': /* ^P */ case KEY_UP: case '-': if (here != 0) --here; else while (label_chunk_info[here + 1].c) ++here; break; case '\016': /* ^N */ case KEY_DOWN: case '+': case '\r': case '\n': if (label_chunk_info[here + 1].c) ++here; else here = 0; break; case KEY_HOME: here = 0; break; case KEY_END: while (label_chunk_info[here + 1].c) ++here; break; case KEY_F(1): case '?': systemDisplayHelp("partition"); clear_wins(); break; case 'A': if (label_chunk_info[here].type != PART_SLICE) { msg = "You can only do this in a disk slice (at top of screen)"; break; } sz = space_free(label_chunk_info[here].c); if (sz <= FS_MIN_SIZE) msg = "Not enough free space to create a new partition in the slice"; else { struct chunk *tmp; int mib[2]; int physmem; size_t size, swsize; char *cp; Chunk *rootdev, *swapdev, *usrdev, *vardev; (void)checkLabels(FALSE, &rootdev, &swapdev, &usrdev, &vardev); if (!rootdev) { cp = variable_get(VAR_ROOT_SIZE); tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk, label_chunk_info[here].c, (cp ? atoi(cp) : ROOT_DEFAULT_SIZE) * ONE_MEG, part, FS_BSDFFS, CHUNK_IS_ROOT); if (!tmp) { msgConfirm("Unable to create the root partition. Too big?"); clear_wins(); break; } tmp->private_data = new_part("/", TRUE, tmp->size); tmp->private_free = safe_free; record_label_chunks(devs, dev); } if (!swapdev) { cp = variable_get(VAR_SWAP_SIZE); if (cp) swsize = atoi(cp) * ONE_MEG; else { mib[0] = CTL_HW; mib[1] = HW_PHYSMEM; size = sizeof physmem; sysctl(mib, 2, &physmem, &size, (void *)0, (size_t)0); swsize = 16 * ONE_MEG + (physmem * 2 / 512); } tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk, label_chunk_info[here].c, swsize, part, FS_SWAP, 0); if (!tmp) { msgConfirm("Unable to create the swap partition. Too big?"); clear_wins(); break; } tmp->private_data = 0; tmp->private_free = safe_free; record_label_chunks(devs, dev); } if (!vardev) { cp = variable_get(VAR_VAR_SIZE); if (cp) sz = atoi(cp) * ONE_MEG; else sz = variable_get(VAR_NO_USR) ? space_free(label_chunk_info[here].c) : VAR_MIN_SIZE * ONE_MEG; tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk, label_chunk_info[here].c, sz, part, FS_BSDFFS, 0); if (!tmp) { msgConfirm("Less than %dMB free for /var - you will need to\n" "partition your disk manually with a custom install!", (cp ? atoi(cp) : VAR_MIN_SIZE)); clear_wins(); break; } tmp->private_data = new_part("/var", TRUE, tmp->size); tmp->private_free = safe_free; record_label_chunks(devs, dev); } if (!usrdev && !variable_get(VAR_NO_USR)) { cp = variable_get(VAR_USR_SIZE); if (cp) sz = atoi(cp) * ONE_MEG; else sz = space_free(label_chunk_info[here].c); if (sz) { if (sz < (USR_MIN_SIZE * ONE_MEG)) { msgConfirm("Less than %dMB free for /usr - you will need to\n" "partition your disk manually with a custom install!", USR_MIN_SIZE); clear_wins(); break; } tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk, label_chunk_info[here].c, sz, part, FS_BSDFFS, 0); if (!tmp) { msgConfirm("Unable to create the /usr partition. Not enough space?\n" "You will need to partition your disk manually with a custom install!"); clear_wins(); break; } tmp->private_data = new_part("/usr", TRUE, tmp->size); tmp->private_free = safe_free; record_label_chunks(devs, dev); } } /* At this point, we're reasonably "labelled" */ if (((cp = variable_get(DISK_LABELLED)) == NULL) || (strcmp(cp, "written"))) variable_set2(DISK_LABELLED, "yes", 0); } break; case 'C': if (label_chunk_info[here].type != PART_SLICE) { msg = "You can only do this in a master partition (see top of screen)"; break; } sz = space_free(label_chunk_info[here].c); if (sz <= FS_MIN_SIZE) { msg = "Not enough space to create an additional FreeBSD partition"; break; } else { char *val; int size; struct chunk *tmp; char osize[80]; u_long flags = 0; sprintf(osize, "%d", sz); DialogX = 3; DialogY = 2; val = msgGetInput(osize, "Please specify the partition size in blocks or append a trailing M for\n" "megabytes or C for cylinders. %d blocks (%dMB) are free.", sz, sz / ONE_MEG); DialogX = DialogY = 0; if (!val || (size = strtol(val, &cp, 0)) <= 0) { clear_wins(); break; } if (*cp) { if (toupper(*cp) == 'M') size *= ONE_MEG; else if (toupper(*cp) == 'C') size *= (label_chunk_info[here].c->disk->bios_hd * label_chunk_info[here].c->disk->bios_sect); } if (size <= FS_MIN_SIZE) { msgConfirm("The minimum filesystem size is %dMB", FS_MIN_SIZE / ONE_MEG); clear_wins(); break; } type = get_partition_type(); if (type == PART_NONE) { clear_wins(); beep(); break; } if (type == PART_FILESYSTEM) { if ((p = get_mountpoint(NULL)) == NULL) { clear_wins(); beep(); break; } else if (!strcmp(p->mountpoint, "/")) flags |= CHUNK_IS_ROOT; else flags &= ~CHUNK_IS_ROOT; } else p = NULL; if ((flags & CHUNK_IS_ROOT)) { if (!(label_chunk_info[here].c->flags & CHUNK_BSD_COMPAT)) { msgConfirm("This region cannot be used for your root partition as the\n" "FreeBSD boot code cannot deal with a root partition created\n" "in that location. Please choose another location or smaller\n" "size for your root partition and try again!"); clear_wins(); break; } if (size < (ROOT_MIN_SIZE * ONE_MEG)) { msgConfirm("Warning: This is smaller than the recommended size for a\n" "root partition. For a variety of reasons, root\n" "partitions should usually be at least %dMB in size", ROOT_MIN_SIZE); } } tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk, label_chunk_info[here].c, size, part, (type == PART_SWAP) ? FS_SWAP : FS_BSDFFS, flags); if (!tmp) { msgConfirm("Unable to create the partition. Too big?"); clear_wins(); break; } if ((flags & CHUNK_IS_ROOT) && (tmp->flags & CHUNK_PAST_1024)) { msgConfirm("This region cannot be used for your root partition as it starts\n" "or extends past the 1024'th cylinder mark and is thus a\n" "poor location to boot from. Please choose another\n" "location (or smaller size) for your root partition and try again!"); Delete_Chunk(label_chunk_info[here].c->disk, tmp); clear_wins(); break; } if (type != PART_SWAP) { /* This is needed to tell the newfs -u about the size */ tmp->private_data = new_part(p->mountpoint, p->newfs, tmp->size); safe_free(p); } else tmp->private_data = p; tmp->private_free = safe_free; if (((cp = variable_get(DISK_LABELLED)) == NULL) || (strcmp(cp, "written"))) variable_set2(DISK_LABELLED, "yes", 0); record_label_chunks(devs, dev); clear_wins(); /*** This is where we assign focus to new label so it shows ***/ { int i; label_focus = -1; for (i = 0; label_chunk_info[i].c; ++i) { if (label_chunk_info[i].c == tmp) { label_focus = i; break; } } if (label_focus == -1) label_focus = i - 1; } } break; case KEY_DC: case 'D': /* delete */ if (label_chunk_info[here].type == PART_SLICE) { msg = MSG_NOT_APPLICABLE; break; } else if (label_chunk_info[here].type == PART_FAT) { msg = "Use the Disk Partition Editor to delete DOS partitions"; break; } Delete_Chunk(label_chunk_info[here].c->disk, label_chunk_info[here].c); if (((cp = variable_get(DISK_LABELLED)) == NULL) || (strcmp(cp, "written"))) variable_set2(DISK_LABELLED, "yes", 0); record_label_chunks(devs, dev); break; case 'M': /* mount */ switch(label_chunk_info[here].type) { case PART_SLICE: msg = MSG_NOT_APPLICABLE; break; case PART_SWAP: msg = "You don't need to specify a mountpoint for a swap partition."; break; case PART_FAT: case PART_FILESYSTEM: oldp = label_chunk_info[here].c->private_data; p = get_mountpoint(label_chunk_info[here].c); if (p) { if (!oldp) p->newfs = FALSE; if (label_chunk_info[here].type == PART_FAT && (!strcmp(p->mountpoint, "/") || !strcmp(p->mountpoint, "/usr") || !strcmp(p->mountpoint, "/var"))) { msgConfirm("%s is an invalid mount point for a DOS partition!", p->mountpoint); strcpy(p->mountpoint, "/bogus"); } } if (((cp = variable_get(DISK_LABELLED)) == NULL) || (strcmp(cp, "written"))) variable_set2(DISK_LABELLED, "yes", 0); record_label_chunks(devs, dev); clear_wins(); break; default: msgFatal("Bogus partition under cursor???"); break; } break; case 'N': /* Set newfs options */ if (label_chunk_info[here].c->private_data && ((PartInfo *)label_chunk_info[here].c->private_data)->newfs) getNewfsCmd(label_chunk_info[here].c->private_data); else msg = MSG_NOT_APPLICABLE; clear_wins(); break; case 'T': /* Toggle newfs state */ if (label_chunk_info[here].type == PART_FILESYSTEM) { PartInfo *pi = ((PartInfo *)label_chunk_info[here].c->private_data); label_chunk_info[here].c->private_data = new_part(pi ? pi->mountpoint : NULL, pi ? !pi->newfs : TRUE, label_chunk_info[here].c->size); safe_free(pi); label_chunk_info[here].c->private_free = safe_free; if (((cp = variable_get(DISK_LABELLED)) == NULL) || (strcmp(cp, "written"))) variable_set2(DISK_LABELLED, "yes", 0); } else msg = MSG_NOT_APPLICABLE; break; case 'U': clear(); if ((cp = variable_get(DISK_LABELLED)) && !strcmp(cp, "written")) { msgConfirm("You've already written out your changes -\n" "it's too late to undo!"); } else if (!msgYesNo("Are you SURE you want to Undo everything?")) { variable_unset(DISK_PARTITIONED); variable_unset(DISK_LABELLED); for (i = 0; devs[i]; i++) { Disk *d; if (!devs[i]->enabled) continue; else if ((d = Open_Disk(devs[i]->name)) != NULL) { Free_Disk(devs[i]->private); devs[i]->private = d; diskPartition(devs[i]); } } record_label_chunks(devs, dev); } clear_wins(); break; case 'W': if ((cp = variable_get(DISK_LABELLED)) && !strcmp(cp, "written")) { msgConfirm("You've already written out your changes - if you\n" "wish to overwrite them, you'll have to start this\n" "procedure again from the beginning."); } else if (!msgYesNo("WARNING: This should only be used when modifying an EXISTING\n" "installation. If you are installing FreeBSD for the first time\n" "then you should simply type Q when you're finished here and your\n" "changes will be committed in one batch automatically at the end of\n" "these questions.\n\n" "Are you absolutely sure you want to do this now?")) { variable_set2(DISK_LABELLED, "yes", 0); diskLabelCommit(NULL); } clear_wins(); break; case '|': if (!msgYesNo("Are you sure you want to go into Wizard mode?\n\n" "This is an entirely undocumented feature which you are not\n" "expected to understand!")) { int i; Device **devs; dialog_clear(); end_dialog(); DialogActive = FALSE; devs = deviceFind(NULL, DEVICE_TYPE_DISK); if (!devs) { msgConfirm("Can't find any disk devices!"); break; } for (i = 0; devs[i] && ((Disk *)devs[i]->private); i++) { if (devs[i]->enabled) slice_wizard(((Disk *)devs[i]->private)); } if (((cp = variable_get(DISK_LABELLED)) == NULL) || (strcmp(cp, "written"))) variable_set2(DISK_LABELLED, "yes", 0); DialogActive = TRUE; record_label_chunks(devs, dev); clear_wins(); } else msg = "A most prudent choice!"; break; case '\033': /* ESC */ case 'Q': labeling = FALSE; break; default: beep(); sprintf(_msg, "Invalid key %d - Type F1 or ? for help", key); msg = _msg; break; } if (label_chunk_info[here].type == PART_SLICE) pslice_focus = here; else label_focus = here; } return DITEM_SUCCESS | DITEM_RESTORE; } static int diskLabelNonInteractive(Device *dev) { char *cp; PartType type; PartInfo *p; u_long flags = 0; int i, status; Device **devs; Disk *d; status = DITEM_SUCCESS; cp = variable_get(VAR_DISK); if (!cp) { dialog_clear(); msgConfirm("diskLabel: No disk selected - can't label automatically."); return DITEM_FAILURE; } devs = deviceFind(cp, DEVICE_TYPE_DISK); if (!devs) { msgConfirm("diskLabel: No disk device %s found!", cp); return DITEM_FAILURE; } if (dev) d = dev->private; else d = devs[0]->private; #ifdef __alpha__ - All_FreeBSD(d, 1); + maybe_dedicate(d); #endif record_label_chunks(devs, dev); for (i = 0; label_chunk_info[i].c; i++) { Chunk *c1 = label_chunk_info[i].c; if (label_chunk_info[i].type == PART_SLICE) { char name[512]; int entries = 1; while (entries) { snprintf(name, sizeof name, "%s-%d", c1->name, entries); if ((cp = variable_get(name)) != NULL) { int sz; char typ[10], mpoint[50]; if (sscanf(cp, "%s %d %s", typ, &sz, mpoint) != 3) { msgConfirm("For slice entry %s, got an invalid detail entry of: %s", c1->name, cp); status = DITEM_FAILURE; continue; } else { Chunk *tmp; if (!strcmp(typ, "swap")) { type = PART_SWAP; strcpy(mpoint, "SWAP"); } else { type = PART_FILESYSTEM; if (!strcmp(mpoint, "/")) flags |= CHUNK_IS_ROOT; else flags &= ~CHUNK_IS_ROOT; } if (!sz) sz = space_free(c1); if (sz > space_free(c1)) { msgConfirm("Not enough free space to create partition: %s", mpoint); status = DITEM_FAILURE; continue; } if (!(tmp = Create_Chunk_DWIM(d, c1, sz, part, (type == PART_SWAP) ? FS_SWAP : FS_BSDFFS, flags))) { msgConfirm("Unable to create from partition spec: %s. Too big?", cp); status = DITEM_FAILURE; break; } else { tmp->private_data = new_part(mpoint, TRUE, sz); tmp->private_free = safe_free; status = DITEM_SUCCESS; } } entries++; } else { /* No more matches, leave the loop */ entries = 0; } } } else { /* Must be something we can set a mountpoint for */ cp = variable_get(c1->name); if (cp) { char mpoint[50], do_newfs[8]; Boolean newfs = FALSE; do_newfs[0] = '\0'; if (sscanf(cp, "%s %s", mpoint, do_newfs) != 2) { dialog_clear(); msgConfirm("For slice entry %s, got an invalid detail entry of: %s", c1->name, cp); status = DITEM_FAILURE; continue; } newfs = toupper(do_newfs[0]) == 'Y' ? TRUE : FALSE; if (c1->private_data) { p = c1->private_data; p->newfs = newfs; strcpy(p->mountpoint, mpoint); } else { c1->private_data = new_part(mpoint, newfs, 0); c1->private_free = safe_free; } if (!strcmp(mpoint, "/")) c1->flags |= CHUNK_IS_ROOT; else c1->flags &= ~CHUNK_IS_ROOT; } } } if (status == DITEM_SUCCESS) variable_set2(DISK_LABELLED, "yes", 0); return status; } Index: stable/3/release/sysinstall/menus.c =================================================================== --- stable/3/release/sysinstall/menus.c (revision 44619) +++ stable/3/release/sysinstall/menus.c (revision 44620) @@ -1,1506 +1,1515 @@ /* * 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.180.2.9 1999/02/14 21:35:55 jkh Exp $ + * $Id: menus.c,v 1.180.2.10 1999/03/09 12:40:14 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" #ifdef __alpha__ #define _AR(str) str "alpha/" #else /* i386 */ #define _AR(str) str "i386/" #endif /* 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 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 _AR("=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 _AR("=ftp://current.freebsd.org/pub/FreeBSD/snapshots/") }, { "3.0 SNAP Server", "releng3.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH _AR("=ftp://releng3.freebsd.org/pub/FreeBSD/snapshots/") }, { "Argentina", "ftp.ar.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ar.freebsd.org/pub/FreeBSD/" }, { "Australia", "ftp.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.au.freebsd.org/pub/FreeBSD/" }, { "Australia #2", "ftp2.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.au.freebsd.org/pub/FreeBSD/" }, { "Australia #3", "ftp3.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.au.freebsd.org/pub/FreeBSD/" }, { "Australia #4", "ftp4.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.au.freebsd.org/pub/FreeBSD/" }, { "Australia #5", "ftp5.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.au.freebsd.org/pub/FreeBSD/" }, { "Brazil", "ftp.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.br.freebsd.org/pub/FreeBSD/" }, { "Brazil #2", "ftp2.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.br.freebsd.org/pub/FreeBSD/" }, { "Brazil #3", "ftp3.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.br.freebsd.org/pub/FreeBSD/" }, { "Brazil #4", "ftp4.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.br.freebsd.org/pub/FreeBSD/" }, { "Brazil #5", "ftp5.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.br.freebsd.org/pub/FreeBSD/" }, { "Brazil #6", "ftp6.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp6.br.freebsd.org/pub/FreeBSD/" }, { "Brazil #7", "ftp7.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp7.br.freebsd.org/pub/FreeBSD/" }, { "Canada", "ftp.ca.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ca.freebsd.org/pub/FreeBSD/" }, { "Czech Republic", "ftp.cz.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.cz.freebsd.org/pub/FreeBSD/" }, { "Denmark", "ftp.dk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.dk.freebsd.org/pub/FreeBSD/" }, { "Denmark #2", "ftp2.dk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.dk.freebsd.org/pub/FreeBSD/" }, { "Estonia", "ftp.ee.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ee.freebsd.org/pub/FreeBSD/" }, { "Finland", "ftp.fi.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.fi.freebsd.org/pub/FreeBSD/" }, { "France", "ftp.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.fr.freebsd.org/pub/FreeBSD/" }, { "France #2", "ftp2.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.fr.freebsd.org/pub/FreeBSD/" }, { "Germany", "ftp.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.de.freebsd.org/pub/FreeBSD/" }, { "Germany #2", "ftp2.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.de.freebsd.org/pub/FreeBSD/" }, { "Germany #3", "ftp3.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.de.freebsd.org/pub/FreeBSD/" }, { "Germany #4", "ftp4.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.de.freebsd.org/pub/FreeBSD/" }, { "Germany #5", "ftp5.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.de.freebsd.org/pub/FreeBSD/" }, { "Germany #6", "ftp6.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp6.de.freebsd.org/pub/FreeBSD/" }, { "Germany #7", "ftp7.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp7.de.freebsd.org/pub/FreeBSD/" }, { "Holland", "ftp.nl.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.nl.freebsd.org/pub/FreeBSD/" }, { "Hong Kong", "ftp.hk.super.net", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.hk.super.net/pub/FreeBSD/" }, { "Iceland", "ftp.is.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.is.freebsd.org/pub/FreeBSD/" }, { "Ireland", "ftp.ie.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ie.freebsd.org/pub/FreeBSD/" }, { "Israel", "ftp.il.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.il.freebsd.org/pub/FreeBSD/" }, { "Israel #2", "ftp2.il.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.il.freebsd.org/pub/FreeBSD/" }, { "Japan", "ftp.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.jp.freebsd.org/pub/FreeBSD/" }, { "Japan #2", "ftp2.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.jp.freebsd.org/pub/FreeBSD/" }, { "Japan #3", "ftp3.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.jp.freebsd.org/pub/FreeBSD/" }, { "Japan #4", "ftp4.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.jp.freebsd.org/pub/FreeBSD/" }, { "Japan #5", "ftp5.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.jp.freebsd.org/pub/FreeBSD/" }, { "Japan #6", "ftp6.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp6.jp.freebsd.org/pub/FreeBSD/" }, { "Korea", "ftp.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.kr.freebsd.org/pub/FreeBSD/" }, { "Korea #2", "ftp2.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.kr.freebsd.org/pub/FreeBSD/" }, { "Korea #3", "ftp3.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.kr.freebsd.org/pub/FreeBSD/" }, { "Korea #4", "ftp4.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.kr.freebsd.org/pub/FreeBSD/" }, { "Korea #5", "ftp5.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.kr.freebsd.org/pub/FreeBSD/" }, { "Poland", "ftp.pl.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.pl.freebsd.org/pub/FreeBSD/" }, { "Portugal", "ftp.pt.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.pt.freebsd.org/pub/misc/FreeBSD/" }, { "Portugal #2", "ftp2.pt.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.pt.freebsd.org/pub/FreeBSD/" }, { "Russia", "ftp.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ru.freebsd.org/pub/FreeBSD/" }, { "Russia #2", "ftp2.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.ru.freebsd.org/pub/FreeBSD/" }, { "Russia #3", "ftp3.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.ru.freebsd.org/pub/FreeBSD/" }, { "Russia #4", "ftp4.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.ru.freebsd.org/pub/FreeBSD/" }, { "South Africa", "ftp.za.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.za.freebsd.org/pub/FreeBSD/" }, { "South Africa #2", "ftp2.za.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.za.freebsd.org/pub/FreeBSD/" }, { "South Africa #3", "ftp3.za.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.za.freebsd.org/pub/FreeBSD/" }, { "South Africa #4", "ftp4.za.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.za.freebsd.org/pub/FreeBSD/" }, { "Spain", "ftp.es.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.es.freebsd.org/pub/FreeBSD/" }, { "Spain #2", "ftp2.es.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.za.freebsd.org/pub/FreeBSD/" }, { "Sweden", "ftp.se.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.se.freebsd.org/pub/FreeBSD/" }, { "Sweden #2", "ftp2.se.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.se.freebsd.org/pub/FreeBSD/" }, { "Sweden #3", "ftp3.se.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.se.freebsd.org/pub/FreeBSD/" }, { "Taiwan", "ftp.tw.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.tw.freebsd.org/pub/FreeBSD" }, { "Taiwan #2", "ftp2.tw.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.tw.freebsd.org/pub/FreeBSD" }, { "Taiwan #3", "ftp3.tw.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.tw.freebsd.org/pub/FreeBSD/" }, { "Thailand", "ftp.nectec.or.th", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.nectec.or.th/pub/mirrors/FreeBSD/" }, { "UK", "ftp.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.uk.freebsd.org/pub/FreeBSD/" }, { "UK #2", "ftp2.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.uk.freebsd.org/pub/FreeBSD/" }, { "UK #3", "ftp3.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.uk.freebsd.org/pub/FreeBSD/" }, { "UK #4", "ftp4.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.uk.freebsd.org/pub/FreeBSD/" }, { "USA", "ftp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.freebsd.org/pub/FreeBSD/" }, { "USA #2", "ftp2.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.freebsd.org/pub/FreeBSD/" }, { "USA #3", "ftp3.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.freebsd.org/pub/FreeBSD/" }, { "USA #4", "ftp4.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.freebsd.org/pub/FreeBSD/" }, { "USA #5", "ftp5.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.freebsd.org/pub/FreeBSD/" }, { "USA #6", "ftp6.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp6.freebsd.org/pub/FreeBSD/" }, { 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, but includes the X Window System", checkDistXDeveloper, distSetXDeveloper }, { "3 Kern-Developer", "Full binaries and doc, kernel sources only", checkDistKernDeveloper, distSetKernDeveloper }, { "4 User", "Average user - binaries and doc only", checkDistUser, distSetUser }, { "5 X-User", "Same as above, but includes the X Window System", checkDistXUser, distSetXUser }, { "6 Minimal", "The smallest configuration possible", checkDistMinimum, distSetMinimum }, { "7 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 }, { "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 } }, }; Index: stable/3/release/sysinstall/sysinstall.h =================================================================== --- stable/3/release/sysinstall/sysinstall.h (revision 44619) +++ stable/3/release/sysinstall/sysinstall.h (revision 44620) @@ -1,717 +1,719 @@ /* * 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.153.2.3 1999/02/05 22:25:36 jkh Exp $ + * $Id: sysinstall.h,v 1.153.2.4 1999/02/09 22:25:58 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 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 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 top, PkgNodePtr plist, int *pos, int *scroll); +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 */