diff --git a/usr.sbin/sade/menus.c b/usr.sbin/sade/menus.c index b56a8e2ea24f..71bc616c6035 100644 --- a/usr.sbin/sade/menus.c +++ b/usr.sbin/sade/menus.c @@ -1,2284 +1,2284 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer, * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * */ #ifndef lint static const char rcsid[] = "$FreeBSD$"; #endif #include "sysinstall.h" /* Miscellaneous work routines for menus */ static int setSrc(dialogMenuItem *self) { Dists |= DIST_SRC; SrcDists = DIST_SRC_ALL; CRYPTODists |= (DIST_CRYPTO_SCRYPTO | DIST_CRYPTO_SSECURE | DIST_CRYPTO_SKERBEROS5); return DITEM_SUCCESS | DITEM_REDRAW; } static int clearSrc(dialogMenuItem *self) { Dists &= ~DIST_SRC; SrcDists = 0; CRYPTODists &= ~(DIST_CRYPTO_SCRYPTO | DIST_CRYPTO_SSECURE | DIST_CRYPTO_SKERBEROS5); return DITEM_SUCCESS | DITEM_REDRAW; } static int setX11Misc(dialogMenuItem *self) { XF86Dists |= DIST_XF86_MISC_ALL; Dists |= DIST_XF86; return DITEM_SUCCESS | DITEM_REDRAW; } static int clearX11Misc(dialogMenuItem *self) { XF86Dists &= ~DIST_XF86_MISC_ALL; if (!XF86ServerDists && !XF86FontDists) Dists &= ~DIST_XF86; return DITEM_SUCCESS | DITEM_REDRAW; } static int setX11Servers(dialogMenuItem *self) { XF86Dists |= DIST_XF86_SERVER; XF86ServerDists = DIST_XF86_SERVER_ALL; return DITEM_SUCCESS | DITEM_REDRAW; } static int clearX11Servers(dialogMenuItem *self) { XF86Dists &= ~DIST_XF86_SERVER; XF86ServerDists = 0; return DITEM_SUCCESS | DITEM_REDRAW; } static int setX11Fonts(dialogMenuItem *self) { XF86Dists |= DIST_XF86_FONTS; XF86FontDists = DIST_XF86_FONTS_ALL; return DITEM_SUCCESS | DITEM_REDRAW; } static int clearX11Fonts(dialogMenuItem *self) { XF86Dists &= ~DIST_XF86_FONTS; XF86FontDists = 0; return DITEM_SUCCESS | DITEM_REDRAW; } #define _IS_SET(dist, set) (((dist) & (set)) == (set)) #define IS_DEVELOPER(dist, extra) (_IS_SET(dist, _DIST_DEVELOPER | extra) || \ _IS_SET(dist, _DIST_DEVELOPER | extra)) #define IS_USER(dist, extra) (_IS_SET(dist, _DIST_USER | extra) || \ _IS_SET(dist, _DIST_USER | extra)) static int checkDistDeveloper(dialogMenuItem *self) { return IS_DEVELOPER(Dists, 0) && _IS_SET(SrcDists, DIST_SRC_ALL); } static int checkDistXDeveloper(dialogMenuItem *self) { return IS_DEVELOPER(Dists, DIST_XF86) && _IS_SET(SrcDists, DIST_SRC_ALL); } static int checkDistKernDeveloper(dialogMenuItem *self) { return IS_DEVELOPER(Dists, 0) && _IS_SET(SrcDists, DIST_SRC_SYS); } static int checkDistXKernDeveloper(dialogMenuItem *self) { return IS_DEVELOPER(Dists, DIST_XF86) && _IS_SET(SrcDists, DIST_SRC_SYS); } static int checkDistUser(dialogMenuItem *self) { return IS_USER(Dists, 0); } static int checkDistXUser(dialogMenuItem *self) { return IS_USER(Dists, DIST_XF86); } static int checkDistMinimum(dialogMenuItem *self) { return Dists == (DIST_BASE | DIST_CRYPTO); } static int checkDistEverything(dialogMenuItem *self) { return Dists == DIST_ALL && CRYPTODists == DIST_CRYPTO_ALL && _IS_SET(SrcDists, DIST_SRC_ALL) && _IS_SET(XF86Dists, DIST_XF86_ALL) && _IS_SET(XF86ServerDists, DIST_XF86_SERVER_ALL) && _IS_SET(XF86FontDists, DIST_XF86_FONTS_ALL); } static int srcFlagCheck(dialogMenuItem *item) { return SrcDists; } static int x11FlagCheck(dialogMenuItem *item) { return Dists & DIST_XF86; } static int checkTrue(dialogMenuItem *item) { return TRUE; } /* All the system menus go here. * * Hardcoded things like version number strings will disappear from * these menus just as soon as I add the code for doing inline variable * expansion. */ DMenu MenuIndex = { DMENU_NORMAL_TYPE, "Glossary of functions", "This menu contains an alphabetized index of the top level functions in\n" "this program (sysinstall). Invoke an option by pressing [SPACE] or\n" "[ENTER]. To exit, use [TAB] to move to the Cancel button.", "Use PageUp or PageDown to move through this menu faster!", NULL, { { " Anon FTP", "Configure anonymous FTP logins.", dmenuVarCheck, configAnonFTP, NULL, "anon_ftp" }, { " Commit", "Commit any pending actions (dangerous!)", NULL, installCustomCommit }, #ifdef WITH_SYSCONS { " Console settings", "Customize system console behavior.", NULL, dmenuSubmenu, NULL, &MenuSyscons }, #endif { " Configure", "The system configuration menu.", NULL, dmenuSubmenu, NULL, &MenuConfigure }, { " Defaults, Load", "Load default settings.", NULL, dispatch_load_floppy }, #ifdef WITH_MICE { " Device, Mouse", "The mouse configuration menu.", NULL, dmenuSubmenu, NULL, &MenuMouse }, #endif { " Disklabel", "The disk Label editor", NULL, diskLabelEditor }, { " Dists, All", "Root of the distribution tree.", NULL, dmenuSubmenu, NULL, &MenuDistributions }, { " Dists, Basic", "Basic FreeBSD distribution menu.", NULL, dmenuSubmenu, NULL, &MenuSubDistributions }, { " Dists, Developer", "Select developer's distribution.", checkDistDeveloper, distSetDeveloper }, { " Dists, Src", "Src distribution menu.", NULL, dmenuSubmenu, NULL, &MenuSrcDistributions }, { " Dists, X Developer", "Select X developer's distribution.", checkDistXDeveloper, distSetXDeveloper }, { " Dists, Kern Developer", "Select kernel developer's distribution.", checkDistKernDeveloper, distSetKernDeveloper }, { " Dists, User", "Select average user distribution.", checkDistUser, distSetUser }, { " Dists, X User", "Select average X user distribution.", checkDistXUser, distSetXUser }, { " Distributions, Adding", "Installing additional distribution sets", NULL, distExtractAll }, { " Distributions, XFree86","XFree86 distribution menu.", NULL, distSetXF86 }, { " Documentation", "Installation instructions, README, etc.", NULL, dmenuSubmenu, NULL, &MenuDocumentation }, { " Doc, README", "The distribution README file.", NULL, dmenuDisplayFile, NULL, "README" }, { " Doc, Early Adopter's", "Early Adopter's Guide to FreeBSD 5.0.", NULL, dmenuDisplayFile, NULL, "EARLY" }, { " Doc, Errata", "The distribution errata.", NULL, dmenuDisplayFile, NULL, "ERRATA" }, { " Doc, Hardware", "The distribution hardware guide.", NULL, dmenuDisplayFile, NULL, "HARDWARE" }, { " Doc, Install", "The distribution installation guide.", NULL, dmenuDisplayFile, NULL, "INSTALL" }, { " Doc, Copyright", "The distribution copyright notices.", NULL, dmenuDisplayFile, NULL, "COPYRIGHT" }, { " Doc, Release", "The distribution release notes.", NULL, dmenuDisplayFile, NULL, "RELNOTES" }, { " Doc, HTML", "The HTML documentation menu.", NULL, docBrowser }, { " Dump Vars", "(debugging) dump out internal variables.", NULL, dump_variables }, { " Emergency shell", "Start an Emergency Holographic shell.", NULL, installFixitHoloShell }, #ifdef WITH_SLICES { " Fdisk", "The disk Partition Editor", NULL, diskPartitionEditor }, #endif { " Fixit", "Repair mode with CDROM or fixit floppy.", NULL, dmenuSubmenu, NULL, &MenuFixit }, { " FTP sites", "The FTP mirror site listing.", NULL, dmenuSubmenu, NULL, &MenuMediaFTP }, { " Gateway", "Set flag to route packets between interfaces.", dmenuVarCheck, dmenuToggleVariable, NULL, "gateway=YES" }, { " HTML Docs", "The HTML documentation menu", NULL, docBrowser }, { " inetd Configuration", "Configure inetd and simple internet services.", dmenuVarCheck, configInetd, NULL, "inetd_enable=YES" }, { " Install, Standard", "A standard system installation.", NULL, installStandard }, { " Install, Express", "An express system installation.", NULL, installExpress }, { " Install, Custom", "The custom installation menu", NULL, dmenuSubmenu, NULL, &MenuInstallCustom }, { " Label", "The disk Label editor", NULL, diskLabelEditor }, { " Media", "Top level media selection menu.", NULL, dmenuSubmenu, NULL, &MenuMedia }, { " Media, Tape", "Select tape installation media.", NULL, mediaSetTape }, { " Media, NFS", "Select NFS installation media.", NULL, mediaSetNFS }, { " Media, Floppy", "Select floppy installation media.", NULL, mediaSetFloppy }, { " Media, CDROM/DVD", "Select CDROM/DVD installation media.", NULL, mediaSetCDROM }, { " Media, DOS", "Select DOS installation media.", NULL, mediaSetDOS }, { " Media, UFS", "Select UFS installation media.", NULL, mediaSetUFS }, { " Media, FTP", "Select FTP installation media.", NULL, mediaSetFTP }, { " Media, FTP Passive", "Select passive FTP installation media.", NULL, mediaSetFTPPassive }, { " Media, HTTP", "Select FTP via HTTP proxy installation media.", NULL, mediaSetHTTP }, { " Network Interfaces", "Configure network interfaces", NULL, tcpMenuSelect }, { " Networking Services", "The network services menu.", NULL, dmenuSubmenu, NULL, &MenuNetworking }, { " NFS, client", "Set NFS client flag.", dmenuVarCheck, dmenuToggleVariable, NULL, "nfs_client_enable=YES" }, { " NFS, server", "Set NFS server flag.", dmenuVarCheck, configNFSServer, NULL, "nfs_server_enable=YES" }, { " NTP Menu", "The NTP configuration menu.", NULL, dmenuSubmenu, NULL, &MenuNTP }, { " Options", "The options editor.", NULL, optionsEditor }, { " Packages", "The packages collection", NULL, configPackages }, #ifdef WITH_SLICES { " Partition", "The disk Slice (PC-style partition) Editor", NULL, diskPartitionEditor }, #endif { " PCNFSD", "Run authentication server for PC-NFS.", dmenuVarCheck, configPCNFSD, NULL, "pcnfsd" }, { " Root Password", "Set the system manager's password.", NULL, dmenuSystemCommand, NULL, "passwd root" }, { " Router", "Select routing daemon (default: routed)", NULL, configRouter, NULL, "router_enable" }, { " Security", "Configure system security options", NULL, dmenuSubmenu, NULL, &MenuSecurity }, #ifdef WITH_SYSCONS { " Syscons", "The system console configuration menu.", NULL, dmenuSubmenu, NULL, &MenuSyscons }, #ifndef PC98 { " Syscons, Font", "The console screen font.", NULL, dmenuSubmenu, NULL, &MenuSysconsFont }, #endif { " 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 }, #ifndef PC98 { " Syscons, Screenmap", "The console screenmap configuration menu.", NULL, dmenuSubmenu, NULL, &MenuSysconsScrnmap }, { " Syscons, Ttys", "The console terminal type menu.", NULL, dmenuSubmenu, NULL, &MenuSysconsTtys }, #endif #endif /* WITH_SYSCONS */ { " Time Zone", "Set the system's time zone.", NULL, dmenuSystemCommand, NULL, "tzsetup" }, { " TTYs", "Configure system ttys.", NULL, configEtcTtys, NULL, "ttys" }, { " Upgrade", "Upgrade an existing system.", NULL, installUpgrade }, { " Usage", "Quick start - How to use this menu system.", NULL, dmenuDisplayFile, NULL, "usage" }, { " User Management", "Add user and group information.", NULL, dmenuSubmenu, NULL, &MenuUsermgmt }, { " XFree86, Fonts", "XFree86 Font selection menu.", NULL, dmenuSubmenu, NULL, &MenuXF86SelectFonts }, { " XFree86, Server", "XFree86 Server selection menu.", NULL, dmenuSubmenu, NULL, &MenuXF86SelectServer }, { NULL } }, }; /* The initial installation menu */ DMenu MenuInitial = { DMENU_NORMAL_TYPE, "sysinstall Main Menu", /* title */ "Welcome to the FreeBSD installation and configuration tool. Please\n" /* prompt */ "select one of the options below by using the arrow keys or typing the\n" "first character of the option name you're interested in. Invoke an\n" "option with [SPACE] or [ENTER]. To exit, use [TAB] to move to Exit.", "Press F1 for Installation Guide", /* help line */ "INSTALL", /* help file */ { { "Select" }, { "X Exit Install", NULL, NULL, dmenuExit }, { " Usage", "Quick start - How to use this menu system", NULL, dmenuDisplayFile, NULL, "usage" }, { "Standard", "Begin a standard installation (recommended)", NULL, installStandard }, { "Express", "Begin a quick installation (for experts)", NULL, installExpress }, { " Custom", "Begin a custom installation (for experts)", NULL, dmenuSubmenu, NULL, &MenuInstallCustom }, { "Configure", "Do post-install configuration of FreeBSD", NULL, dmenuSubmenu, NULL, &MenuConfigure }, { "Doc", "Installation instructions, README, etc.", NULL, dmenuSubmenu, NULL, &MenuDocumentation }, #ifdef WITH_SYSCONS { "Keymap", "Select keyboard type", NULL, dmenuSubmenu, NULL, &MenuSysconsKeymap }, #endif { "Options", "View/Set various installation options", NULL, optionsEditor }, { "Fixit", "Repair mode with CDROM/DVD/floppy or start shell", NULL, dmenuSubmenu, NULL, &MenuFixit }, { "Upgrade", "Upgrade an existing system", NULL, installUpgrade }, { "Load Config","Load default install configuration", NULL, dispatch_load_floppy }, { "Index", "Glossary of functions", NULL, dmenuSubmenu, NULL, &MenuIndex }, { NULL } }, }; /* The main documentation menu */ DMenu MenuDocumentation = { DMENU_NORMAL_TYPE, "FreeBSD Documentation Menu", "If you are at all unsure about the configuration of your hardware\n" "or are looking to build a system specifically for FreeBSD, read the\n" "Hardware guide! New users should also read the Install document for\n" "a step-by-step tutorial on installing FreeBSD. For general information,\n" "consult the README file.", "Confused? Press F1 for help.", "usage", { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "1 README", "A general description of FreeBSD. Read this!", NULL, dmenuDisplayFile, NULL, "README" }, { "2 Early Adopter's", "Early Adopter's Guide to FreeBSD 5.0.", NULL, dmenuDisplayFile, NULL, "EARLY" }, { "3 Errata", "Late-breaking, post-release news.", NULL, dmenuDisplayFile, NULL, "ERRATA" }, { "4 Hardware", "The FreeBSD survival guide for PC hardware.", NULL, dmenuDisplayFile, NULL, "HARDWARE" }, { "5 Install", "A step-by-step guide to installing FreeBSD.", NULL, dmenuDisplayFile, NULL, "INSTALL" }, { "6 Copyright", "The FreeBSD Copyright notices.", NULL, dmenuDisplayFile, NULL, "COPYRIGHT" }, { "7 Release" ,"The release notes for this version of FreeBSD.", NULL, dmenuDisplayFile, NULL, "RELNOTES" }, { "8 Shortcuts", "Creating shortcuts to sysinstall.", NULL, dmenuDisplayFile, NULL, "shortcuts" }, { "9 HTML Docs", "Go to the HTML documentation menu (post-install).", NULL, docBrowser }, { NULL } }, }; #ifdef WITH_MICE DMenu MenuMouseType = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, #ifdef PC98 "Select a protocol type for your mouse", "If your mouse is attached to the bus mouse port, you should always choose\n" "\"Auto\", regardless of the model and the brand of the mouse. All other\n" "protocol types are for serial mice and should not be used with the bus\n" "mouse. If you have a serial mouse and are not sure about its protocol,\n" "you should also try \"Auto\". It may not work for the serial mouse if the\n" "mouse does not support the PnP standard. But, it won't hurt. Many\n" "2-button serial mice are compatible with \"Microsoft\" or \"MouseMan\".\n" "3-button serial mice may be compatible with \"MouseSystems\" or \"MouseMan\".\n" "If the serial mouse has a wheel, it may be compatible with \"IntelliMouse\".", NULL, NULL, { { "1 Auto", "Bus mouse or PnP serial mouse", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=auto" }, #else "Select a protocol type for your mouse", "If your mouse is attached to the PS/2 mouse port or the bus mouse port,\n" "you should always choose \"Auto\", regardless of the model and the brand\n" "of the mouse. All other protocol types are for serial mice and should\n" "not be used with the PS/2 port mouse or the bus mouse. If you have\n" "a serial mouse and are not sure about its protocol, you should also try\n" "\"Auto\". It may not work for the serial mouse if the mouse does not\n" "support the PnP standard. But, it won't hurt. Many 2-button serial mice\n" "are compatible with \"Microsoft\" or \"MouseMan\". 3-button serial mice\n" "may be compatible with \"MouseSystems\" or \"MouseMan\". If the serial\n" "mouse has a wheel, it may be compatible with \"IntelliMouse\".", NULL, NULL, { { "1 Auto", "Bus mouse, PS/2 style mouse or PnP serial mouse", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=auto" }, #endif /* PC98 */ { "2 GlidePoint", "ALPS GlidePoint pad (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=glidepoint" }, { "3 Hitachi","Hitachi tablet (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=mmhittab" }, { "4 IntelliMouse", "Microsoft IntelliMouse (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=intellimouse" }, { "5 Logitech", "Logitech protocol (old models) (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=logitech" }, { "6 Microsoft", "Microsoft protocol (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=microsoft" }, { "7 MM Series","MM Series protocol (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=mmseries" }, { "8 MouseMan", "Logitech MouseMan/TrackMan models (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=mouseman" }, { "9 MouseSystems", "MouseSystems protocol (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=mousesystems" }, { "A ThinkingMouse","Kensington ThinkingMouse (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=thinkingmouse" }, { NULL } }, }; #ifdef PC98 DMenu MenuMousePort = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Select your mouse port from the following menu", "The built-in pointing device of laptop/notebook computers is usually\n" "a BusMouse style device.", NULL, NULL, { { "1 BusMouse", "PC-98x1 bus mouse (/dev/mse0)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/mse0" }, { "2 COM1", "Serial mouse on COM1 (/dev/cuaa0)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuaa0" }, { "3 COM2", "Serial mouse on COM2 (/dev/cuaa1)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuaa1" }, { NULL } }, }; #else DMenu MenuMousePort = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Select your mouse port from the following menu", "The built-in pointing device of laptop/notebook computers is usually\n" "a PS/2 style device.", NULL, NULL, { { "1 PS/2", "PS/2 style mouse (/dev/psm0)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/psm0" }, { "2 COM1", "Serial mouse on COM1 (/dev/cuaa0)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuaa0" }, { "3 COM2", "Serial mouse on COM2 (/dev/cuaa1)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuaa1" }, { "4 COM3", "Serial mouse on COM3 (/dev/cuaa2)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuaa2" }, { "5 COM4", "Serial mouse on COM4 (/dev/cuaa3)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuaa3" }, { "6 BusMouse", "Logitech, ATI or MS bus mouse (/dev/mse0)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/mse0" }, { NULL } }, }; #endif /* PC98 */ DMenu MenuMouse = { DMENU_NORMAL_TYPE, "Please configure your mouse", "You can cut and paste text in the text console by running the mouse\n" "daemon. Specify a port and a protocol type of your mouse and enable\n" "the mouse daemon. If you don't want this feature, select 6 to disable\n" "the daemon.\n" "Once you've enabled the mouse daemon, you can specify \"/dev/sysmouse\"\n" "as your mouse device and \"SysMouse\" or \"MouseSystems\" as mouse\n" "protocol when running the X configuration utility (see Configuration\n" "menu).", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "2 Enable", "Test and run the mouse daemon", NULL, mousedTest, NULL, NULL }, { "3 Type", "Select mouse protocol type", NULL, dmenuSubmenu, NULL, &MenuMouseType }, { "4 Port", "Select mouse port", NULL, dmenuSubmenu, NULL, &MenuMousePort }, { "5 Flags", "Set additional flags", dmenuVarCheck, setMouseFlags, NULL, VAR_MOUSED_FLAGS "=" }, { "6 Disable", "Disable the mouse daemon", NULL, mousedDisable, NULL, NULL }, { NULL } }, }; #endif /* WITH_MICE */ DMenu MenuMediaCDROM = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Choose a CD/DVD type", "FreeBSD can be installed directly from a CD/DVD containing a valid\n" "FreeBSD distribution. If you are seeing this menu it is because\n" "more than one CD/DVD drive was found on your system. Please select one\n" "of the following CD/DVD drives as your installation drive.", "Press F1 to read the installation guide", "INSTALL", { { NULL } }, }; DMenu MenuMediaFloppy = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Choose a Floppy drive", "You have more than one floppy drive. Please choose which drive\n" "you would like to use.", NULL, NULL, { { NULL } }, }; DMenu MenuMediaDOS = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Choose a DOS partition", "FreeBSD can be installed directly from a DOS partition\n" "assuming, of course, that you have copied the relevant\n" "distributions into your DOS partition before starting this\n" "installation. If this is not the case then you should reboot\n" "DOS at this time and copy the distributions you wish to install\n" "into a \"FREEBSD\" subdirectory on one of your DOS partitions.\n" "Otherwise, please select the DOS partition containing the FreeBSD\n" "distribution files.", "Press F1 to read the installation guide", "INSTALL", { { NULL } }, }; DMenu MenuMediaFTP = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Please select a FreeBSD FTP distribution site", "Please select the site closest to you or \"other\" if you'd like to\n" "specify a different choice. Also note that not every site listed here\n" "carries more than the base distribution kits. Only Primary sites are\n" "guaranteed to carry the full range of possible distributions.", "Select a site that's close!", "INSTALL", { { "Main Site", "ftp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.freebsd.org" }, { "URL", "Specify some other ftp site by URL", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=other" }, { "Snapshots Server", "snapshots.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://snapshots.jp.freebsd.org" }, { "IPv6 Ireland", "ftp3.ie.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.ie.freebsd.org" }, { " IPv6 Japan", "ftp2.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.jp.freebsd.org" }, { " IPv6 USA", "ftp4.us.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.us.freebsd.org" }, { "Primary", "ftp1.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp1.freebsd.org" }, { " Primary #2", "ftp2.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.freebsd.org" }, { " Primary #3", "ftp3.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.freebsd.org" }, { " Primary #4", "ftp4.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.freebsd.org" }, { " Primary #5", "ftp5.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.freebsd.org" }, { " Primary #6", "ftp6.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp6.freebsd.org" }, { " Primary #7", "ftp7.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp7.freebsd.org" }, { " Primary #8", "ftp8.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp8.freebsd.org" }, { " Primary #9", "ftp9.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp9.freebsd.org" }, { " Primary #10", "ftp10.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp10.freebsd.org" }, { " Primary #11", "ftp11.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp11.freebsd.org" }, { " Primary #12", "ftp12.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp12.freebsd.org" }, { " Primary #13", "ftp13.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp13.freebsd.org" }, { " Primary #14", "ftp14.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp14.freebsd.org" }, { "Argentina", "ftp.ar.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ar.freebsd.org" }, { "Australia", "ftp.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.au.freebsd.org" }, { " Australia #2","ftp2.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.au.freebsd.org" }, { " Australia #3","ftp3.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.au.freebsd.org" }, { "Austria","ftp.at.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.at.freebsd.org" }, { " Austria #2","ftp2.at.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.at.freebsd.org" }, { "Brazil", "ftp.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.br.freebsd.org" }, { " Brazil #2", "ftp2.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.br.freebsd.org" }, { " Brazil #3", "ftp3.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.br.freebsd.org" }, { " Brazil #4", "ftp4.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.br.freebsd.org" }, { " Brazil #5", "ftp5.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.br.freebsd.org" }, { " Brazil #6", "ftp6.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp6.br.freebsd.org" }, { " Brazil #7", "ftp7.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp7.br.freebsd.org" }, { "Canada", "ftp.ca.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ca.freebsd.org" }, { "China", "ftp.cn.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.cn.freebsd.org" }, { "Croatia", "ftp.hr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.hr.freebsd.org" }, { "Czech Republic", "ftp.cz.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.cz.freebsd.org" }, { "Denmark", "ftp.dk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.dk.freebsd.org" }, { " Denmark #2", "ftp2.dk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.dk.freebsd.org" }, { "Estonia", "ftp.ee.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ee.freebsd.org" }, { "Finland", "ftp.fi.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.fi.freebsd.org" }, { "France", "ftp.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.fr.freebsd.org" }, { " France #2", "ftp2.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.fr.freebsd.org" }, { " France #3", "ftp3.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.fr.freebsd.org" }, { " France #4", "ftp4.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.fr.freebsd.org" }, { " France #5", "ftp5.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.fr.freebsd.org" }, { " France #6", "ftp6.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp6.fr.freebsd.org" }, { " France #8", "ftp8.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp8.fr.freebsd.org" }, { "Germany", "ftp.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.de.freebsd.org" }, { " Germany #2", "ftp2.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.de.freebsd.org" }, { " Germany #3", "ftp3.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.de.freebsd.org" }, { " Germany #4", "ftp4.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.de.freebsd.org" }, { " Germany #5", "ftp5.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.de.freebsd.org" }, { " Germany #6", "ftp6.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp6.de.freebsd.org" }, { " Germany #7", "ftp7.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp7.de.freebsd.org" }, { "Greece", "ftp.gr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.gr.freebsd.org" }, { " Greece #2", "ftp2.gr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.gr.freebsd.org" }, { "Hong Kong", "ftp.hk.super.net", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.hk.super.net" }, { "Hungary", "ftp.hu.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.hu.freebsd.org" }, { "Iceland", "ftp.is.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.is.freebsd.org" }, { "Ireland", "ftp.ie.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ie.freebsd.org" }, { " Ireland #2", "ftp2.ie.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.ie.freebsd.org" }, { " Ireland #3", "ftp3.ie.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.ie.freebsd.org" }, { "Italy", "ftp.it.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.it.freebsd.org" }, { "Japan", "ftp.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.jp.freebsd.org" }, { " Japan #2", "ftp2.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.jp.freebsd.org" }, { " Japan #3", "ftp3.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.jp.freebsd.org" }, { " Japan #4", "ftp4.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.jp.freebsd.org" }, { " Japan #5", "ftp5.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.jp.freebsd.org" }, { " Japan #6", "ftp6.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp6.jp.freebsd.org" }, { " Japan #7", "ftp7.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp7.jp.freebsd.org" }, { " Japan #8", "ftp8.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp8.jp.freebsd.org" }, { " Japan #9", "ftp9.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp9.jp.freebsd.org" }, { "Korea", "ftp.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.kr.freebsd.org" }, { " Korea #2", "ftp2.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.kr.freebsd.org" }, { " Korea #3", "ftp3.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.kr.freebsd.org" }, { "Lithuania", "ftp.lt.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.lt.freebsd.org" }, { "Netherlands", "ftp.nl.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.nl.freebsd.org" }, { " Netherlands #2", "ftp2.nl.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.nl.freebsd.org" }, { "Norway", "ftp.no.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.no.freebsd.org" }, { " Norway #3", "ftp3.no.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.no.freebsd.org" }, { "Poland", "ftp.pl.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.pl.freebsd.org" }, { " Poland #2", "ftp2.pl.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.pl.freebsd.org" }, { "Portugal", "ftp.pt.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.pt.freebsd.org" }, { " Portugal #2", "ftp2.pt.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.pt.freebsd.org" }, { " Portugal #4", "ftp4.pt.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.pt.freebsd.org" }, { "Romania", "ftp.ro.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ro.freebsd.org" }, { "Russia", "ftp.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ru.freebsd.org" }, { " Russia #2", "ftp2.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.ru.freebsd.org" }, { " Russia #5", "ftp5.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.ru.freebsd.org" }, { " Russia #7", "ftp7.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp7.ru.freebsd.org" }, { " Russia #8", "ftp8.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp8.ru.freebsd.org" }, { " Russia #9", "ftp9.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp9.ru.freebsd.org" }, { "Singapore", "ftp.sg.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.sg.freebsd.org" }, { "Slovak Republic", "ftp.sk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.sk.freebsd.org" }, { "Slovenia", "ftp.si.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.si.freebsd.org" }, { " Slovenia #2", "ftp2.si.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.si.freebsd.org" }, { "South Africa", "ftp.za.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.za.freebsd.org" }, { " South Africa #2", "ftp2.za.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.za.freebsd.org" }, { " South Africa #3", "ftp3.za.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.za.freebsd.org" }, { " South Africa #4", "ftp4.za.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.za.freebsd.org" }, { "Spain", "ftp.es.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.es.freebsd.org" }, { " Spain #2", "ftp2.es.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.es.freebsd.org" }, { " Spain #3", "ftp3.es.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.es.freebsd.org" }, { "Sweden", "ftp.se.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.se.freebsd.org" }, { " Sweden #2", "ftp2.se.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.se.freebsd.org" }, { " Sweden #3", "ftp3.se.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.se.freebsd.org" }, { " Sweden #5", "ftp5.se.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.se.freebsd.org" }, { "Switzerland", "ftp.ch.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ch.freebsd.org" }, { " Switzerland #2", "ftp2.ch.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.ch.freebsd.org" }, { "Taiwan", "ftp.tw.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.tw.freebsd.org" }, { " Taiwan #2", "ftp2.tw.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.tw.freebsd.org" }, { " Taiwan #3", "ftp3.tw.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.tw.freebsd.org" }, { " Taiwan #4", "ftp4.tw.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.tw.freebsd.org" }, { " Taiwan #6", "ftp6.tw.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp6.tw.freebsd.org" }, { " Taiwan #11", "ftp11.tw.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp11.tw.freebsd.org" }, { "Turkey", "ftp.tr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.tr.freebsd.org" }, { "UK", "ftp.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.uk.freebsd.org" }, { " UK #2", "ftp2.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.uk.freebsd.org" }, { " UK #3", "ftp3.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.uk.freebsd.org" }, { " UK #4", "ftp4.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.uk.freebsd.org" }, { " UK #5", "ftp5.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.uk.freebsd.org" }, { " UK #6", "ftp6.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp6.uk.freebsd.org" }, { "Ukraine", "ftp.ua.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ua.freebsd.org" }, { " Ukraine #2", "ftp2.ua.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.ua.freebsd.org" }, { " Ukraine #5", "ftp5.ua.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.ua.freebsd.org" }, { " Ukraine #6", "ftp6.ua.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp6.ua.freebsd.org" }, { " Ukraine #7", "ftp7.ua.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp7.ua.freebsd.org" }, { " Ukraine #8", "ftp8.ua.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp8.ua.freebsd.org" }, { "USA #1", "ftp1.us.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp1.us.freebsd.org" }, { " USA #2", "ftp2.us.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.us.freebsd.org" }, { " USA #3", "ftp3.us.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.us.freebsd.org" }, { " USA #4", "ftp4.us.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.us.freebsd.org" }, { " USA #5", "ftp5.us.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.us.freebsd.org" }, { " USA #6", "ftp6.us.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp6.us.freebsd.org" }, { " USA #7", "ftp7.us.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp7.us.freebsd.org" }, { " USA #8", "ftp8.us.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp8.us.freebsd.org" }, { " USA #9", "ftp9.us.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp9.us.freebsd.org" }, { " USA #10", "ftp10.us.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp10.us.freebsd.org" }, { " USA #11", "ftp11.us.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp11.us.freebsd.org" }, { " USA #12", "ftp12.us.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp12.us.freebsd.org" }, { " USA #13", "ftp13.us.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp13.us.freebsd.org" }, { " USA #14", "ftp14.us.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp14.us.freebsd.org" }, { NULL } } }; DMenu MenuMediaTape = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Choose a tape drive type", "FreeBSD can be installed from tape drive, though this installation\n" "method requires a certain amount of temporary storage in addition\n" "to the space required by the distribution itself (tape drives make\n" "poor random-access devices, so we extract _everything_ on the tape\n" "in one pass). If you have sufficient space for this, then you should\n" "select one of the following tape devices detected on your system.", "Press F1 to read the installation guide", "INSTALL", { { NULL } }, }; DMenu MenuNetworkDevice = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Network interface information required", "If you are using PPP over a serial device, as opposed to a direct\n" "ethernet connection, then you may first need to dial your Internet\n" "Service Provider using the ppp utility we provide for that purpose.\n" "If you're using SLIP over a serial device then the expectation is\n" "that you have a HARDWIRED connection.\n\n" "You can also install over a parallel port using a special \"laplink\"\n" "cable to another machine running FreeBSD.", "Press F1 to read network configuration manual", "network_device", { { NULL } }, }; /* Prototype KLD load menu */ DMenu MenuKLD = { DMENU_NORMAL_TYPE, "KLD Menu", "Load a KLD from a floppy\n", NULL, NULL, { { NULL } }, }; /* The media selection menu */ DMenu MenuMedia = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Choose Installation Media", "FreeBSD can be installed from a variety of different installation\n" "media, ranging from floppies to an Internet FTP server. If you're\n" "installing FreeBSD from a supported CD/DVD drive then this is generally\n" "the best media to use if you have no overriding reason for using other\n" "media.", "Press F1 for more information on the various media types", "media", { { "1 CD/DVD", "Install from a FreeBSD CD/DVD", NULL, mediaSetCDROM }, { "2 FTP", "Install from an FTP server", NULL, mediaSetFTPActive }, { "3 FTP Passive", "Install from an FTP server through a firewall", NULL, mediaSetFTPPassive }, { "4 HTTP", "Install from an FTP server through a http proxy", NULL, mediaSetHTTP }, { "5 DOS", "Install from a DOS partition", NULL, mediaSetDOS }, { "6 NFS", "Install over NFS", NULL, mediaSetNFS }, { "7 File System", "Install from an existing filesystem", NULL, mediaSetUFS }, { "8 Floppy", "Install from a floppy disk set", NULL, mediaSetFloppy }, { "9 Tape", "Install from SCSI or QIC tape", NULL, mediaSetTape }, { "X Options", "Go to the Options screen", NULL, optionsEditor }, { NULL } }, }; /* The distributions menu */ DMenu MenuDistributions = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "Choose Distributions", "As a convenience, we provide several \"canned\" distribution sets.\n" "These select what we consider to be the most reasonable defaults for the\n" "type of system in question. If you would prefer to pick and choose the\n" "list of distributions yourself, simply select \"Custom\". You can also\n" "pick a canned distribution set and then fine-tune it with the Custom item.\n\n" "Choose an item by pressing [SPACE] or [ENTER]. When finished, choose the\n" "Exit item or move to the OK button with [TAB].", "Press F1 for more information on these options.", "distributions", { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { "All", "All system sources, binaries and X Window System", checkDistEverything, distSetEverything, NULL, NULL, ' ', ' ', ' ' }, { "Reset", "Reset selected distribution list to nothing", NULL, distReset, NULL, NULL, ' ', ' ', ' ' }, { "4 Developer", "Full sources, binaries and doc but no games", checkDistDeveloper, distSetDeveloper }, { "5 X-Developer", "Same as above + X Window System", checkDistXDeveloper, distSetXDeveloper }, { "6 Kern-Developer", "Full binaries and doc, kernel sources only", checkDistKernDeveloper, distSetKernDeveloper }, { "7 X-Kern-Developer", "Same as above + X Window System", checkDistXKernDeveloper, distSetXKernDeveloper }, { "8 User", "Average user - binaries and doc only", checkDistUser, distSetUser }, { "9 X-User", "Same as above + X Window System", checkDistXUser, distSetXUser }, { "A Minimal", "The smallest configuration possible", checkDistMinimum, distSetMinimum }, { "B Custom", "Specify your own distribution set", NULL, dmenuSubmenu, NULL, &MenuSubDistributions, '>', '>', '>' }, { NULL } }, }; DMenu MenuSubDistributions = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "Select the distributions you wish to install.", "Please check off the distributions you wish to install. At the\n" "very minimum, this should be \"base\".", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { "All", "All system sources, binaries and X Window System", NULL, distSetEverything, NULL, NULL, ' ', ' ', ' ' }, { "Reset", "Reset all of the below", NULL, distReset, NULL, NULL, ' ', ' ', ' ' }, { " base", "Binary base distribution (required)", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_BASE }, #ifdef __i386__ { " compat1x", "FreeBSD 1.x binary compatibility", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_COMPAT1X }, { " compat20", "FreeBSD 2.0 binary compatibility", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_COMPAT20 }, { " compat21", "FreeBSD 2.1 binary compatibility", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_COMPAT21 }, { " compat22", "FreeBSD 2.2.x and 3.0 a.out binary compatibility", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_COMPAT22 }, { " compat3x", "FreeBSD 3.x binary compatibility", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_COMPAT3X }, #endif #if __FreeBSD__ >= 4 && (defined(__i386__) || defined(__alpha__)) { " compat4x", "FreeBSD 4.x binary compatibility", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_COMPAT4X }, #endif { " crypto", "Basic encryption services", dmenuFlagCheck, dmenuSetFlag, NULL, &CRYPTODists, '[', 'X', ']', DIST_CRYPTO_CRYPTO, }, { " dict", "Spelling checker dictionary files", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_DICT }, { " doc", "Miscellaneous FreeBSD online docs", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_DOC }, { " games", "Games (non-commercial)", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_GAMES }, { " info", "GNU info files", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_INFO }, { " man", "System manual pages - recommended", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_MANPAGES }, { " catman", "Preformatted system manual pages", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_CATPAGES }, { " proflibs", "Profiled versions of the libraries", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_PROFLIBS }, { " src", "Sources for everything", srcFlagCheck, distSetSrc }, { " ports", "The FreeBSD Ports collection", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_PORTS }, { " local", "Local additions collection", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_LOCAL}, { " perl", "The Perl distribution", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_PERL }, { " XFree86", "The XFree86 distribution", x11FlagCheck, distSetXF86 }, { NULL } }, }; DMenu MenuSrcDistributions = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "Select the sub-components of src you wish to install.", "Please check off those portions of the FreeBSD source tree\n" "you wish to install.", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { "All", "Select all of the below", NULL, setSrc, NULL, NULL, ' ', ' ', ' ' }, { "Reset", "Reset all of the below", NULL, clearSrc, NULL, NULL, ' ', ' ', ' ' }, { " base", "top-level files in /usr/src", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_BASE }, { " contrib", "/usr/src/contrib (contributed software)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_CONTRIB }, { " gnu", "/usr/src/gnu (software from the GNU Project)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_GNU }, { " etc", "/usr/src/etc (miscellaneous system files)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_ETC }, { " games", "/usr/src/games (the obvious!)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_GAMES }, { " include", "/usr/src/include (header files)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_INCLUDE }, { " lib", "/usr/src/lib (system libraries)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_LIB }, { " libexec", "/usr/src/libexec (system programs)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_LIBEXEC }, { " release", "/usr/src/release (release-generation tools)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_RELEASE }, { " bin", "/usr/src/bin (system binaries)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_BIN }, { " sbin", "/usr/src/sbin (system binaries)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_SBIN }, { " scrypto", "/usr/src/crypto (contrib encryption sources)", dmenuFlagCheck, dmenuSetFlag, NULL, &CRYPTODists, '[', 'X', ']', DIST_CRYPTO_SCRYPTO }, { " share", "/usr/src/share (documents and shared files)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_SHARE }, { " skrb5", "/usr/src/kerberos5 (sources for Kerberos5)", dmenuFlagCheck, dmenuSetFlag, NULL, &CRYPTODists, '[', 'X', ']', DIST_CRYPTO_SKERBEROS5 }, { " ssecure", "/usr/src/secure (BSD encryption sources)", dmenuFlagCheck, dmenuSetFlag, NULL, &CRYPTODists, '[', 'X', ']', DIST_CRYPTO_SSECURE }, { " sys", "/usr/src/sys (FreeBSD kernel)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_SYS }, { " tools", "/usr/src/tools (miscellaneous tools)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_TOOLS }, { " ubin", "/usr/src/usr.bin (user binaries)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_UBIN }, { " usbin", "/usr/src/usr.sbin (aux system binaries)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_USBIN }, { NULL } }, }; DMenu MenuXF86Config = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Please select the XFree86 configuration tool you want to use.", "The first option, xf86cfg, is fully graphical.\n" "The second option provides a menu-based interface similar to\n" "what you are currently using. " "The third option, xf86config, is\n" "a more simplistic shell-script based tool and less friendly to\n" "new users, but it may work in situations where the other options\n" "do not.", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "2 xf86cfg", "Fully graphical XFree86 configuration tool.", NULL, dmenuSetVariable, NULL, VAR_XF86_CONFIG "=xf86cfg" }, { "3 xf86cfg -textmode", "ncurses-based XFree86 configuration tool.", NULL, dmenuSetVariable, NULL, VAR_XF86_CONFIG "=xf86cfg -textmode" }, { "4 xf86config", "Shell-script based XFree86 configuration tool.", NULL, dmenuSetVariable, NULL, VAR_XF86_CONFIG "=xf86config" }, { "D XDesktop", "X already set up, just do desktop configuration.", NULL, dmenuSubmenu, NULL, &MenuXDesktops }, { NULL } }, }; DMenu MenuXDesktops = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Please select the default X desktop to use.", "By default, XFree86 comes with a fairly vanilla desktop which\n" "is based around the twm(1) window manager and does not offer\n" "much in the way of features. It does have the advantage of\n" "being a standard part of X so you don't need to load anything\n" "extra in order to use it. If, however, you have access to a\n" "reasonably full packages collection on your installation media,\n" "you can choose any one of the following desktops as alternatives.", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "2 KDE", "The K Desktop Environment (Lite Edition)", NULL, dmenuSetVariable, NULL, VAR_DESKSTYLE "=kde" }, { "3 GNOME 2", "The GNOME 2 Desktop Environment (Lite Edition)", NULL, dmenuSetVariable, NULL, VAR_DESKSTYLE "=gnome2" }, { "4 Afterstep", "The Afterstep window manager", NULL, dmenuSetVariable, NULL, VAR_DESKSTYLE "=afterstep" }, { "5 Windowmaker", "The Windowmaker window manager", NULL, dmenuSetVariable, NULL, VAR_DESKSTYLE "=windowmaker" }, { "6 fvwm", "The fvwm window manager", NULL, dmenuSetVariable, NULL, VAR_DESKSTYLE "=fvwm2" }, { NULL } }, }; DMenu MenuXF86Select = { DMENU_NORMAL_TYPE, "XFree86 Distribution", "Please select the components you need from the XFree86\n" "distribution sets.", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "Basic", "Basic component menu (required)", NULL, dmenuSubmenu, NULL, &MenuXF86SelectCore }, { "Server", "X server menu", NULL, dmenuSubmenu, NULL, &MenuXF86SelectServer }, { "Fonts", "Font set menu", NULL, dmenuSubmenu, NULL, &MenuXF86SelectFonts }, { NULL } }, }; DMenu MenuXF86SelectCore = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "XFree86 base distribution types", "Please check off the basic XFree86 components you wish to install.\n" "Bin, lib, and set are recommended for a minimum installaion.", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { "All", "Select all below", NULL, setX11Misc, NULL, NULL, ' ', ' ', ' ' }, { "Reset", "Reset all below", NULL, clearX11Misc, NULL, NULL, ' ', ' ', ' ' }, { " bin", "Client applications", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_CLIENTS }, { " lib", "Shared libraries and data files needed at runtime", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_LIB }, { " man", "Manual pages", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_MAN }, { " doc", "Documentation", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_DOC }, { " prog", "Programming tools", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_PROG }, { NULL } }, }; DMenu MenuXF86SelectFonts = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "Font distribution selection.", "Please check off the individual font distributions you wish to\n\ install. At the minimum, you should install the standard\n\ 75 DPI and misc fonts if you're also installing a server\n\ (these are selected by default).", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { "All", "All fonts", NULL, setX11Fonts, NULL, NULL, ' ', ' ', ' ' }, { "Reset", "Reset font selections", NULL, clearX11Fonts, NULL, NULL, ' ', ' ', ' ' }, { " fnts", "Standard miscellaneous fonts", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86FontDists, '[', 'X', ']', DIST_XF86_FONTS_BITMAPS }, { " f75", "75 DPI fonts", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86FontDists, '[', 'X', ']', DIST_XF86_FONTS_75 }, { " 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 }, { " server", "Font server", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86FontDists, '[', 'X', ']', DIST_XF86_FONTS_SERVER }, { NULL } }, }; DMenu MenuXF86SelectServer = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "X Server selection.", "Please check off the types of X servers you wish to install.\n", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { "All", "Select all of the above", NULL, setX11Servers, NULL, NULL, ' ', ' ', ' ' }, { "Reset", "Reset all of the above", NULL, clearX11Servers, NULL, NULL, ' ', ' ', ' ' }, { " srv", "Standard Graphics Framebuffer", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_FB }, { " nest", "Nested X Server", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_NEST }, { " prt", "X Print Server", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_PRINT }, { " vfb", "Virtual Framebuffer", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_VFB }, { 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] or [ENTER]. To de-select it, press it again.\n\n" "Use [TAB] to get to the buttons and leave this menu.", "Press F1 for important information regarding disk geometry!", "drives", { { NULL } }, }; DMenu MenuHTMLDoc = { DMENU_NORMAL_TYPE, "Select HTML Documentation pointer", "Please select the body of documentation you're interested in, the main\n" "ones right now being the FAQ and the Handbook. You can also choose \"other\"\n" "to enter an arbitrary URL for browsing.", "Press F1 for more help on what you see here.", "html", { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "2 Handbook", "The FreeBSD Handbook.", NULL, docShowDocument }, { "3 FAQ", "The Frequently Asked Questions guide.", NULL, docShowDocument }, { "4 Home", "The Home Pages for the FreeBSD Project (requires net)", NULL, docShowDocument }, { "5 Other", "Enter a URL.", NULL, docShowDocument }, { NULL } }, }; /* The main installation menu */ DMenu MenuInstallCustom = { DMENU_NORMAL_TYPE, "Choose Custom Installation Options", "This is the custom installation menu. You may use this menu to specify\n" "details on the type of distribution you wish to have, where you wish\n" "to install it from and how you wish to allocate disk storage to FreeBSD.", "Press F1 to read the installation guide", "INSTALL", { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "2 Options", "View/Set various installation options", NULL, optionsEditor }, #ifndef WITH_SLICES { "3 Label", "Label disk partitions", NULL, diskLabelEditor }, { "4 Distributions", "Select distribution(s) to extract", NULL, dmenuSubmenu, NULL, &MenuDistributions }, { "5 Media", "Choose the installation media type", NULL, dmenuSubmenu, NULL, &MenuMedia }, { "6 Commit", "Perform any pending Partition/Label/Extract actions", NULL, installCustomCommit }, #else { "3 Partition", "Allocate disk space for FreeBSD", NULL, diskPartitionEditor }, { "4 Label", "Label allocated disk partitions", NULL, diskLabelEditor }, { "5 Distributions", "Select distribution(s) to extract", NULL, dmenuSubmenu, NULL, &MenuDistributions }, { "6 Media", "Choose the installation media type", NULL, dmenuSubmenu, NULL, &MenuMedia }, { "7 Commit", "Perform any pending Partition/Label/Extract actions", NULL, installCustomCommit }, #endif { NULL } }, }; #if defined(__i386__) || defined(__amd64__) #ifdef PC98 /* IPL type menu */ DMenu MenuIPLType = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "overwrite me", /* will be disk specific label */ "If you want a FreeBSD Boot Manager, select \"BootMgr\". If you would\n" "prefer your Boot Manager to remain untouched then select \"None\".\n\n", "Press F1 to read about drive setup", "drives", { { "BootMgr", "Install the FreeBSD Boot Manager", dmenuRadioCheck, dmenuSetValue, NULL, &BootMgr }, { "None", "Leave the IPL untouched", dmenuRadioCheck, dmenuSetValue, NULL, &BootMgr, '(', '*', ')', 1 }, { NULL } }, }; #else /* MBR type menu */ DMenu MenuMBRType = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "overwrite me", /* will be disk specific label */ "FreeBSD comes with a boot selector that allows you to easily\n" "select between FreeBSD and any other operating systems on your machine\n" "at boot time. If you have more than one drive and want to boot\n" "from the second one, the boot selector will also make it possible\n" "to do so (limitations in the PC BIOS usually prevent this otherwise).\n" "If you do not want a boot selector, or wish to replace an existing\n" "one, select \"standard\". If you would prefer your Master Boot\n" "Record to remain untouched then select \"None\".\n\n" " NOTE: PC-DOS users will almost certainly require \"None\"!", "Press F1 to read about drive setup", "drives", { { "BootMgr", "Install the FreeBSD Boot Manager", dmenuRadioCheck, dmenuSetValue, NULL, &BootMgr }, { "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 } }, }; #endif /* PC98 */ #endif /* __i386__ */ /* Final configuration menu */ DMenu MenuConfigure = { DMENU_NORMAL_TYPE, "FreeBSD Configuration Menu", /* title */ "If you've already installed FreeBSD, you may use this menu to customize\n" "it somewhat to suit your particular configuration. Most importantly,\n" "you can use the Packages utility to load extra \"3rd party\"\n" "software not provided in the base distributions.", "Press F1 for more information on these options", "configure", { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { " Distributions", "Install additional distribution sets", NULL, distExtractAll }, { " Packages", "Install pre-packaged software for FreeBSD", NULL, configPackages }, { " Root Password", "Set the system manager's password", NULL, dmenuSystemCommand, NULL, "passwd root" }, #ifdef WITH_SLICES { " Fdisk", "The disk Slice (PC-style partition) Editor", NULL, diskPartitionEditor }, #endif { " Label", "The disk Label editor", NULL, diskLabelEditor }, { " User Management", "Add user and group information", NULL, dmenuSubmenu, NULL, &MenuUsermgmt }, #ifdef WITH_SYSCONS { " Console", "Customize system console behavior", NULL, dmenuSubmenu, NULL, &MenuSyscons }, #endif { " Time Zone", "Set which time zone you're in", NULL, dmenuSystemCommand, NULL, "tzsetup" }, { " Media", "Change the installation media type", NULL, dmenuSubmenu, NULL, &MenuMedia }, #ifdef WITH_MICE { " Mouse", "Configure your mouse", - NULL, dmenuSubmenu, NULL, &MenuMouse, NULL }, + NULL, dmenuSubmenu, NULL, &MenuMouse }, #endif { " Networking", "Configure additional network services", NULL, dmenuSubmenu, NULL, &MenuNetworking }, { " Security", "Configure system security options", NULL, dmenuSubmenu, NULL, &MenuSecurity }, { " Startup", "Configure system startup options", NULL, dmenuSubmenu, NULL, &MenuStartup }, { " TTYs", "Configure system ttys.", NULL, configEtcTtys, NULL, "ttys" }, { " Options", "View/Set various installation options", NULL, optionsEditor }, { " XFree86", "Configure XFree86 Server", NULL, configXSetup }, { " Desktop", "Configure XFree86 Desktop", NULL, configXDesktop }, { " HTML Docs", "Go to the HTML documentation menu (post-install)", NULL, docBrowser }, { " Load KLD", "Load a KLD from a floppy", NULL, kldBrowser }, { NULL } }, }; DMenu MenuStartup = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "Startup Services Menu", "This menu allows you to configure various aspects of your system's\n" "startup configuration. Use [SPACE] or [ENTER] to select items, and\n" "[TAB] to move to the buttons. Select Exit to leave this menu.", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, #ifdef __i386__ { " APM", "Auto-power management services (typically laptops)", dmenuVarCheck, dmenuToggleVariable, NULL, "apm_enable=YES" }, #endif #ifdef PCCARD_ARCH { " pccard", "Enable PCCARD (AKA PCMCIA) services (also laptops)", dmenuVarCheck, dmenuToggleVariable, NULL, "pccard_enable=YES" }, { " pccard mem", "Set PCCARD memory address (if enabled)", dmenuVarCheck, dmenuISetVariable, NULL, "pccard_mem" }, { " pccard ifconfig", "List of PCCARD ethernet devices to configure", dmenuVarCheck, dmenuISetVariable, NULL, "pccard_ifconfig" }, #endif { " usbd", "Enable USB daemon (detect USB attach / detach)", dmenuVarCheck, dmenuToggleVariable, NULL, "usbd_enable=YES" }, { " usbd flags", "Set default flags to usbd (if enabled)", dmenuVarCheck, dmenuISetVariable, NULL, "usbd_flags" }, { " ", " -- ", NULL, NULL, NULL, NULL, ' ', ' ', ' ' }, { " Startup dirs", "Set the list of dirs to look for startup scripts", dmenuVarCheck, dmenuISetVariable, NULL, "local_startup" }, { " named", "Run a local name server on this host", dmenuVarCheck, dmenuToggleVariable, NULL, "named_enable=YES" }, { " named flags", "Set default flags to named (if enabled)", dmenuVarCheck, dmenuISetVariable, NULL, "named_flags" }, { " NIS client", "This host wishes to be an NIS client.", dmenuVarCheck, configRpcBind, NULL, "nis_client_enable=YES" }, { " NIS domainname", "Set NIS domainname (if enabled)", dmenuVarCheck, dmenuISetVariable, NULL, "nisdomainname" }, { " NIS server", "This host wishes to be an NIS server.", dmenuVarCheck, configRpcBind, NULL, "nis_server_enable=YES" }, { " ", " -- ", NULL, NULL, NULL, NULL, ' ', ' ', ' ' }, { " Accounting", "This host wishes to run process accounting.", dmenuVarCheck, dmenuToggleVariable, NULL, "accounting_enable=YES" }, { " lpd", "This host has a printer and wants to run lpd.", dmenuVarCheck, dmenuToggleVariable, NULL, "lpd_enable=YES" }, #ifdef WITH_LINUX { " Linux", "This host wants to be able to run Linux binaries.", dmenuVarCheck, configLinux, NULL, VAR_LINUX_ENABLE "=YES" }, #endif #ifdef __i386__ { " SCO", "This host wants to be able to run IBCS2 binaries.", dmenuVarCheck, dmenuToggleVariable, NULL, "ibcs2_enable=YES" }, { " SVR4", "This host wants to be able to run SVR4 binaries.", dmenuVarCheck, dmenuToggleVariable, NULL, "svr4_enable=YES" }, #endif #ifdef __alpha__ { " OSF/1", "This host wants to be able to run DEC OSF/1 binaries.", dmenuVarCheck, configOSF1, NULL, VAR_OSF1_ENABLE "=YES" }, #endif { " quotas", "This host wishes to check quotas on startup.", dmenuVarCheck, dmenuToggleVariable, NULL, "check_quotas=YES" }, { NULL } }, }; DMenu MenuNetworking = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "Network Services Menu", "You may have already configured one network device (and the other\n" "various hostname/gateway/name server parameters) in the process\n" "of installing FreeBSD. This menu allows you to configure other\n" "aspects of your system's network configuration.", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { " Interfaces", "Configure additional network interfaces", NULL, tcpMenuSelect }, { " AMD", "This machine wants to run the auto-mounter service", dmenuVarCheck, configRpcBind, NULL, "amd_enable=YES" }, { " AMD Flags", "Set flags to AMD service (if enabled)", dmenuVarCheck, dmenuISetVariable, NULL, "amd_flags" }, { " Anon FTP", "This machine wishes to allow anonymous FTP.", dmenuVarCheck, configAnonFTP, NULL, "anon_ftp" }, { " Gateway", "This machine will route packets between interfaces", dmenuVarCheck, dmenuToggleVariable, NULL, "gateway_enable=YES" }, { " inetd", "This machine wants to run the inet daemon", dmenuVarCheck, configInetd, NULL, "inetd_enable=YES" }, { " Mail", "This machine wants to run a Mail Transfer Agent", NULL, dmenuSubmenu, NULL, &MenuMTA }, { " NFS client", "This machine will be an NFS client", dmenuVarCheck, dmenuToggleVariable, NULL, "nfs_client_enable=YES" }, { " NFS server", "This machine will be an NFS server", dmenuVarCheck, configNFSServer, NULL, "nfs_server_enable=YES" }, { " Ntpdate", "Select a clock-synchronization server", dmenuVarCheck, dmenuSubmenu, NULL, &MenuNTP, '[', 'X', ']', (uintptr_t)"ntpdate_enable=YES" }, { " PCNFSD", "Run authentication server for clients with PC-NFS.", dmenuVarCheck, configPCNFSD, NULL, "pcnfsd" }, { " rpcbind", "RPC port mapping daemon (formerly portmapper)", dmenuVarCheck, dmenuToggleVariable, NULL, "rpcbind_enable=YES" }, { " rpc.statd", "NFS status monitoring daemon", dmenuVarCheck, configRpcBind, NULL, "rpc_statd_enable=YES" }, { " rpc.lockd", "NFS file locking daemon", dmenuVarCheck, configRpcBind, NULL, "rpc_lockd_enable=YES" }, { " Routed", "Select routing daemon (default: routed)", dmenuVarCheck, configRouter, NULL, "router_enable=YES" }, { " Rwhod", "This machine wants to run the rwho daemon", dmenuVarCheck, dmenuToggleVariable, NULL, "rwhod_enable=YES" }, { " sshd", "This machine wants to run the SSH daemon", dmenuVarCheck, dmenuToggleVariable, NULL, "sshd_enable=YES" }, { " TCP Extensions", "Allow RFC1323 and RFC1644 TCP extensions?", dmenuVarCheck, dmenuToggleVariable, NULL, "tcp_extensions=YES" }, { NULL } }, }; DMenu MenuMTA = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Mail Transfer Agent Selection", "You can choose which Mail Transfer Agent (MTA) you wish to install and run.\n" "Selecting Sendmail local disables sendmail's network socket for\n" "incoming mail, but still enables sendmail for local and outbound mail.\n" "The Postfix option will install the Postfix MTA from the ports\n" "collection. The Exim option will install the Exim MTA from the ports\n" "collection. To return to the previous menu, select Exit.", NULL, NULL, { { "Sendmail", "Use sendmail", dmenuVarCheck, dmenuSetVariable, NULL, "sendmail_enable=YES" }, { "Sendmail local", "Use sendmail, but do not listen on the network", dmenuVarCheck, dmenuSetVariable, NULL, "sendmail_enable=NO" }, { "Postfix", "Use the Postfix MTA", NULL, configMTAPostfix, NULL, NULL }, { "Exim", "Use the Exim MTA", NULL, configMTAExim, NULL, NULL }, { "None", "Do not install an MTA", dmenuVarCheck, dmenuSetVariable, NULL, "sendmail_enable=NONE" }, { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { NULL } }, }; DMenu MenuNTP = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "NTPDATE Server Selection", "There are a number of time synchronization servers available\n" "for public use around the Internet. Please select one reasonably\n" "close to you to have your system time synchronized accordingly.", "These are the primary open-access NTP servers", NULL, { { "None", "No NTP server", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=NO,ntpdate_flags=none" }, { "Other", "Select a site not on this list", dmenuVarsCheck, configNTP, NULL, NULL }, { "Argentina", "tick.nap.com.ar", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tick.nap.com.ar" }, { "Argentina #2", "time.sinectis.com.ar", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.sinectis.com.ar" }, { "Argentina #3", "tock.nap.com.ar", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tock.nap.com.ar" }, { "Australia", "augean.eleceng.adelaide.edu.au", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=augean.eleceng.adelaide.edu.au" }, { "Australia #2", "ntp.adelaide.edu.au", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.adelaide.edu.au" }, { "Australia #3", "ntp.saard.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.saard.net" }, { "Australia #4", "time.deakin.edu.au", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.deakin.edu.au" }, { "Australia #5", "time.esec.com.au", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.esec.com.au" }, { "Belgium", "ntp1.belbone.be", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.belbone.be" }, { "Belgium #2", "ntp2.belbone.be", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.belbone.be" }, { "Brazil", "ntp.cais.rnp.br", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.cais.rnp.br" }, { "Brazil #2", "ntp.pop-df.rnp.br", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.pop-df.rnp.br" }, { "Brazil #3", "ntp.ufes.br", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.ufes.br" }, { "Brazil #4", "ntp1.pucpr.br", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.pucpr.br" }, { "Canada", "ntp.cpsc.ucalgary.ca", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.cpsc.ucalgary.ca" }, { "Canada #2", "ntp1.cmc.ec.gc.ca", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.cmc.ec.gc.ca" }, { "Canada #3", "ntp2.cmc.ec.gc.ca", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.cmc.ec.gc.ca" }, { "Canada #4", "tick.utoronto.ca", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tick.utoronto.ca" }, { "Canada #5", "time.chu.nrc.ca", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.chu.nrc.ca" }, { "Canada #6", "time.nrc.ca", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.nrc.ca" }, { "Canada #7", "timelord.uregina.ca", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=timelord.uregina.ca" }, { "Canada #8", "tock.utoronto.ca", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tock.utoronto.ca" }, { "Czech", "ntp.karpo.cz", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.karpo.cz" }, { "Denmark", "clock.netcetera.dk", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock.netcetera.dk" }, { "Denmark", "clock2.netcetera.dk", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock2.netcetera.dk" }, { "Spain", "slug.ctv.es", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=slug.ctv.es" }, { "Finland", "tick.keso.fi", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tick.keso.fi" }, { "Finland #2", "tock.keso.fi", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tock.keso.fi" }, { "France", "ntp.obspm.fr", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.obspm.fr" }, { "France #2", "ntp.univ-lyon1.fr", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.univ-lyon1.fr" }, { "France #3", "ntp.via.ecp.fr", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.via.ecp.fr" }, { "Croatia", "zg1.ntp.carnet.hr", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=zg1.ntp.carnet.hr" }, { "Croatia #2", "zg2.ntp.carnet.hr", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=zg2.ntp.carnet.hr" }, { "Croatia #3", "st.ntp.carnet.hr", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=st.ntp.carnet.hr" }, { "Croatia #4", "ri.ntp.carnet.hr", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ri.ntp.carnet.hr" }, { "Croatia #5", "os.ntp.carnet.hr", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=os.ntp.carnet.hr" }, { "Hungary", "time.kfki.hu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.kfki.hu" }, { "Indonesia", "ntp.incaf.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.incaf.net" }, { "Ireland", "ntp.maths.tcd.ie", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.maths.tcd.ie" }, { "Italy", "ntps.net4u.it", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=" }, { "Japan", "ntp.cyber-fleet.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.cyber-fleet.net" }, { "Korea", "time.nuri.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.nuri.net" }, { "Mexico", "ntp2a.audiotel.com.mx", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2a.audiotel.com.mx" }, { "Mexico #2", "ntp2b.audiotel.com.mx", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2b.audiotel.com.mx" }, { "Mexico #3", "ntp2c.audiotel.com.mx", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2c.audiotel.com.mx" }, { "Nigeria", "ntp.supernet300.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.supernet300.com" }, { "Netherlands", "ntp1.theinternetone.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.theinternetone.net" }, { "Netherlands #2", "ntp2.theinternetone.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.theinternetone.net" }, { "Netherlands #3", "ntp3.theinternetone.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp3.theinternetone.net" }, { "Norway", "fartein.ifi.uio.no", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=fartein.ifi.uio.no" }, { "Norway #2", "time.alcanet.no", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.alcanet.no" }, { "New Zealand", "ntp.massey.ac.nz", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.massey.ac.nz" }, { "New Zealand #2", "ntp.public.otago.ac.nz", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.public.otago.ac.nz" }, { "New Zealand #3", "tk1.ihug.co.nz", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tk1.ihug.co.nz" }, { "New Zealand #4", "ntp.waikato.ac.nz", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.waikato.ac.nz" }, { "Poland", "info.cyf-kr.edu.pl", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=info.cyf-kr.edu.pl" }, { "Portugal", "bug.fe.up.pt", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=bug.fe.up.pt" }, { "Romania", "ntp.ip.ro", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.ip.ro" }, { "Russia", "ntp.psn.ru", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.psn.ru" }, { "Russia #2", "sign.chg.ru", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=sign.chg.ru" }, { "Sweden", "ntp.lth.se", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.lth.se" }, { "Singapore", "ntp.shim.org", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.shim.org" }, { "Slovenia", "calvus.rzs-hm.si", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=calvus.rzs-hm.si" }, { "Slovenia #2", "sizif.mf.uni-lj.si", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=sizif.mf.uni-lj.si" }, { "Slovenia #3", "ntp1.arnes.si", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.arnes.si" }, { "Slovenia #4", "ntp2.arnes.si", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.arnes.si" }, { "Slovenia #5", "time.ijs.si", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.ijs.si" }, { "Scotland", "ntp.cs.strath.ac.uk", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.cs.strath.ac.uk" }, { "United Kingdom", "ntp.exnet.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.exnet.com" }, { "United Kingdom #2", "ntp0.uk.uu.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp0.uk.uu.net" }, { "United Kingdom #3", "ntp1.uk.uu.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.uk.uu.net" }, { "United Kingdom #4", "ntp2.uk.uu.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.uk.uu.net" }, { "United Kingdom #5", "ntp2a.mcc.ac.uk", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2a.mcc.ac.uk" }, { "United Kingdom #6", "ntp2b.mcc.ac.uk", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2b.mcc.ac.uk" }, { "United Kingdom #7", "ntp2c.mcc.ac.uk", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2c.mcc.ac.uk" }, { "United Kingdom #8", "ntp2d.mcc.ac.uk", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2d.mcc.ac.uk" }, { "United Kingdom #9", "tick.tanac.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tick.tanac.net" }, { "U.S. AR", "sushi.compsci.lyon.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=sushi.compsci.lyon.edu" }, { "U.S. AZ", "ntp.drydog.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.drydog.com" }, { "U.S. CA", "ntp.ucsd.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.ucsd.edu" }, { "U.S. CA #2", "ntp1.mainecoon.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.mainecoon.com" }, { "U.S. CA #3", "ntp2.mainecoon.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.mainecoon.com" }, { "U.S. CA #4", "reloj.kjsl.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=reloj.kjsl.com" }, { "U.S. CA #5", "time.five-ten-sg.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.five-ten-sg.com" }, { "U.S. DE", "louie.udel.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=louie.udel.edu" }, { "U.S. GA", "ntp.shorty.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.shorty.com" }, { "U.S. GA #2", "rolex.usg.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=rolex.usg.edu" }, { "U.S. GA #3", "timex.usg.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=timex.usg.edu" }, { "U.S. IL", "ntp-0.cso.uiuc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-0.cso.uiuc.edu" }, { "U.S. IL #2", "ntp-1.cso.uiuc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-1.cso.uiuc.edu" }, { "U.S. IL #3", "ntp-1.mcs.anl.gov", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-1.mcs.anl.gov" }, { "U.S. IL #4", "ntp-2.cso.uiuc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-2.cso.uiuc.edu" }, { "U.S. IL #5", "ntp-2.mcs.anl.gov", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-2.mcs.anl.gov" }, { "U.S. IN", "gilbreth.ecn.purdue.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=gilbreth.ecn.purdue.edu" }, { "U.S. IN #2", "harbor.ecn.purdue.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=harbor.ecn.purdue.edu" }, { "U.S. IN #3", "molecule.ecn.purdue.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=molecule.ecn.purdue.edu" }, { "U.S. KS", "ntp1.kansas.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.kansas.net" }, { "U.S. KS #2", "ntp2.kansas.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.kansas.net" }, { "U.S. MA", "ntp.ourconcord.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.ourconcord.net" }, { "U.S. MA #2", "timeserver.cs.umb.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=timeserver.cs.umb.edu" }, { "U.S. MN", "ns.nts.umn.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ns.nts.umn.edu" }, { "U.S. MN #2", "nss.nts.umn.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=nss.nts.umn.edu" }, { "U.S. MO", "time-ext.missouri.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time-ext.missouri.edu" }, { "U.S. MT", "chronos1.umt.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=chronos1.umt.edu" }, { "U.S. MT #2", "chronos2.umt.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=chronos2.umt.edu" }, { "U.S. MT #3", "chronos3.umt.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=chronos3.umt.edu" }, { "U.S. NC", "clock1.unc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock1.unc.edu" }, { "U.S. NV", "cuckoo.nevada.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=cuckoo.nevada.edu" }, { "U.S. NV #2", "tick.cs.unlv.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tick.cs.unlv.edu" }, { "U.S. NV #3", "tock.cs.unlv.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tock.cs.unlv.edu" }, { "U.S. NY", "clock.linuxshell.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock.linuxshell.net" }, { "U.S. NY #2", "ntp.ctr.columbia.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.ctr.columbia.edu" }, { "U.S. NY #3", "ntp0.cornell.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp0.cornell.edu" }, { "U.S. NY #4", "ntp1.mpis.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.mpis.net" }, { "U.S. NY #5", "ntp2.mpis.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.mpis.net" }, { "U.S. NY #6", "sundial.columbia.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=sundial.columbia.edu" }, { "U.S. NY #7", "timex.cs.columbia.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=timex.cs.columbia.edu" }, { "U.S. OK", "constellation.ecn.uoknor.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=constellation.ecn.uoknor.edu" }, { "U.S. PA", "clock-1.cs.cmu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock-1.cs.cmu.edu" }, { "U.S. PA #2", "clock-2.cs.cmu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock-2.cs.cmu.edu" }, { "U.S. PA #3", "clock.psu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock.psu.edu" }, { "U.S. PA #4", "fuzz.psc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=fuzz.psc.edu" }, { "U.S. PA #5", "ntp-1.ece.cmu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-1.ece.cmu.edu" }, { "U.S. PA #6", "ntp-2.ece.cmu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-2.ece.cmu.edu" }, { "U.S. TX", "ntp.cox.smu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.cox.smu.edu" }, { "U.S. TX #2", "ntp.fnbhs.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.fnbhs.com" }, { "U.S. TX #3", "ntp.tmc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.tmc.edu" }, { "U.S. TX #4", "ntp5.tamu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp5.tamu.edu" }, { "U.S. TX #5", "tick.greyware.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tick.greyware.com" }, { "U.S. TX #6", "tock.greyware.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tock.greyware.com" }, { "U.S. VA", "ntp-1.vt.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-1.vt.edu" }, { "U.S. VA #2", "ntp-2.vt.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-2.vt.edu" }, { "U.S. VA #3", "ntp.cmr.gov", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.cmr.gov" }, { "U.S. VT", "ntp0.state.vt.us", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp0.state.vt.us" }, { "U.S. VT #2", "ntp1.state.vt.us", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.state.vt.us" }, { "U.S. VT #3", "ntp2.state.vt.us", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.state.vt.us" }, { "U.S. WA", "clock.tricity.wsu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock.tricity.wsu.edu" }, { "U.S. WA #2", "ntp.tcp-udp.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.tcp-udp.net" }, { "U.S. WI", "ntp1.cs.wisc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.cs.wisc.edu" }, { "U.S. WI #2", "ntp3.cs.wisc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp3.cs.wisc.edu" }, { "Venezuela", "ntp.linux.org.ve", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.linux.org.ve" }, { "South Africa", "ntp.cs.unp.ac.za", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.cs.unp.ac.za" }, { NULL } }, }; #ifdef WITH_SYSCONS DMenu MenuSyscons = { DMENU_NORMAL_TYPE, "System Console Configuration", "The default system console driver for FreeBSD (syscons) has a\n" "number of configuration options which may be set according to\n" "your preference.\n\n" "When you are done setting configuration options, select Cancel.", "Configure your system console settings", NULL, { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, #ifdef PC98 { "2 Keymap", "Choose an alternate keyboard map", NULL, dmenuSubmenu, NULL, &MenuSysconsKeymap }, { "3 Repeat", "Set the rate at which keys repeat", NULL, dmenuSubmenu, NULL, &MenuSysconsKeyrate }, { "4 Saver", "Configure the screen saver", NULL, dmenuSubmenu, NULL, &MenuSysconsSaver }, #else { "2 Font", "Choose an alternate screen font", NULL, dmenuSubmenu, NULL, &MenuSysconsFont }, { "3 Keymap", "Choose an alternate keyboard map", NULL, dmenuSubmenu, NULL, &MenuSysconsKeymap }, { "4 Repeat", "Set the rate at which keys repeat", NULL, dmenuSubmenu, NULL, &MenuSysconsKeyrate }, { "5 Saver", "Configure the screen saver", NULL, dmenuSubmenu, NULL, &MenuSysconsSaver }, { "6 Screenmap", "Choose an alternate screenmap", NULL, dmenuSubmenu, NULL, &MenuSysconsScrnmap }, { "7 Ttys", "Choose console terminal type", NULL, dmenuSubmenu, NULL, &MenuSysconsTtys }, #endif { NULL } }, }; #ifdef PC98 DMenu MenuSysconsKeymap = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "System Console Keymap", "The default system console driver for FreeBSD (syscons) defaults\n" "to a standard \"PC-98x1\" keyboard map. Users may wish to choose\n" "one of the other keymaps below.\n" "Note that sysinstall itself only uses the part of the keyboard map\n" "which is required to generate the ANSI character subset, but your\n" "choice of keymap will also be saved for later (fuller) use.", "Choose a keyboard map", NULL, { { "Japanese PC-98x1", "Japanese PC-98x1 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=jp.pc98" }, { " Japanese PC-98x1 (ISO)", "Japanese PC-98x1 (ISO) keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=jp.pc98.iso" }, { NULL } }, }; #else DMenu MenuSysconsKeymap = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "System Console Keymap", "The default system console driver for FreeBSD (syscons) defaults\n" "to a standard \"American\" keyboard map. Users in other countries\n" "(or with different keyboard preferences) may wish to choose one of\n" "the other keymaps below.\n" "Note that sysinstall itself only uses the part of the keyboard map\n" "which is required to generate the ANSI character subset, but your\n" "choice of keymap will also be saved for later (fuller) use.", "Choose a keyboard map", NULL, { { "Belgian", "Belgian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=be.iso" }, { " Brazil CP850", "Brazil CP850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=br275.cp850" }, { " Brazil ISO (accent)", "Brazil ISO keymap (accent keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=br275.iso.acc" }, { " Brazil ISO", "Brazil ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=br275.iso" }, { " Bulgarian BDS", "Bulgarian BDS keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=bg.bds.ctrlcaps" }, { " Bulgarian Phonetic", "Bulgarian Phonetic keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=bg.phonetic.ctrlcaps" }, { " Croatian ISO", "Croatian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=hr.iso" }, { " Czech ISO (accent)", "Czech ISO keymap (accent keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=cs.latin2.qwertz" }, { "Danish CP865", "Danish Code Page 865 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=danish.cp865" }, { " Danish ISO", "Danish ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=danish.iso" }, { "Estonian ISO", "Estonian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=estonian.iso" }, { " Estonian ISO 15", "Estonian ISO 8859-15 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=estonian.iso15" }, { " Estonian CP850", "Estonian Code Page 850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=estonian.cp850" }, { "Finnish CP850","Finnish Code Page 850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=finnish.cp850" }, { " Finnish ISO", "Finnish ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=finnish.iso" }, { " French ISO (accent)", "French ISO keymap (accent keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=fr.iso.acc" }, { " French ISO", "French ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=fr.iso" }, { "German CP850", "German Code Page 850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=german.cp850" }, { " German ISO", "German ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=german.iso" }, { " Greek 101", "Greek ISO keymap (101 keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=gr.us101.acc" }, { " Greek 104", "Greek ISO keymap (104 keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=el.iso07" }, { " Greek ELOT", "Greek ISO keymap (ELOT 1000)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=gr.elot.acc" }, { "Hungarian 101", "Hungarian ISO keymap (101 key)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=hu.iso2.101keys" }, { " Hungarian 102", "Hungarian ISO keymap (102 key)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=hu.iso2.102keys" }, { "Icelandic (accent)", "Icelandic ISO keymap (accent keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=icelandic.iso.acc" }, { " Icelandic", "Icelandic ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=icelandic.iso" }, { " Italian", "Italian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=it.iso" }, { "Japanese 106", "Japanese 106 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=jp.106" }, { "Latin American", "Latin American ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=lat-amer" }, { "Norway ISO", "Norwegian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=norwegian.iso" }, { "Polish ISO", "Polish ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=pl_PL.ISO8859-2" }, { " Portuguese (accent)", "Portuguese ISO keymap (accent keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=pt.iso.acc" }, { " Portuguese", "Portuguese ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=pt.iso" }, { "Russia KOI8-R", "Russian KOI8-R keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=ru.koi8-r" }, { "Slovenian", "Slovenian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=si.iso" }, { " Spanish (accent)", "Spanish ISO keymap (accent keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=spanish.iso.acc" }, { " Spanish", "Spanish ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=spanish.iso" }, { " Swedish CP850", "Swedish Code Page 850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swedish.cp850" }, { " Swedish ISO", "Swedish ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swedish.iso" }, { " Swiss French ISO (accent)", "Swiss French ISO keymap (accent keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swissfrench.iso.acc" }, { " Swiss French ISO", "Swiss French ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swissfrench.iso" }, { " Swiss French CP850", "Swiss French Code Page 850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swissfrench.cp850" }, { " Swiss German ISO (accent)", "Swiss German ISO keymap (accent keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swissgerman.iso.acc" }, { " Swiss German ISO", "Swiss German ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swissgerman.iso" }, { " Swiss German CP850", "Swiss German Code Page 850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swissgerman.cp850" }, { "UK CP850", "UK Code Page 850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=uk.cp850" }, { " UK ISO", "UK ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=uk.iso" }, { " Ukrainian KOI8-U", "Ukrainian KOI8-U keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=ua.koi8-u" }, { " Ukrainian KOI8-U+KOI8-R", "Ukrainian KOI8-U+KOI8-R keymap (alter)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=ua.koi8-u.shift.alt" }, { " USA CapsLock->Ctrl", "US standard (Caps as L-Control)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=us.pc-ctrl" }, { " USA Dvorak", "US Dvorak keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=us.dvorak" }, { " USA Dvorak (left)", "US left handed Dvorak keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=us.dvorakl" }, { " USA Dvorak (right)", "US right handed Dvorak keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=us.dvorakr" }, { " USA Emacs", "US standard optimized for EMACS", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=us.emacs" }, { " USA ISO", "US ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=us.iso" }, { " USA UNIX", "US traditional UNIX-workstation", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=us.unix" }, { NULL } }, }; #endif /* PC98 */ DMenu MenuSysconsKeyrate = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "System Console Keyboard Repeat Rate", "This menu allows you to set the speed at which keys repeat\n" "when held down.", "Choose a keyboard repeat rate", NULL, { { "Slow", "Slow keyboard repeat rate", dmenuVarCheck, dmenuSetVariable, NULL, "keyrate=slow" }, { "Normal", "\"Normal\" keyboard repeat rate", dmenuVarCheck, dmenuSetVariable, NULL, "keyrate=normal" }, { "Fast", "Fast keyboard repeat rate", dmenuVarCheck, dmenuSetVariable, NULL, "keyrate=fast" }, { "Default", "Use default keyboard repeat rate", dmenuVarCheck, dmenuSetVariable, NULL, "keyrate=NO" }, { NULL } }, }; DMenu MenuSysconsSaver = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "System Console Screen Saver", "By default, the console driver will not attempt to do anything\n" "special with your screen when it's idle. If you expect to leave your\n" "monitor switched on and idle for long periods of time then you should\n" "probably enable one of these screen savers to prevent phosphor burn-in.", "Choose a nifty-looking screen saver", NULL, { { "1 Blank", "Simply blank the screen", dmenuVarCheck, configSaver, NULL, "saver=blank" }, { "2 Daemon", "\"BSD Daemon\" animated screen saver (text)", dmenuVarCheck, configSaver, NULL, "saver=daemon" }, { "3 Fade", "Fade out effect screen saver", dmenuVarCheck, configSaver, NULL, "saver=fade" }, { "4 Fire", "Flames effect screen saver", dmenuVarCheck, configSaver, NULL, "saver=fire" }, { "5 Green", "\"Green\" power saving mode (if supported by monitor)", dmenuVarCheck, configSaver, NULL, "saver=green" }, { "6 Logo", "\"BSD Daemon\" animated screen saver (graphics)", dmenuVarCheck, configSaver, NULL, "saver=logo" }, { "7 Rain", "Rain drops screen saver", dmenuVarCheck, configSaver, NULL, "saver=rain" }, { "8 Snake", "Draw a FreeBSD \"snake\" on your screen", dmenuVarCheck, configSaver, NULL, "saver=snake" }, { "9 Star", "A \"twinkling stars\" effect", dmenuVarCheck, configSaver, NULL, "saver=star" }, { "Warp", "A \"stars warping\" effect", dmenuVarCheck, configSaver, NULL, "saver=warp" }, { "Dragon", "Dragon screensaver (graphics)", dmenuVarCheck, configSaver, NULL, "saver=dragon" }, { "Timeout", "Set the screen saver timeout interval", NULL, configSaverTimeout, NULL, NULL, ' ', ' ', ' ' }, { NULL } }, }; #ifndef PC98 DMenu MenuSysconsScrnmap = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "System Console Screenmap", "Unless you load a specific font, most PC hardware defaults to\n" "displaying characters in the IBM 437 character set. However,\n" "in the Unix world, this character set is very rarely used. Most\n" "Western European countries, for example, prefer ISO 8859-1.\n" "American users won't notice the difference since the bottom half\n" "of all these character sets is ANSI anyway.\n" "If your hardware is capable of downloading a new display font,\n" "you should probably choose that option. However, for hardware\n" "where this is not possible (e.g. monochrome adapters), a screen\n" "map will give you the best approximation that your hardware can\n" "display at all.", "Choose a screen map", NULL, { { "1 None", "No screenmap, don't touch font", dmenuVarCheck, dmenuSetVariable, NULL, "scrnmap=NO" }, { "2 ISO 8859-1 to IBM437", "W-Europe ISO 8859-1 to IBM 437 screenmap", dmenuVarCheck, dmenuSetVariable, NULL, "scrnmap=iso-8859-1_to_cp437" }, { "3 ISO 8859-7 to IBM437", "Greek ISO 8859-7 to IBM 437 screenmap", dmenuVarCheck, dmenuSetVariable, NULL, "scrnmap=iso-8859-7_to_cp437" }, { "4 US-ASCII to IBM437", "US-ASCII to IBM 437 screenmap", dmenuVarCheck, dmenuSetVariable, NULL, "scrnmap=us-ascii_to_cp437" }, { "5 KOI8-R to IBM866", "Russian KOI8-R to IBM 866 screenmap", dmenuVarCheck, dmenuSetVariable, NULL, "scrnmap=koi8-r2cp866" }, { "6 KOI8-U to IBM866u", "Ukrainian KOI8-U to IBM 866u screenmap", dmenuVarCheck, dmenuSetVariable, NULL, "scrnmap=koi8-u2cp866u" }, { NULL } }, }; DMenu MenuSysconsTtys = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "System Console Terminal Type", "For various console encodings, a corresponding terminal type\n" "must be chosen in /etc/ttys.\n\n" "WARNING: For compatibility reasons, only entries starting with\n" "ttyv and terminal types starting with cons[0-9] can be changed\n" "via this menu.\n", "Choose a terminal type", NULL, { { "1 None", "Don't touch anything", dmenuVarCheck, dmenuSetVariable, NULL, VAR_CONSTERM "=NO" }, { "2 IBM437 (VGA default)", "cons25", dmenuVarCheck, dmenuSetVariable, NULL, VAR_CONSTERM "=cons25" }, { "3 ISO 8859-1", "cons25l1", dmenuVarCheck, dmenuSetVariable, NULL, VAR_CONSTERM "=cons25l1" }, { "4 ISO 8859-2", "cons25l2", dmenuVarCheck, dmenuSetVariable, NULL, VAR_CONSTERM "=cons25l2" }, { "5 ISO 8859-7", "cons25l7", dmenuVarCheck, dmenuSetVariable, NULL, VAR_CONSTERM "=cons25l7" }, { "6 KOI8-R", "cons25r", dmenuVarCheck, dmenuSetVariable, NULL, VAR_CONSTERM "=cons25r" }, { "7 KOI8-U", "cons25u", dmenuVarCheck, dmenuSetVariable, NULL, VAR_CONSTERM "=cons25u" }, { "8 US-ASCII", "cons25w", dmenuVarCheck, dmenuSetVariable, NULL, VAR_CONSTERM "=cons25w" }, { NULL } }, }; DMenu MenuSysconsFont = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "System Console Font", "Most PC hardware defaults to displaying characters in the\n" "IBM 437 character set. However, in the Unix world, this\n" "character set is very rarely used. Most Western European\n" "countries, for example, prefer ISO 8859-1.\n" "American users won't notice the difference since the bottom half\n" "of all these charactersets is ANSI anyway. However, they might\n" "want to load a font anyway to use the 30- or 50-line displays.\n" "If your hardware is capable of downloading a new display font,\n" "you can select the appropriate font below.", "Choose a font", NULL, { { "1 None", "Use hardware default font", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=NO,font8x14=NO,font8x16=NO" }, { "2 IBM 437", "English and others, VGA default", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp437-8x8,font8x14=cp437-8x14,font8x16=cp437-8x16" }, { "3 IBM 850", "Western Europe, IBM encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp850-8x8,font8x14=cp850-8x14,font8x16=cp850-8x16" }, { "4 IBM 865", "Norwegian, IBM encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp865-8x8,font8x14=cp865-8x14,font8x16=cp865-8x16" }, { "5 IBM 866", "Russian, IBM encoding (use with KOI8-R screenmap)", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp866-8x8,font8x14=cp866-8x14,font8x16=cp866b-8x16,mousechar_start=3" }, { "6 IBM 866u", "Ukrainian, IBM encoding (use with KOI8-U screenmap)", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp866u-8x8,font8x14=cp866u-8x14,font8x16=cp866u-8x16,mousechar_start=3" }, { "7 IBM 1251", "Cyrillic, MS Windows encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp1251-8x8,font8x14=cp1251-8x14,font8x16=cp1251-8x16,mousechar_start=3" }, { "8 ISO 8859-1", "Western Europe, ISO encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=iso-8x8,font8x14=iso-8x14,font8x16=iso-8x16" }, { "9 ISO 8859-2", "Eastern Europe, ISO encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=iso02-8x8,font8x14=iso02-8x14,font8x16=iso02-8x16" }, { "a ISO 8859-4", "Baltic, ISO encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=iso04-8x8,font8x14=iso04-8x14,font8x16=iso04-8x16" }, { "b ISO 8859-7", "Greek, ISO encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=iso07-8x8,font8x14=iso07-8x14,font8x16=iso07-8x16" }, { "c ISO 8859-8", "Hebrew, ISO encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=iso08-8x8,font8x14=iso08-8x14,font8x16=iso08-8x16" }, { "d ISO 8859-15", "Europe, ISO encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=iso15-8x8,font8x14=iso15-8x14,font8x16=iso15-8x16" }, { "e SWISS", "English, better resolution", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=swiss-8x8,font8x14=NO,font8x16=swiss-8x16" }, { NULL } }, }; #endif /* PC98 */ #endif /* WITH_SYSCONS */ DMenu MenuUsermgmt = { DMENU_NORMAL_TYPE, "User and group management", "The submenus here allow to manipulate user groups and\n" "login accounts.\n", "Configure your user groups and users", NULL, { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "User", "Add a new user to the system.", NULL, userAddUser }, { "Group", "Add a new user group to the system.", NULL, userAddGroup }, { NULL } }, }; DMenu MenuSecurity = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "System Security Options Menu", "This menu allows you to configure aspects of the operating system security\n" "policy. Please read the system documentation carefully before modifying\n" "these settings, as they may cause service disruption if used improperly.\n" "\n" "Most settings will take affect only following a system reboot.", "Configure system security options", NULL, { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { " Securelevel", "Configure securelevels for the system", NULL, configSecurelevel }, #if 0 { " LOMAC", "Use Low Watermark Mandatory Access Control at boot", dmenuVarCheck, dmenuToggleVariable, NULL, "lomac_enable=YES" }, #endif { " NFS port", "Require that the NFS clients used reserved ports", dmenuVarCheck, dmenuToggleVariable, NULL, "nfs_reserved_port_only=YES" }, { NULL } }, }; DMenu MenuSecurelevel = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Securelevel Configuration Menu", "This menu allows you to select the securelevel your system runs with.\n" "When operating at a securelevel, certain root privileges are disabled,\n" "which may increase resistance to exploits and protect system integrity.\n" "In secure mode system flags may not be overriden by the root user,\n" "access to direct kernel memory is limited, and kernel modules may not\n" "be changed. In highly secure mode, mounted file systems may not be\n" "modified on-disk, tampering with the system clock is prohibited. In\n" "network secure mode configuration changes to firwalling are prohibited.\n", "Select a securelevel to operate at - F1 for help", "securelevel", { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { "Disabled", "Disable securelevels", NULL, configSecurelevelDisabled, }, { "Secure", "Secure mode", NULL, configSecurelevelSecure }, { "Highly Secure", "Highly secure mode", NULL, configSecurelevelHighlySecure }, { "Network Secure", "Network secure mode", NULL, configSecurelevelNetworkSecure }, { NULL } } }; DMenu MenuFixit = { DMENU_NORMAL_TYPE, "Please choose a fixit option", "There are three ways of going into \"fixit\" mode:\n" "- you can use the live filesystem CDROM/DVD, in which case there will be\n" " full access to the complete set of FreeBSD commands and utilities,\n" "- you can use the more limited (but perhaps customized) fixit floppy,\n" "- or you can start an Emergency Holographic Shell now, which is\n" " limited to the subset of commands that is already available right now.", "Press F1 for more detailed repair instructions", "fixit", { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "2 CDROM/DVD", "Use the \"live\" filesystem CDROM/DVD", NULL, installFixitCDROM }, { "3 Floppy", "Use a floppy generated from the fixit image", NULL, installFixitFloppy }, { "4 Shell", "Start an Emergency Holographic Shell", NULL, installFixitHoloShell }, { NULL } }, }; diff --git a/usr.sbin/sade/sade.h b/usr.sbin/sade/sade.h index e4c939f4ec60..938cfad0be72 100644 --- a/usr.sbin/sade/sade.h +++ b/usr.sbin/sade/sade.h @@ -1,885 +1,885 @@ /* * The new sysinstall program. * * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer, * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ #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 ***/ #if defined(__i386__) || defined(__alpha__) || defined(__amd64__) #define WITH_SYSCONS #define WITH_MICE #endif #if defined(__i386__) || defined(__amd64__) #define WITH_SLICES #endif #if defined(__i386__) || defined(__alpha__) #define WITH_LINUX #endif #if defined(PC98) #define PCCARD_ARCH 1 /* Support PCCARD installations */ #endif /* device limits */ #define DEV_NAME_MAX 128 /* 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_DESKSTYLE "_deskStyle" #define VAR_DISK "disk" #define VAR_DISKINTERACTIVE "diskInteractive" #define VAR_DISTS "dists" #define VAR_DIST_MAIN "distMain" #define VAR_DIST_CRYPTO "distCRYPTO" #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_FIXIT_TTY "fixitTty" #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_HTTP_PATH "_httpPath" #define VAR_HTTP_PROXY "httpProxy" #define VAR_HTTP_PORT "httpPort" #define VAR_HTTP_HOST "httpHost" #define VAR_HTTP_FTP_MODE "httpFtpMode" #define VAR_GATEWAY "defaultrouter" #define VAR_GEOMETRY "geometry" #define VAR_HOSTNAME "hostname" #define VAR_IFCONFIG "ifconfig_" #define VAR_INSTALL_CFG "installConfig" #define VAR_INSTALL_ROOT "installRoot" #define VAR_IPADDR "ipaddr" #define VAR_IPV6_ENABLE "ipv6_enable" #define VAR_IPV6ADDR "ipv6addr" #define VAR_KERN_SECURELEVEL "kern_securelevel" #define VAR_KEYMAP "keymap" #define VAR_LABEL "label" #define VAR_LABEL_COUNT "labelCount" #define VAR_LINUX_ENABLE "linux_enable" #define VAR_MEDIA_TYPE "mediaType" #define VAR_MEDIA_TIMEOUT "MEDIA_TIMEOUT" #define VAR_MOUSED "moused_enable" #define VAR_MOUSED_FLAGS "moused_flags" #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_NEWFS_ARGS "newfsArgs" #define VAR_NFS_PATH "nfs" #define VAR_NFS_HOST "nfsHost" #define VAR_NFS_V3 "nfs_use_v3" #define VAR_NFS_TCP "nfs_use_tcp" #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_HOLOSHELL "noHoloShell" #define VAR_NO_INET6 "noInet6" #define VAR_NO_WARN "noWarn" #define VAR_NO_USR "noUsr" #define VAR_NO_TMP "noTmp" #define VAR_NO_HOME "noHome" #define VAR_NONINTERACTIVE "nonInteractive" #define VAR_NOVELL "novell" #define VAR_OSF1_ENABLE "osf1_enable" #define VAR_RPCBIND_ENABLE "rpcbind_enable" #define VAR_NTPDATE_FLAGS "ntpdate_flags" #define VAR_PACKAGE "package" #define VAR_PARTITION "partition" #define VAR_PCNFSD "pcnfsd" #define VAR_PKG_TMPDIR "PKG_TMPDIR" #define VAR_PORTS_PATH "ports" #define VAR_PPP_ENABLE "ppp_enable" #define VAR_PPP_PROFILE "ppp_profile" #define VAR_RELNAME "releaseName" #define VAR_ROOT_SIZE "rootSize" #define VAR_ROUTER "router" #define VAR_ROUTER_ENABLE "router_enable" #define VAR_ROUTERFLAGS "router_flags" #define VAR_SENDMAIL_ENABLE "sendmail_enable" #define VAR_SERIAL_SPEED "serialSpeed" #define VAR_SLOW_ETHER "slowEthernetCard" #define VAR_SWAP_SIZE "swapSize" #define VAR_TAPE_BLOCKSIZE "tapeBlocksize" #define VAR_TRY_DHCP "tryDHCP" #define VAR_TRY_RTSOL "tryRTSOL" #define VAR_SKIP_PCCARD "skipPCCARD" #define VAR_UFS_PATH "ufs" #define VAR_USR_SIZE "usrSize" #define VAR_VAR_SIZE "varSize" #define VAR_TMP_SIZE "tmpSize" #define VAR_HOME_SIZE "homeSize" #define VAR_XF86_CONFIG "_xf86config" #define VAR_TERM "TERM" #define VAR_CONSTERM "_consterm" #define DEFAULT_TAPE_BLOCKSIZE "20" /* One MB worth of blocks */ #define ONE_MEG 2048 #define ONE_GIG (ONE_MEG * 1024) /* 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 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" */ #if (__STDC_VERSION__ >= 199901L) || (__GNUC__ >= 3) dialogMenuItem items[]; /* Array of menu items */ #elif __GNUC__ dialogMenuItem items[0]; /* Array of menu items */ #else #error "Create hack for C89 and K&R compilers." #endif } 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, DEVICE_TYPE_HTTP, } 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; unsigned int volume; } Device; /* Some internal representations of partitions */ typedef enum { PART_NONE, PART_SLICE, PART_SWAP, PART_FILESYSTEM, PART_FAT, PART_EFI } PartType; #define NEWFS_UFS_CMD "newfs" #define NEWFS_MSDOS_CMD "newfs_msdos" enum newfs_type { NEWFS_UFS, NEWFS_MSDOS, NEWFS_CUSTOM }; #define NEWFS_UFS_STRING "UFS" #define NEWFS_MSDOS_STRING "FAT" #define NEWFS_CUSTOM_STRING "CST" /* The longest set of custom command line arguments we'll pass. */ #define NEWFS_CMD_ARGS_MAX 256 typedef struct _part_info { char mountpoint[FILENAME_MAX]; /* Is invocation of newfs desired? */ Boolean do_newfs; enum newfs_type newfs_type; union { struct { char user_options[NEWFS_CMD_ARGS_MAX]; Boolean acls; /* unused */ Boolean multilabel; /* unused */ Boolean softupdates; Boolean ufs1; } newfs_ufs; struct { /* unused */ } newfs_msdos; struct { char command[NEWFS_CMD_ARGS_MAX]; } newfs_custom; } newfs_data; } 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 */ unsigned int volume; /* Volume of package */ } 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 { int use_rtsol; int use_dhcp; 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 Restarting; /* Are we restarting sysinstall? */ 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 CRYPTODists; /* 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 */ #if defined(__i386__) || defined(__amd64__) #ifdef PC98 extern DMenu MenuIPLType; /* Type of IPL to write on the disk */ #else extern DMenu MenuMBRType; /* Type of MBR to write on the disk */ #endif #endif 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 MenuKLD; /* Prototype KLD menu */ extern DMenu MenuMedia; /* Media type menu */ #ifdef WITH_MICE extern DMenu MenuMouse; /* Mouse type menu */ #endif 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 MenuSecurity; /* System security options menu */ extern DMenu MenuSecurelevel; /* Securelevel menu */ extern DMenu MenuStartup; /* Startup services menu */ #ifdef WITH_SYSCONS 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 MenuSysconsTtys; /* System console terminal type menu */ #endif extern DMenu MenuNetworking; /* Network configuration menu */ extern DMenu MenuMTA; /* MTA selection menu */ extern DMenu MenuInstallCustom; /* Custom Installation menu */ extern DMenu MenuDistributions; /* Distribution menu */ extern DMenu MenuDiskDevices; /* Disk type devices */ extern DMenu MenuSubDistributions; /* Custom 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 MenuXF86SelectFonts; /* XFree86 font selection menu */ extern DMenu MenuXDesktops; /* 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 */ extern int FixItMode; /* FixItMode starts shell onc urrent device (ie Serial port) */ extern const char * StartName; /* Which name we were started as */ /* 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, ...) __printflike(2, 3); 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 configResolv(dialogMenuItem *self); extern int configPackages(dialogMenuItem *self); extern int configSaver(dialogMenuItem *self); extern int configSaverTimeout(dialogMenuItem *self); #ifdef WITH_LINUX extern int configLinux(dialogMenuItem *self); #endif extern int configNTP(dialogMenuItem *self); #ifdef __alpha__ extern int configOSF1(dialogMenuItem *self); #endif extern int configUsers(dialogMenuItem *self); extern int configXSetup(dialogMenuItem *self); extern int configXDesktop(dialogMenuItem *self); extern int configRouter(dialogMenuItem *self); extern int configPCNFSD(dialogMenuItem *self); extern int configInetd(dialogMenuItem *self); extern int configNFSServer(dialogMenuItem *self); extern int configMTAPostfix(dialogMenuItem *self); extern int configMTAExim(dialogMenuItem *self); extern int configRpcBind(dialogMenuItem *self); extern int configWriteRC_conf(dialogMenuItem *self); extern int configSecurelevel(dialogMenuItem *self); extern int configSecurelevelDisabled(dialogMenuItem *self); extern int configSecurelevelSecure(dialogMenuItem *self); extern int configSecurelevelHighlySecure(dialogMenuItem *self); extern int configSecurelevelNetworkSecure(dialogMenuItem *self); extern int configEtcTtys(dialogMenuItem *self); #ifdef __i386__ extern int checkLoaderACPI(void); extern int configLoaderACPI(int); #endif /* devices.c */ extern DMenu *deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)(dialogMenuItem *d), int (*check)(dialogMenuItem *d)); extern void deviceGetAll(void); extern void deviceReset(void); extern void deviceRescan(void); extern Device **deviceFind(char *name, DeviceType type); extern Device **deviceFindDescr(char *name, char *desc, DeviceType class); extern int deviceCount(Device **devs); extern Device *new_device(char *name); extern Device *deviceRegister(char *name, char *desc, char *devname, DeviceType type, Boolean enabled, Boolean (*init)(Device *mediadev), FILE * (*get)(Device *dev, char *file, Boolean probe), void (*shutDown)(Device *mediadev), void *private); extern Boolean dummyInit(Device *dev); extern FILE *dummyGet(Device *dev, char *dist, Boolean probe); extern void dummyShutdown(Device *dev); /* dhcp.c */ extern int dhcpParseLeases(char *file, char *hostname, char *domain, char *nameserver, char *ipaddr, char *gateway, char *netmask); /* disks.c */ #ifdef WITH_SLICES extern void diskPartition(Device *dev); extern int diskPartitionEditor(dialogMenuItem *self); #endif extern int diskPartitionWrite(dialogMenuItem *self); extern int diskGetSelectCount(Device ***devs); /* 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 distUnsetCustom(dialogMenuItem *self); extern int distSetDeveloper(dialogMenuItem *self); extern int distSetXDeveloper(dialogMenuItem *self); extern int distSetKernDeveloper(dialogMenuItem *self); extern int distSetXKernDeveloper(dialogMenuItem *self); extern int distSetUser(dialogMenuItem *self); extern int distSetXUser(dialogMenuItem *self); extern int distSetMinimum(dialogMenuItem *self); extern int distSetEverything(dialogMenuItem *self); extern int 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); /* http.c */ extern Boolean mediaInitHTTP(Device *dev); extern FILE *mediaGetHTTP(Device *dev, char *file, Boolean probe); /* globals.c */ extern void globalsInit(void); /* index.c */ int index_read(FILE *fp, PkgNodePtr papa); int index_menu(PkgNodePtr root, PkgNodePtr top, PkgNodePtr plist, int *pos, int *scroll); void index_init(PkgNodePtr top, PkgNodePtr plist); void index_node_free(PkgNodePtr top, PkgNodePtr plist); void index_sort(PkgNodePtr top); void index_print(PkgNodePtr top, int level); int index_extract(Device *dev, PkgNodePtr top, PkgNodePtr who, Boolean depended); int index_initialize(char *path); PkgNodePtr index_search(PkgNodePtr top, char *str, PkgNodePtr *tp); /* install.c */ extern Boolean checkLabels(Boolean whinge, Chunk **rdev, Chunk **sdev, Chunk **udev, Chunk **vdev, Chunk **vtdev, Chunk **hdev); extern int installCommit(dialogMenuItem *self); extern int installCustomCommit(dialogMenuItem *self); extern int installExpress(dialogMenuItem *self); extern int installStandard(dialogMenuItem *self); extern int installFixitHoloShell(dialogMenuItem *self); extern int installFixitCDROM(dialogMenuItem *self); extern int installFixitFloppy(dialogMenuItem *self); extern int installFixupBase(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); /* makedevs.c (auto-generated) */ extern const char termcap_ansi[]; extern const char termcap_vt100[]; extern const char termcap_cons25w[]; 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 char termcap_xterm[]; 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 mediaSetHTTP(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 Mkdir_command(char *key, void *data); extern int Mount(char *, void *data); extern int Mount_msdosfs(char *mountp, void *devname); 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); /* modules.c */ extern void driverFloppyCheck(void); extern void moduleInitialize(void); extern int kldBrowser(dialogMenuItem *self); /* mouse.c */ extern int mousedTest(dialogMenuItem *self); extern int mousedDisable(dialogMenuItem *self); extern int setMouseFlags(dialogMenuItem *self); /* msg.c */ extern Boolean isDebug(void); extern void msgInfo(char *fmt, ...) __printf0like(1, 2); extern void msgYap(char *fmt, ...) __printflike(1, 2); extern void msgWarn(char *fmt, ...) __printflike(1, 2); extern void msgDebug(char *fmt, ...) __printflike(1, 2); extern void msgError(char *fmt, ...) __printflike(1, 2); extern void msgFatal(char *fmt, ...) __printflike(1, 2); extern void msgConfirm(char *fmt, ...) __printflike(1, 2); extern void msgNotify(char *fmt, ...) __printflike(1, 2); extern void msgWeHaveOutput(char *fmt, ...) __printflike(1, 2); extern int msgYesNo(char *fmt, ...) __printflike(1, 2); extern int msgNoYes(char *fmt, ...) __printflike(1, 2); extern char *msgGetInput(char *buf, char *fmt, ...) __printflike(2, 3); 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_installed(char *name); /* pccard.c */ extern void pccardInitialize(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 void systemSuspendDialog(void); extern void systemResumeDialog(void); 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, ...) __printflike(1, 2); /* 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); /* ttys.c */ extern void configTtys(void); /* ufs.c */ extern void mediaShutdownUFS(Device *dev); extern Boolean mediaInitUFS(Device *dev); extern FILE *mediaGetUFS(Device *dev, char *file, Boolean probe); /* usb.c */ extern void usbInitialize(void); /* 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 variable_check2(char *data); extern int dump_variables(dialogMenuItem *self); extern void free_variables(void); extern void pvariable_set(char *var); extern char *pvariable_get(char *var); /* wizard.c */ extern void slice_wizard(Disk *d); /* * Macros. Please find a better place for us! */ -#define DEVICE_INIT(d) ((d) != NULL ? (d)->init((d)) : NULL) +#define DEVICE_INIT(d) ((d) != NULL ? (d)->init((d)) : (Boolean)0) #define DEVICE_GET(d, b, f) ((d) != NULL ? (d)->get((d), (b), (f)) : NULL) #define DEVICE_SHUTDOWN(d) ((d) != NULL ? (d)->shutdown((d)) : (void)0) #ifdef USE_GZIP #define UNZIPPER "gunzip" #else #define UNZIPPER "bunzip2" #endif #endif /* _SYSINSTALL_H_INCLUDE */ diff --git a/usr.sbin/sade/system.c b/usr.sbin/sade/system.c index 906dec206061..65c353a41c9e 100644 --- a/usr.sbin/sade/system.c +++ b/usr.sbin/sade/system.c @@ -1,542 +1,542 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * * $FreeBSD$ * * Jordan Hubbard * * My contributions are in the public domain. * * Parts of this file are also blatently stolen from Poul-Henning Kamp's * previous version of sysinstall, and as such fall under his "BEERWARE license" * so buy him a beer if you like it! Buy him a beer for me, too! * Heck, get him completely drunk and send me pictures! :-) */ #include "sysinstall.h" #include #include #include #include #include #include #include #include #include #include #include /* Where we stick our temporary expanded doc file */ #define DOC_TMP_DIR "/tmp/.doc" #define DOC_TMP_FILE "/tmp/.doc/doc.tmp" static pid_t ehs_pid; /* * Handle interrupt signals - this probably won't work in all cases * due to our having bogotified the internal state of dialog or curses, * but we'll give it a try. */ static int intr_continue(dialogMenuItem *self) { return DITEM_LEAVE_MENU; } static int intr_reboot(dialogMenuItem *self) { systemShutdown(-1); /* NOTREACHED */ return 0; } static int intr_restart(dialogMenuItem *self) { int ret, fd, fdmax; mediaClose(); free_variables(); fdmax = getdtablesize(); for (fd = 3; fd < fdmax; fd++) close(fd); ret = execl(StartName, StartName, "-restart", (char *)NULL); msgDebug("execl failed (%s)\n", strerror(errno)); /* NOTREACHED */ return -1; } static dialogMenuItem intrmenu[] = { { "Abort", "Abort the installation", NULL, intr_reboot }, { "Restart", "Restart the installation program", NULL, intr_restart }, { "Continue", "Continue the installation", NULL, intr_continue }, }; static void handle_intr(int sig) { WINDOW *save = savescr(); use_helpline(NULL); use_helpfile(NULL); if (OnVTY) { ioctl(0, VT_ACTIVATE, 1); /* Switch back */ msgInfo(NULL); } (void)dialog_menu("Installation interrupt", "Do you want to abort the installation?", -1, -1, 3, -3, intrmenu, NULL, NULL, NULL); restorescr(save); } /* * Harvest children if we are init. */ static void reap_children(int sig) { int errbak = errno; while (waitpid(-1, NULL, WNOHANG) > 0) ; errno = errbak; } /* Expand a file into a convenient location, nuking it each time */ static char * expand(char *fname) { char *gunzip = RunningAsInit ? "/stand/gunzip" : "/usr/bin/gunzip"; if (!directory_exists(DOC_TMP_DIR)) { Mkdir(DOC_TMP_DIR); if (chown(DOC_TMP_DIR, 0, 0) < 0) return NULL; if (chmod(DOC_TMP_DIR, S_IRWXU) < 0) return NULL; } else unlink(DOC_TMP_FILE); if (!file_readable(fname) || vsystem("%s < %s > %s", gunzip, fname, DOC_TMP_FILE)) return NULL; return DOC_TMP_FILE; } /* Initialize system defaults */ void systemInitialize(int argc, char **argv) { size_t i; int boothowto; sigset_t signalset; signal(SIGINT, SIG_IGN); globalsInit(); i = sizeof(boothowto); - if (!sysctlbyname("debug.boothowto", &boothowto, &i, NULL, NULL) && + if (!sysctlbyname("debug.boothowto", &boothowto, &i, NULL, 0) && (i == sizeof(boothowto)) && (boothowto & RB_VERBOSE)) variable_set2(VAR_DEBUG, "YES", 0); /* Are we running as init? */ if (getpid() == 1) { struct ufs_args ufs_args; int fd; RunningAsInit = 1; setsid(); close(0); fd = open("/dev/ttyv0", O_RDWR); if (fd == -1) { fd = open("/dev/console", O_RDWR); /* fallback */ variable_set2(VAR_FIXIT_TTY, "serial", 0); /* give fixit a hint */ } else OnVTY = TRUE; /* * To make _sure_ we're on a VTY and don't have /dev/console switched * away to a serial port or something, attempt to set the cursor appearance. */ if (OnVTY) { int fd2, type; type = 0; /* normal */ if ((fd2 = open("/dev/console", O_RDWR)) != -1) { if (ioctl(fd2, CONS_CURSORTYPE, &type) == -1) { OnVTY = FALSE; variable_set2(VAR_FIXIT_TTY, "serial", 0); /* Tell Fixit the console type */ close(fd); close(fd2); open("/dev/console", O_RDWR); } else close(fd2); } } close(1); dup(0); close(2); dup(0); printf("%s running as init on %s\n", argv[0], OnVTY ? "vty0" : "serial console"); ioctl(0, TIOCSCTTY, (char *)NULL); setlogin("root"); setenv("PATH", "/stand:/bin:/sbin:/usr/sbin:/usr/bin:/mnt/bin:/mnt/sbin:/mnt/usr/sbin:/mnt/usr/bin:/usr/X11R6/bin", 1); setbuf(stdin, 0); setbuf(stderr, 0); #ifdef __alpha__ i = 0; sysctlbyname("machdep.unaligned_print", NULL, 0, &i, sizeof(i)); #endif #if 0 signal(SIGCHLD, reap_children); #endif memset(&ufs_args, 0, sizeof(ufs_args)); mount("ufs", "/", MNT_UPDATE, &ufs_args); } else { char hname[256]; /* Initalize various things for a multi-user environment */ if (!gethostname(hname, sizeof hname)) variable_set2(VAR_HOSTNAME, hname, 0); } if (set_termcap() == -1) { printf("Can't find terminal entry\n"); exit(-1); } /* XXX - libdialog has particularly bad return value checking */ init_dialog(); /* If we haven't crashed I guess dialog is running ! */ DialogActive = TRUE; /* Make sure HOME is set for those utilities that need it */ if (!getenv("HOME")) setenv("HOME", "/", 1); signal(SIGINT, handle_intr); /* * Make sure we can be interrupted even if we were re-executed * from an interrupt. */ sigemptyset(&signalset); sigaddset(&signalset, SIGINT); sigprocmask(SIG_UNBLOCK, &signalset, NULL); (void)vsystem("rm -rf %s", DOC_TMP_DIR); } /* Close down and prepare to exit */ void systemShutdown(int status) { /* If some media is open, close it down */ if (status >=0) mediaClose(); /* write out any changes to rc.conf .. */ configRC_conf(); /* Shut down the dialog library */ if (DialogActive) { end_dialog(); DialogActive = FALSE; } /* Shut down curses */ endwin(); /* If we have a temporary doc dir lying around, nuke it */ (void)vsystem("rm -rf %s", DOC_TMP_DIR); /* REALLY exit! */ if (RunningAsInit) { /* Put the console back */ ioctl(0, VT_ACTIVATE, 2); #if defined(__alpha__) || defined(__sparc64__) reboot(RB_HALT); #else reboot(0); #endif } else exit(status); } /* Run some general command */ int systemExecute(char *command) { int status; struct termios foo; WINDOW *w = savescr(); dialog_clear(); dialog_update(); end_dialog(); DialogActive = FALSE; if (tcgetattr(0, &foo) != -1) { foo.c_cc[VERASE] = '\010'; tcsetattr(0, TCSANOW, &foo); } if (!Fake) status = system(command); else { status = 0; msgDebug("systemExecute: Faked execution of `%s'\n", command); } DialogActive = TRUE; restorescr(w); return status; } /* suspend/resume libdialog/curses screen */ static WINDOW *oldW; void systemSuspendDialog(void) { oldW = savescr(); dialog_clear(); dialog_update(); end_dialog(); DialogActive = FALSE; } void systemResumeDialog(void) { DialogActive = TRUE; restorescr(oldW); } /* Display a help file in a filebox */ int systemDisplayHelp(char *file) { char *fname = NULL; char buf[FILENAME_MAX]; int ret = 0; WINDOW *w = savescr(); fname = systemHelpFile(file, buf); if (!fname) { snprintf(buf, FILENAME_MAX, "The %s file is not provided on this particular floppy image.", file); use_helpfile(NULL); use_helpline(NULL); dialog_mesgbox("Sorry!", buf, -1, -1); ret = 1; } else { use_helpfile(NULL); use_helpline(NULL); dialog_textbox(file, fname, LINES, COLS); } restorescr(w); return ret; } char * systemHelpFile(char *file, char *buf) { if (!file) return NULL; if (file[0] == '/') return file; snprintf(buf, FILENAME_MAX, "/stand/help/%s.hlp.gz", file); if (file_readable(buf)) return expand(buf); snprintf(buf, FILENAME_MAX, "/stand/help/%s.hlp", file); if (file_readable(buf)) return expand(buf); snprintf(buf, FILENAME_MAX, "/stand/help/%s.TXT.gz", file); if (file_readable(buf)) return expand(buf); snprintf(buf, FILENAME_MAX, "/stand/help/%s.TXT", file); if (file_readable(buf)) return expand(buf); snprintf(buf, FILENAME_MAX, "/usr/src/usr.sbin/sysinstall/help/%s.hlp", file); if (file_readable(buf)) return buf; snprintf(buf, FILENAME_MAX, "/usr/src/usr.sbin/sysinstall/help/%s.TXT", file); if (file_readable(buf)) return buf; return NULL; } void systemChangeTerminal(char *color, const u_char c_term[], char *mono, const u_char m_term[]) { if (OnVTY) { int setupterm(char *color, int, int *); if (ColorDisplay) { setenv("TERM", color, 1); setenv("TERMCAP", c_term, 1); reset_shell_mode(); setterm(color); cbreak(); noecho(); } else { setenv("TERM", mono, 1); setenv("TERMCAP", m_term, 1); reset_shell_mode(); setterm(mono); cbreak(); noecho(); } } clear(); refresh(); dialog_clear(); } int vsystem(char *fmt, ...) { va_list args; int pstat; pid_t pid; int omask; sig_t intsave, quitsave; char *cmd; int i; cmd = (char *)alloca(FILENAME_MAX); cmd[0] = '\0'; va_start(args, fmt); vsnprintf(cmd, FILENAME_MAX, fmt, args); va_end(args); omask = sigblock(sigmask(SIGCHLD)); if (Fake) { msgDebug("vsystem: Faked execution of `%s'\n", cmd); return 0; } if (isDebug()) msgDebug("Executing command `%s'\n", cmd); pid = fork(); if (pid == -1) { (void)sigsetmask(omask); i = 127; } else if (!pid) { /* Junior */ (void)sigsetmask(omask); if (DebugFD != -1) { dup2(DebugFD, 0); dup2(DebugFD, 1); dup2(DebugFD, 2); } else { close(1); open("/dev/null", O_WRONLY); dup2(1, 2); } if (!RunningAsInit) execl("/bin/sh", "/bin/sh", "-c", cmd, (char *)NULL); else execl("/stand/sh", "/stand/sh", "-c", cmd, (char *)NULL); exit(1); } else { intsave = signal(SIGINT, SIG_IGN); quitsave = signal(SIGQUIT, SIG_IGN); pid = waitpid(pid, &pstat, 0); (void)sigsetmask(omask); (void)signal(SIGINT, intsave); (void)signal(SIGQUIT, quitsave); i = (pid == -1) ? -1 : WEXITSTATUS(pstat); if (isDebug()) msgDebug("Command `%s' returns status of %d\n", cmd, i); } return i; } void systemCreateHoloshell(void) { int waitstatus; if ((FixItMode || OnVTY) && RunningAsInit) { if (ehs_pid != 0) { int pstat; if (kill(ehs_pid, 0) == 0) { if (msgNoYes("There seems to be an emergency holographic shell\n" "already running on VTY 4.\n\n" "Kill it and start a new one?")) return; /* try cleaning up as much as possible */ (void) kill(ehs_pid, SIGHUP); sleep(1); (void) kill(ehs_pid, SIGKILL); } /* avoid too many zombies */ (void) waitpid(ehs_pid, &pstat, WNOHANG); } if (strcmp(variable_get(VAR_FIXIT_TTY), "serial") == 0) systemSuspendDialog(); /* must be before the fork() */ if ((ehs_pid = fork()) == 0) { int i, fd; struct termios foo; extern int login_tty(int); ioctl(0, TIOCNOTTY, NULL); for (i = getdtablesize(); i >= 0; --i) close(i); if (strcmp(variable_get(VAR_FIXIT_TTY), "serial") == 0) fd = open("/dev/console", O_RDWR); else fd = open("/dev/ttyv3", O_RDWR); ioctl(0, TIOCSCTTY, &fd); dup2(0, 1); dup2(0, 2); DebugFD = 2; if (login_tty(fd) == -1) msgDebug("Doctor: I can't set the controlling terminal.\n"); signal(SIGTTOU, SIG_IGN); if (tcgetattr(fd, &foo) != -1) { foo.c_cc[VERASE] = '\010'; if (tcsetattr(fd, TCSANOW, &foo) == -1) msgDebug("Doctor: I'm unable to set the erase character.\n"); } else msgDebug("Doctor: I'm unable to get the terminal attributes!\n"); if (strcmp(variable_get(VAR_FIXIT_TTY), "serial") == 0) { printf("Type ``exit'' in this fixit shell to resume sysinstall.\n\n"); fflush(stdout); } execlp("sh", "-sh", 0); msgDebug("Was unable to execute sh for Holographic shell!\n"); exit(1); } else { if (strcmp(variable_get(VAR_FIXIT_TTY), "standard") == 0) { WINDOW *w = savescr(); msgNotify("Starting an emergency holographic shell on VTY4"); sleep(2); restorescr(w); } else { (void)waitpid(ehs_pid, &waitstatus, 0); /* we only wait for shell to finish it serial mode since there is no virtual console */ systemResumeDialog(); } } } } diff --git a/usr.sbin/sade/variable.c b/usr.sbin/sade/variable.c index e1328629d8a1..e86104fd100a 100644 --- a/usr.sbin/sade/variable.c +++ b/usr.sbin/sade/variable.c @@ -1,326 +1,326 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * * $FreeBSD$ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. * Copyright (c) 2001 * Murray Stokely. 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" /* Routines for dealing with variable lists */ static void make_variable(char *var, char *value, int dirty) { Variable *vp; /* Trim leading and trailing whitespace */ var = string_skipwhite(string_prune(var)); if (!var || !*var) return; /* Now search to see if it's already in the list */ for (vp = VarHead; vp; vp = vp->next) { if (!strcmp(vp->name, var)) { if (vp->dirty && !dirty) return; setenv(var, value, 1); free(vp->value); vp->value = strdup(value); if (dirty != -1) vp->dirty = dirty; return; } } setenv(var, value, 1); /* No? Create a new one */ vp = (Variable *)safe_malloc(sizeof(Variable)); vp->name = strdup(var); vp->value = strdup(value); if (dirty == -1) dirty = 0; vp->dirty = dirty; vp->next = VarHead; VarHead = vp; } void variable_set(char *var, int dirty) { char tmp[1024], *cp; if (!var) msgFatal("NULL variable name & value passed."); else if (!*var) msgDebug("Warning: Zero length name & value passed to variable_set()\n"); SAFE_STRCPY(tmp, var); if ((cp = index(tmp, '=')) == NULL) msgFatal("Invalid variable format: %s", var); *(cp++) = '\0'; make_variable(tmp, string_skipwhite(cp), dirty); } void variable_set2(char *var, char *value, int dirty) { if (!var || !value) msgFatal("Null name or value passed to set_variable2(%s) = %s!", var ? var : "", value ? value : ""); else if (!*var || !*value) msgDebug("Warning: Zero length name or value passed to variable_set2(%s) = %s\n", var, value); make_variable(var, value, dirty); } char * variable_get(char *var) { return getenv(var); } int variable_cmp(char *var, char *value) { char *val; if ((val = variable_get(var))) return strcmp(val, value); return -1; } void variable_unset(char *var) { Variable *vp; char name[512], *cp; if ((cp = index(var, '=')) != NULL) sstrncpy(name, var, cp - var); else SAFE_STRCPY(name, var); unsetenv(name); /* Now search to see if it's in our list, if we have one.. */ if (!VarHead) return; else if (!VarHead->next && !strcmp(VarHead->name, name)) { safe_free(VarHead->name); safe_free(VarHead->value); free(VarHead); VarHead = NULL; } else { for (vp = VarHead; vp; vp = vp->next) { if (!strcmp(vp->name, name)) { Variable *save = vp->next; safe_free(vp->name); safe_free(vp->value); *vp = *save; safe_free(save); break; } } } } /* Prompt user for the name of a variable */ char * variable_get_value(char *var, char *prompt, int dirty) { char *cp; cp = variable_get(var); if (cp && variable_get(VAR_NONINTERACTIVE)) return cp; else if ((cp = msgGetInput(cp, "%s", prompt)) != NULL) variable_set2(var, cp, dirty); else cp = NULL; return cp; } /* Check if value passed in data (in the form "variable=value") is * valid, and it's status compared to the value of variable stored in * env * * Possible return values : * -3: Invalid line, the data string is NOT set as an env variable * -2: Invalid line, the data string is set as an env variable * -1: Invalid line * 0: Valid line, is NOT equal to env version * 1: Valid line, is equal to env version * 2: Valid line, value empty - e.g. foo="" * 3: Valid line, does not exist in env */ int variable_check2(char *data) { char *cp, *cp2, *cp3, tmp[256]; if (data == NULL) return -1; SAFE_STRCPY(tmp, data); if ((cp = index(tmp, '=')) != NULL) { *(cp++) = '\0'; if (*cp == '"') { /* smash quotes if present */ ++cp; if ((cp3 = index(cp, '"')) != NULL) *cp3 = '\0'; } else if ((cp3 = index(cp, ',')) != NULL) *cp3 = '\0'; cp2 = variable_get(tmp); if (cp2 != NULL) { - if (*cp == NULL) + if (*cp == '\0') return 2; else return strcmp(cp, cp2) == 0 ? 1 : 0; } else return 3; } else return variable_get(tmp) != NULL ? -2 : -3; } /* Check if the value passed in data (in the form "variable=value") is equal to the value of variable stored in env */ int variable_check(char *data) { int ret; ret = variable_check2(data); switch(ret) { case -2: case 1: case 2: return TRUE; /* NOT REACHED */ default: return FALSE; } } int dump_variables(dialogMenuItem *unused) { FILE *fp; Variable *vp; if (isDebug()) msgDebug("Writing sysinstall variables to file..\n"); fp = fopen("/etc/sysinstall.vars", "w"); if (!fp) { msgConfirm("Unable to write to /etc/sysinstall.vars: %s", strerror(errno)); return DITEM_FAILURE; } for (vp = VarHead; vp; vp = vp->next) fprintf(fp, "%s=\"%s\" (%d)\n", vp->name, vp->value, vp->dirty); fclose(fp); return DITEM_SUCCESS; } /* Free all of the variables, useful to really start over as when the user selects "restart" from the interrupt menu. */ void free_variables(void) { Variable *vp; /* Free the variables from our list, if we have one.. */ if (!VarHead) return; else if (!VarHead->next) { unsetenv(VarHead->name); safe_free(VarHead->name); safe_free(VarHead->value); free(VarHead); VarHead = NULL; } else { for (vp = VarHead; vp; ) { Variable *save = vp; unsetenv(vp->name); safe_free(vp->name); safe_free(vp->value); vp = vp->next; safe_free(save); } VarHead = NULL; } } /* * Persistent variables. The variables modified by these functions * are not cleared between invocations of sysinstall. This is useful * to allow the user to completely restart sysinstall, without having * it load all of the modules again from the installation media which * are still in memory. */ void pvariable_set(char *var) { char tmp[1024]; if (!var) msgFatal("NULL variable name & value passed."); else if (!*var) msgDebug("Warning: Zero length name & value passed to variable_set()\n"); /* Add a trivial namespace to whatever name the caller chooses. */ SAFE_STRCPY(tmp, "SYSINSTALL_PVAR"); if (index(var, '=') == NULL) msgFatal("Invalid variable format: %s", var); strlcat(tmp, var, 1024); putenv(tmp); } char * pvariable_get(char *var) { char tmp[1024]; SAFE_STRCPY(tmp, "SYSINSTALL_PVAR"); strlcat(tmp, var, 1024); return getenv(tmp); } diff --git a/usr.sbin/sysinstall/anonFTP.c b/usr.sbin/sysinstall/anonFTP.c index f79974b56b9c..7d130f14e95d 100644 --- a/usr.sbin/sysinstall/anonFTP.c +++ b/usr.sbin/sysinstall/anonFTP.c @@ -1,327 +1,327 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * * $FreeBSD$ * * Copyright (c) 1995 * Coranth Gryphon. All rights reserved. * Copyright (c) 1996 * Jordan K. 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 THE AUTHORS ``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 THE AUTHORS OR THEIR 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 /* This doesn't change until FTP itself changes */ #define FTP_NAME "ftp" #define MOTD_FILE "ftpmotd" /* These change if we want to use different defaults */ #define FTP_UID 14 #define FTP_GID 5 #define FTP_GROUP "operator" #define FTP_UPLOAD "incoming" #define FTP_COMMENT "Anonymous FTP Admin" #define FTP_HOMEDIR "/var/ftp" #define ANONFTP_HELPFILE "anonftp" /* Set up the structure to hold configuration information */ /* Note that this is only what we could fit onto the one screen */ typedef struct { char homedir[64]; /* Home Dir for Anon FTP */ char group[32]; /* Group */ char uid[8]; /* UID */ char comment[64]; /* PWD Comment */ char upload[32]; /* Upload Dir */ } FTPConf; static FTPConf tconf; #define ANONFTP_HOMEDIR_LEN 64 #define ANONFTP_COMMENT_LEN 64 #define ANONFTP_UPLOAD_LEN 32 #define ANONFTP_GROUP_LEN 32 #define ANONFTP_UID_LEN 8 static int okbutton, cancelbutton; /* What the screen size is meant to be */ #define ANONFTP_DIALOG_Y 0 #define ANONFTP_DIALOG_X 8 #define ANONFTP_DIALOG_WIDTH COLS - 16 #define ANONFTP_DIALOG_HEIGHT LINES - 2 static Layout layout[] = { #define LAYOUT_UID 0 { 2, 3, 8, ANONFTP_UID_LEN - 1, "UID:", "What user ID to assign to FTP Admin", tconf.uid, STRINGOBJ, NULL }, #define LAYOUT_GROUP 1 { 2, 15, 15, ANONFTP_GROUP_LEN - 1, "Group:", "Group name that ftp process belongs to", tconf.group, STRINGOBJ, NULL }, #define LAYOUT_COMMENT 2 { 2, 35, 24, ANONFTP_COMMENT_LEN - 1, "Comment:", "Password file comment for FTP Admin", tconf.comment, STRINGOBJ, NULL }, #define LAYOUT_HOMEDIR 3 { 9, 10, 43, ANONFTP_HOMEDIR_LEN - 1, "FTP Root Directory:", "The top directory to chroot to when doing anonymous ftp", tconf.homedir, STRINGOBJ, NULL }, #define LAYOUT_UPLOAD 4 { 14, 20, 22, ANONFTP_UPLOAD_LEN - 1, "Upload Subdirectory:", "Designated sub-directory that holds uploads", tconf.upload, STRINGOBJ, NULL }, #define LAYOUT_OKBUTTON 5 { 19, 15, 0, 0, "OK", "Select this if you are happy with these settings", &okbutton, BUTTONOBJ, NULL }, #define LAYOUT_CANCELBUTTON 6 { 19, 35, 0, 0, "CANCEL", "Select this if you wish to cancel this screen", &cancelbutton, BUTTONOBJ, NULL }, - { NULL }, + { 0 }, }; static int createFtpUser(void) { struct passwd *tpw; struct group *tgrp; char pwline[256]; char *tptr; int gid; FILE *fptr; if ((gid = atoi(tconf.group)) <= 0) { if (!(tgrp = getgrnam(tconf.group))) { /* group does not exist, create it by name */ tptr = msgGetInput("14", "What group ID to use for group %s ?", tconf.group); if (tptr && *tptr && ((gid = atoi(tptr)) > 0)) { if ((fptr = fopen(_PATH_GROUP,"a"))) { fprintf(fptr,"%s:*:%d:%s\n",tconf.group,gid,FTP_NAME); fclose(fptr); } } else gid = FTP_GID; } else gid = tgrp->gr_gid; } else if (!getgrgid(gid)) { /* group does not exist, create it by number */ tptr = msgGetInput("14", "What group name to use for gid %d ?", gid); if (tptr && *tptr) { SAFE_STRCPY(tconf.group, tptr); if ((tgrp = getgrnam(tconf.group))) { gid = tgrp->gr_gid; } else if ((fptr = fopen(_PATH_GROUP,"a"))) { fprintf(fptr,"%s:*:%d:%s\n",tconf.group,gid,FTP_NAME); fclose(fptr); } } } if ((tpw = getpwnam(FTP_NAME))) { if (tpw->pw_uid != FTP_UID) msgConfirm("FTP user already exists with a different uid."); return DITEM_SUCCESS; /* succeeds if already exists */ } sprintf(pwline, "%s:*:%s:%d::0:0:%s:%s:/nonexistent\n", FTP_NAME, tconf.uid, gid, tconf.comment, tconf.homedir); fptr = fopen(_PATH_MASTERPASSWD,"a"); if (! fptr) { msgConfirm("Could not open master password file."); return DITEM_FAILURE; } fprintf(fptr, "%s", pwline); fclose(fptr); msgNotify("Remaking password file: %s", _PATH_MASTERPASSWD); vsystem("pwd_mkdb -p %s", _PATH_MASTERPASSWD); return DITEM_SUCCESS | DITEM_RESTORE; } /* This is it - how to get the setup values */ static int anonftpOpenDialog(void) { WINDOW *ds_win; ComposeObj *obj = NULL; int n = 0, cancel = FALSE; int max; char title[80]; WINDOW *w = savescr(); /* We need a curses window */ if (!(ds_win = openLayoutDialog(ANONFTP_HELPFILE, " Anonymous FTP Configuration ", ANONFTP_DIALOG_X, ANONFTP_DIALOG_Y, ANONFTP_DIALOG_WIDTH, ANONFTP_DIALOG_HEIGHT))) { beep(); msgConfirm("Cannot open anonymous ftp dialog window!!"); restorescr(w); return DITEM_FAILURE; } /* Draw a sub-box for the path configuration */ draw_box(ds_win, ANONFTP_DIALOG_Y + 7, ANONFTP_DIALOG_X + 8, ANONFTP_DIALOG_HEIGHT - 11, ANONFTP_DIALOG_WIDTH - 17, dialog_attr, border_attr); wattrset(ds_win, dialog_attr); sprintf(title, " Path Configuration "); mvwaddstr(ds_win, ANONFTP_DIALOG_Y + 7, ANONFTP_DIALOG_X + 22, title); /** Initialize the config Data Structure **/ bzero(&tconf, sizeof(tconf)); SAFE_STRCPY(tconf.group, FTP_GROUP); SAFE_STRCPY(tconf.upload, FTP_UPLOAD); SAFE_STRCPY(tconf.comment, FTP_COMMENT); SAFE_STRCPY(tconf.homedir, FTP_HOMEDIR); sprintf(tconf.uid, "%d", FTP_UID); /* Some more initialisation before we go into the main input loop */ obj = initLayoutDialog(ds_win, layout, ANONFTP_DIALOG_X, ANONFTP_DIALOG_Y, &max); cancelbutton = okbutton = 0; while (layoutDialogLoop(ds_win, layout, &obj, &n, max, &cancelbutton, &cancel)); /* Clear this crap off the screen */ delwin(ds_win); use_helpfile(NULL); restorescr(w); if (cancel) return DITEM_FAILURE; return DITEM_SUCCESS; } int configAnonFTP(dialogMenuItem *self __unused) { int i; if (msgYesNo("Anonymous FTP permits un-authenticated users to connect to the system\n" "FTP server, if FTP service is enabled. Anonymous users are\n" "restricted to a specific subset of the file system, and the default\n" "configuration provides a drop-box incoming directory to which uploads\n" "are permitted. You must separately enable both inetd(8), and enable\n" "ftpd(8) in inetd.conf(5) for FTP services to be available. If you\n" "did not do so earlier, you will have the opportunity to enable inetd(8)\n" "again later.\n\n" "Do you wish to continue configuring anonymous FTP?")) { return DITEM_FAILURE; } /* Be optimistic */ i = DITEM_SUCCESS; i = anonftpOpenDialog(); if (DITEM_STATUS(i) != DITEM_SUCCESS) { msgConfirm("Configuration of Anonymous FTP cancelled per user request."); return i; } /*** Use defaults for any invalid values ***/ if (atoi(tconf.uid) <= 0) sprintf(tconf.uid, "%d", FTP_UID); if (!tconf.group[0]) SAFE_STRCPY(tconf.group, FTP_GROUP); if (!tconf.upload[0]) SAFE_STRCPY(tconf.upload, FTP_UPLOAD); /*** If the user did not specify a directory, use default ***/ if (tconf.homedir[strlen(tconf.homedir) - 1] == '/') tconf.homedir[strlen(tconf.homedir) - 1] = '\0'; if (!tconf.homedir[0]) SAFE_STRCPY(tconf.homedir, FTP_HOMEDIR); /*** If HomeDir does not exist, create it ***/ if (!directory_exists(tconf.homedir)) vsystem("mkdir -p %s", tconf.homedir); if (directory_exists(tconf.homedir)) { msgNotify("Configuring %s for use by anon FTP.", tconf.homedir); vsystem("chmod 555 %s && chown root.%s %s", tconf.homedir, tconf.group, tconf.homedir); vsystem("mkdir %s/bin && chmod 555 %s/bin", tconf.homedir, tconf.homedir); vsystem("cp /bin/ls %s/bin && chmod 111 %s/bin/ls", tconf.homedir, tconf.homedir); vsystem("cp /bin/date %s/bin && chmod 111 %s/bin/date", tconf.homedir, tconf.homedir); vsystem("mkdir %s/etc && chmod 555 %s/etc", tconf.homedir, tconf.homedir); vsystem("mkdir -p %s/pub", tconf.homedir); vsystem("mkdir -p %s/%s", tconf.homedir, tconf.upload); vsystem("chmod 1777 %s/%s", tconf.homedir, tconf.upload); if (DITEM_STATUS(createFtpUser()) == DITEM_SUCCESS) { msgNotify("Copying password information for anon FTP."); vsystem("awk -F: '{if ($3 < 10 || $1 == \"ftp\") print $0}' /etc/passwd > %s/etc/passwd && chmod 444 %s/etc/passwd", tconf.homedir, tconf.homedir); vsystem("awk -F: '{if ($3 < 100) print $0}' /etc/group > %s/etc/group && chmod 444 %s/etc/group", tconf.homedir, tconf.homedir); vsystem("chown -R root.%s %s/pub", tconf.group, tconf.homedir); } else { msgConfirm("Unable to create FTP user! Anonymous FTP setup failed."); i = DITEM_FAILURE; } if (!msgYesNo("Create a welcome message file for anonymous FTP users?")) { char cmd[256]; vsystem("echo Your welcome message here. > %s/etc/%s", tconf.homedir, MOTD_FILE); sprintf(cmd, "%s %s/etc/%s", variable_get(VAR_EDITOR), tconf.homedir, MOTD_FILE); if (!systemExecute(cmd)) i = DITEM_SUCCESS; else i = DITEM_FAILURE; } } else { msgConfirm("Invalid Directory: %s\n" "Anonymous FTP will not be set up.", tconf.homedir); i = DITEM_FAILURE; } if (DITEM_STATUS(i) == DITEM_SUCCESS) variable_set2("anon_ftp", "YES", 0); return i | DITEM_RESTORE; } diff --git a/usr.sbin/sysinstall/dhcp.c b/usr.sbin/sysinstall/dhcp.c index a74a72bd4ba6..fa35580e1235 100644 --- a/usr.sbin/sysinstall/dhcp.c +++ b/usr.sbin/sysinstall/dhcp.c @@ -1,158 +1,158 @@ /* * $FreeBSD$ * * Copyright (c) 1999 * C. Stone. 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 C. STONE ``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 C STONE OR HIS BODILY PARASITES 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 BY THE VOICES IN YOUR HEAD BEFOREHAND. * */ #include "sysinstall.h" #include int dhcpParseLeases(char *file, char *hostname, char *domain, char *nameserver, char *ipaddr, char *gateway, char *netmask) { char tempbuf[1024]; char optbuf[1024], *optname = NULL; char *tptr; int endedflag = 0; int leaseflag = 0; FILE *fp; enum { P_NOSTMT, P_NOSTMT1, P_STMT, P_STMTLINE } state; if ((fp = fopen(file, "r")) == NULL) { msgDebug("error opening file %s: %s\n", file, strerror(errno)); return -1; } state = P_NOSTMT; while (fscanf(fp, "%1023s", tempbuf) > 0) { switch (state) { case P_NOSTMT: state = P_NOSTMT1; if (!strncasecmp(tempbuf, "lease", 5)) { if (!leaseflag) leaseflag = 1; else { fclose(fp); return 0; } } break; case P_NOSTMT1: if (tempbuf[0] != '{') { msgWarn("dhcpParseLeases: '{' expected"); fclose(fp); return -1; } state = P_STMT; break; case P_STMT: if (!strncasecmp("option", tempbuf, 6)) continue; if (tempbuf[0] == '}') { state = P_NOSTMT; leaseflag = 0; continue; } if (!leaseflag) break; if (tempbuf[0] == ';') { /* play it safe */ state = P_STMT; continue; } if ((tptr = (char *)strchr(tempbuf, ';')) && (*(tptr + 1) == 0)) { - *tptr = NULL; + *tptr = '\0'; endedflag = 1; } if (!isalnum(tempbuf[0])) { msgWarn("dhcpParseLeases: bad option"); fclose(fp); return -1; } if (optname) free(optname); optname = strdup(tempbuf); if (endedflag) { state = P_STMT; endedflag = 0; continue; } state = P_STMTLINE; break; case P_STMTLINE: if (tempbuf[0] == ';') { state = P_STMT; continue; } if ((tptr = (char *)strchr(tempbuf, ';')) && (*(tptr + 1) == 0)) { - *tptr = NULL; + *tptr = '\0'; endedflag = 1; } if (tempbuf[0] == '"') { if (sscanf(tempbuf, "\"%[^\" ]\"", optbuf) < 1) { msgWarn("dhcpParseLeases: bad option value"); fclose(fp); return -1; } } else strcpy(optbuf, tempbuf); if (!strcasecmp("host-name", optname)) { strcpy(hostname, optbuf); } else if (!strcasecmp("domain-name", optname)) { strcpy(domain, optbuf); } else if (!strcasecmp("fixed-address", optname)) { strcpy(ipaddr, optbuf); } else if (!strcasecmp("routers", optname)) { if((tptr = (char *)strchr(optbuf, ','))) - *tptr = NULL; + *tptr = '\0'; strcpy(gateway, optbuf); } else if (!strcasecmp("subnet-mask", optname)) { strcpy(netmask, optbuf); } else if (!strcasecmp("domain-name-servers", optname)) { /* ...one value per property */ if((tptr = (char *)strchr(optbuf, ','))) - *tptr = NULL; + *tptr = '\0'; strcpy(nameserver, optbuf); } if (endedflag) { state = P_STMT; endedflag = 0; continue; } break; } } fclose(fp); return 0; } diff --git a/usr.sbin/sysinstall/menus.c b/usr.sbin/sysinstall/menus.c index b56a8e2ea24f..71bc616c6035 100644 --- a/usr.sbin/sysinstall/menus.c +++ b/usr.sbin/sysinstall/menus.c @@ -1,2284 +1,2284 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer, * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * */ #ifndef lint static const char rcsid[] = "$FreeBSD$"; #endif #include "sysinstall.h" /* Miscellaneous work routines for menus */ static int setSrc(dialogMenuItem *self) { Dists |= DIST_SRC; SrcDists = DIST_SRC_ALL; CRYPTODists |= (DIST_CRYPTO_SCRYPTO | DIST_CRYPTO_SSECURE | DIST_CRYPTO_SKERBEROS5); return DITEM_SUCCESS | DITEM_REDRAW; } static int clearSrc(dialogMenuItem *self) { Dists &= ~DIST_SRC; SrcDists = 0; CRYPTODists &= ~(DIST_CRYPTO_SCRYPTO | DIST_CRYPTO_SSECURE | DIST_CRYPTO_SKERBEROS5); return DITEM_SUCCESS | DITEM_REDRAW; } static int setX11Misc(dialogMenuItem *self) { XF86Dists |= DIST_XF86_MISC_ALL; Dists |= DIST_XF86; return DITEM_SUCCESS | DITEM_REDRAW; } static int clearX11Misc(dialogMenuItem *self) { XF86Dists &= ~DIST_XF86_MISC_ALL; if (!XF86ServerDists && !XF86FontDists) Dists &= ~DIST_XF86; return DITEM_SUCCESS | DITEM_REDRAW; } static int setX11Servers(dialogMenuItem *self) { XF86Dists |= DIST_XF86_SERVER; XF86ServerDists = DIST_XF86_SERVER_ALL; return DITEM_SUCCESS | DITEM_REDRAW; } static int clearX11Servers(dialogMenuItem *self) { XF86Dists &= ~DIST_XF86_SERVER; XF86ServerDists = 0; return DITEM_SUCCESS | DITEM_REDRAW; } static int setX11Fonts(dialogMenuItem *self) { XF86Dists |= DIST_XF86_FONTS; XF86FontDists = DIST_XF86_FONTS_ALL; return DITEM_SUCCESS | DITEM_REDRAW; } static int clearX11Fonts(dialogMenuItem *self) { XF86Dists &= ~DIST_XF86_FONTS; XF86FontDists = 0; return DITEM_SUCCESS | DITEM_REDRAW; } #define _IS_SET(dist, set) (((dist) & (set)) == (set)) #define IS_DEVELOPER(dist, extra) (_IS_SET(dist, _DIST_DEVELOPER | extra) || \ _IS_SET(dist, _DIST_DEVELOPER | extra)) #define IS_USER(dist, extra) (_IS_SET(dist, _DIST_USER | extra) || \ _IS_SET(dist, _DIST_USER | extra)) static int checkDistDeveloper(dialogMenuItem *self) { return IS_DEVELOPER(Dists, 0) && _IS_SET(SrcDists, DIST_SRC_ALL); } static int checkDistXDeveloper(dialogMenuItem *self) { return IS_DEVELOPER(Dists, DIST_XF86) && _IS_SET(SrcDists, DIST_SRC_ALL); } static int checkDistKernDeveloper(dialogMenuItem *self) { return IS_DEVELOPER(Dists, 0) && _IS_SET(SrcDists, DIST_SRC_SYS); } static int checkDistXKernDeveloper(dialogMenuItem *self) { return IS_DEVELOPER(Dists, DIST_XF86) && _IS_SET(SrcDists, DIST_SRC_SYS); } static int checkDistUser(dialogMenuItem *self) { return IS_USER(Dists, 0); } static int checkDistXUser(dialogMenuItem *self) { return IS_USER(Dists, DIST_XF86); } static int checkDistMinimum(dialogMenuItem *self) { return Dists == (DIST_BASE | DIST_CRYPTO); } static int checkDistEverything(dialogMenuItem *self) { return Dists == DIST_ALL && CRYPTODists == DIST_CRYPTO_ALL && _IS_SET(SrcDists, DIST_SRC_ALL) && _IS_SET(XF86Dists, DIST_XF86_ALL) && _IS_SET(XF86ServerDists, DIST_XF86_SERVER_ALL) && _IS_SET(XF86FontDists, DIST_XF86_FONTS_ALL); } static int srcFlagCheck(dialogMenuItem *item) { return SrcDists; } static int x11FlagCheck(dialogMenuItem *item) { return Dists & DIST_XF86; } static int checkTrue(dialogMenuItem *item) { return TRUE; } /* All the system menus go here. * * Hardcoded things like version number strings will disappear from * these menus just as soon as I add the code for doing inline variable * expansion. */ DMenu MenuIndex = { DMENU_NORMAL_TYPE, "Glossary of functions", "This menu contains an alphabetized index of the top level functions in\n" "this program (sysinstall). Invoke an option by pressing [SPACE] or\n" "[ENTER]. To exit, use [TAB] to move to the Cancel button.", "Use PageUp or PageDown to move through this menu faster!", NULL, { { " Anon FTP", "Configure anonymous FTP logins.", dmenuVarCheck, configAnonFTP, NULL, "anon_ftp" }, { " Commit", "Commit any pending actions (dangerous!)", NULL, installCustomCommit }, #ifdef WITH_SYSCONS { " Console settings", "Customize system console behavior.", NULL, dmenuSubmenu, NULL, &MenuSyscons }, #endif { " Configure", "The system configuration menu.", NULL, dmenuSubmenu, NULL, &MenuConfigure }, { " Defaults, Load", "Load default settings.", NULL, dispatch_load_floppy }, #ifdef WITH_MICE { " Device, Mouse", "The mouse configuration menu.", NULL, dmenuSubmenu, NULL, &MenuMouse }, #endif { " Disklabel", "The disk Label editor", NULL, diskLabelEditor }, { " Dists, All", "Root of the distribution tree.", NULL, dmenuSubmenu, NULL, &MenuDistributions }, { " Dists, Basic", "Basic FreeBSD distribution menu.", NULL, dmenuSubmenu, NULL, &MenuSubDistributions }, { " Dists, Developer", "Select developer's distribution.", checkDistDeveloper, distSetDeveloper }, { " Dists, Src", "Src distribution menu.", NULL, dmenuSubmenu, NULL, &MenuSrcDistributions }, { " Dists, X Developer", "Select X developer's distribution.", checkDistXDeveloper, distSetXDeveloper }, { " Dists, Kern Developer", "Select kernel developer's distribution.", checkDistKernDeveloper, distSetKernDeveloper }, { " Dists, User", "Select average user distribution.", checkDistUser, distSetUser }, { " Dists, X User", "Select average X user distribution.", checkDistXUser, distSetXUser }, { " Distributions, Adding", "Installing additional distribution sets", NULL, distExtractAll }, { " Distributions, XFree86","XFree86 distribution menu.", NULL, distSetXF86 }, { " Documentation", "Installation instructions, README, etc.", NULL, dmenuSubmenu, NULL, &MenuDocumentation }, { " Doc, README", "The distribution README file.", NULL, dmenuDisplayFile, NULL, "README" }, { " Doc, Early Adopter's", "Early Adopter's Guide to FreeBSD 5.0.", NULL, dmenuDisplayFile, NULL, "EARLY" }, { " Doc, Errata", "The distribution errata.", NULL, dmenuDisplayFile, NULL, "ERRATA" }, { " Doc, Hardware", "The distribution hardware guide.", NULL, dmenuDisplayFile, NULL, "HARDWARE" }, { " Doc, Install", "The distribution installation guide.", NULL, dmenuDisplayFile, NULL, "INSTALL" }, { " Doc, Copyright", "The distribution copyright notices.", NULL, dmenuDisplayFile, NULL, "COPYRIGHT" }, { " Doc, Release", "The distribution release notes.", NULL, dmenuDisplayFile, NULL, "RELNOTES" }, { " Doc, HTML", "The HTML documentation menu.", NULL, docBrowser }, { " Dump Vars", "(debugging) dump out internal variables.", NULL, dump_variables }, { " Emergency shell", "Start an Emergency Holographic shell.", NULL, installFixitHoloShell }, #ifdef WITH_SLICES { " Fdisk", "The disk Partition Editor", NULL, diskPartitionEditor }, #endif { " Fixit", "Repair mode with CDROM or fixit floppy.", NULL, dmenuSubmenu, NULL, &MenuFixit }, { " FTP sites", "The FTP mirror site listing.", NULL, dmenuSubmenu, NULL, &MenuMediaFTP }, { " Gateway", "Set flag to route packets between interfaces.", dmenuVarCheck, dmenuToggleVariable, NULL, "gateway=YES" }, { " HTML Docs", "The HTML documentation menu", NULL, docBrowser }, { " inetd Configuration", "Configure inetd and simple internet services.", dmenuVarCheck, configInetd, NULL, "inetd_enable=YES" }, { " Install, Standard", "A standard system installation.", NULL, installStandard }, { " Install, Express", "An express system installation.", NULL, installExpress }, { " Install, Custom", "The custom installation menu", NULL, dmenuSubmenu, NULL, &MenuInstallCustom }, { " Label", "The disk Label editor", NULL, diskLabelEditor }, { " Media", "Top level media selection menu.", NULL, dmenuSubmenu, NULL, &MenuMedia }, { " Media, Tape", "Select tape installation media.", NULL, mediaSetTape }, { " Media, NFS", "Select NFS installation media.", NULL, mediaSetNFS }, { " Media, Floppy", "Select floppy installation media.", NULL, mediaSetFloppy }, { " Media, CDROM/DVD", "Select CDROM/DVD installation media.", NULL, mediaSetCDROM }, { " Media, DOS", "Select DOS installation media.", NULL, mediaSetDOS }, { " Media, UFS", "Select UFS installation media.", NULL, mediaSetUFS }, { " Media, FTP", "Select FTP installation media.", NULL, mediaSetFTP }, { " Media, FTP Passive", "Select passive FTP installation media.", NULL, mediaSetFTPPassive }, { " Media, HTTP", "Select FTP via HTTP proxy installation media.", NULL, mediaSetHTTP }, { " Network Interfaces", "Configure network interfaces", NULL, tcpMenuSelect }, { " Networking Services", "The network services menu.", NULL, dmenuSubmenu, NULL, &MenuNetworking }, { " NFS, client", "Set NFS client flag.", dmenuVarCheck, dmenuToggleVariable, NULL, "nfs_client_enable=YES" }, { " NFS, server", "Set NFS server flag.", dmenuVarCheck, configNFSServer, NULL, "nfs_server_enable=YES" }, { " NTP Menu", "The NTP configuration menu.", NULL, dmenuSubmenu, NULL, &MenuNTP }, { " Options", "The options editor.", NULL, optionsEditor }, { " Packages", "The packages collection", NULL, configPackages }, #ifdef WITH_SLICES { " Partition", "The disk Slice (PC-style partition) Editor", NULL, diskPartitionEditor }, #endif { " PCNFSD", "Run authentication server for PC-NFS.", dmenuVarCheck, configPCNFSD, NULL, "pcnfsd" }, { " Root Password", "Set the system manager's password.", NULL, dmenuSystemCommand, NULL, "passwd root" }, { " Router", "Select routing daemon (default: routed)", NULL, configRouter, NULL, "router_enable" }, { " Security", "Configure system security options", NULL, dmenuSubmenu, NULL, &MenuSecurity }, #ifdef WITH_SYSCONS { " Syscons", "The system console configuration menu.", NULL, dmenuSubmenu, NULL, &MenuSyscons }, #ifndef PC98 { " Syscons, Font", "The console screen font.", NULL, dmenuSubmenu, NULL, &MenuSysconsFont }, #endif { " 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 }, #ifndef PC98 { " Syscons, Screenmap", "The console screenmap configuration menu.", NULL, dmenuSubmenu, NULL, &MenuSysconsScrnmap }, { " Syscons, Ttys", "The console terminal type menu.", NULL, dmenuSubmenu, NULL, &MenuSysconsTtys }, #endif #endif /* WITH_SYSCONS */ { " Time Zone", "Set the system's time zone.", NULL, dmenuSystemCommand, NULL, "tzsetup" }, { " TTYs", "Configure system ttys.", NULL, configEtcTtys, NULL, "ttys" }, { " Upgrade", "Upgrade an existing system.", NULL, installUpgrade }, { " Usage", "Quick start - How to use this menu system.", NULL, dmenuDisplayFile, NULL, "usage" }, { " User Management", "Add user and group information.", NULL, dmenuSubmenu, NULL, &MenuUsermgmt }, { " XFree86, Fonts", "XFree86 Font selection menu.", NULL, dmenuSubmenu, NULL, &MenuXF86SelectFonts }, { " XFree86, Server", "XFree86 Server selection menu.", NULL, dmenuSubmenu, NULL, &MenuXF86SelectServer }, { NULL } }, }; /* The initial installation menu */ DMenu MenuInitial = { DMENU_NORMAL_TYPE, "sysinstall Main Menu", /* title */ "Welcome to the FreeBSD installation and configuration tool. Please\n" /* prompt */ "select one of the options below by using the arrow keys or typing the\n" "first character of the option name you're interested in. Invoke an\n" "option with [SPACE] or [ENTER]. To exit, use [TAB] to move to Exit.", "Press F1 for Installation Guide", /* help line */ "INSTALL", /* help file */ { { "Select" }, { "X Exit Install", NULL, NULL, dmenuExit }, { " Usage", "Quick start - How to use this menu system", NULL, dmenuDisplayFile, NULL, "usage" }, { "Standard", "Begin a standard installation (recommended)", NULL, installStandard }, { "Express", "Begin a quick installation (for experts)", NULL, installExpress }, { " Custom", "Begin a custom installation (for experts)", NULL, dmenuSubmenu, NULL, &MenuInstallCustom }, { "Configure", "Do post-install configuration of FreeBSD", NULL, dmenuSubmenu, NULL, &MenuConfigure }, { "Doc", "Installation instructions, README, etc.", NULL, dmenuSubmenu, NULL, &MenuDocumentation }, #ifdef WITH_SYSCONS { "Keymap", "Select keyboard type", NULL, dmenuSubmenu, NULL, &MenuSysconsKeymap }, #endif { "Options", "View/Set various installation options", NULL, optionsEditor }, { "Fixit", "Repair mode with CDROM/DVD/floppy or start shell", NULL, dmenuSubmenu, NULL, &MenuFixit }, { "Upgrade", "Upgrade an existing system", NULL, installUpgrade }, { "Load Config","Load default install configuration", NULL, dispatch_load_floppy }, { "Index", "Glossary of functions", NULL, dmenuSubmenu, NULL, &MenuIndex }, { NULL } }, }; /* The main documentation menu */ DMenu MenuDocumentation = { DMENU_NORMAL_TYPE, "FreeBSD Documentation Menu", "If you are at all unsure about the configuration of your hardware\n" "or are looking to build a system specifically for FreeBSD, read the\n" "Hardware guide! New users should also read the Install document for\n" "a step-by-step tutorial on installing FreeBSD. For general information,\n" "consult the README file.", "Confused? Press F1 for help.", "usage", { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "1 README", "A general description of FreeBSD. Read this!", NULL, dmenuDisplayFile, NULL, "README" }, { "2 Early Adopter's", "Early Adopter's Guide to FreeBSD 5.0.", NULL, dmenuDisplayFile, NULL, "EARLY" }, { "3 Errata", "Late-breaking, post-release news.", NULL, dmenuDisplayFile, NULL, "ERRATA" }, { "4 Hardware", "The FreeBSD survival guide for PC hardware.", NULL, dmenuDisplayFile, NULL, "HARDWARE" }, { "5 Install", "A step-by-step guide to installing FreeBSD.", NULL, dmenuDisplayFile, NULL, "INSTALL" }, { "6 Copyright", "The FreeBSD Copyright notices.", NULL, dmenuDisplayFile, NULL, "COPYRIGHT" }, { "7 Release" ,"The release notes for this version of FreeBSD.", NULL, dmenuDisplayFile, NULL, "RELNOTES" }, { "8 Shortcuts", "Creating shortcuts to sysinstall.", NULL, dmenuDisplayFile, NULL, "shortcuts" }, { "9 HTML Docs", "Go to the HTML documentation menu (post-install).", NULL, docBrowser }, { NULL } }, }; #ifdef WITH_MICE DMenu MenuMouseType = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, #ifdef PC98 "Select a protocol type for your mouse", "If your mouse is attached to the bus mouse port, you should always choose\n" "\"Auto\", regardless of the model and the brand of the mouse. All other\n" "protocol types are for serial mice and should not be used with the bus\n" "mouse. If you have a serial mouse and are not sure about its protocol,\n" "you should also try \"Auto\". It may not work for the serial mouse if the\n" "mouse does not support the PnP standard. But, it won't hurt. Many\n" "2-button serial mice are compatible with \"Microsoft\" or \"MouseMan\".\n" "3-button serial mice may be compatible with \"MouseSystems\" or \"MouseMan\".\n" "If the serial mouse has a wheel, it may be compatible with \"IntelliMouse\".", NULL, NULL, { { "1 Auto", "Bus mouse or PnP serial mouse", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=auto" }, #else "Select a protocol type for your mouse", "If your mouse is attached to the PS/2 mouse port or the bus mouse port,\n" "you should always choose \"Auto\", regardless of the model and the brand\n" "of the mouse. All other protocol types are for serial mice and should\n" "not be used with the PS/2 port mouse or the bus mouse. If you have\n" "a serial mouse and are not sure about its protocol, you should also try\n" "\"Auto\". It may not work for the serial mouse if the mouse does not\n" "support the PnP standard. But, it won't hurt. Many 2-button serial mice\n" "are compatible with \"Microsoft\" or \"MouseMan\". 3-button serial mice\n" "may be compatible with \"MouseSystems\" or \"MouseMan\". If the serial\n" "mouse has a wheel, it may be compatible with \"IntelliMouse\".", NULL, NULL, { { "1 Auto", "Bus mouse, PS/2 style mouse or PnP serial mouse", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=auto" }, #endif /* PC98 */ { "2 GlidePoint", "ALPS GlidePoint pad (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=glidepoint" }, { "3 Hitachi","Hitachi tablet (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=mmhittab" }, { "4 IntelliMouse", "Microsoft IntelliMouse (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=intellimouse" }, { "5 Logitech", "Logitech protocol (old models) (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=logitech" }, { "6 Microsoft", "Microsoft protocol (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=microsoft" }, { "7 MM Series","MM Series protocol (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=mmseries" }, { "8 MouseMan", "Logitech MouseMan/TrackMan models (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=mouseman" }, { "9 MouseSystems", "MouseSystems protocol (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=mousesystems" }, { "A ThinkingMouse","Kensington ThinkingMouse (serial)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_TYPE "=thinkingmouse" }, { NULL } }, }; #ifdef PC98 DMenu MenuMousePort = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Select your mouse port from the following menu", "The built-in pointing device of laptop/notebook computers is usually\n" "a BusMouse style device.", NULL, NULL, { { "1 BusMouse", "PC-98x1 bus mouse (/dev/mse0)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/mse0" }, { "2 COM1", "Serial mouse on COM1 (/dev/cuaa0)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuaa0" }, { "3 COM2", "Serial mouse on COM2 (/dev/cuaa1)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuaa1" }, { NULL } }, }; #else DMenu MenuMousePort = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Select your mouse port from the following menu", "The built-in pointing device of laptop/notebook computers is usually\n" "a PS/2 style device.", NULL, NULL, { { "1 PS/2", "PS/2 style mouse (/dev/psm0)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/psm0" }, { "2 COM1", "Serial mouse on COM1 (/dev/cuaa0)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuaa0" }, { "3 COM2", "Serial mouse on COM2 (/dev/cuaa1)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuaa1" }, { "4 COM3", "Serial mouse on COM3 (/dev/cuaa2)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuaa2" }, { "5 COM4", "Serial mouse on COM4 (/dev/cuaa3)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/cuaa3" }, { "6 BusMouse", "Logitech, ATI or MS bus mouse (/dev/mse0)", dmenuVarCheck, dmenuSetVariable, NULL, VAR_MOUSED_PORT "=/dev/mse0" }, { NULL } }, }; #endif /* PC98 */ DMenu MenuMouse = { DMENU_NORMAL_TYPE, "Please configure your mouse", "You can cut and paste text in the text console by running the mouse\n" "daemon. Specify a port and a protocol type of your mouse and enable\n" "the mouse daemon. If you don't want this feature, select 6 to disable\n" "the daemon.\n" "Once you've enabled the mouse daemon, you can specify \"/dev/sysmouse\"\n" "as your mouse device and \"SysMouse\" or \"MouseSystems\" as mouse\n" "protocol when running the X configuration utility (see Configuration\n" "menu).", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "2 Enable", "Test and run the mouse daemon", NULL, mousedTest, NULL, NULL }, { "3 Type", "Select mouse protocol type", NULL, dmenuSubmenu, NULL, &MenuMouseType }, { "4 Port", "Select mouse port", NULL, dmenuSubmenu, NULL, &MenuMousePort }, { "5 Flags", "Set additional flags", dmenuVarCheck, setMouseFlags, NULL, VAR_MOUSED_FLAGS "=" }, { "6 Disable", "Disable the mouse daemon", NULL, mousedDisable, NULL, NULL }, { NULL } }, }; #endif /* WITH_MICE */ DMenu MenuMediaCDROM = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Choose a CD/DVD type", "FreeBSD can be installed directly from a CD/DVD containing a valid\n" "FreeBSD distribution. If you are seeing this menu it is because\n" "more than one CD/DVD drive was found on your system. Please select one\n" "of the following CD/DVD drives as your installation drive.", "Press F1 to read the installation guide", "INSTALL", { { NULL } }, }; DMenu MenuMediaFloppy = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Choose a Floppy drive", "You have more than one floppy drive. Please choose which drive\n" "you would like to use.", NULL, NULL, { { NULL } }, }; DMenu MenuMediaDOS = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Choose a DOS partition", "FreeBSD can be installed directly from a DOS partition\n" "assuming, of course, that you have copied the relevant\n" "distributions into your DOS partition before starting this\n" "installation. If this is not the case then you should reboot\n" "DOS at this time and copy the distributions you wish to install\n" "into a \"FREEBSD\" subdirectory on one of your DOS partitions.\n" "Otherwise, please select the DOS partition containing the FreeBSD\n" "distribution files.", "Press F1 to read the installation guide", "INSTALL", { { NULL } }, }; DMenu MenuMediaFTP = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Please select a FreeBSD FTP distribution site", "Please select the site closest to you or \"other\" if you'd like to\n" "specify a different choice. Also note that not every site listed here\n" "carries more than the base distribution kits. Only Primary sites are\n" "guaranteed to carry the full range of possible distributions.", "Select a site that's close!", "INSTALL", { { "Main Site", "ftp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.freebsd.org" }, { "URL", "Specify some other ftp site by URL", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=other" }, { "Snapshots Server", "snapshots.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://snapshots.jp.freebsd.org" }, { "IPv6 Ireland", "ftp3.ie.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.ie.freebsd.org" }, { " IPv6 Japan", "ftp2.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.jp.freebsd.org" }, { " IPv6 USA", "ftp4.us.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.us.freebsd.org" }, { "Primary", "ftp1.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp1.freebsd.org" }, { " Primary #2", "ftp2.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.freebsd.org" }, { " Primary #3", "ftp3.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.freebsd.org" }, { " Primary #4", "ftp4.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.freebsd.org" }, { " Primary #5", "ftp5.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.freebsd.org" }, { " Primary #6", "ftp6.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp6.freebsd.org" }, { " Primary #7", "ftp7.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp7.freebsd.org" }, { " Primary #8", "ftp8.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp8.freebsd.org" }, { " Primary #9", "ftp9.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp9.freebsd.org" }, { " Primary #10", "ftp10.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp10.freebsd.org" }, { " Primary #11", "ftp11.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp11.freebsd.org" }, { " Primary #12", "ftp12.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp12.freebsd.org" }, { " Primary #13", "ftp13.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp13.freebsd.org" }, { " Primary #14", "ftp14.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp14.freebsd.org" }, { "Argentina", "ftp.ar.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ar.freebsd.org" }, { "Australia", "ftp.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.au.freebsd.org" }, { " Australia #2","ftp2.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.au.freebsd.org" }, { " Australia #3","ftp3.au.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.au.freebsd.org" }, { "Austria","ftp.at.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.at.freebsd.org" }, { " Austria #2","ftp2.at.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.at.freebsd.org" }, { "Brazil", "ftp.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.br.freebsd.org" }, { " Brazil #2", "ftp2.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.br.freebsd.org" }, { " Brazil #3", "ftp3.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.br.freebsd.org" }, { " Brazil #4", "ftp4.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.br.freebsd.org" }, { " Brazil #5", "ftp5.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.br.freebsd.org" }, { " Brazil #6", "ftp6.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp6.br.freebsd.org" }, { " Brazil #7", "ftp7.br.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp7.br.freebsd.org" }, { "Canada", "ftp.ca.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ca.freebsd.org" }, { "China", "ftp.cn.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.cn.freebsd.org" }, { "Croatia", "ftp.hr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.hr.freebsd.org" }, { "Czech Republic", "ftp.cz.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.cz.freebsd.org" }, { "Denmark", "ftp.dk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.dk.freebsd.org" }, { " Denmark #2", "ftp2.dk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.dk.freebsd.org" }, { "Estonia", "ftp.ee.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ee.freebsd.org" }, { "Finland", "ftp.fi.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.fi.freebsd.org" }, { "France", "ftp.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.fr.freebsd.org" }, { " France #2", "ftp2.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.fr.freebsd.org" }, { " France #3", "ftp3.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.fr.freebsd.org" }, { " France #4", "ftp4.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.fr.freebsd.org" }, { " France #5", "ftp5.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.fr.freebsd.org" }, { " France #6", "ftp6.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp6.fr.freebsd.org" }, { " France #8", "ftp8.fr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp8.fr.freebsd.org" }, { "Germany", "ftp.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.de.freebsd.org" }, { " Germany #2", "ftp2.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.de.freebsd.org" }, { " Germany #3", "ftp3.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.de.freebsd.org" }, { " Germany #4", "ftp4.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.de.freebsd.org" }, { " Germany #5", "ftp5.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.de.freebsd.org" }, { " Germany #6", "ftp6.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp6.de.freebsd.org" }, { " Germany #7", "ftp7.de.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp7.de.freebsd.org" }, { "Greece", "ftp.gr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.gr.freebsd.org" }, { " Greece #2", "ftp2.gr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.gr.freebsd.org" }, { "Hong Kong", "ftp.hk.super.net", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.hk.super.net" }, { "Hungary", "ftp.hu.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.hu.freebsd.org" }, { "Iceland", "ftp.is.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.is.freebsd.org" }, { "Ireland", "ftp.ie.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ie.freebsd.org" }, { " Ireland #2", "ftp2.ie.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.ie.freebsd.org" }, { " Ireland #3", "ftp3.ie.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.ie.freebsd.org" }, { "Italy", "ftp.it.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.it.freebsd.org" }, { "Japan", "ftp.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.jp.freebsd.org" }, { " Japan #2", "ftp2.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.jp.freebsd.org" }, { " Japan #3", "ftp3.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.jp.freebsd.org" }, { " Japan #4", "ftp4.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.jp.freebsd.org" }, { " Japan #5", "ftp5.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.jp.freebsd.org" }, { " Japan #6", "ftp6.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp6.jp.freebsd.org" }, { " Japan #7", "ftp7.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp7.jp.freebsd.org" }, { " Japan #8", "ftp8.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp8.jp.freebsd.org" }, { " Japan #9", "ftp9.jp.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp9.jp.freebsd.org" }, { "Korea", "ftp.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.kr.freebsd.org" }, { " Korea #2", "ftp2.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.kr.freebsd.org" }, { " Korea #3", "ftp3.kr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.kr.freebsd.org" }, { "Lithuania", "ftp.lt.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.lt.freebsd.org" }, { "Netherlands", "ftp.nl.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.nl.freebsd.org" }, { " Netherlands #2", "ftp2.nl.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.nl.freebsd.org" }, { "Norway", "ftp.no.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.no.freebsd.org" }, { " Norway #3", "ftp3.no.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.no.freebsd.org" }, { "Poland", "ftp.pl.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.pl.freebsd.org" }, { " Poland #2", "ftp2.pl.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.pl.freebsd.org" }, { "Portugal", "ftp.pt.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.pt.freebsd.org" }, { " Portugal #2", "ftp2.pt.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.pt.freebsd.org" }, { " Portugal #4", "ftp4.pt.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.pt.freebsd.org" }, { "Romania", "ftp.ro.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ro.freebsd.org" }, { "Russia", "ftp.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ru.freebsd.org" }, { " Russia #2", "ftp2.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.ru.freebsd.org" }, { " Russia #5", "ftp5.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.ru.freebsd.org" }, { " Russia #7", "ftp7.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp7.ru.freebsd.org" }, { " Russia #8", "ftp8.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp8.ru.freebsd.org" }, { " Russia #9", "ftp9.ru.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp9.ru.freebsd.org" }, { "Singapore", "ftp.sg.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.sg.freebsd.org" }, { "Slovak Republic", "ftp.sk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.sk.freebsd.org" }, { "Slovenia", "ftp.si.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.si.freebsd.org" }, { " Slovenia #2", "ftp2.si.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.si.freebsd.org" }, { "South Africa", "ftp.za.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.za.freebsd.org" }, { " South Africa #2", "ftp2.za.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.za.freebsd.org" }, { " South Africa #3", "ftp3.za.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.za.freebsd.org" }, { " South Africa #4", "ftp4.za.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.za.freebsd.org" }, { "Spain", "ftp.es.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.es.freebsd.org" }, { " Spain #2", "ftp2.es.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.es.freebsd.org" }, { " Spain #3", "ftp3.es.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.es.freebsd.org" }, { "Sweden", "ftp.se.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.se.freebsd.org" }, { " Sweden #2", "ftp2.se.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.se.freebsd.org" }, { " Sweden #3", "ftp3.se.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.se.freebsd.org" }, { " Sweden #5", "ftp5.se.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.se.freebsd.org" }, { "Switzerland", "ftp.ch.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ch.freebsd.org" }, { " Switzerland #2", "ftp2.ch.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.ch.freebsd.org" }, { "Taiwan", "ftp.tw.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.tw.freebsd.org" }, { " Taiwan #2", "ftp2.tw.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.tw.freebsd.org" }, { " Taiwan #3", "ftp3.tw.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.tw.freebsd.org" }, { " Taiwan #4", "ftp4.tw.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.tw.freebsd.org" }, { " Taiwan #6", "ftp6.tw.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp6.tw.freebsd.org" }, { " Taiwan #11", "ftp11.tw.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp11.tw.freebsd.org" }, { "Turkey", "ftp.tr.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.tr.freebsd.org" }, { "UK", "ftp.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.uk.freebsd.org" }, { " UK #2", "ftp2.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.uk.freebsd.org" }, { " UK #3", "ftp3.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.uk.freebsd.org" }, { " UK #4", "ftp4.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.uk.freebsd.org" }, { " UK #5", "ftp5.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.uk.freebsd.org" }, { " UK #6", "ftp6.uk.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp6.uk.freebsd.org" }, { "Ukraine", "ftp.ua.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp.ua.freebsd.org" }, { " Ukraine #2", "ftp2.ua.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.ua.freebsd.org" }, { " Ukraine #5", "ftp5.ua.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.ua.freebsd.org" }, { " Ukraine #6", "ftp6.ua.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp6.ua.freebsd.org" }, { " Ukraine #7", "ftp7.ua.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp7.ua.freebsd.org" }, { " Ukraine #8", "ftp8.ua.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp8.ua.freebsd.org" }, { "USA #1", "ftp1.us.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp1.us.freebsd.org" }, { " USA #2", "ftp2.us.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp2.us.freebsd.org" }, { " USA #3", "ftp3.us.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp3.us.freebsd.org" }, { " USA #4", "ftp4.us.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp4.us.freebsd.org" }, { " USA #5", "ftp5.us.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp5.us.freebsd.org" }, { " USA #6", "ftp6.us.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp6.us.freebsd.org" }, { " USA #7", "ftp7.us.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp7.us.freebsd.org" }, { " USA #8", "ftp8.us.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp8.us.freebsd.org" }, { " USA #9", "ftp9.us.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp9.us.freebsd.org" }, { " USA #10", "ftp10.us.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp10.us.freebsd.org" }, { " USA #11", "ftp11.us.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp11.us.freebsd.org" }, { " USA #12", "ftp12.us.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp12.us.freebsd.org" }, { " USA #13", "ftp13.us.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp13.us.freebsd.org" }, { " USA #14", "ftp14.us.freebsd.org", NULL, dmenuSetVariable, NULL, VAR_FTP_PATH "=ftp://ftp14.us.freebsd.org" }, { NULL } } }; DMenu MenuMediaTape = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Choose a tape drive type", "FreeBSD can be installed from tape drive, though this installation\n" "method requires a certain amount of temporary storage in addition\n" "to the space required by the distribution itself (tape drives make\n" "poor random-access devices, so we extract _everything_ on the tape\n" "in one pass). If you have sufficient space for this, then you should\n" "select one of the following tape devices detected on your system.", "Press F1 to read the installation guide", "INSTALL", { { NULL } }, }; DMenu MenuNetworkDevice = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Network interface information required", "If you are using PPP over a serial device, as opposed to a direct\n" "ethernet connection, then you may first need to dial your Internet\n" "Service Provider using the ppp utility we provide for that purpose.\n" "If you're using SLIP over a serial device then the expectation is\n" "that you have a HARDWIRED connection.\n\n" "You can also install over a parallel port using a special \"laplink\"\n" "cable to another machine running FreeBSD.", "Press F1 to read network configuration manual", "network_device", { { NULL } }, }; /* Prototype KLD load menu */ DMenu MenuKLD = { DMENU_NORMAL_TYPE, "KLD Menu", "Load a KLD from a floppy\n", NULL, NULL, { { NULL } }, }; /* The media selection menu */ DMenu MenuMedia = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Choose Installation Media", "FreeBSD can be installed from a variety of different installation\n" "media, ranging from floppies to an Internet FTP server. If you're\n" "installing FreeBSD from a supported CD/DVD drive then this is generally\n" "the best media to use if you have no overriding reason for using other\n" "media.", "Press F1 for more information on the various media types", "media", { { "1 CD/DVD", "Install from a FreeBSD CD/DVD", NULL, mediaSetCDROM }, { "2 FTP", "Install from an FTP server", NULL, mediaSetFTPActive }, { "3 FTP Passive", "Install from an FTP server through a firewall", NULL, mediaSetFTPPassive }, { "4 HTTP", "Install from an FTP server through a http proxy", NULL, mediaSetHTTP }, { "5 DOS", "Install from a DOS partition", NULL, mediaSetDOS }, { "6 NFS", "Install over NFS", NULL, mediaSetNFS }, { "7 File System", "Install from an existing filesystem", NULL, mediaSetUFS }, { "8 Floppy", "Install from a floppy disk set", NULL, mediaSetFloppy }, { "9 Tape", "Install from SCSI or QIC tape", NULL, mediaSetTape }, { "X Options", "Go to the Options screen", NULL, optionsEditor }, { NULL } }, }; /* The distributions menu */ DMenu MenuDistributions = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "Choose Distributions", "As a convenience, we provide several \"canned\" distribution sets.\n" "These select what we consider to be the most reasonable defaults for the\n" "type of system in question. If you would prefer to pick and choose the\n" "list of distributions yourself, simply select \"Custom\". You can also\n" "pick a canned distribution set and then fine-tune it with the Custom item.\n\n" "Choose an item by pressing [SPACE] or [ENTER]. When finished, choose the\n" "Exit item or move to the OK button with [TAB].", "Press F1 for more information on these options.", "distributions", { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { "All", "All system sources, binaries and X Window System", checkDistEverything, distSetEverything, NULL, NULL, ' ', ' ', ' ' }, { "Reset", "Reset selected distribution list to nothing", NULL, distReset, NULL, NULL, ' ', ' ', ' ' }, { "4 Developer", "Full sources, binaries and doc but no games", checkDistDeveloper, distSetDeveloper }, { "5 X-Developer", "Same as above + X Window System", checkDistXDeveloper, distSetXDeveloper }, { "6 Kern-Developer", "Full binaries and doc, kernel sources only", checkDistKernDeveloper, distSetKernDeveloper }, { "7 X-Kern-Developer", "Same as above + X Window System", checkDistXKernDeveloper, distSetXKernDeveloper }, { "8 User", "Average user - binaries and doc only", checkDistUser, distSetUser }, { "9 X-User", "Same as above + X Window System", checkDistXUser, distSetXUser }, { "A Minimal", "The smallest configuration possible", checkDistMinimum, distSetMinimum }, { "B Custom", "Specify your own distribution set", NULL, dmenuSubmenu, NULL, &MenuSubDistributions, '>', '>', '>' }, { NULL } }, }; DMenu MenuSubDistributions = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "Select the distributions you wish to install.", "Please check off the distributions you wish to install. At the\n" "very minimum, this should be \"base\".", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { "All", "All system sources, binaries and X Window System", NULL, distSetEverything, NULL, NULL, ' ', ' ', ' ' }, { "Reset", "Reset all of the below", NULL, distReset, NULL, NULL, ' ', ' ', ' ' }, { " base", "Binary base distribution (required)", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_BASE }, #ifdef __i386__ { " compat1x", "FreeBSD 1.x binary compatibility", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_COMPAT1X }, { " compat20", "FreeBSD 2.0 binary compatibility", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_COMPAT20 }, { " compat21", "FreeBSD 2.1 binary compatibility", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_COMPAT21 }, { " compat22", "FreeBSD 2.2.x and 3.0 a.out binary compatibility", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_COMPAT22 }, { " compat3x", "FreeBSD 3.x binary compatibility", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_COMPAT3X }, #endif #if __FreeBSD__ >= 4 && (defined(__i386__) || defined(__alpha__)) { " compat4x", "FreeBSD 4.x binary compatibility", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_COMPAT4X }, #endif { " crypto", "Basic encryption services", dmenuFlagCheck, dmenuSetFlag, NULL, &CRYPTODists, '[', 'X', ']', DIST_CRYPTO_CRYPTO, }, { " dict", "Spelling checker dictionary files", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_DICT }, { " doc", "Miscellaneous FreeBSD online docs", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_DOC }, { " games", "Games (non-commercial)", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_GAMES }, { " info", "GNU info files", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_INFO }, { " man", "System manual pages - recommended", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_MANPAGES }, { " catman", "Preformatted system manual pages", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_CATPAGES }, { " proflibs", "Profiled versions of the libraries", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_PROFLIBS }, { " src", "Sources for everything", srcFlagCheck, distSetSrc }, { " ports", "The FreeBSD Ports collection", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_PORTS }, { " local", "Local additions collection", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_LOCAL}, { " perl", "The Perl distribution", dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_PERL }, { " XFree86", "The XFree86 distribution", x11FlagCheck, distSetXF86 }, { NULL } }, }; DMenu MenuSrcDistributions = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "Select the sub-components of src you wish to install.", "Please check off those portions of the FreeBSD source tree\n" "you wish to install.", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { "All", "Select all of the below", NULL, setSrc, NULL, NULL, ' ', ' ', ' ' }, { "Reset", "Reset all of the below", NULL, clearSrc, NULL, NULL, ' ', ' ', ' ' }, { " base", "top-level files in /usr/src", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_BASE }, { " contrib", "/usr/src/contrib (contributed software)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_CONTRIB }, { " gnu", "/usr/src/gnu (software from the GNU Project)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_GNU }, { " etc", "/usr/src/etc (miscellaneous system files)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_ETC }, { " games", "/usr/src/games (the obvious!)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_GAMES }, { " include", "/usr/src/include (header files)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_INCLUDE }, { " lib", "/usr/src/lib (system libraries)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_LIB }, { " libexec", "/usr/src/libexec (system programs)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_LIBEXEC }, { " release", "/usr/src/release (release-generation tools)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_RELEASE }, { " bin", "/usr/src/bin (system binaries)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_BIN }, { " sbin", "/usr/src/sbin (system binaries)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_SBIN }, { " scrypto", "/usr/src/crypto (contrib encryption sources)", dmenuFlagCheck, dmenuSetFlag, NULL, &CRYPTODists, '[', 'X', ']', DIST_CRYPTO_SCRYPTO }, { " share", "/usr/src/share (documents and shared files)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_SHARE }, { " skrb5", "/usr/src/kerberos5 (sources for Kerberos5)", dmenuFlagCheck, dmenuSetFlag, NULL, &CRYPTODists, '[', 'X', ']', DIST_CRYPTO_SKERBEROS5 }, { " ssecure", "/usr/src/secure (BSD encryption sources)", dmenuFlagCheck, dmenuSetFlag, NULL, &CRYPTODists, '[', 'X', ']', DIST_CRYPTO_SSECURE }, { " sys", "/usr/src/sys (FreeBSD kernel)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_SYS }, { " tools", "/usr/src/tools (miscellaneous tools)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_TOOLS }, { " ubin", "/usr/src/usr.bin (user binaries)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_UBIN }, { " usbin", "/usr/src/usr.sbin (aux system binaries)", dmenuFlagCheck, dmenuSetFlag, NULL, &SrcDists, '[', 'X', ']', DIST_SRC_USBIN }, { NULL } }, }; DMenu MenuXF86Config = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Please select the XFree86 configuration tool you want to use.", "The first option, xf86cfg, is fully graphical.\n" "The second option provides a menu-based interface similar to\n" "what you are currently using. " "The third option, xf86config, is\n" "a more simplistic shell-script based tool and less friendly to\n" "new users, but it may work in situations where the other options\n" "do not.", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "2 xf86cfg", "Fully graphical XFree86 configuration tool.", NULL, dmenuSetVariable, NULL, VAR_XF86_CONFIG "=xf86cfg" }, { "3 xf86cfg -textmode", "ncurses-based XFree86 configuration tool.", NULL, dmenuSetVariable, NULL, VAR_XF86_CONFIG "=xf86cfg -textmode" }, { "4 xf86config", "Shell-script based XFree86 configuration tool.", NULL, dmenuSetVariable, NULL, VAR_XF86_CONFIG "=xf86config" }, { "D XDesktop", "X already set up, just do desktop configuration.", NULL, dmenuSubmenu, NULL, &MenuXDesktops }, { NULL } }, }; DMenu MenuXDesktops = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Please select the default X desktop to use.", "By default, XFree86 comes with a fairly vanilla desktop which\n" "is based around the twm(1) window manager and does not offer\n" "much in the way of features. It does have the advantage of\n" "being a standard part of X so you don't need to load anything\n" "extra in order to use it. If, however, you have access to a\n" "reasonably full packages collection on your installation media,\n" "you can choose any one of the following desktops as alternatives.", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "2 KDE", "The K Desktop Environment (Lite Edition)", NULL, dmenuSetVariable, NULL, VAR_DESKSTYLE "=kde" }, { "3 GNOME 2", "The GNOME 2 Desktop Environment (Lite Edition)", NULL, dmenuSetVariable, NULL, VAR_DESKSTYLE "=gnome2" }, { "4 Afterstep", "The Afterstep window manager", NULL, dmenuSetVariable, NULL, VAR_DESKSTYLE "=afterstep" }, { "5 Windowmaker", "The Windowmaker window manager", NULL, dmenuSetVariable, NULL, VAR_DESKSTYLE "=windowmaker" }, { "6 fvwm", "The fvwm window manager", NULL, dmenuSetVariable, NULL, VAR_DESKSTYLE "=fvwm2" }, { NULL } }, }; DMenu MenuXF86Select = { DMENU_NORMAL_TYPE, "XFree86 Distribution", "Please select the components you need from the XFree86\n" "distribution sets.", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "Basic", "Basic component menu (required)", NULL, dmenuSubmenu, NULL, &MenuXF86SelectCore }, { "Server", "X server menu", NULL, dmenuSubmenu, NULL, &MenuXF86SelectServer }, { "Fonts", "Font set menu", NULL, dmenuSubmenu, NULL, &MenuXF86SelectFonts }, { NULL } }, }; DMenu MenuXF86SelectCore = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "XFree86 base distribution types", "Please check off the basic XFree86 components you wish to install.\n" "Bin, lib, and set are recommended for a minimum installaion.", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { "All", "Select all below", NULL, setX11Misc, NULL, NULL, ' ', ' ', ' ' }, { "Reset", "Reset all below", NULL, clearX11Misc, NULL, NULL, ' ', ' ', ' ' }, { " bin", "Client applications", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_CLIENTS }, { " lib", "Shared libraries and data files needed at runtime", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_LIB }, { " man", "Manual pages", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_MAN }, { " doc", "Documentation", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_DOC }, { " prog", "Programming tools", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_PROG }, { NULL } }, }; DMenu MenuXF86SelectFonts = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "Font distribution selection.", "Please check off the individual font distributions you wish to\n\ install. At the minimum, you should install the standard\n\ 75 DPI and misc fonts if you're also installing a server\n\ (these are selected by default).", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { "All", "All fonts", NULL, setX11Fonts, NULL, NULL, ' ', ' ', ' ' }, { "Reset", "Reset font selections", NULL, clearX11Fonts, NULL, NULL, ' ', ' ', ' ' }, { " fnts", "Standard miscellaneous fonts", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86FontDists, '[', 'X', ']', DIST_XF86_FONTS_BITMAPS }, { " f75", "75 DPI fonts", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86FontDists, '[', 'X', ']', DIST_XF86_FONTS_75 }, { " 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 }, { " server", "Font server", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86FontDists, '[', 'X', ']', DIST_XF86_FONTS_SERVER }, { NULL } }, }; DMenu MenuXF86SelectServer = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "X Server selection.", "Please check off the types of X servers you wish to install.\n", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { "All", "Select all of the above", NULL, setX11Servers, NULL, NULL, ' ', ' ', ' ' }, { "Reset", "Reset all of the above", NULL, clearX11Servers, NULL, NULL, ' ', ' ', ' ' }, { " srv", "Standard Graphics Framebuffer", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_FB }, { " nest", "Nested X Server", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_NEST }, { " prt", "X Print Server", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_PRINT }, { " vfb", "Virtual Framebuffer", dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_VFB }, { 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] or [ENTER]. To de-select it, press it again.\n\n" "Use [TAB] to get to the buttons and leave this menu.", "Press F1 for important information regarding disk geometry!", "drives", { { NULL } }, }; DMenu MenuHTMLDoc = { DMENU_NORMAL_TYPE, "Select HTML Documentation pointer", "Please select the body of documentation you're interested in, the main\n" "ones right now being the FAQ and the Handbook. You can also choose \"other\"\n" "to enter an arbitrary URL for browsing.", "Press F1 for more help on what you see here.", "html", { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "2 Handbook", "The FreeBSD Handbook.", NULL, docShowDocument }, { "3 FAQ", "The Frequently Asked Questions guide.", NULL, docShowDocument }, { "4 Home", "The Home Pages for the FreeBSD Project (requires net)", NULL, docShowDocument }, { "5 Other", "Enter a URL.", NULL, docShowDocument }, { NULL } }, }; /* The main installation menu */ DMenu MenuInstallCustom = { DMENU_NORMAL_TYPE, "Choose Custom Installation Options", "This is the custom installation menu. You may use this menu to specify\n" "details on the type of distribution you wish to have, where you wish\n" "to install it from and how you wish to allocate disk storage to FreeBSD.", "Press F1 to read the installation guide", "INSTALL", { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "2 Options", "View/Set various installation options", NULL, optionsEditor }, #ifndef WITH_SLICES { "3 Label", "Label disk partitions", NULL, diskLabelEditor }, { "4 Distributions", "Select distribution(s) to extract", NULL, dmenuSubmenu, NULL, &MenuDistributions }, { "5 Media", "Choose the installation media type", NULL, dmenuSubmenu, NULL, &MenuMedia }, { "6 Commit", "Perform any pending Partition/Label/Extract actions", NULL, installCustomCommit }, #else { "3 Partition", "Allocate disk space for FreeBSD", NULL, diskPartitionEditor }, { "4 Label", "Label allocated disk partitions", NULL, diskLabelEditor }, { "5 Distributions", "Select distribution(s) to extract", NULL, dmenuSubmenu, NULL, &MenuDistributions }, { "6 Media", "Choose the installation media type", NULL, dmenuSubmenu, NULL, &MenuMedia }, { "7 Commit", "Perform any pending Partition/Label/Extract actions", NULL, installCustomCommit }, #endif { NULL } }, }; #if defined(__i386__) || defined(__amd64__) #ifdef PC98 /* IPL type menu */ DMenu MenuIPLType = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "overwrite me", /* will be disk specific label */ "If you want a FreeBSD Boot Manager, select \"BootMgr\". If you would\n" "prefer your Boot Manager to remain untouched then select \"None\".\n\n", "Press F1 to read about drive setup", "drives", { { "BootMgr", "Install the FreeBSD Boot Manager", dmenuRadioCheck, dmenuSetValue, NULL, &BootMgr }, { "None", "Leave the IPL untouched", dmenuRadioCheck, dmenuSetValue, NULL, &BootMgr, '(', '*', ')', 1 }, { NULL } }, }; #else /* MBR type menu */ DMenu MenuMBRType = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "overwrite me", /* will be disk specific label */ "FreeBSD comes with a boot selector that allows you to easily\n" "select between FreeBSD and any other operating systems on your machine\n" "at boot time. If you have more than one drive and want to boot\n" "from the second one, the boot selector will also make it possible\n" "to do so (limitations in the PC BIOS usually prevent this otherwise).\n" "If you do not want a boot selector, or wish to replace an existing\n" "one, select \"standard\". If you would prefer your Master Boot\n" "Record to remain untouched then select \"None\".\n\n" " NOTE: PC-DOS users will almost certainly require \"None\"!", "Press F1 to read about drive setup", "drives", { { "BootMgr", "Install the FreeBSD Boot Manager", dmenuRadioCheck, dmenuSetValue, NULL, &BootMgr }, { "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 } }, }; #endif /* PC98 */ #endif /* __i386__ */ /* Final configuration menu */ DMenu MenuConfigure = { DMENU_NORMAL_TYPE, "FreeBSD Configuration Menu", /* title */ "If you've already installed FreeBSD, you may use this menu to customize\n" "it somewhat to suit your particular configuration. Most importantly,\n" "you can use the Packages utility to load extra \"3rd party\"\n" "software not provided in the base distributions.", "Press F1 for more information on these options", "configure", { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { " Distributions", "Install additional distribution sets", NULL, distExtractAll }, { " Packages", "Install pre-packaged software for FreeBSD", NULL, configPackages }, { " Root Password", "Set the system manager's password", NULL, dmenuSystemCommand, NULL, "passwd root" }, #ifdef WITH_SLICES { " Fdisk", "The disk Slice (PC-style partition) Editor", NULL, diskPartitionEditor }, #endif { " Label", "The disk Label editor", NULL, diskLabelEditor }, { " User Management", "Add user and group information", NULL, dmenuSubmenu, NULL, &MenuUsermgmt }, #ifdef WITH_SYSCONS { " Console", "Customize system console behavior", NULL, dmenuSubmenu, NULL, &MenuSyscons }, #endif { " Time Zone", "Set which time zone you're in", NULL, dmenuSystemCommand, NULL, "tzsetup" }, { " Media", "Change the installation media type", NULL, dmenuSubmenu, NULL, &MenuMedia }, #ifdef WITH_MICE { " Mouse", "Configure your mouse", - NULL, dmenuSubmenu, NULL, &MenuMouse, NULL }, + NULL, dmenuSubmenu, NULL, &MenuMouse }, #endif { " Networking", "Configure additional network services", NULL, dmenuSubmenu, NULL, &MenuNetworking }, { " Security", "Configure system security options", NULL, dmenuSubmenu, NULL, &MenuSecurity }, { " Startup", "Configure system startup options", NULL, dmenuSubmenu, NULL, &MenuStartup }, { " TTYs", "Configure system ttys.", NULL, configEtcTtys, NULL, "ttys" }, { " Options", "View/Set various installation options", NULL, optionsEditor }, { " XFree86", "Configure XFree86 Server", NULL, configXSetup }, { " Desktop", "Configure XFree86 Desktop", NULL, configXDesktop }, { " HTML Docs", "Go to the HTML documentation menu (post-install)", NULL, docBrowser }, { " Load KLD", "Load a KLD from a floppy", NULL, kldBrowser }, { NULL } }, }; DMenu MenuStartup = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "Startup Services Menu", "This menu allows you to configure various aspects of your system's\n" "startup configuration. Use [SPACE] or [ENTER] to select items, and\n" "[TAB] to move to the buttons. Select Exit to leave this menu.", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, #ifdef __i386__ { " APM", "Auto-power management services (typically laptops)", dmenuVarCheck, dmenuToggleVariable, NULL, "apm_enable=YES" }, #endif #ifdef PCCARD_ARCH { " pccard", "Enable PCCARD (AKA PCMCIA) services (also laptops)", dmenuVarCheck, dmenuToggleVariable, NULL, "pccard_enable=YES" }, { " pccard mem", "Set PCCARD memory address (if enabled)", dmenuVarCheck, dmenuISetVariable, NULL, "pccard_mem" }, { " pccard ifconfig", "List of PCCARD ethernet devices to configure", dmenuVarCheck, dmenuISetVariable, NULL, "pccard_ifconfig" }, #endif { " usbd", "Enable USB daemon (detect USB attach / detach)", dmenuVarCheck, dmenuToggleVariable, NULL, "usbd_enable=YES" }, { " usbd flags", "Set default flags to usbd (if enabled)", dmenuVarCheck, dmenuISetVariable, NULL, "usbd_flags" }, { " ", " -- ", NULL, NULL, NULL, NULL, ' ', ' ', ' ' }, { " Startup dirs", "Set the list of dirs to look for startup scripts", dmenuVarCheck, dmenuISetVariable, NULL, "local_startup" }, { " named", "Run a local name server on this host", dmenuVarCheck, dmenuToggleVariable, NULL, "named_enable=YES" }, { " named flags", "Set default flags to named (if enabled)", dmenuVarCheck, dmenuISetVariable, NULL, "named_flags" }, { " NIS client", "This host wishes to be an NIS client.", dmenuVarCheck, configRpcBind, NULL, "nis_client_enable=YES" }, { " NIS domainname", "Set NIS domainname (if enabled)", dmenuVarCheck, dmenuISetVariable, NULL, "nisdomainname" }, { " NIS server", "This host wishes to be an NIS server.", dmenuVarCheck, configRpcBind, NULL, "nis_server_enable=YES" }, { " ", " -- ", NULL, NULL, NULL, NULL, ' ', ' ', ' ' }, { " Accounting", "This host wishes to run process accounting.", dmenuVarCheck, dmenuToggleVariable, NULL, "accounting_enable=YES" }, { " lpd", "This host has a printer and wants to run lpd.", dmenuVarCheck, dmenuToggleVariable, NULL, "lpd_enable=YES" }, #ifdef WITH_LINUX { " Linux", "This host wants to be able to run Linux binaries.", dmenuVarCheck, configLinux, NULL, VAR_LINUX_ENABLE "=YES" }, #endif #ifdef __i386__ { " SCO", "This host wants to be able to run IBCS2 binaries.", dmenuVarCheck, dmenuToggleVariable, NULL, "ibcs2_enable=YES" }, { " SVR4", "This host wants to be able to run SVR4 binaries.", dmenuVarCheck, dmenuToggleVariable, NULL, "svr4_enable=YES" }, #endif #ifdef __alpha__ { " OSF/1", "This host wants to be able to run DEC OSF/1 binaries.", dmenuVarCheck, configOSF1, NULL, VAR_OSF1_ENABLE "=YES" }, #endif { " quotas", "This host wishes to check quotas on startup.", dmenuVarCheck, dmenuToggleVariable, NULL, "check_quotas=YES" }, { NULL } }, }; DMenu MenuNetworking = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "Network Services Menu", "You may have already configured one network device (and the other\n" "various hostname/gateway/name server parameters) in the process\n" "of installing FreeBSD. This menu allows you to configure other\n" "aspects of your system's network configuration.", NULL, NULL, { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { " Interfaces", "Configure additional network interfaces", NULL, tcpMenuSelect }, { " AMD", "This machine wants to run the auto-mounter service", dmenuVarCheck, configRpcBind, NULL, "amd_enable=YES" }, { " AMD Flags", "Set flags to AMD service (if enabled)", dmenuVarCheck, dmenuISetVariable, NULL, "amd_flags" }, { " Anon FTP", "This machine wishes to allow anonymous FTP.", dmenuVarCheck, configAnonFTP, NULL, "anon_ftp" }, { " Gateway", "This machine will route packets between interfaces", dmenuVarCheck, dmenuToggleVariable, NULL, "gateway_enable=YES" }, { " inetd", "This machine wants to run the inet daemon", dmenuVarCheck, configInetd, NULL, "inetd_enable=YES" }, { " Mail", "This machine wants to run a Mail Transfer Agent", NULL, dmenuSubmenu, NULL, &MenuMTA }, { " NFS client", "This machine will be an NFS client", dmenuVarCheck, dmenuToggleVariable, NULL, "nfs_client_enable=YES" }, { " NFS server", "This machine will be an NFS server", dmenuVarCheck, configNFSServer, NULL, "nfs_server_enable=YES" }, { " Ntpdate", "Select a clock-synchronization server", dmenuVarCheck, dmenuSubmenu, NULL, &MenuNTP, '[', 'X', ']', (uintptr_t)"ntpdate_enable=YES" }, { " PCNFSD", "Run authentication server for clients with PC-NFS.", dmenuVarCheck, configPCNFSD, NULL, "pcnfsd" }, { " rpcbind", "RPC port mapping daemon (formerly portmapper)", dmenuVarCheck, dmenuToggleVariable, NULL, "rpcbind_enable=YES" }, { " rpc.statd", "NFS status monitoring daemon", dmenuVarCheck, configRpcBind, NULL, "rpc_statd_enable=YES" }, { " rpc.lockd", "NFS file locking daemon", dmenuVarCheck, configRpcBind, NULL, "rpc_lockd_enable=YES" }, { " Routed", "Select routing daemon (default: routed)", dmenuVarCheck, configRouter, NULL, "router_enable=YES" }, { " Rwhod", "This machine wants to run the rwho daemon", dmenuVarCheck, dmenuToggleVariable, NULL, "rwhod_enable=YES" }, { " sshd", "This machine wants to run the SSH daemon", dmenuVarCheck, dmenuToggleVariable, NULL, "sshd_enable=YES" }, { " TCP Extensions", "Allow RFC1323 and RFC1644 TCP extensions?", dmenuVarCheck, dmenuToggleVariable, NULL, "tcp_extensions=YES" }, { NULL } }, }; DMenu MenuMTA = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Mail Transfer Agent Selection", "You can choose which Mail Transfer Agent (MTA) you wish to install and run.\n" "Selecting Sendmail local disables sendmail's network socket for\n" "incoming mail, but still enables sendmail for local and outbound mail.\n" "The Postfix option will install the Postfix MTA from the ports\n" "collection. The Exim option will install the Exim MTA from the ports\n" "collection. To return to the previous menu, select Exit.", NULL, NULL, { { "Sendmail", "Use sendmail", dmenuVarCheck, dmenuSetVariable, NULL, "sendmail_enable=YES" }, { "Sendmail local", "Use sendmail, but do not listen on the network", dmenuVarCheck, dmenuSetVariable, NULL, "sendmail_enable=NO" }, { "Postfix", "Use the Postfix MTA", NULL, configMTAPostfix, NULL, NULL }, { "Exim", "Use the Exim MTA", NULL, configMTAExim, NULL, NULL }, { "None", "Do not install an MTA", dmenuVarCheck, dmenuSetVariable, NULL, "sendmail_enable=NONE" }, { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { NULL } }, }; DMenu MenuNTP = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "NTPDATE Server Selection", "There are a number of time synchronization servers available\n" "for public use around the Internet. Please select one reasonably\n" "close to you to have your system time synchronized accordingly.", "These are the primary open-access NTP servers", NULL, { { "None", "No NTP server", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=NO,ntpdate_flags=none" }, { "Other", "Select a site not on this list", dmenuVarsCheck, configNTP, NULL, NULL }, { "Argentina", "tick.nap.com.ar", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tick.nap.com.ar" }, { "Argentina #2", "time.sinectis.com.ar", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.sinectis.com.ar" }, { "Argentina #3", "tock.nap.com.ar", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tock.nap.com.ar" }, { "Australia", "augean.eleceng.adelaide.edu.au", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=augean.eleceng.adelaide.edu.au" }, { "Australia #2", "ntp.adelaide.edu.au", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.adelaide.edu.au" }, { "Australia #3", "ntp.saard.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.saard.net" }, { "Australia #4", "time.deakin.edu.au", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.deakin.edu.au" }, { "Australia #5", "time.esec.com.au", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.esec.com.au" }, { "Belgium", "ntp1.belbone.be", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.belbone.be" }, { "Belgium #2", "ntp2.belbone.be", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.belbone.be" }, { "Brazil", "ntp.cais.rnp.br", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.cais.rnp.br" }, { "Brazil #2", "ntp.pop-df.rnp.br", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.pop-df.rnp.br" }, { "Brazil #3", "ntp.ufes.br", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.ufes.br" }, { "Brazil #4", "ntp1.pucpr.br", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.pucpr.br" }, { "Canada", "ntp.cpsc.ucalgary.ca", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.cpsc.ucalgary.ca" }, { "Canada #2", "ntp1.cmc.ec.gc.ca", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.cmc.ec.gc.ca" }, { "Canada #3", "ntp2.cmc.ec.gc.ca", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.cmc.ec.gc.ca" }, { "Canada #4", "tick.utoronto.ca", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tick.utoronto.ca" }, { "Canada #5", "time.chu.nrc.ca", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.chu.nrc.ca" }, { "Canada #6", "time.nrc.ca", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.nrc.ca" }, { "Canada #7", "timelord.uregina.ca", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=timelord.uregina.ca" }, { "Canada #8", "tock.utoronto.ca", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tock.utoronto.ca" }, { "Czech", "ntp.karpo.cz", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.karpo.cz" }, { "Denmark", "clock.netcetera.dk", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock.netcetera.dk" }, { "Denmark", "clock2.netcetera.dk", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock2.netcetera.dk" }, { "Spain", "slug.ctv.es", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=slug.ctv.es" }, { "Finland", "tick.keso.fi", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tick.keso.fi" }, { "Finland #2", "tock.keso.fi", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tock.keso.fi" }, { "France", "ntp.obspm.fr", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.obspm.fr" }, { "France #2", "ntp.univ-lyon1.fr", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.univ-lyon1.fr" }, { "France #3", "ntp.via.ecp.fr", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.via.ecp.fr" }, { "Croatia", "zg1.ntp.carnet.hr", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=zg1.ntp.carnet.hr" }, { "Croatia #2", "zg2.ntp.carnet.hr", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=zg2.ntp.carnet.hr" }, { "Croatia #3", "st.ntp.carnet.hr", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=st.ntp.carnet.hr" }, { "Croatia #4", "ri.ntp.carnet.hr", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ri.ntp.carnet.hr" }, { "Croatia #5", "os.ntp.carnet.hr", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=os.ntp.carnet.hr" }, { "Hungary", "time.kfki.hu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.kfki.hu" }, { "Indonesia", "ntp.incaf.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.incaf.net" }, { "Ireland", "ntp.maths.tcd.ie", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.maths.tcd.ie" }, { "Italy", "ntps.net4u.it", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=" }, { "Japan", "ntp.cyber-fleet.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.cyber-fleet.net" }, { "Korea", "time.nuri.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.nuri.net" }, { "Mexico", "ntp2a.audiotel.com.mx", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2a.audiotel.com.mx" }, { "Mexico #2", "ntp2b.audiotel.com.mx", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2b.audiotel.com.mx" }, { "Mexico #3", "ntp2c.audiotel.com.mx", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2c.audiotel.com.mx" }, { "Nigeria", "ntp.supernet300.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.supernet300.com" }, { "Netherlands", "ntp1.theinternetone.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.theinternetone.net" }, { "Netherlands #2", "ntp2.theinternetone.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.theinternetone.net" }, { "Netherlands #3", "ntp3.theinternetone.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp3.theinternetone.net" }, { "Norway", "fartein.ifi.uio.no", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=fartein.ifi.uio.no" }, { "Norway #2", "time.alcanet.no", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.alcanet.no" }, { "New Zealand", "ntp.massey.ac.nz", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.massey.ac.nz" }, { "New Zealand #2", "ntp.public.otago.ac.nz", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.public.otago.ac.nz" }, { "New Zealand #3", "tk1.ihug.co.nz", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tk1.ihug.co.nz" }, { "New Zealand #4", "ntp.waikato.ac.nz", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.waikato.ac.nz" }, { "Poland", "info.cyf-kr.edu.pl", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=info.cyf-kr.edu.pl" }, { "Portugal", "bug.fe.up.pt", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=bug.fe.up.pt" }, { "Romania", "ntp.ip.ro", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.ip.ro" }, { "Russia", "ntp.psn.ru", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.psn.ru" }, { "Russia #2", "sign.chg.ru", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=sign.chg.ru" }, { "Sweden", "ntp.lth.se", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.lth.se" }, { "Singapore", "ntp.shim.org", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.shim.org" }, { "Slovenia", "calvus.rzs-hm.si", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=calvus.rzs-hm.si" }, { "Slovenia #2", "sizif.mf.uni-lj.si", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=sizif.mf.uni-lj.si" }, { "Slovenia #3", "ntp1.arnes.si", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.arnes.si" }, { "Slovenia #4", "ntp2.arnes.si", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.arnes.si" }, { "Slovenia #5", "time.ijs.si", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.ijs.si" }, { "Scotland", "ntp.cs.strath.ac.uk", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.cs.strath.ac.uk" }, { "United Kingdom", "ntp.exnet.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.exnet.com" }, { "United Kingdom #2", "ntp0.uk.uu.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp0.uk.uu.net" }, { "United Kingdom #3", "ntp1.uk.uu.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.uk.uu.net" }, { "United Kingdom #4", "ntp2.uk.uu.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.uk.uu.net" }, { "United Kingdom #5", "ntp2a.mcc.ac.uk", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2a.mcc.ac.uk" }, { "United Kingdom #6", "ntp2b.mcc.ac.uk", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2b.mcc.ac.uk" }, { "United Kingdom #7", "ntp2c.mcc.ac.uk", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2c.mcc.ac.uk" }, { "United Kingdom #8", "ntp2d.mcc.ac.uk", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2d.mcc.ac.uk" }, { "United Kingdom #9", "tick.tanac.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tick.tanac.net" }, { "U.S. AR", "sushi.compsci.lyon.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=sushi.compsci.lyon.edu" }, { "U.S. AZ", "ntp.drydog.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.drydog.com" }, { "U.S. CA", "ntp.ucsd.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.ucsd.edu" }, { "U.S. CA #2", "ntp1.mainecoon.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.mainecoon.com" }, { "U.S. CA #3", "ntp2.mainecoon.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.mainecoon.com" }, { "U.S. CA #4", "reloj.kjsl.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=reloj.kjsl.com" }, { "U.S. CA #5", "time.five-ten-sg.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time.five-ten-sg.com" }, { "U.S. DE", "louie.udel.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=louie.udel.edu" }, { "U.S. GA", "ntp.shorty.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.shorty.com" }, { "U.S. GA #2", "rolex.usg.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=rolex.usg.edu" }, { "U.S. GA #3", "timex.usg.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=timex.usg.edu" }, { "U.S. IL", "ntp-0.cso.uiuc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-0.cso.uiuc.edu" }, { "U.S. IL #2", "ntp-1.cso.uiuc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-1.cso.uiuc.edu" }, { "U.S. IL #3", "ntp-1.mcs.anl.gov", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-1.mcs.anl.gov" }, { "U.S. IL #4", "ntp-2.cso.uiuc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-2.cso.uiuc.edu" }, { "U.S. IL #5", "ntp-2.mcs.anl.gov", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-2.mcs.anl.gov" }, { "U.S. IN", "gilbreth.ecn.purdue.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=gilbreth.ecn.purdue.edu" }, { "U.S. IN #2", "harbor.ecn.purdue.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=harbor.ecn.purdue.edu" }, { "U.S. IN #3", "molecule.ecn.purdue.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=molecule.ecn.purdue.edu" }, { "U.S. KS", "ntp1.kansas.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.kansas.net" }, { "U.S. KS #2", "ntp2.kansas.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.kansas.net" }, { "U.S. MA", "ntp.ourconcord.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.ourconcord.net" }, { "U.S. MA #2", "timeserver.cs.umb.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=timeserver.cs.umb.edu" }, { "U.S. MN", "ns.nts.umn.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ns.nts.umn.edu" }, { "U.S. MN #2", "nss.nts.umn.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=nss.nts.umn.edu" }, { "U.S. MO", "time-ext.missouri.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=time-ext.missouri.edu" }, { "U.S. MT", "chronos1.umt.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=chronos1.umt.edu" }, { "U.S. MT #2", "chronos2.umt.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=chronos2.umt.edu" }, { "U.S. MT #3", "chronos3.umt.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=chronos3.umt.edu" }, { "U.S. NC", "clock1.unc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock1.unc.edu" }, { "U.S. NV", "cuckoo.nevada.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=cuckoo.nevada.edu" }, { "U.S. NV #2", "tick.cs.unlv.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tick.cs.unlv.edu" }, { "U.S. NV #3", "tock.cs.unlv.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tock.cs.unlv.edu" }, { "U.S. NY", "clock.linuxshell.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock.linuxshell.net" }, { "U.S. NY #2", "ntp.ctr.columbia.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.ctr.columbia.edu" }, { "U.S. NY #3", "ntp0.cornell.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp0.cornell.edu" }, { "U.S. NY #4", "ntp1.mpis.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.mpis.net" }, { "U.S. NY #5", "ntp2.mpis.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.mpis.net" }, { "U.S. NY #6", "sundial.columbia.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=sundial.columbia.edu" }, { "U.S. NY #7", "timex.cs.columbia.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=timex.cs.columbia.edu" }, { "U.S. OK", "constellation.ecn.uoknor.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=constellation.ecn.uoknor.edu" }, { "U.S. PA", "clock-1.cs.cmu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock-1.cs.cmu.edu" }, { "U.S. PA #2", "clock-2.cs.cmu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock-2.cs.cmu.edu" }, { "U.S. PA #3", "clock.psu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock.psu.edu" }, { "U.S. PA #4", "fuzz.psc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=fuzz.psc.edu" }, { "U.S. PA #5", "ntp-1.ece.cmu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-1.ece.cmu.edu" }, { "U.S. PA #6", "ntp-2.ece.cmu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-2.ece.cmu.edu" }, { "U.S. TX", "ntp.cox.smu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.cox.smu.edu" }, { "U.S. TX #2", "ntp.fnbhs.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.fnbhs.com" }, { "U.S. TX #3", "ntp.tmc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.tmc.edu" }, { "U.S. TX #4", "ntp5.tamu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp5.tamu.edu" }, { "U.S. TX #5", "tick.greyware.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tick.greyware.com" }, { "U.S. TX #6", "tock.greyware.com", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=tock.greyware.com" }, { "U.S. VA", "ntp-1.vt.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-1.vt.edu" }, { "U.S. VA #2", "ntp-2.vt.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp-2.vt.edu" }, { "U.S. VA #3", "ntp.cmr.gov", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.cmr.gov" }, { "U.S. VT", "ntp0.state.vt.us", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp0.state.vt.us" }, { "U.S. VT #2", "ntp1.state.vt.us", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.state.vt.us" }, { "U.S. VT #3", "ntp2.state.vt.us", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp2.state.vt.us" }, { "U.S. WA", "clock.tricity.wsu.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=clock.tricity.wsu.edu" }, { "U.S. WA #2", "ntp.tcp-udp.net", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.tcp-udp.net" }, { "U.S. WI", "ntp1.cs.wisc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp1.cs.wisc.edu" }, { "U.S. WI #2", "ntp3.cs.wisc.edu", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp3.cs.wisc.edu" }, { "Venezuela", "ntp.linux.org.ve", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.linux.org.ve" }, { "South Africa", "ntp.cs.unp.ac.za", dmenuVarsCheck, dmenuSetVariables, NULL, "ntpdate_enable=YES,ntpdate_flags=ntp.cs.unp.ac.za" }, { NULL } }, }; #ifdef WITH_SYSCONS DMenu MenuSyscons = { DMENU_NORMAL_TYPE, "System Console Configuration", "The default system console driver for FreeBSD (syscons) has a\n" "number of configuration options which may be set according to\n" "your preference.\n\n" "When you are done setting configuration options, select Cancel.", "Configure your system console settings", NULL, { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, #ifdef PC98 { "2 Keymap", "Choose an alternate keyboard map", NULL, dmenuSubmenu, NULL, &MenuSysconsKeymap }, { "3 Repeat", "Set the rate at which keys repeat", NULL, dmenuSubmenu, NULL, &MenuSysconsKeyrate }, { "4 Saver", "Configure the screen saver", NULL, dmenuSubmenu, NULL, &MenuSysconsSaver }, #else { "2 Font", "Choose an alternate screen font", NULL, dmenuSubmenu, NULL, &MenuSysconsFont }, { "3 Keymap", "Choose an alternate keyboard map", NULL, dmenuSubmenu, NULL, &MenuSysconsKeymap }, { "4 Repeat", "Set the rate at which keys repeat", NULL, dmenuSubmenu, NULL, &MenuSysconsKeyrate }, { "5 Saver", "Configure the screen saver", NULL, dmenuSubmenu, NULL, &MenuSysconsSaver }, { "6 Screenmap", "Choose an alternate screenmap", NULL, dmenuSubmenu, NULL, &MenuSysconsScrnmap }, { "7 Ttys", "Choose console terminal type", NULL, dmenuSubmenu, NULL, &MenuSysconsTtys }, #endif { NULL } }, }; #ifdef PC98 DMenu MenuSysconsKeymap = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "System Console Keymap", "The default system console driver for FreeBSD (syscons) defaults\n" "to a standard \"PC-98x1\" keyboard map. Users may wish to choose\n" "one of the other keymaps below.\n" "Note that sysinstall itself only uses the part of the keyboard map\n" "which is required to generate the ANSI character subset, but your\n" "choice of keymap will also be saved for later (fuller) use.", "Choose a keyboard map", NULL, { { "Japanese PC-98x1", "Japanese PC-98x1 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=jp.pc98" }, { " Japanese PC-98x1 (ISO)", "Japanese PC-98x1 (ISO) keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=jp.pc98.iso" }, { NULL } }, }; #else DMenu MenuSysconsKeymap = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "System Console Keymap", "The default system console driver for FreeBSD (syscons) defaults\n" "to a standard \"American\" keyboard map. Users in other countries\n" "(or with different keyboard preferences) may wish to choose one of\n" "the other keymaps below.\n" "Note that sysinstall itself only uses the part of the keyboard map\n" "which is required to generate the ANSI character subset, but your\n" "choice of keymap will also be saved for later (fuller) use.", "Choose a keyboard map", NULL, { { "Belgian", "Belgian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=be.iso" }, { " Brazil CP850", "Brazil CP850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=br275.cp850" }, { " Brazil ISO (accent)", "Brazil ISO keymap (accent keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=br275.iso.acc" }, { " Brazil ISO", "Brazil ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=br275.iso" }, { " Bulgarian BDS", "Bulgarian BDS keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=bg.bds.ctrlcaps" }, { " Bulgarian Phonetic", "Bulgarian Phonetic keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=bg.phonetic.ctrlcaps" }, { " Croatian ISO", "Croatian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=hr.iso" }, { " Czech ISO (accent)", "Czech ISO keymap (accent keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=cs.latin2.qwertz" }, { "Danish CP865", "Danish Code Page 865 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=danish.cp865" }, { " Danish ISO", "Danish ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=danish.iso" }, { "Estonian ISO", "Estonian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=estonian.iso" }, { " Estonian ISO 15", "Estonian ISO 8859-15 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=estonian.iso15" }, { " Estonian CP850", "Estonian Code Page 850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=estonian.cp850" }, { "Finnish CP850","Finnish Code Page 850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=finnish.cp850" }, { " Finnish ISO", "Finnish ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=finnish.iso" }, { " French ISO (accent)", "French ISO keymap (accent keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=fr.iso.acc" }, { " French ISO", "French ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=fr.iso" }, { "German CP850", "German Code Page 850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=german.cp850" }, { " German ISO", "German ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=german.iso" }, { " Greek 101", "Greek ISO keymap (101 keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=gr.us101.acc" }, { " Greek 104", "Greek ISO keymap (104 keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=el.iso07" }, { " Greek ELOT", "Greek ISO keymap (ELOT 1000)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=gr.elot.acc" }, { "Hungarian 101", "Hungarian ISO keymap (101 key)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=hu.iso2.101keys" }, { " Hungarian 102", "Hungarian ISO keymap (102 key)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=hu.iso2.102keys" }, { "Icelandic (accent)", "Icelandic ISO keymap (accent keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=icelandic.iso.acc" }, { " Icelandic", "Icelandic ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=icelandic.iso" }, { " Italian", "Italian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=it.iso" }, { "Japanese 106", "Japanese 106 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=jp.106" }, { "Latin American", "Latin American ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=lat-amer" }, { "Norway ISO", "Norwegian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=norwegian.iso" }, { "Polish ISO", "Polish ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=pl_PL.ISO8859-2" }, { " Portuguese (accent)", "Portuguese ISO keymap (accent keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=pt.iso.acc" }, { " Portuguese", "Portuguese ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=pt.iso" }, { "Russia KOI8-R", "Russian KOI8-R keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=ru.koi8-r" }, { "Slovenian", "Slovenian ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=si.iso" }, { " Spanish (accent)", "Spanish ISO keymap (accent keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=spanish.iso.acc" }, { " Spanish", "Spanish ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=spanish.iso" }, { " Swedish CP850", "Swedish Code Page 850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swedish.cp850" }, { " Swedish ISO", "Swedish ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swedish.iso" }, { " Swiss French ISO (accent)", "Swiss French ISO keymap (accent keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swissfrench.iso.acc" }, { " Swiss French ISO", "Swiss French ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swissfrench.iso" }, { " Swiss French CP850", "Swiss French Code Page 850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swissfrench.cp850" }, { " Swiss German ISO (accent)", "Swiss German ISO keymap (accent keys)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swissgerman.iso.acc" }, { " Swiss German ISO", "Swiss German ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swissgerman.iso" }, { " Swiss German CP850", "Swiss German Code Page 850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=swissgerman.cp850" }, { "UK CP850", "UK Code Page 850 keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=uk.cp850" }, { " UK ISO", "UK ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=uk.iso" }, { " Ukrainian KOI8-U", "Ukrainian KOI8-U keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=ua.koi8-u" }, { " Ukrainian KOI8-U+KOI8-R", "Ukrainian KOI8-U+KOI8-R keymap (alter)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=ua.koi8-u.shift.alt" }, { " USA CapsLock->Ctrl", "US standard (Caps as L-Control)", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=us.pc-ctrl" }, { " USA Dvorak", "US Dvorak keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=us.dvorak" }, { " USA Dvorak (left)", "US left handed Dvorak keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=us.dvorakl" }, { " USA Dvorak (right)", "US right handed Dvorak keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=us.dvorakr" }, { " USA Emacs", "US standard optimized for EMACS", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=us.emacs" }, { " USA ISO", "US ISO keymap", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=us.iso" }, { " USA UNIX", "US traditional UNIX-workstation", dmenuVarCheck, dmenuSetKmapVariable, NULL, "keymap=us.unix" }, { NULL } }, }; #endif /* PC98 */ DMenu MenuSysconsKeyrate = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "System Console Keyboard Repeat Rate", "This menu allows you to set the speed at which keys repeat\n" "when held down.", "Choose a keyboard repeat rate", NULL, { { "Slow", "Slow keyboard repeat rate", dmenuVarCheck, dmenuSetVariable, NULL, "keyrate=slow" }, { "Normal", "\"Normal\" keyboard repeat rate", dmenuVarCheck, dmenuSetVariable, NULL, "keyrate=normal" }, { "Fast", "Fast keyboard repeat rate", dmenuVarCheck, dmenuSetVariable, NULL, "keyrate=fast" }, { "Default", "Use default keyboard repeat rate", dmenuVarCheck, dmenuSetVariable, NULL, "keyrate=NO" }, { NULL } }, }; DMenu MenuSysconsSaver = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "System Console Screen Saver", "By default, the console driver will not attempt to do anything\n" "special with your screen when it's idle. If you expect to leave your\n" "monitor switched on and idle for long periods of time then you should\n" "probably enable one of these screen savers to prevent phosphor burn-in.", "Choose a nifty-looking screen saver", NULL, { { "1 Blank", "Simply blank the screen", dmenuVarCheck, configSaver, NULL, "saver=blank" }, { "2 Daemon", "\"BSD Daemon\" animated screen saver (text)", dmenuVarCheck, configSaver, NULL, "saver=daemon" }, { "3 Fade", "Fade out effect screen saver", dmenuVarCheck, configSaver, NULL, "saver=fade" }, { "4 Fire", "Flames effect screen saver", dmenuVarCheck, configSaver, NULL, "saver=fire" }, { "5 Green", "\"Green\" power saving mode (if supported by monitor)", dmenuVarCheck, configSaver, NULL, "saver=green" }, { "6 Logo", "\"BSD Daemon\" animated screen saver (graphics)", dmenuVarCheck, configSaver, NULL, "saver=logo" }, { "7 Rain", "Rain drops screen saver", dmenuVarCheck, configSaver, NULL, "saver=rain" }, { "8 Snake", "Draw a FreeBSD \"snake\" on your screen", dmenuVarCheck, configSaver, NULL, "saver=snake" }, { "9 Star", "A \"twinkling stars\" effect", dmenuVarCheck, configSaver, NULL, "saver=star" }, { "Warp", "A \"stars warping\" effect", dmenuVarCheck, configSaver, NULL, "saver=warp" }, { "Dragon", "Dragon screensaver (graphics)", dmenuVarCheck, configSaver, NULL, "saver=dragon" }, { "Timeout", "Set the screen saver timeout interval", NULL, configSaverTimeout, NULL, NULL, ' ', ' ', ' ' }, { NULL } }, }; #ifndef PC98 DMenu MenuSysconsScrnmap = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "System Console Screenmap", "Unless you load a specific font, most PC hardware defaults to\n" "displaying characters in the IBM 437 character set. However,\n" "in the Unix world, this character set is very rarely used. Most\n" "Western European countries, for example, prefer ISO 8859-1.\n" "American users won't notice the difference since the bottom half\n" "of all these character sets is ANSI anyway.\n" "If your hardware is capable of downloading a new display font,\n" "you should probably choose that option. However, for hardware\n" "where this is not possible (e.g. monochrome adapters), a screen\n" "map will give you the best approximation that your hardware can\n" "display at all.", "Choose a screen map", NULL, { { "1 None", "No screenmap, don't touch font", dmenuVarCheck, dmenuSetVariable, NULL, "scrnmap=NO" }, { "2 ISO 8859-1 to IBM437", "W-Europe ISO 8859-1 to IBM 437 screenmap", dmenuVarCheck, dmenuSetVariable, NULL, "scrnmap=iso-8859-1_to_cp437" }, { "3 ISO 8859-7 to IBM437", "Greek ISO 8859-7 to IBM 437 screenmap", dmenuVarCheck, dmenuSetVariable, NULL, "scrnmap=iso-8859-7_to_cp437" }, { "4 US-ASCII to IBM437", "US-ASCII to IBM 437 screenmap", dmenuVarCheck, dmenuSetVariable, NULL, "scrnmap=us-ascii_to_cp437" }, { "5 KOI8-R to IBM866", "Russian KOI8-R to IBM 866 screenmap", dmenuVarCheck, dmenuSetVariable, NULL, "scrnmap=koi8-r2cp866" }, { "6 KOI8-U to IBM866u", "Ukrainian KOI8-U to IBM 866u screenmap", dmenuVarCheck, dmenuSetVariable, NULL, "scrnmap=koi8-u2cp866u" }, { NULL } }, }; DMenu MenuSysconsTtys = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "System Console Terminal Type", "For various console encodings, a corresponding terminal type\n" "must be chosen in /etc/ttys.\n\n" "WARNING: For compatibility reasons, only entries starting with\n" "ttyv and terminal types starting with cons[0-9] can be changed\n" "via this menu.\n", "Choose a terminal type", NULL, { { "1 None", "Don't touch anything", dmenuVarCheck, dmenuSetVariable, NULL, VAR_CONSTERM "=NO" }, { "2 IBM437 (VGA default)", "cons25", dmenuVarCheck, dmenuSetVariable, NULL, VAR_CONSTERM "=cons25" }, { "3 ISO 8859-1", "cons25l1", dmenuVarCheck, dmenuSetVariable, NULL, VAR_CONSTERM "=cons25l1" }, { "4 ISO 8859-2", "cons25l2", dmenuVarCheck, dmenuSetVariable, NULL, VAR_CONSTERM "=cons25l2" }, { "5 ISO 8859-7", "cons25l7", dmenuVarCheck, dmenuSetVariable, NULL, VAR_CONSTERM "=cons25l7" }, { "6 KOI8-R", "cons25r", dmenuVarCheck, dmenuSetVariable, NULL, VAR_CONSTERM "=cons25r" }, { "7 KOI8-U", "cons25u", dmenuVarCheck, dmenuSetVariable, NULL, VAR_CONSTERM "=cons25u" }, { "8 US-ASCII", "cons25w", dmenuVarCheck, dmenuSetVariable, NULL, VAR_CONSTERM "=cons25w" }, { NULL } }, }; DMenu MenuSysconsFont = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "System Console Font", "Most PC hardware defaults to displaying characters in the\n" "IBM 437 character set. However, in the Unix world, this\n" "character set is very rarely used. Most Western European\n" "countries, for example, prefer ISO 8859-1.\n" "American users won't notice the difference since the bottom half\n" "of all these charactersets is ANSI anyway. However, they might\n" "want to load a font anyway to use the 30- or 50-line displays.\n" "If your hardware is capable of downloading a new display font,\n" "you can select the appropriate font below.", "Choose a font", NULL, { { "1 None", "Use hardware default font", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=NO,font8x14=NO,font8x16=NO" }, { "2 IBM 437", "English and others, VGA default", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp437-8x8,font8x14=cp437-8x14,font8x16=cp437-8x16" }, { "3 IBM 850", "Western Europe, IBM encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp850-8x8,font8x14=cp850-8x14,font8x16=cp850-8x16" }, { "4 IBM 865", "Norwegian, IBM encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp865-8x8,font8x14=cp865-8x14,font8x16=cp865-8x16" }, { "5 IBM 866", "Russian, IBM encoding (use with KOI8-R screenmap)", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp866-8x8,font8x14=cp866-8x14,font8x16=cp866b-8x16,mousechar_start=3" }, { "6 IBM 866u", "Ukrainian, IBM encoding (use with KOI8-U screenmap)", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp866u-8x8,font8x14=cp866u-8x14,font8x16=cp866u-8x16,mousechar_start=3" }, { "7 IBM 1251", "Cyrillic, MS Windows encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=cp1251-8x8,font8x14=cp1251-8x14,font8x16=cp1251-8x16,mousechar_start=3" }, { "8 ISO 8859-1", "Western Europe, ISO encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=iso-8x8,font8x14=iso-8x14,font8x16=iso-8x16" }, { "9 ISO 8859-2", "Eastern Europe, ISO encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=iso02-8x8,font8x14=iso02-8x14,font8x16=iso02-8x16" }, { "a ISO 8859-4", "Baltic, ISO encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=iso04-8x8,font8x14=iso04-8x14,font8x16=iso04-8x16" }, { "b ISO 8859-7", "Greek, ISO encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=iso07-8x8,font8x14=iso07-8x14,font8x16=iso07-8x16" }, { "c ISO 8859-8", "Hebrew, ISO encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=iso08-8x8,font8x14=iso08-8x14,font8x16=iso08-8x16" }, { "d ISO 8859-15", "Europe, ISO encoding", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=iso15-8x8,font8x14=iso15-8x14,font8x16=iso15-8x16" }, { "e SWISS", "English, better resolution", dmenuVarCheck, dmenuSetVariables, NULL, "font8x8=swiss-8x8,font8x14=NO,font8x16=swiss-8x16" }, { NULL } }, }; #endif /* PC98 */ #endif /* WITH_SYSCONS */ DMenu MenuUsermgmt = { DMENU_NORMAL_TYPE, "User and group management", "The submenus here allow to manipulate user groups and\n" "login accounts.\n", "Configure your user groups and users", NULL, { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "User", "Add a new user to the system.", NULL, userAddUser }, { "Group", "Add a new user group to the system.", NULL, userAddGroup }, { NULL } }, }; DMenu MenuSecurity = { DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS, "System Security Options Menu", "This menu allows you to configure aspects of the operating system security\n" "policy. Please read the system documentation carefully before modifying\n" "these settings, as they may cause service disruption if used improperly.\n" "\n" "Most settings will take affect only following a system reboot.", "Configure system security options", NULL, { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { " Securelevel", "Configure securelevels for the system", NULL, configSecurelevel }, #if 0 { " LOMAC", "Use Low Watermark Mandatory Access Control at boot", dmenuVarCheck, dmenuToggleVariable, NULL, "lomac_enable=YES" }, #endif { " NFS port", "Require that the NFS clients used reserved ports", dmenuVarCheck, dmenuToggleVariable, NULL, "nfs_reserved_port_only=YES" }, { NULL } }, }; DMenu MenuSecurelevel = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Securelevel Configuration Menu", "This menu allows you to select the securelevel your system runs with.\n" "When operating at a securelevel, certain root privileges are disabled,\n" "which may increase resistance to exploits and protect system integrity.\n" "In secure mode system flags may not be overriden by the root user,\n" "access to direct kernel memory is limited, and kernel modules may not\n" "be changed. In highly secure mode, mounted file systems may not be\n" "modified on-disk, tampering with the system clock is prohibited. In\n" "network secure mode configuration changes to firwalling are prohibited.\n", "Select a securelevel to operate at - F1 for help", "securelevel", { { "X Exit", "Exit this menu (returning to previous)", checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' }, { "Disabled", "Disable securelevels", NULL, configSecurelevelDisabled, }, { "Secure", "Secure mode", NULL, configSecurelevelSecure }, { "Highly Secure", "Highly secure mode", NULL, configSecurelevelHighlySecure }, { "Network Secure", "Network secure mode", NULL, configSecurelevelNetworkSecure }, { NULL } } }; DMenu MenuFixit = { DMENU_NORMAL_TYPE, "Please choose a fixit option", "There are three ways of going into \"fixit\" mode:\n" "- you can use the live filesystem CDROM/DVD, in which case there will be\n" " full access to the complete set of FreeBSD commands and utilities,\n" "- you can use the more limited (but perhaps customized) fixit floppy,\n" "- or you can start an Emergency Holographic Shell now, which is\n" " limited to the subset of commands that is already available right now.", "Press F1 for more detailed repair instructions", "fixit", { { "X Exit", "Exit this menu (returning to previous)", NULL, dmenuExit }, { "2 CDROM/DVD", "Use the \"live\" filesystem CDROM/DVD", NULL, installFixitCDROM }, { "3 Floppy", "Use a floppy generated from the fixit image", NULL, installFixitFloppy }, { "4 Shell", "Start an Emergency Holographic Shell", NULL, installFixitHoloShell }, { NULL } }, }; diff --git a/usr.sbin/sysinstall/sysinstall.h b/usr.sbin/sysinstall/sysinstall.h index e4c939f4ec60..938cfad0be72 100644 --- a/usr.sbin/sysinstall/sysinstall.h +++ b/usr.sbin/sysinstall/sysinstall.h @@ -1,885 +1,885 @@ /* * The new sysinstall program. * * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer, * verbatim and that no modifications are made prior to this * point in the file. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ #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 ***/ #if defined(__i386__) || defined(__alpha__) || defined(__amd64__) #define WITH_SYSCONS #define WITH_MICE #endif #if defined(__i386__) || defined(__amd64__) #define WITH_SLICES #endif #if defined(__i386__) || defined(__alpha__) #define WITH_LINUX #endif #if defined(PC98) #define PCCARD_ARCH 1 /* Support PCCARD installations */ #endif /* device limits */ #define DEV_NAME_MAX 128 /* 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_DESKSTYLE "_deskStyle" #define VAR_DISK "disk" #define VAR_DISKINTERACTIVE "diskInteractive" #define VAR_DISTS "dists" #define VAR_DIST_MAIN "distMain" #define VAR_DIST_CRYPTO "distCRYPTO" #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_FIXIT_TTY "fixitTty" #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_HTTP_PATH "_httpPath" #define VAR_HTTP_PROXY "httpProxy" #define VAR_HTTP_PORT "httpPort" #define VAR_HTTP_HOST "httpHost" #define VAR_HTTP_FTP_MODE "httpFtpMode" #define VAR_GATEWAY "defaultrouter" #define VAR_GEOMETRY "geometry" #define VAR_HOSTNAME "hostname" #define VAR_IFCONFIG "ifconfig_" #define VAR_INSTALL_CFG "installConfig" #define VAR_INSTALL_ROOT "installRoot" #define VAR_IPADDR "ipaddr" #define VAR_IPV6_ENABLE "ipv6_enable" #define VAR_IPV6ADDR "ipv6addr" #define VAR_KERN_SECURELEVEL "kern_securelevel" #define VAR_KEYMAP "keymap" #define VAR_LABEL "label" #define VAR_LABEL_COUNT "labelCount" #define VAR_LINUX_ENABLE "linux_enable" #define VAR_MEDIA_TYPE "mediaType" #define VAR_MEDIA_TIMEOUT "MEDIA_TIMEOUT" #define VAR_MOUSED "moused_enable" #define VAR_MOUSED_FLAGS "moused_flags" #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_NEWFS_ARGS "newfsArgs" #define VAR_NFS_PATH "nfs" #define VAR_NFS_HOST "nfsHost" #define VAR_NFS_V3 "nfs_use_v3" #define VAR_NFS_TCP "nfs_use_tcp" #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_HOLOSHELL "noHoloShell" #define VAR_NO_INET6 "noInet6" #define VAR_NO_WARN "noWarn" #define VAR_NO_USR "noUsr" #define VAR_NO_TMP "noTmp" #define VAR_NO_HOME "noHome" #define VAR_NONINTERACTIVE "nonInteractive" #define VAR_NOVELL "novell" #define VAR_OSF1_ENABLE "osf1_enable" #define VAR_RPCBIND_ENABLE "rpcbind_enable" #define VAR_NTPDATE_FLAGS "ntpdate_flags" #define VAR_PACKAGE "package" #define VAR_PARTITION "partition" #define VAR_PCNFSD "pcnfsd" #define VAR_PKG_TMPDIR "PKG_TMPDIR" #define VAR_PORTS_PATH "ports" #define VAR_PPP_ENABLE "ppp_enable" #define VAR_PPP_PROFILE "ppp_profile" #define VAR_RELNAME "releaseName" #define VAR_ROOT_SIZE "rootSize" #define VAR_ROUTER "router" #define VAR_ROUTER_ENABLE "router_enable" #define VAR_ROUTERFLAGS "router_flags" #define VAR_SENDMAIL_ENABLE "sendmail_enable" #define VAR_SERIAL_SPEED "serialSpeed" #define VAR_SLOW_ETHER "slowEthernetCard" #define VAR_SWAP_SIZE "swapSize" #define VAR_TAPE_BLOCKSIZE "tapeBlocksize" #define VAR_TRY_DHCP "tryDHCP" #define VAR_TRY_RTSOL "tryRTSOL" #define VAR_SKIP_PCCARD "skipPCCARD" #define VAR_UFS_PATH "ufs" #define VAR_USR_SIZE "usrSize" #define VAR_VAR_SIZE "varSize" #define VAR_TMP_SIZE "tmpSize" #define VAR_HOME_SIZE "homeSize" #define VAR_XF86_CONFIG "_xf86config" #define VAR_TERM "TERM" #define VAR_CONSTERM "_consterm" #define DEFAULT_TAPE_BLOCKSIZE "20" /* One MB worth of blocks */ #define ONE_MEG 2048 #define ONE_GIG (ONE_MEG * 1024) /* 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 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" */ #if (__STDC_VERSION__ >= 199901L) || (__GNUC__ >= 3) dialogMenuItem items[]; /* Array of menu items */ #elif __GNUC__ dialogMenuItem items[0]; /* Array of menu items */ #else #error "Create hack for C89 and K&R compilers." #endif } 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, DEVICE_TYPE_HTTP, } 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; unsigned int volume; } Device; /* Some internal representations of partitions */ typedef enum { PART_NONE, PART_SLICE, PART_SWAP, PART_FILESYSTEM, PART_FAT, PART_EFI } PartType; #define NEWFS_UFS_CMD "newfs" #define NEWFS_MSDOS_CMD "newfs_msdos" enum newfs_type { NEWFS_UFS, NEWFS_MSDOS, NEWFS_CUSTOM }; #define NEWFS_UFS_STRING "UFS" #define NEWFS_MSDOS_STRING "FAT" #define NEWFS_CUSTOM_STRING "CST" /* The longest set of custom command line arguments we'll pass. */ #define NEWFS_CMD_ARGS_MAX 256 typedef struct _part_info { char mountpoint[FILENAME_MAX]; /* Is invocation of newfs desired? */ Boolean do_newfs; enum newfs_type newfs_type; union { struct { char user_options[NEWFS_CMD_ARGS_MAX]; Boolean acls; /* unused */ Boolean multilabel; /* unused */ Boolean softupdates; Boolean ufs1; } newfs_ufs; struct { /* unused */ } newfs_msdos; struct { char command[NEWFS_CMD_ARGS_MAX]; } newfs_custom; } newfs_data; } 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 */ unsigned int volume; /* Volume of package */ } 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 { int use_rtsol; int use_dhcp; 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 Restarting; /* Are we restarting sysinstall? */ 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 CRYPTODists; /* 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 */ #if defined(__i386__) || defined(__amd64__) #ifdef PC98 extern DMenu MenuIPLType; /* Type of IPL to write on the disk */ #else extern DMenu MenuMBRType; /* Type of MBR to write on the disk */ #endif #endif 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 MenuKLD; /* Prototype KLD menu */ extern DMenu MenuMedia; /* Media type menu */ #ifdef WITH_MICE extern DMenu MenuMouse; /* Mouse type menu */ #endif 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 MenuSecurity; /* System security options menu */ extern DMenu MenuSecurelevel; /* Securelevel menu */ extern DMenu MenuStartup; /* Startup services menu */ #ifdef WITH_SYSCONS 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 MenuSysconsTtys; /* System console terminal type menu */ #endif extern DMenu MenuNetworking; /* Network configuration menu */ extern DMenu MenuMTA; /* MTA selection menu */ extern DMenu MenuInstallCustom; /* Custom Installation menu */ extern DMenu MenuDistributions; /* Distribution menu */ extern DMenu MenuDiskDevices; /* Disk type devices */ extern DMenu MenuSubDistributions; /* Custom 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 MenuXF86SelectFonts; /* XFree86 font selection menu */ extern DMenu MenuXDesktops; /* 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 */ extern int FixItMode; /* FixItMode starts shell onc urrent device (ie Serial port) */ extern const char * StartName; /* Which name we were started as */ /* 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, ...) __printflike(2, 3); 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 configResolv(dialogMenuItem *self); extern int configPackages(dialogMenuItem *self); extern int configSaver(dialogMenuItem *self); extern int configSaverTimeout(dialogMenuItem *self); #ifdef WITH_LINUX extern int configLinux(dialogMenuItem *self); #endif extern int configNTP(dialogMenuItem *self); #ifdef __alpha__ extern int configOSF1(dialogMenuItem *self); #endif extern int configUsers(dialogMenuItem *self); extern int configXSetup(dialogMenuItem *self); extern int configXDesktop(dialogMenuItem *self); extern int configRouter(dialogMenuItem *self); extern int configPCNFSD(dialogMenuItem *self); extern int configInetd(dialogMenuItem *self); extern int configNFSServer(dialogMenuItem *self); extern int configMTAPostfix(dialogMenuItem *self); extern int configMTAExim(dialogMenuItem *self); extern int configRpcBind(dialogMenuItem *self); extern int configWriteRC_conf(dialogMenuItem *self); extern int configSecurelevel(dialogMenuItem *self); extern int configSecurelevelDisabled(dialogMenuItem *self); extern int configSecurelevelSecure(dialogMenuItem *self); extern int configSecurelevelHighlySecure(dialogMenuItem *self); extern int configSecurelevelNetworkSecure(dialogMenuItem *self); extern int configEtcTtys(dialogMenuItem *self); #ifdef __i386__ extern int checkLoaderACPI(void); extern int configLoaderACPI(int); #endif /* devices.c */ extern DMenu *deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)(dialogMenuItem *d), int (*check)(dialogMenuItem *d)); extern void deviceGetAll(void); extern void deviceReset(void); extern void deviceRescan(void); extern Device **deviceFind(char *name, DeviceType type); extern Device **deviceFindDescr(char *name, char *desc, DeviceType class); extern int deviceCount(Device **devs); extern Device *new_device(char *name); extern Device *deviceRegister(char *name, char *desc, char *devname, DeviceType type, Boolean enabled, Boolean (*init)(Device *mediadev), FILE * (*get)(Device *dev, char *file, Boolean probe), void (*shutDown)(Device *mediadev), void *private); extern Boolean dummyInit(Device *dev); extern FILE *dummyGet(Device *dev, char *dist, Boolean probe); extern void dummyShutdown(Device *dev); /* dhcp.c */ extern int dhcpParseLeases(char *file, char *hostname, char *domain, char *nameserver, char *ipaddr, char *gateway, char *netmask); /* disks.c */ #ifdef WITH_SLICES extern void diskPartition(Device *dev); extern int diskPartitionEditor(dialogMenuItem *self); #endif extern int diskPartitionWrite(dialogMenuItem *self); extern int diskGetSelectCount(Device ***devs); /* 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 distUnsetCustom(dialogMenuItem *self); extern int distSetDeveloper(dialogMenuItem *self); extern int distSetXDeveloper(dialogMenuItem *self); extern int distSetKernDeveloper(dialogMenuItem *self); extern int distSetXKernDeveloper(dialogMenuItem *self); extern int distSetUser(dialogMenuItem *self); extern int distSetXUser(dialogMenuItem *self); extern int distSetMinimum(dialogMenuItem *self); extern int distSetEverything(dialogMenuItem *self); extern int 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); /* http.c */ extern Boolean mediaInitHTTP(Device *dev); extern FILE *mediaGetHTTP(Device *dev, char *file, Boolean probe); /* globals.c */ extern void globalsInit(void); /* index.c */ int index_read(FILE *fp, PkgNodePtr papa); int index_menu(PkgNodePtr root, PkgNodePtr top, PkgNodePtr plist, int *pos, int *scroll); void index_init(PkgNodePtr top, PkgNodePtr plist); void index_node_free(PkgNodePtr top, PkgNodePtr plist); void index_sort(PkgNodePtr top); void index_print(PkgNodePtr top, int level); int index_extract(Device *dev, PkgNodePtr top, PkgNodePtr who, Boolean depended); int index_initialize(char *path); PkgNodePtr index_search(PkgNodePtr top, char *str, PkgNodePtr *tp); /* install.c */ extern Boolean checkLabels(Boolean whinge, Chunk **rdev, Chunk **sdev, Chunk **udev, Chunk **vdev, Chunk **vtdev, Chunk **hdev); extern int installCommit(dialogMenuItem *self); extern int installCustomCommit(dialogMenuItem *self); extern int installExpress(dialogMenuItem *self); extern int installStandard(dialogMenuItem *self); extern int installFixitHoloShell(dialogMenuItem *self); extern int installFixitCDROM(dialogMenuItem *self); extern int installFixitFloppy(dialogMenuItem *self); extern int installFixupBase(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); /* makedevs.c (auto-generated) */ extern const char termcap_ansi[]; extern const char termcap_vt100[]; extern const char termcap_cons25w[]; 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 char termcap_xterm[]; 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 mediaSetHTTP(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 Mkdir_command(char *key, void *data); extern int Mount(char *, void *data); extern int Mount_msdosfs(char *mountp, void *devname); 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); /* modules.c */ extern void driverFloppyCheck(void); extern void moduleInitialize(void); extern int kldBrowser(dialogMenuItem *self); /* mouse.c */ extern int mousedTest(dialogMenuItem *self); extern int mousedDisable(dialogMenuItem *self); extern int setMouseFlags(dialogMenuItem *self); /* msg.c */ extern Boolean isDebug(void); extern void msgInfo(char *fmt, ...) __printf0like(1, 2); extern void msgYap(char *fmt, ...) __printflike(1, 2); extern void msgWarn(char *fmt, ...) __printflike(1, 2); extern void msgDebug(char *fmt, ...) __printflike(1, 2); extern void msgError(char *fmt, ...) __printflike(1, 2); extern void msgFatal(char *fmt, ...) __printflike(1, 2); extern void msgConfirm(char *fmt, ...) __printflike(1, 2); extern void msgNotify(char *fmt, ...) __printflike(1, 2); extern void msgWeHaveOutput(char *fmt, ...) __printflike(1, 2); extern int msgYesNo(char *fmt, ...) __printflike(1, 2); extern int msgNoYes(char *fmt, ...) __printflike(1, 2); extern char *msgGetInput(char *buf, char *fmt, ...) __printflike(2, 3); 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_installed(char *name); /* pccard.c */ extern void pccardInitialize(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 void systemSuspendDialog(void); extern void systemResumeDialog(void); 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, ...) __printflike(1, 2); /* 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); /* ttys.c */ extern void configTtys(void); /* ufs.c */ extern void mediaShutdownUFS(Device *dev); extern Boolean mediaInitUFS(Device *dev); extern FILE *mediaGetUFS(Device *dev, char *file, Boolean probe); /* usb.c */ extern void usbInitialize(void); /* 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 variable_check2(char *data); extern int dump_variables(dialogMenuItem *self); extern void free_variables(void); extern void pvariable_set(char *var); extern char *pvariable_get(char *var); /* wizard.c */ extern void slice_wizard(Disk *d); /* * Macros. Please find a better place for us! */ -#define DEVICE_INIT(d) ((d) != NULL ? (d)->init((d)) : NULL) +#define DEVICE_INIT(d) ((d) != NULL ? (d)->init((d)) : (Boolean)0) #define DEVICE_GET(d, b, f) ((d) != NULL ? (d)->get((d), (b), (f)) : NULL) #define DEVICE_SHUTDOWN(d) ((d) != NULL ? (d)->shutdown((d)) : (void)0) #ifdef USE_GZIP #define UNZIPPER "gunzip" #else #define UNZIPPER "bunzip2" #endif #endif /* _SYSINSTALL_H_INCLUDE */ diff --git a/usr.sbin/sysinstall/system.c b/usr.sbin/sysinstall/system.c index 906dec206061..65c353a41c9e 100644 --- a/usr.sbin/sysinstall/system.c +++ b/usr.sbin/sysinstall/system.c @@ -1,542 +1,542 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * * $FreeBSD$ * * Jordan Hubbard * * My contributions are in the public domain. * * Parts of this file are also blatently stolen from Poul-Henning Kamp's * previous version of sysinstall, and as such fall under his "BEERWARE license" * so buy him a beer if you like it! Buy him a beer for me, too! * Heck, get him completely drunk and send me pictures! :-) */ #include "sysinstall.h" #include #include #include #include #include #include #include #include #include #include #include /* Where we stick our temporary expanded doc file */ #define DOC_TMP_DIR "/tmp/.doc" #define DOC_TMP_FILE "/tmp/.doc/doc.tmp" static pid_t ehs_pid; /* * Handle interrupt signals - this probably won't work in all cases * due to our having bogotified the internal state of dialog or curses, * but we'll give it a try. */ static int intr_continue(dialogMenuItem *self) { return DITEM_LEAVE_MENU; } static int intr_reboot(dialogMenuItem *self) { systemShutdown(-1); /* NOTREACHED */ return 0; } static int intr_restart(dialogMenuItem *self) { int ret, fd, fdmax; mediaClose(); free_variables(); fdmax = getdtablesize(); for (fd = 3; fd < fdmax; fd++) close(fd); ret = execl(StartName, StartName, "-restart", (char *)NULL); msgDebug("execl failed (%s)\n", strerror(errno)); /* NOTREACHED */ return -1; } static dialogMenuItem intrmenu[] = { { "Abort", "Abort the installation", NULL, intr_reboot }, { "Restart", "Restart the installation program", NULL, intr_restart }, { "Continue", "Continue the installation", NULL, intr_continue }, }; static void handle_intr(int sig) { WINDOW *save = savescr(); use_helpline(NULL); use_helpfile(NULL); if (OnVTY) { ioctl(0, VT_ACTIVATE, 1); /* Switch back */ msgInfo(NULL); } (void)dialog_menu("Installation interrupt", "Do you want to abort the installation?", -1, -1, 3, -3, intrmenu, NULL, NULL, NULL); restorescr(save); } /* * Harvest children if we are init. */ static void reap_children(int sig) { int errbak = errno; while (waitpid(-1, NULL, WNOHANG) > 0) ; errno = errbak; } /* Expand a file into a convenient location, nuking it each time */ static char * expand(char *fname) { char *gunzip = RunningAsInit ? "/stand/gunzip" : "/usr/bin/gunzip"; if (!directory_exists(DOC_TMP_DIR)) { Mkdir(DOC_TMP_DIR); if (chown(DOC_TMP_DIR, 0, 0) < 0) return NULL; if (chmod(DOC_TMP_DIR, S_IRWXU) < 0) return NULL; } else unlink(DOC_TMP_FILE); if (!file_readable(fname) || vsystem("%s < %s > %s", gunzip, fname, DOC_TMP_FILE)) return NULL; return DOC_TMP_FILE; } /* Initialize system defaults */ void systemInitialize(int argc, char **argv) { size_t i; int boothowto; sigset_t signalset; signal(SIGINT, SIG_IGN); globalsInit(); i = sizeof(boothowto); - if (!sysctlbyname("debug.boothowto", &boothowto, &i, NULL, NULL) && + if (!sysctlbyname("debug.boothowto", &boothowto, &i, NULL, 0) && (i == sizeof(boothowto)) && (boothowto & RB_VERBOSE)) variable_set2(VAR_DEBUG, "YES", 0); /* Are we running as init? */ if (getpid() == 1) { struct ufs_args ufs_args; int fd; RunningAsInit = 1; setsid(); close(0); fd = open("/dev/ttyv0", O_RDWR); if (fd == -1) { fd = open("/dev/console", O_RDWR); /* fallback */ variable_set2(VAR_FIXIT_TTY, "serial", 0); /* give fixit a hint */ } else OnVTY = TRUE; /* * To make _sure_ we're on a VTY and don't have /dev/console switched * away to a serial port or something, attempt to set the cursor appearance. */ if (OnVTY) { int fd2, type; type = 0; /* normal */ if ((fd2 = open("/dev/console", O_RDWR)) != -1) { if (ioctl(fd2, CONS_CURSORTYPE, &type) == -1) { OnVTY = FALSE; variable_set2(VAR_FIXIT_TTY, "serial", 0); /* Tell Fixit the console type */ close(fd); close(fd2); open("/dev/console", O_RDWR); } else close(fd2); } } close(1); dup(0); close(2); dup(0); printf("%s running as init on %s\n", argv[0], OnVTY ? "vty0" : "serial console"); ioctl(0, TIOCSCTTY, (char *)NULL); setlogin("root"); setenv("PATH", "/stand:/bin:/sbin:/usr/sbin:/usr/bin:/mnt/bin:/mnt/sbin:/mnt/usr/sbin:/mnt/usr/bin:/usr/X11R6/bin", 1); setbuf(stdin, 0); setbuf(stderr, 0); #ifdef __alpha__ i = 0; sysctlbyname("machdep.unaligned_print", NULL, 0, &i, sizeof(i)); #endif #if 0 signal(SIGCHLD, reap_children); #endif memset(&ufs_args, 0, sizeof(ufs_args)); mount("ufs", "/", MNT_UPDATE, &ufs_args); } else { char hname[256]; /* Initalize various things for a multi-user environment */ if (!gethostname(hname, sizeof hname)) variable_set2(VAR_HOSTNAME, hname, 0); } if (set_termcap() == -1) { printf("Can't find terminal entry\n"); exit(-1); } /* XXX - libdialog has particularly bad return value checking */ init_dialog(); /* If we haven't crashed I guess dialog is running ! */ DialogActive = TRUE; /* Make sure HOME is set for those utilities that need it */ if (!getenv("HOME")) setenv("HOME", "/", 1); signal(SIGINT, handle_intr); /* * Make sure we can be interrupted even if we were re-executed * from an interrupt. */ sigemptyset(&signalset); sigaddset(&signalset, SIGINT); sigprocmask(SIG_UNBLOCK, &signalset, NULL); (void)vsystem("rm -rf %s", DOC_TMP_DIR); } /* Close down and prepare to exit */ void systemShutdown(int status) { /* If some media is open, close it down */ if (status >=0) mediaClose(); /* write out any changes to rc.conf .. */ configRC_conf(); /* Shut down the dialog library */ if (DialogActive) { end_dialog(); DialogActive = FALSE; } /* Shut down curses */ endwin(); /* If we have a temporary doc dir lying around, nuke it */ (void)vsystem("rm -rf %s", DOC_TMP_DIR); /* REALLY exit! */ if (RunningAsInit) { /* Put the console back */ ioctl(0, VT_ACTIVATE, 2); #if defined(__alpha__) || defined(__sparc64__) reboot(RB_HALT); #else reboot(0); #endif } else exit(status); } /* Run some general command */ int systemExecute(char *command) { int status; struct termios foo; WINDOW *w = savescr(); dialog_clear(); dialog_update(); end_dialog(); DialogActive = FALSE; if (tcgetattr(0, &foo) != -1) { foo.c_cc[VERASE] = '\010'; tcsetattr(0, TCSANOW, &foo); } if (!Fake) status = system(command); else { status = 0; msgDebug("systemExecute: Faked execution of `%s'\n", command); } DialogActive = TRUE; restorescr(w); return status; } /* suspend/resume libdialog/curses screen */ static WINDOW *oldW; void systemSuspendDialog(void) { oldW = savescr(); dialog_clear(); dialog_update(); end_dialog(); DialogActive = FALSE; } void systemResumeDialog(void) { DialogActive = TRUE; restorescr(oldW); } /* Display a help file in a filebox */ int systemDisplayHelp(char *file) { char *fname = NULL; char buf[FILENAME_MAX]; int ret = 0; WINDOW *w = savescr(); fname = systemHelpFile(file, buf); if (!fname) { snprintf(buf, FILENAME_MAX, "The %s file is not provided on this particular floppy image.", file); use_helpfile(NULL); use_helpline(NULL); dialog_mesgbox("Sorry!", buf, -1, -1); ret = 1; } else { use_helpfile(NULL); use_helpline(NULL); dialog_textbox(file, fname, LINES, COLS); } restorescr(w); return ret; } char * systemHelpFile(char *file, char *buf) { if (!file) return NULL; if (file[0] == '/') return file; snprintf(buf, FILENAME_MAX, "/stand/help/%s.hlp.gz", file); if (file_readable(buf)) return expand(buf); snprintf(buf, FILENAME_MAX, "/stand/help/%s.hlp", file); if (file_readable(buf)) return expand(buf); snprintf(buf, FILENAME_MAX, "/stand/help/%s.TXT.gz", file); if (file_readable(buf)) return expand(buf); snprintf(buf, FILENAME_MAX, "/stand/help/%s.TXT", file); if (file_readable(buf)) return expand(buf); snprintf(buf, FILENAME_MAX, "/usr/src/usr.sbin/sysinstall/help/%s.hlp", file); if (file_readable(buf)) return buf; snprintf(buf, FILENAME_MAX, "/usr/src/usr.sbin/sysinstall/help/%s.TXT", file); if (file_readable(buf)) return buf; return NULL; } void systemChangeTerminal(char *color, const u_char c_term[], char *mono, const u_char m_term[]) { if (OnVTY) { int setupterm(char *color, int, int *); if (ColorDisplay) { setenv("TERM", color, 1); setenv("TERMCAP", c_term, 1); reset_shell_mode(); setterm(color); cbreak(); noecho(); } else { setenv("TERM", mono, 1); setenv("TERMCAP", m_term, 1); reset_shell_mode(); setterm(mono); cbreak(); noecho(); } } clear(); refresh(); dialog_clear(); } int vsystem(char *fmt, ...) { va_list args; int pstat; pid_t pid; int omask; sig_t intsave, quitsave; char *cmd; int i; cmd = (char *)alloca(FILENAME_MAX); cmd[0] = '\0'; va_start(args, fmt); vsnprintf(cmd, FILENAME_MAX, fmt, args); va_end(args); omask = sigblock(sigmask(SIGCHLD)); if (Fake) { msgDebug("vsystem: Faked execution of `%s'\n", cmd); return 0; } if (isDebug()) msgDebug("Executing command `%s'\n", cmd); pid = fork(); if (pid == -1) { (void)sigsetmask(omask); i = 127; } else if (!pid) { /* Junior */ (void)sigsetmask(omask); if (DebugFD != -1) { dup2(DebugFD, 0); dup2(DebugFD, 1); dup2(DebugFD, 2); } else { close(1); open("/dev/null", O_WRONLY); dup2(1, 2); } if (!RunningAsInit) execl("/bin/sh", "/bin/sh", "-c", cmd, (char *)NULL); else execl("/stand/sh", "/stand/sh", "-c", cmd, (char *)NULL); exit(1); } else { intsave = signal(SIGINT, SIG_IGN); quitsave = signal(SIGQUIT, SIG_IGN); pid = waitpid(pid, &pstat, 0); (void)sigsetmask(omask); (void)signal(SIGINT, intsave); (void)signal(SIGQUIT, quitsave); i = (pid == -1) ? -1 : WEXITSTATUS(pstat); if (isDebug()) msgDebug("Command `%s' returns status of %d\n", cmd, i); } return i; } void systemCreateHoloshell(void) { int waitstatus; if ((FixItMode || OnVTY) && RunningAsInit) { if (ehs_pid != 0) { int pstat; if (kill(ehs_pid, 0) == 0) { if (msgNoYes("There seems to be an emergency holographic shell\n" "already running on VTY 4.\n\n" "Kill it and start a new one?")) return; /* try cleaning up as much as possible */ (void) kill(ehs_pid, SIGHUP); sleep(1); (void) kill(ehs_pid, SIGKILL); } /* avoid too many zombies */ (void) waitpid(ehs_pid, &pstat, WNOHANG); } if (strcmp(variable_get(VAR_FIXIT_TTY), "serial") == 0) systemSuspendDialog(); /* must be before the fork() */ if ((ehs_pid = fork()) == 0) { int i, fd; struct termios foo; extern int login_tty(int); ioctl(0, TIOCNOTTY, NULL); for (i = getdtablesize(); i >= 0; --i) close(i); if (strcmp(variable_get(VAR_FIXIT_TTY), "serial") == 0) fd = open("/dev/console", O_RDWR); else fd = open("/dev/ttyv3", O_RDWR); ioctl(0, TIOCSCTTY, &fd); dup2(0, 1); dup2(0, 2); DebugFD = 2; if (login_tty(fd) == -1) msgDebug("Doctor: I can't set the controlling terminal.\n"); signal(SIGTTOU, SIG_IGN); if (tcgetattr(fd, &foo) != -1) { foo.c_cc[VERASE] = '\010'; if (tcsetattr(fd, TCSANOW, &foo) == -1) msgDebug("Doctor: I'm unable to set the erase character.\n"); } else msgDebug("Doctor: I'm unable to get the terminal attributes!\n"); if (strcmp(variable_get(VAR_FIXIT_TTY), "serial") == 0) { printf("Type ``exit'' in this fixit shell to resume sysinstall.\n\n"); fflush(stdout); } execlp("sh", "-sh", 0); msgDebug("Was unable to execute sh for Holographic shell!\n"); exit(1); } else { if (strcmp(variable_get(VAR_FIXIT_TTY), "standard") == 0) { WINDOW *w = savescr(); msgNotify("Starting an emergency holographic shell on VTY4"); sleep(2); restorescr(w); } else { (void)waitpid(ehs_pid, &waitstatus, 0); /* we only wait for shell to finish it serial mode since there is no virtual console */ systemResumeDialog(); } } } } diff --git a/usr.sbin/sysinstall/tcpip.c b/usr.sbin/sysinstall/tcpip.c index 2f9dc8da85c6..db1539d0e376 100644 --- a/usr.sbin/sysinstall/tcpip.c +++ b/usr.sbin/sysinstall/tcpip.c @@ -1,695 +1,695 @@ /* * $FreeBSD$ * * Copyright (c) 1995 * Gary J Palmer. All rights reserved. * Copyright (c) 1996 * Jordan K. 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 THE AUTHORS ``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 THE AUTHORS 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. * */ /* * All kinds of hacking also performed by jkh on this code. Don't * blame Gary for every bogosity you see here.. :-) * * -jkh */ #include "sysinstall.h" #include #include #include #include #include /* The help file for the TCP/IP setup screen */ #define TCP_HELPFILE "tcp" /* These are nasty, but they make the layout structure a lot easier ... */ static char hostname[HOSTNAME_FIELD_LEN], domainname[HOSTNAME_FIELD_LEN], gateway[IPADDR_FIELD_LEN], nameserver[INET6_ADDRSTRLEN]; static int okbutton, cancelbutton; static char ipaddr[IPADDR_FIELD_LEN], netmask[IPADDR_FIELD_LEN], extras[EXTRAS_FIELD_LEN]; static char ipv6addr[INET6_ADDRSTRLEN]; /* What the screen size is meant to be */ #define TCP_DIALOG_Y 0 #define TCP_DIALOG_X 8 #define TCP_DIALOG_WIDTH COLS - 16 #define TCP_DIALOG_HEIGHT LINES - 2 static Layout layout[] = { #define LAYOUT_HOSTNAME 0 { 1, 2, 25, HOSTNAME_FIELD_LEN - 1, "Host:", "Your fully-qualified hostname, e.g. foo.bar.com", hostname, STRINGOBJ, NULL }, #define LAYOUT_DOMAINNAME 1 { 1, 35, 20, HOSTNAME_FIELD_LEN - 1, "Domain:", "The name of the domain that your machine is in, e.g. bar.com", domainname, STRINGOBJ, NULL }, #define LAYOUT_GATEWAY 2 { 5, 2, 18, IPADDR_FIELD_LEN - 1, "IPv4 Gateway:", "IPv4 address of host forwarding packets to non-local destinations", gateway, STRINGOBJ, NULL }, #define LAYOUT_NAMESERVER 3 { 5, 35, 18, INET6_ADDRSTRLEN - 1, "Name server:", "IPv4 or IPv6 address of your local DNS server", nameserver, STRINGOBJ, NULL }, #define LAYOUT_IPADDR 4 { 10, 10, 18, IPADDR_FIELD_LEN - 1, "IPv4 Address:", "The IPv4 address to be used for this interface", ipaddr, STRINGOBJ, NULL }, #define LAYOUT_NETMASK 5 { 10, 35, 18, IPADDR_FIELD_LEN - 1, "Netmask:", "The netmask for this interface, e.g. 0xffffff00 for a class C network", netmask, STRINGOBJ, NULL }, #define LAYOUT_EXTRAS 6 { 14, 10, 37, HOSTNAME_FIELD_LEN - 1, "Extra options to ifconfig (usually empty):", "Any interface-specific options to ifconfig you would like to add", extras, STRINGOBJ, NULL }, #define LAYOUT_OKBUTTON 7 { 19, 15, 0, 0, "OK", "Select this if you are happy with these settings", &okbutton, BUTTONOBJ, NULL }, #define LAYOUT_CANCELBUTTON 8 { 19, 35, 0, 0, "CANCEL", "Select this if you wish to cancel this screen", &cancelbutton, BUTTONOBJ, NULL }, - { NULL }, + { 0 }, }; #define _validByte(b) ((b) >= 0 && (b) <= 255) /* whine */ static void feepout(char *msg) { beep(); msgConfirm("%s", msg); } /* Verify IP address integrity */ static int verifyIP(char *ip, unsigned long *mask, unsigned long *out) { long a, b, c, d; char *endptr; unsigned long parsedip; unsigned long max_addr = (255 << 24) | (255 << 16) | (255 << 8) | 255; if (ip == NULL) return 0; a = strtol(ip, &endptr, 10); if (*endptr++ != '.') return 0; b = strtol(endptr, &endptr, 10); if (*endptr++ != '.') return 0; c = strtol(endptr, &endptr, 10); if (*endptr++ != '.') return 0; d = strtol(endptr, &endptr, 10); if (*endptr != '\0') return 0; if (!_validByte(a) || !_validByte(b) || !_validByte(c) || !_validByte(d)) return 0; parsedip = (a << 24) | (b << 16) | (c << 8) | d; if (out) *out = parsedip; /* * The ip address must not be network or broadcast address. */ if (mask && ((parsedip == (parsedip & *mask)) || (parsedip == ((parsedip & *mask) + max_addr - *mask)))) return 0; return 1; } static int verifyIP6(char *ip) { struct addrinfo hints, *res; memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_INET6; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST; if (getaddrinfo(ip, NULL, &hints, &res) == 0) { freeaddrinfo(res); return 1; } return 0; } /* Verify IPv4 netmask as being well-formed as a 0x or AAA.BBB.CCC.DDD mask */ static int verifyNetmask(const char *netmask, unsigned long *out) { unsigned long mask; unsigned long tmp; char *endptr; if (netmask[0] == '0' && (netmask[1] == 'x' || netmask[1] == 'X')) { /* Parse out hex mask */ mask = strtoul(netmask, &endptr, 0); if (*endptr != '\0') return 0; } else { /* Parse out quad decimal mask */ mask = strtoul(netmask, &endptr, 10); if (!_validByte(mask) || *endptr++ != '.') return 0; tmp = strtoul(endptr, &endptr, 10); if (!_validByte(tmp) || *endptr++ != '.') return 0; mask = (mask << 8) + tmp; tmp = strtoul(endptr, &endptr, 10); if (!_validByte(tmp) || *endptr++ != '.') return 0; mask = (mask << 8) + tmp; tmp = strtoul(endptr, &endptr, 10); if (!_validByte(tmp) || *endptr++ != '\0') return 0; mask = (mask << 8) + tmp; } /* Verify that we have a continous netmask */ if ((((-mask & mask) - 1) | mask) != 0xffffffff) return 0; if (out) *out = mask; return 1; } static int verifyGW(char *gw, unsigned long *ip, unsigned long *mask) { unsigned long parsedgw; if (!verifyIP(gw, mask, &parsedgw)) return 0; /* Gateway needs to be within the set of IPs reachable through the interface */ if (ip && mask && ((parsedgw & *mask) != (*ip & *mask))) return 0; return 1; } /* Check for the settings on the screen - the per-interface stuff is moved to the main handling code now to do it on the fly - sigh */ static int verifySettings(void) { unsigned long parsedip; unsigned long parsednetmask; if (!hostname[0]) feepout("Must specify a host name of some sort!"); else if (netmask[0] && !verifyNetmask(netmask, &parsednetmask)) feepout("Invalid netmask value"); else if (nameserver[0] && !verifyIP(nameserver, NULL, NULL) && !verifyIP6(nameserver)) feepout("Invalid name server IP address specified"); else if (ipaddr[0] && !verifyIP(ipaddr, &parsednetmask, &parsedip)) feepout("Invalid IPv4 address"); else if (gateway[0] && strcmp(gateway, "NO") && !verifyGW(gateway, ipaddr[0] ? &parsedip : NULL, netmask[0] ? &parsednetmask : NULL)) feepout("Invalid gateway IPv4 address specified"); else return 1; return 0; } static void dhcpGetInfo(Device *devp) { /* If it fails, do it the old-fashioned way */ if (dhcpParseLeases("/var/db/dhclient.leases", hostname, domainname, nameserver, ipaddr, gateway, netmask) == -1) { FILE *ifp; char *cp, cmd[256], data[2048]; int i, j; /* Bah, now we have to kludge getting the information from ifconfig */ snprintf(cmd, sizeof cmd, "ifconfig %s", devp->name); ifp = popen(cmd, "r"); if (ifp) { j = fread(data, 1, sizeof(data), ifp); fclose(ifp); if (j < 0) /* paranoia */ j = 0; data[j] = '\0'; if (isDebug()) msgDebug("DHCP configured interface returns %s\n", data); /* XXX This is gross as it assumes a certain ordering to ifconfig's output! XXX */ if ((cp = strstr(data, "inet ")) != NULL) { i = 0; cp += 5; /* move over keyword */ while (*cp != ' ') ipaddr[i++] = *(cp++); ipaddr[i] = '\0'; if (!strncmp(++cp, "netmask", 7)) { i = 0; cp += 8; while (*cp != ' ') netmask[i++] = *(cp++); netmask[i] = '\0'; } } } } /* If we didn't get a name server value, hunt for it in resolv.conf */ if (!nameserver[0] && file_readable("/etc/resolv.conf")) configEnvironmentResolv("/etc/resolv.conf"); if (hostname[0]) variable_set2(VAR_HOSTNAME, hostname, 0); } static void rtsolGetInfo(Device *devp) { FILE *ifp; char *cp, cmd[256], data[2048]; int i; snprintf(cmd, sizeof cmd, "ifconfig %s", devp->name); if ((ifp = popen(cmd, "r")) == NULL) return; while (fgets(data, sizeof(data), ifp) != NULL) { if (isDebug()) msgDebug("RTSOL configured interface returns %s\n", data); if ((cp = strstr(data, "inet6 ")) != NULL) { cp += 6; /* move over keyword */ if (strncmp(cp, "fe80:", 5)) { i = 0; while (*cp != ' ') ipv6addr[i++] = *(cp++); ipv6addr[i] = '\0'; } } } fclose(ifp); } /* This is it - how to get TCP setup values */ int tcpOpenDialog(Device *devp) { WINDOW *ds_win, *save = NULL; ComposeObj *obj = NULL; int n = 0, filled = 0, cancel = FALSE; int max, ret = DITEM_SUCCESS; int use_dhcp = FALSE; int use_rtsol = FALSE; char *tmp; char title[80]; save = savescr(); /* Initialise vars from previous device values */ if (devp->private) { DevInfo *di = (DevInfo *)devp->private; SAFE_STRCPY(ipaddr, di->ipaddr); SAFE_STRCPY(netmask, di->netmask); SAFE_STRCPY(extras, di->extras); use_dhcp = di->use_dhcp; use_rtsol = di->use_rtsol; } else { /* See if there are any defaults */ char *cp; char *old_interactive = NULL; /* * This is a hack so that the dialogs below are interactive in a * script if we have requested interactive behavior. */ if (variable_get(VAR_NONINTERACTIVE) && variable_get(VAR_NETINTERACTIVE)) { old_interactive = strdup(VAR_NONINTERACTIVE); variable_unset(VAR_NONINTERACTIVE); } /* * Try a RTSOL scan if such behavior is desired. * If the variable was configured and is YES, do it. * If it was configured to anything else, treat it as NO. * Otherwise, ask the question interactively. */ if (!variable_get(VAR_NO_INET6) && (!variable_cmp(VAR_TRY_RTSOL, "YES") || (variable_get(VAR_TRY_RTSOL)==0 && !msgNoYes("Do you want to try IPv6 configuration of the interface?")))) { int i; size_t len; i = 0; sysctlbyname("net.inet6.ip6.forwarding", NULL, 0, &i, sizeof(i)); i = 1; sysctlbyname("net.inet6.ip6.accept_rtadv", NULL, 0, &i, sizeof(i)); vsystem("ifconfig %s up", devp->name); len = sizeof(i); sysctlbyname("net.inet6.ip6.dad_count", &i, &len, NULL, 0); sleep(i + 1); Mkdir("/var/run"); msgNotify("Scanning for RA servers..."); if (0 == vsystem("rtsol %s", devp->name)) { len = sizeof(i); sysctlbyname("net.inet6.ip6.dad_count", &i, &len, NULL, 0); sleep(i + 1); rtsolGetInfo(devp); use_rtsol = TRUE; } else use_rtsol = FALSE; } /* * First try a DHCP scan if such behavior is desired. * If the variable was configured and is YES, do it. * If it was configured to anything else, treat it as NO. * Otherwise, ask the question interactively. */ if (!variable_cmp(VAR_TRY_DHCP, "YES") || (variable_get(VAR_TRY_DHCP)==0 && !msgNoYes("Do you want to try DHCP configuration of the interface?"))) { Mkdir("/var/db"); Mkdir("/var/run"); Mkdir("/tmp"); msgNotify("Scanning for DHCP servers..."); vsystem("dhclient -r %s", devp->name); if (0 == vsystem("dhclient -1 %s", devp->name)) { dhcpGetInfo(devp); use_dhcp = TRUE; } else use_dhcp = FALSE; } /* Restore old VAR_NONINTERACTIVE if needed. */ if (old_interactive != NULL) { variable_set2(VAR_NONINTERACTIVE, old_interactive, 0); free(old_interactive); } /* Special hack so it doesn't show up oddly in the tcpip setup menu */ if (!strcmp(gateway, "NO")) gateway[0] = '\0'; /* Get old IP address from variable space, if available */ if (!ipaddr[0]) { if ((cp = variable_get(VAR_IPADDR)) != NULL) SAFE_STRCPY(ipaddr, cp); else if ((cp = variable_get(string_concat3(devp->name, "_", VAR_IPADDR))) != NULL) SAFE_STRCPY(ipaddr, cp); } /* Get old netmask from variable space, if available */ if (!netmask[0]) { if ((cp = variable_get(VAR_NETMASK)) != NULL) SAFE_STRCPY(netmask, cp); else if ((cp = variable_get(string_concat3(devp->name, "_", VAR_NETMASK))) != NULL) SAFE_STRCPY(netmask, cp); } /* Get old extras string from variable space, if available */ if (!extras[0]) { if ((cp = variable_get(VAR_EXTRAS)) != NULL) SAFE_STRCPY(extras, cp); else if ((cp = variable_get(string_concat3(devp->name, "_", VAR_EXTRAS))) != NULL) SAFE_STRCPY(extras, cp); } } /* Look up values already recorded with the system, or blank the string variables ready to accept some new data */ if (!hostname[0]) { tmp = variable_get(VAR_HOSTNAME); if (tmp) SAFE_STRCPY(hostname, tmp); } if (!domainname[0]) { tmp = variable_get(VAR_DOMAINNAME); if (tmp) SAFE_STRCPY(domainname, tmp); } if (!gateway[0]) { tmp = variable_get(VAR_GATEWAY); if (tmp && strcmp(tmp, "NO")) SAFE_STRCPY(gateway, tmp); } if (!nameserver[0]) { tmp = variable_get(VAR_NAMESERVER); if (tmp) SAFE_STRCPY(nameserver, tmp); } /* If non-interactive, jump straight over the dialog crap and into config section */ if (variable_get(VAR_NONINTERACTIVE) && !variable_get(VAR_NETINTERACTIVE)) { if (!hostname[0]) msgConfirm("WARNING: hostname variable not set and is a non-optional\n" "parameter. Please add this to your installation script\n" "or set the netInteractive variable (see sysinstall man page)"); else goto netconfig; } /* Now do all the screen I/O */ dialog_clear_norefresh(); /* Modify the help line for PLIP config */ if (!strncmp(devp->name, "lp", 2)) layout[LAYOUT_EXTRAS].help = "For PLIP configuration, you must enter the peer's IP address here."; /* We need a curses window */ tmp = " Network Configuration "; if (ipv6addr[0]) tmp = string_concat(tmp, "(IPv6 ready) "); if (!(ds_win = openLayoutDialog(TCP_HELPFILE, tmp, TCP_DIALOG_X, TCP_DIALOG_Y, TCP_DIALOG_WIDTH, TCP_DIALOG_HEIGHT))) { beep(); msgConfirm("Cannot open TCP/IP dialog window!!"); restorescr(save); return DITEM_FAILURE; } /* Draw interface configuration box */ draw_box(ds_win, TCP_DIALOG_Y + 9, TCP_DIALOG_X + 8, TCP_DIALOG_HEIGHT - 13, TCP_DIALOG_WIDTH - 17, dialog_attr, border_attr); wattrset(ds_win, dialog_attr); sprintf(title, " Configuration for Interface %s ", devp->name); mvwaddstr(ds_win, TCP_DIALOG_Y + 9, TCP_DIALOG_X + 14, title); /* Some more initialisation before we go into the main input loop */ obj = initLayoutDialog(ds_win, layout, TCP_DIALOG_X, TCP_DIALOG_Y, &max); reenter: cancelbutton = okbutton = 0; while (layoutDialogLoop(ds_win, layout, &obj, &n, max, &cancelbutton, &cancel)) { /* Prevent this from being irritating if user really means NO */ if (filled < 3) { /* Insert a default value for the netmask, 0xffffff00 is * the most appropriate one (entire class C, or subnetted * class A/B network). */ if (!netmask[0]) { strcpy(netmask, "255.255.255.0"); RefreshStringObj(layout[LAYOUT_NETMASK].obj); ++filled; } if (!index(hostname, '.') && domainname[0]) { strcat(hostname, "."); strcat(hostname, domainname); RefreshStringObj(layout[LAYOUT_HOSTNAME].obj); ++filled; } else if (((tmp = index(hostname, '.')) != NULL) && !domainname[0]) { SAFE_STRCPY(domainname, tmp + 1); RefreshStringObj(layout[LAYOUT_DOMAINNAME].obj); ++filled; } } } if (!cancel && !verifySettings()) goto reenter; /* Clear this crap off the screen */ delwin(ds_win); dialog_clear_norefresh(); use_helpfile(NULL); /* We actually need to inform the rest of sysinstall about this data now if the user hasn't selected cancel. Save the stuff out to the environment via the variable_set() mechanism */ netconfig: if (!cancel) { DevInfo *di; char temp[512], ifn[255]; char *pccard; int ipv4_enable = FALSE; if (hostname[0]) { variable_set2(VAR_HOSTNAME, hostname, 1); sethostname(hostname, strlen(hostname)); } if (domainname[0]) variable_set2(VAR_DOMAINNAME, domainname, 0); if (gateway[0]) variable_set2(VAR_GATEWAY, gateway, use_dhcp ? 0 : 1); if (nameserver[0]) variable_set2(VAR_NAMESERVER, nameserver, 0); if (ipaddr[0]) variable_set2(VAR_IPADDR, ipaddr, 0); if (ipv6addr[0]) variable_set2(VAR_IPV6ADDR, ipv6addr, 0); if (!devp->private) devp->private = (DevInfo *)safe_malloc(sizeof(DevInfo)); di = devp->private; SAFE_STRCPY(di->ipaddr, ipaddr); SAFE_STRCPY(di->netmask, netmask); SAFE_STRCPY(di->extras, extras); di->use_dhcp = use_dhcp; di->use_rtsol = use_rtsol; if (use_dhcp || ipaddr[0]) ipv4_enable = TRUE; if (ipv4_enable) { sprintf(ifn, "%s%s", VAR_IFCONFIG, devp->name); if (use_dhcp) sprintf(temp, "DHCP"); else sprintf(temp, "inet %s %s netmask %s", ipaddr, extras, netmask); variable_set2(ifn, temp, 1); } #ifdef PCCARD_ARCH pccard = variable_get("_pccard_install"); if (pccard && strcmp(pccard, "YES") == 0 && ipv4_enable) { variable_set2("pccard_ifconfig", temp, 1); } #endif if (use_rtsol) variable_set2(VAR_IPV6_ENABLE, "YES", 1); if (!use_dhcp) configResolv(NULL); /* XXX this will do it on the MFS copy XXX */ ret = DITEM_SUCCESS; } else ret = DITEM_FAILURE; restorescr(save); return ret; } static Device *NetDev; static int netHook(dialogMenuItem *self) { Device **devs; devs = deviceFindDescr(self->prompt, self->title, DEVICE_TYPE_NETWORK); if (devs) { if (DITEM_STATUS(tcpOpenDialog(devs[0])) != DITEM_FAILURE) NetDev = devs[0]; else NetDev = NULL; } return devs ? DITEM_LEAVE_MENU : DITEM_FAILURE; } /* Get a network device */ Device * tcpDeviceSelect(void) { DMenu *menu; Device **devs, *rval; int cnt; devs = deviceFind(variable_get(VAR_NETWORK_DEVICE), DEVICE_TYPE_NETWORK); cnt = deviceCount(devs); rval = NULL; if (!cnt) { msgConfirm("No network devices available!"); return NULL; } else if ((!RunningAsInit) && (variable_check("NETWORK_CONFIGURED=NO") != TRUE)) { if (!msgYesNo("Running multi-user, assume that the network is already configured?")) return devs[0]; } if (cnt == 1) { if (DITEM_STATUS(tcpOpenDialog(devs[0]) == DITEM_SUCCESS)) rval = devs[0]; } else if (variable_get(VAR_NONINTERACTIVE) && variable_get(VAR_NETWORK_DEVICE)) { devs = deviceFind(variable_get(VAR_NETWORK_DEVICE), DEVICE_TYPE_NETWORK); cnt = deviceCount(devs); if (cnt) { if (DITEM_STATUS(tcpOpenDialog(devs[0]) == DITEM_SUCCESS)) rval = devs[0]; } } else { int status; menu = deviceCreateMenu(&MenuNetworkDevice, DEVICE_TYPE_NETWORK, netHook, NULL); if (!menu) msgFatal("Unable to create network device menu! Argh!"); status = dmenuOpenSimple(menu, FALSE); free(menu); if (status) rval = NetDev; } return rval; } /* Do it from a menu that doesn't care about status */ int tcpMenuSelect(dialogMenuItem *self) { Device *tmp; WINDOW *save; variable_set("NETWORK_CONFIGURED=NO",0); tmp = tcpDeviceSelect(); variable_unset("NETWORK_CONFIGURED"); save = savescr(); if (tmp && tmp->private && !((DevInfo *)tmp->private)->use_dhcp && !msgYesNo("Would you like to bring the %s interface up right now?", tmp->name)) if (!DEVICE_INIT(tmp)) msgConfirm("Initialization of %s device failed.", tmp->name); restorescr(save); return DITEM_SUCCESS; } diff --git a/usr.sbin/sysinstall/user.c b/usr.sbin/sysinstall/user.c index 1b0b845ae9e8..ecee440fe788 100644 --- a/usr.sbin/sysinstall/user.c +++ b/usr.sbin/sysinstall/user.c @@ -1,742 +1,742 @@ /* * $FreeBSD$ * * Copyright (c) 1996 * Jörg Wunsch. All rights reserved. * * The basic structure has been taken from tcpip.c, which is: * * Copyright (c) 1995 * Gary J Palmer. All rights reserved. * Jordan K 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 THE AUTHORS ``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 THE AUTHORS 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 /* The help file for the user mgmt screen */ #define USER_HELPFILE "usermgmt" /* XXX should they be moved out to sysinstall.h? */ #define GNAME_FIELD_LEN 32 #define GID_FIELD_LEN 10 #define GMEMB_FIELD_LEN 64 #define UID_FIELD_LEN 10 #define UGROUP_FIELD_LEN GNAME_FIELD_LEN #define GECOS_FIELD_LEN 64 #define UMEMB_FIELD_LEN GMEMB_FIELD_LEN #define HOMEDIR_FIELD_LEN 48 #define SHELL_FIELD_LEN 48 #define PASSWD_FIELD_LEN 32 /* These are nasty, but they make the layout structure a lot easier ... */ static char gname[GNAME_FIELD_LEN], gid[GID_FIELD_LEN], gmemb[GMEMB_FIELD_LEN], uname[UT_NAMESIZE + 1], passwd[PASSWD_FIELD_LEN], uid[UID_FIELD_LEN], ugroup[UGROUP_FIELD_LEN], gecos[GECOS_FIELD_LEN], umemb[UMEMB_FIELD_LEN], homedir[HOMEDIR_FIELD_LEN], shell[SHELL_FIELD_LEN]; #define CLEAR(v) memset(v, 0, sizeof v) static int okbutton, cancelbutton; /* What the screen size is meant to be */ #define USER_DIALOG_Y 0 #define USER_DIALOG_X 8 #define USER_DIALOG_WIDTH COLS - 16 #define USER_DIALOG_HEIGHT LINES - 2 /* The group configuration menu. */ static Layout groupLayout[] = { #define LAYOUT_GNAME 0 { 4, 10, 20, GNAME_FIELD_LEN - 1, "Group name:", "The alphanumeric name of the new group (mandatory)", gname, STRINGOBJ, NULL }, #define LAYOUT_GID 1 { 4, 38, 10, GID_FIELD_LEN - 1, "GID:", "The numerical ID for this group (leave blank for automatic choice)", gid, STRINGOBJ, NULL }, #define LAYOUT_GMEMB 2 { 11, 10, 40, GMEMB_FIELD_LEN - 1, "Group members:", "Who belongs to this group (i.e., gets access rights for it)", gmemb, STRINGOBJ, NULL }, #define LAYOUT_OKBUTTON 3 { 18, 15, 0, 0, "OK", "Select this if you are happy with these settings", &okbutton, BUTTONOBJ, NULL }, #define LAYOUT_CANCELBUTTON 4 { 18, 35, 0, 0, "CANCEL", "Select this if you wish to cancel this screen", &cancelbutton, BUTTONOBJ, NULL }, - { NULL }, + { 0 }, }; /* The user configuration menu. */ static Layout userLayout[] = { #define LAYOUT_UNAME 0 { 3, 6, UT_NAMESIZE, UT_NAMESIZE + 1, "Login ID:", "The login name of the new user (mandatory)", uname, STRINGOBJ, NULL }, #define LAYOUT_UID 1 { 3, 23, 8, UID_FIELD_LEN - 1, "UID:", "The numerical ID for this user (leave blank for automatic choice)", uid, STRINGOBJ, NULL }, #define LAYOUT_UGROUP 2 { 3, 33, 8, UGROUP_FIELD_LEN - 1, "Group:", "The login group name for this user (leave blank for automatic choice)", ugroup, STRINGOBJ, NULL }, #define LAYOUT_PASSWD 3 { 3, 43, 15, PASSWD_FIELD_LEN - 1, "Password:", "The password for this user (enter this field with care!)", passwd, NO_ECHO_OBJ(STRINGOBJ), NULL }, #define LAYOUT_GECOS 4 { 8, 6, 33, GECOS_FIELD_LEN - 1, "Full name:", "The user's full name (comment)", gecos, STRINGOBJ, NULL }, #define LAYOUT_UMEMB 5 { 8, 43, 15, UMEMB_FIELD_LEN - 1, "Member groups:", "The groups this user belongs to (i.e. gets access rights for)", umemb, STRINGOBJ, NULL }, #define LAYOUT_HOMEDIR 6 { 13, 6, 20, HOMEDIR_FIELD_LEN - 1, "Home directory:", "The user's home directory (leave blank for default)", homedir, STRINGOBJ, NULL }, #define LAYOUT_SHELL 7 { 13, 29, 29, SHELL_FIELD_LEN - 1, "Login shell:", "The user's login shell (leave blank for default)", shell, STRINGOBJ, NULL }, #define LAYOUT_U_OKBUTTON 8 { 18, 15, 0, 0, "OK", "Select this if you are happy with these settings", &okbutton, BUTTONOBJ, NULL }, #define LAYOUT_U_CANCELBUTTON 9 { 18, 35, 0, 0, "CANCEL", "Select this if you wish to cancel this screen", &cancelbutton, BUTTONOBJ, NULL }, - { NULL }, + { 0 }, }; /* whine */ static void feepout(char *msg) { beep(); dialog_notify(msg); } /* Check for the settings on the screen. */ static int verifyGroupSettings(void) { char tmp[256], *cp; long lgid; if (strlen(gname) == 0) { feepout("The group name field must not be empty!"); return 0; } snprintf(tmp, 256, "pw group show -q -n %s > /dev/null", gname); if (vsystem("%s", tmp) == 0) { feepout("This group name is already in use."); return 0; } if (strlen(gid) > 0) { lgid = strtol(gid, &cp, 10); if (lgid < 0 || lgid >= 65536 || (*cp != '\0' && !isspace(*cp))) { feepout("The GID must be a number between 1 and 65535."); return 0; } } if (strlen(gmemb) > 0) { if (strpbrk(gmemb, " \t") != NULL) { feepout("The group member list must not contain any whitespace;\n" "use commas to separate the names."); return 0; } #ifndef notyet /* XXX */ feepout("Sorry, the group member list feature\n" "is currently not yet implemented."); return 0; #endif } return 1; } /* * Ask pw(8) to fill in the blanks for us. * Works solely on the global variables. */ static void completeGroup(void) { int pfd[2], i; char tmp[256], *cp; ssize_t l; size_t amnt; pid_t pid; char *vec[4] = { "pw", "group", "next", 0 }; pipe (pfd); if ((pid = fork()) == 0) { /* The kiddy. */ dup2(pfd[1], 1); dup2(pfd[1], 2); for (i = getdtablesize(); i > 2; i--) close(i); execv("/usr/sbin/pw", vec); msgDebug("Cannot execv() /usr/sbin/pw.\n"); _exit(99); } else { /* The oldie. */ close(pfd[1]); amnt = sizeof tmp; i = 0; while((l = read(pfd[0], &tmp[i], amnt)) > 0) { amnt -= l; i += l; if (amnt == 0) { close(pfd[0]); break; } } close(pfd[0]); tmp[i] = '\0'; waitpid(pid, &i, 0); if (WIFSIGNALED(i) || WEXITSTATUS(i) != 0) /* ignore by now */ return; if ((cp = strchr(tmp, '\n')) != NULL) *cp = '\0'; strncpy(gid, tmp, sizeof gid); } } static void addGroup(WINDOW *ds_win) { char tmp[256]; int pfd[2], i; ssize_t l; size_t amnt; pid_t pid; char *vec[8] = { "pw", "group", "add", "-n", 0, "-g", 0, 0 }; #define VEC_GNAME 4 #define VEC_GID 6 msgNotify("Adding group \"%s\"...", gname); pipe (pfd); if ((pid = fork()) == 0) { /* The kiddy. */ dup2(pfd[1], 1); dup2(pfd[1], 2); for (i = getdtablesize(); i > 2; i--) close(i); vec[VEC_GNAME] = gname; if (strlen(gid) > 0) vec[VEC_GID] = gid; else vec[VEC_GID - 1] = 0; execv("/usr/sbin/pw", vec); msgDebug("Cannot execv() /usr/sbin/pw.\n"); _exit(99); } else { /* The oldie. */ close(pfd[1]); amnt = sizeof tmp; i = 0; while((l = read(pfd[0], &tmp[i], amnt)) > 0) { amnt -= l; i += l; if (amnt == 0) { close(pfd[0]); break; } } close(pfd[0]); tmp[i] = '\0'; waitpid(pid, &i, 0); if (WIFSIGNALED(i)) msgDebug("pw(8) exited with signal %d.\n", WTERMSIG(i)); else if(WEXITSTATUS(i)) { i = 0; if(strncmp(tmp, "pw: ", 4) == 0) i = 4; tmp[sizeof tmp - 1] = '\0'; /* sanity */ msgConfirm("The `pw' command exited with an error status.\n" "Its error message was:\n\n%s", &tmp[i]); } } #undef VEC_GNAME #undef VEC_GID } int userAddGroup(dialogMenuItem *self) { WINDOW *ds_win, *save; ComposeObj *obj = NULL; int n = 0, cancel = FALSE, ret; int max, firsttime = TRUE; if (RunningAsInit && !strstr(variable_get(SYSTEM_STATE), "install")) { msgConfirm("This option may only be used after the system is installed, sorry!"); return DITEM_FAILURE; } save = savescr(); dialog_clear_norefresh(); /* We need a curses window */ if (!(ds_win = openLayoutDialog(USER_HELPFILE, " User and Group Management ", USER_DIALOG_X, USER_DIALOG_Y, USER_DIALOG_WIDTH, USER_DIALOG_HEIGHT))) { beep(); msgConfirm("Cannot open addgroup dialog window!!"); return(DITEM_FAILURE); } /* Draw a group entry box */ draw_box(ds_win, USER_DIALOG_Y + 2, USER_DIALOG_X + 8, USER_DIALOG_HEIGHT - 8, USER_DIALOG_WIDTH - 17, dialog_attr, border_attr); wattrset(ds_win, dialog_attr); mvwaddstr(ds_win, USER_DIALOG_Y + 2, USER_DIALOG_X + 22, " Add a new group "); CLEAR(gname); CLEAR(gid); CLEAR(gmemb); /* Some more initialisation before we go into the main input loop */ obj = initLayoutDialog(ds_win, groupLayout, USER_DIALOG_X, USER_DIALOG_Y, &max); reenter: cancelbutton = okbutton = 0; if (firsttime) { /* fill in the blanks, well, just the GID */ completeGroup(); RefreshStringObj(groupLayout[LAYOUT_GID].obj); firsttime = FALSE; } while (layoutDialogLoop(ds_win, groupLayout, &obj, &n, max, &cancelbutton, &cancel)); if (!cancel && !verifyGroupSettings()) goto reenter; /* Clear this crap off the screen */ delwin(ds_win); dialog_clear_norefresh(); use_helpfile(NULL); if (!cancel) { addGroup(ds_win); ret = DITEM_SUCCESS; } else ret = DITEM_FAILURE; restorescr(save); return ret; } /* Check for the settings on the screen. */ static int verifyUserSettings(WINDOW *ds_win) { char tmp[256], *cp; long luid; WINDOW *save; int rv; if (strlen(uname) == 0) { feepout("The user name field must not be empty!"); return 0; } snprintf(tmp, 256, "pw user show -q -n %s > /dev/null", uname); if (vsystem("%s", tmp) == 0) { feepout("This user name is already in use."); return 0; } if (strlen(uid) > 0) { luid = strtol(uid, &cp, 10); if (luid < 0 || luid >= 65536 || (*cp != '\0' && !isspace(*cp))) { feepout("The UID must be a number between 1 and 65535."); return 0; } } if ((homedir[0]!=0) && (homedir[0]!='/')) { feepout("The pathname for home directories must begin with a '/'."); return 0; } if (strlen(shell) > 0) { setusershell(); while((cp = getusershell()) != NULL) if (strcmp(cp, shell) == 0) break; endusershell(); if (cp == NULL) { save = savescr(); rv = msgYesNo("Warning:\n\n" "The requested shell \"%s\" is not\n" "a valid user shell.\n\n" "Use it anyway?\n", shell); restorescr(save); wrefresh(ds_win); if (rv != DITEM_SUCCESS) return 0; } } if (strlen(umemb) > 0) { if (strpbrk(umemb, " \t") != NULL) { feepout("The member groups list must not contain any whitespace;\n" "use commas to separate the names."); return 0; } } return 1; } /* * Ask pw(8) to fill in the blanks for us. * Works solely on the global variables. */ static void completeUser(void) { int pfd[2], i; char tmp[256], *cp, *cp2; ssize_t l; size_t amnt; pid_t pid; char *vec[7] = { "pw", "user", "add", "-N", "-n", 0, 0 }; #define VEC_UNAME 5 pipe (pfd); if ((pid = fork()) == 0) { /* The kiddy. */ dup2(pfd[1], 1); dup2(pfd[1], 2); for (i = getdtablesize(); i > 2; i--) close(i); vec[VEC_UNAME] = uname; execv("/usr/sbin/pw", vec); msgDebug("Cannot execv() /usr/sbin/pw.\n"); _exit(99); } else { /* The oldie. */ close(pfd[1]); amnt = sizeof tmp; i = 0; while((l = read(pfd[0], &tmp[i], amnt)) > 0) { amnt -= l; i += l; if (amnt == 0) { close(pfd[0]); break; } } close(pfd[0]); tmp[i] = '\0'; waitpid(pid, &i, 0); if (WIFSIGNALED(i) || WEXITSTATUS(i) != 0) /* ignore by now */ return; if ((cp = strchr(tmp, '\n')) != NULL) *cp = '\0'; if ((cp = strchr(tmp, ':')) == NULL || (cp = strchr(++cp, ':')) == NULL) return; cp++; if ((cp2 = strchr(cp, ':')) == NULL) return; *cp2++ = '\0'; strncpy(uid, cp, sizeof uid); cp = cp2; if ((cp2 = strchr(cp, ':')) == NULL) return; *cp2++ = '\0'; #ifdef notyet /* XXX pw user add -g doesn't accept a numerical GID */ strncpy(ugroup, cp, sizeof ugroup); #endif cp = cp2; if ((cp2 = strchr(cp, ':')) == NULL || (cp2 = strchr(++cp2, ':')) == NULL || (cp = cp2 = strchr(++cp2, ':')) == NULL || (cp2 = strchr(++cp2, ':')) == NULL) return; *cp2++ = '\0'; cp++; strncpy(gecos, cp, sizeof gecos); cp = cp2; if ((cp2 = strchr(cp, ':')) == NULL) return; *cp2++ = '\0'; if (*cp2) strncpy(shell, cp2, sizeof shell); } #undef VEC_UNAME } static void addUser(WINDOW *ds_win) { char tmp[256], *msg; int pfd[2], ipfd[2], i, j; ssize_t l; size_t amnt; pid_t pid; /* * Maximal list: * pw user add -m -n uname -g grp -u uid -c comment -d homedir -s shell -G grplist -h 0 */ char *vec[21] = { "pw", "user", "add", "-m", "-n", /* ... */ }; #define VEC_UNAME 5 msgNotify("Adding user \"%s\"...", uname); pipe (pfd); pipe (ipfd); if ((pid = fork()) == 0) { /* The kiddy. */ dup2(ipfd[0], 0); dup2(pfd[1], 1); dup2(pfd[1], 2); for (i = getdtablesize(); i > 2; i--) close(i); vec[i = VEC_UNAME] = uname; i++; #define ADDVEC(var, option) do { if (strlen(var) > 0) { vec[i++] = option; vec[i++] = var; } } while (0) ADDVEC(ugroup, "-g"); ADDVEC(uid, "-u"); ADDVEC(gecos, "-c"); ADDVEC(homedir, "-d"); ADDVEC(shell, "-s"); ADDVEC(umemb, "-G"); if (passwd[0]) { vec[i++] = "-h"; vec[i++] = "0"; } vec[i] = 0; execv("/usr/sbin/pw", vec); msgDebug("Cannot execv() /usr/sbin/pw.\n"); _exit(99); } else { /* The oldie. */ close(pfd[1]); close(ipfd[0]); if (passwd[0]) write(ipfd[1], passwd, strlen(passwd)); close(ipfd[1]); amnt = sizeof tmp; i = 0; while((l = read(pfd[0], &tmp[i], amnt)) > 0) { amnt -= l; i += l; if (amnt == 0) { close(pfd[0]); break; } } close(pfd[0]); tmp[i] = '\0'; waitpid(pid, &i, 0); if (WIFSIGNALED(i)) { j = WTERMSIG(i); msg = "The `pw' command exited with signal %d.\n"; goto sysfail; } else if((j = WEXITSTATUS(i))) { i = 0; if(strncmp(tmp, "pw: ", 4) == 0) i = 4; tmp[sizeof tmp - 1] = '\0'; /* sanity */ if (j == EX_DATAERR || j == EX_NOUSER || j == EX_SOFTWARE) msgConfirm("The `pw' command exited with an error status.\n" "Its error message was:\n\n%s", &tmp[i]); else { msg = "The `pw' command exited with unexpected status %d.\n"; sysfail: msgDebug(msg, j); msgDebug("Command stdout and stderr was:\n\n%s", tmp); msgConfirm(msg, j); } } else if (!passwd[0]) msgConfirm("You will need to enter a password for this user\n" "later, using the passwd(1) command from the shell.\n\n" "The account for `%s' is currently still disabled.", uname); } #undef VEC_UNAME #undef ADDVEC } int userAddUser(dialogMenuItem *self) { WINDOW *ds_win, *save; ComposeObj *obj = NULL; int n = 0, cancel = FALSE, ret; int max, firsttime = TRUE, filled=0; if (RunningAsInit && !strstr(variable_get(SYSTEM_STATE), "install")) { msgConfirm("This option may only be used after the system is installed, sorry!"); return DITEM_FAILURE; } save = savescr(); dialog_clear_norefresh(); /* We need a curses window */ if (!(ds_win = openLayoutDialog(USER_HELPFILE, " User and Group Management ", USER_DIALOG_X, USER_DIALOG_Y, USER_DIALOG_WIDTH, USER_DIALOG_HEIGHT))) { beep(); msgConfirm("Cannot open adduser dialog window!!"); return(DITEM_FAILURE); } /* Draw a user entry box */ draw_box(ds_win, USER_DIALOG_Y + 1, USER_DIALOG_X + 3, USER_DIALOG_HEIGHT - 6, USER_DIALOG_WIDTH - 6, dialog_attr, border_attr); wattrset(ds_win, dialog_attr); mvwaddstr(ds_win, USER_DIALOG_Y + 1, USER_DIALOG_X + 22, " Add a new user "); CLEAR(uname); CLEAR(uid); CLEAR(ugroup); CLEAR(gecos); CLEAR(passwd); CLEAR(umemb); CLEAR(homedir); CLEAR(shell); /* Some more initialisation before we go into the main input loop */ obj = initLayoutDialog(ds_win, userLayout, USER_DIALOG_X, USER_DIALOG_Y, &max); reenter: cancelbutton = okbutton = 0; if (firsttime) { /* fill in the blanks, well, just the GID */ completeUser(); RefreshStringObj(userLayout[LAYOUT_UID].obj); RefreshStringObj(userLayout[LAYOUT_UGROUP].obj); RefreshStringObj(userLayout[LAYOUT_GECOS].obj); RefreshStringObj(userLayout[LAYOUT_UMEMB].obj); RefreshStringObj(userLayout[LAYOUT_HOMEDIR].obj); RefreshStringObj(userLayout[LAYOUT_SHELL].obj); firsttime = FALSE; } while (layoutDialogLoop(ds_win, userLayout, &obj, &n, max, &cancelbutton, &cancel)) { /* Prevent this from being irritating if user really means NO */ if (filled < 3) { if ((uname[0]) && !homedir[0]) { SAFE_STRCPY(homedir,"/home/"); strcat(homedir,uname); RefreshStringObj(userLayout[LAYOUT_HOMEDIR].obj); ++filled; } } }; if (!cancel && !verifyUserSettings(ds_win)) goto reenter; /* Clear this crap off the screen */ delwin(ds_win); dialog_clear_norefresh(); use_helpfile(NULL); if (!cancel) { addUser(ds_win); ret = DITEM_SUCCESS; } else ret = DITEM_FAILURE; restorescr(save); return ret; } diff --git a/usr.sbin/sysinstall/variable.c b/usr.sbin/sysinstall/variable.c index e1328629d8a1..e86104fd100a 100644 --- a/usr.sbin/sysinstall/variable.c +++ b/usr.sbin/sysinstall/variable.c @@ -1,326 +1,326 @@ /* * The new sysinstall program. * * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * * $FreeBSD$ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. * Copyright (c) 2001 * Murray Stokely. 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" /* Routines for dealing with variable lists */ static void make_variable(char *var, char *value, int dirty) { Variable *vp; /* Trim leading and trailing whitespace */ var = string_skipwhite(string_prune(var)); if (!var || !*var) return; /* Now search to see if it's already in the list */ for (vp = VarHead; vp; vp = vp->next) { if (!strcmp(vp->name, var)) { if (vp->dirty && !dirty) return; setenv(var, value, 1); free(vp->value); vp->value = strdup(value); if (dirty != -1) vp->dirty = dirty; return; } } setenv(var, value, 1); /* No? Create a new one */ vp = (Variable *)safe_malloc(sizeof(Variable)); vp->name = strdup(var); vp->value = strdup(value); if (dirty == -1) dirty = 0; vp->dirty = dirty; vp->next = VarHead; VarHead = vp; } void variable_set(char *var, int dirty) { char tmp[1024], *cp; if (!var) msgFatal("NULL variable name & value passed."); else if (!*var) msgDebug("Warning: Zero length name & value passed to variable_set()\n"); SAFE_STRCPY(tmp, var); if ((cp = index(tmp, '=')) == NULL) msgFatal("Invalid variable format: %s", var); *(cp++) = '\0'; make_variable(tmp, string_skipwhite(cp), dirty); } void variable_set2(char *var, char *value, int dirty) { if (!var || !value) msgFatal("Null name or value passed to set_variable2(%s) = %s!", var ? var : "", value ? value : ""); else if (!*var || !*value) msgDebug("Warning: Zero length name or value passed to variable_set2(%s) = %s\n", var, value); make_variable(var, value, dirty); } char * variable_get(char *var) { return getenv(var); } int variable_cmp(char *var, char *value) { char *val; if ((val = variable_get(var))) return strcmp(val, value); return -1; } void variable_unset(char *var) { Variable *vp; char name[512], *cp; if ((cp = index(var, '=')) != NULL) sstrncpy(name, var, cp - var); else SAFE_STRCPY(name, var); unsetenv(name); /* Now search to see if it's in our list, if we have one.. */ if (!VarHead) return; else if (!VarHead->next && !strcmp(VarHead->name, name)) { safe_free(VarHead->name); safe_free(VarHead->value); free(VarHead); VarHead = NULL; } else { for (vp = VarHead; vp; vp = vp->next) { if (!strcmp(vp->name, name)) { Variable *save = vp->next; safe_free(vp->name); safe_free(vp->value); *vp = *save; safe_free(save); break; } } } } /* Prompt user for the name of a variable */ char * variable_get_value(char *var, char *prompt, int dirty) { char *cp; cp = variable_get(var); if (cp && variable_get(VAR_NONINTERACTIVE)) return cp; else if ((cp = msgGetInput(cp, "%s", prompt)) != NULL) variable_set2(var, cp, dirty); else cp = NULL; return cp; } /* Check if value passed in data (in the form "variable=value") is * valid, and it's status compared to the value of variable stored in * env * * Possible return values : * -3: Invalid line, the data string is NOT set as an env variable * -2: Invalid line, the data string is set as an env variable * -1: Invalid line * 0: Valid line, is NOT equal to env version * 1: Valid line, is equal to env version * 2: Valid line, value empty - e.g. foo="" * 3: Valid line, does not exist in env */ int variable_check2(char *data) { char *cp, *cp2, *cp3, tmp[256]; if (data == NULL) return -1; SAFE_STRCPY(tmp, data); if ((cp = index(tmp, '=')) != NULL) { *(cp++) = '\0'; if (*cp == '"') { /* smash quotes if present */ ++cp; if ((cp3 = index(cp, '"')) != NULL) *cp3 = '\0'; } else if ((cp3 = index(cp, ',')) != NULL) *cp3 = '\0'; cp2 = variable_get(tmp); if (cp2 != NULL) { - if (*cp == NULL) + if (*cp == '\0') return 2; else return strcmp(cp, cp2) == 0 ? 1 : 0; } else return 3; } else return variable_get(tmp) != NULL ? -2 : -3; } /* Check if the value passed in data (in the form "variable=value") is equal to the value of variable stored in env */ int variable_check(char *data) { int ret; ret = variable_check2(data); switch(ret) { case -2: case 1: case 2: return TRUE; /* NOT REACHED */ default: return FALSE; } } int dump_variables(dialogMenuItem *unused) { FILE *fp; Variable *vp; if (isDebug()) msgDebug("Writing sysinstall variables to file..\n"); fp = fopen("/etc/sysinstall.vars", "w"); if (!fp) { msgConfirm("Unable to write to /etc/sysinstall.vars: %s", strerror(errno)); return DITEM_FAILURE; } for (vp = VarHead; vp; vp = vp->next) fprintf(fp, "%s=\"%s\" (%d)\n", vp->name, vp->value, vp->dirty); fclose(fp); return DITEM_SUCCESS; } /* Free all of the variables, useful to really start over as when the user selects "restart" from the interrupt menu. */ void free_variables(void) { Variable *vp; /* Free the variables from our list, if we have one.. */ if (!VarHead) return; else if (!VarHead->next) { unsetenv(VarHead->name); safe_free(VarHead->name); safe_free(VarHead->value); free(VarHead); VarHead = NULL; } else { for (vp = VarHead; vp; ) { Variable *save = vp; unsetenv(vp->name); safe_free(vp->name); safe_free(vp->value); vp = vp->next; safe_free(save); } VarHead = NULL; } } /* * Persistent variables. The variables modified by these functions * are not cleared between invocations of sysinstall. This is useful * to allow the user to completely restart sysinstall, without having * it load all of the modules again from the installation media which * are still in memory. */ void pvariable_set(char *var) { char tmp[1024]; if (!var) msgFatal("NULL variable name & value passed."); else if (!*var) msgDebug("Warning: Zero length name & value passed to variable_set()\n"); /* Add a trivial namespace to whatever name the caller chooses. */ SAFE_STRCPY(tmp, "SYSINSTALL_PVAR"); if (index(var, '=') == NULL) msgFatal("Invalid variable format: %s", var); strlcat(tmp, var, 1024); putenv(tmp); } char * pvariable_get(char *var) { char tmp[1024]; SAFE_STRCPY(tmp, "SYSINSTALL_PVAR"); strlcat(tmp, var, 1024); return getenv(tmp); }