2 * The new sysinstall program.
4 * This is probably the last attempt in the `sysinstall' line, the next
5 * generation being slated to essentially a complete rewrite.
8 * Jordan Hubbard. All rights reserved.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer,
15 * verbatim and that no modifications are made prior to this
17 * 2. Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution.
21 * THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 #ifndef _SYSINSTALL_H_INCLUDE
37 #define _SYSINSTALL_H_INCLUDE
39 #include <sys/types.h>
48 #include "ui_objects.h"
55 #if defined(__i386__) || defined(__alpha__) || defined(__amd64__)
60 #if defined(__i386__) || defined(__amd64__)
64 #if defined(__i386__) || defined(__alpha__)
69 #define PCCARD_ARCH 1 /* Support PCCARD installations */
73 #define DEV_NAME_MAX 128 /* The maximum length of a device name */
74 #define DEV_MAX 100 /* The maximum number of devices we'll deal with */
75 #define INTERFACE_MAX 50 /* Maximum number of network interfaces we'll deal with */
76 #define IO_ERROR -2 /* Status code for I/O error rather than normal EOF */
78 /* Number of seconds to wait for data to come off even the slowest media */
79 #define MEDIA_TIMEOUT 300
82 * I make some pretty gross assumptions about having a max of 50 chunks
83 * total - 8 slices and 42 partitions. I can't easily display many more
84 * than that on the screen at once!
86 * For 2.1 I'll revisit this and try to make it more dynamic, but since
87 * this will catch 99.99% of all possible cases, I'm not too worried.
91 /* Internal environment variable names */
92 #define DISK_PARTITIONED "_diskPartitioned"
93 #define DISK_LABELLED "_diskLabelled"
94 #define DISK_SELECTED "_diskSelected"
95 #define SYSTEM_STATE "_systemState"
96 #define RUNNING_ON_ROOT "_runningOnRoot"
97 #define TCP_CONFIGURED "_tcpConfigured"
99 /* Ones that can be tweaked from config files */
100 #define VAR_BLANKTIME "blanktime"
101 #define VAR_BOOTMGR "bootManager"
102 #define VAR_BROWSER_BINARY "browserBinary"
103 #define VAR_BROWSER_PACKAGE "browserPackage"
104 #define VAR_CPIO_VERBOSITY "cpioVerbose"
105 #define VAR_DEBUG "debug"
106 #define VAR_DESKSTYLE "_deskStyle"
107 #define VAR_DISK "disk"
108 #define VAR_DISKINTERACTIVE "diskInteractive"
109 #define VAR_DISTS "dists"
110 #define VAR_DIST_MAIN "distMain"
111 #define VAR_DIST_SRC "distSRC"
112 #define VAR_DIST_X11 "distX11"
113 #define VAR_DEDICATE_DISK "dedicateDisk"
114 #define VAR_DOMAINNAME "domainname"
115 #define VAR_EDITOR "editor"
116 #define VAR_EXTRAS "ifconfig_"
117 #define VAR_COMMAND "command"
118 #define VAR_CONFIG_FILE "configFile"
119 #define VAR_FIXIT_TTY "fixitTty"
120 #define VAR_FTP_DIR "ftpDirectory"
121 #define VAR_FTP_PASS "ftpPass"
122 #define VAR_FTP_PATH "_ftpPath"
123 #define VAR_FTP_PORT "ftpPort"
124 #define VAR_FTP_STATE "ftpState"
125 #define VAR_FTP_USER "ftpUser"
126 #define VAR_FTP_HOST "ftpHost"
127 #define VAR_HTTP_PATH "_httpPath"
128 #define VAR_HTTP_PROXY "httpProxy"
129 #define VAR_HTTP_PORT "httpPort"
130 #define VAR_HTTP_HOST "httpHost"
131 #define VAR_HTTP_FTP_MODE "httpFtpMode"
132 #define VAR_GATEWAY "defaultrouter"
133 #define VAR_GEOMETRY "geometry"
134 #define VAR_HOSTNAME "hostname"
135 #define VAR_IFCONFIG "ifconfig_"
136 #define VAR_INSTALL_CFG "installConfig"
137 #define VAR_INSTALL_ROOT "installRoot"
138 #define VAR_IPADDR "ipaddr"
139 #define VAR_IPV6_ENABLE "ipv6_enable"
140 #define VAR_IPV6ADDR "ipv6addr"
141 #define VAR_KERN_SECURELEVEL "kern_securelevel"
142 #define VAR_KEYMAP "keymap"
143 #define VAR_LABEL "label"
144 #define VAR_LABEL_COUNT "labelCount"
145 #define VAR_LINUX_ENABLE "linux_enable"
146 #define VAR_MEDIA_TYPE "mediaType"
147 #define VAR_MEDIA_TIMEOUT "MEDIA_TIMEOUT"
148 #define VAR_MOUSED "moused_enable"
149 #define VAR_MOUSED_FLAGS "moused_flags"
150 #define VAR_MOUSED_PORT "moused_port"
151 #define VAR_MOUSED_TYPE "moused_type"
152 #define VAR_NAMESERVER "nameserver"
153 #define VAR_NETINTERACTIVE "netInteractive"
154 #define VAR_NETMASK "netmask"
155 #define VAR_NETWORK_DEVICE "netDev"
156 #define VAR_NEWFS_ARGS "newfsArgs"
157 #define VAR_NFS_PATH "nfs"
158 #define VAR_NFS_HOST "nfsHost"
159 #define VAR_NFS_V3 "nfs_use_v3"
160 #define VAR_NFS_TCP "nfs_use_tcp"
161 #define VAR_NFS_SECURE "nfs_reserved_port_only"
162 #define VAR_NFS_SERVER "nfs_server_enable"
163 #define VAR_NO_CONFIRM "noConfirm"
164 #define VAR_NO_ERROR "noError"
165 #define VAR_NO_HOLOSHELL "noHoloShell"
166 #define VAR_NO_INET6 "noInet6"
167 #define VAR_NO_WARN "noWarn"
168 #define VAR_NO_USR "noUsr"
169 #define VAR_NO_TMP "noTmp"
170 #define VAR_NO_HOME "noHome"
171 #define VAR_NONINTERACTIVE "nonInteractive"
172 #define VAR_NOVELL "novell"
173 #define VAR_OSF1_ENABLE "osf1_enable"
174 #define VAR_RPCBIND_ENABLE "rpcbind_enable"
175 #define VAR_NTPDATE_FLAGS "ntpdate_flags"
176 #define VAR_PACKAGE "package"
177 #define VAR_PARTITION "partition"
178 #define VAR_PCNFSD "pcnfsd"
179 #define VAR_PKG_TMPDIR "PKG_TMPDIR"
180 #define VAR_PORTS_PATH "ports"
181 #define VAR_PPP_ENABLE "ppp_enable"
182 #define VAR_PPP_PROFILE "ppp_profile"
183 #define VAR_RELNAME "releaseName"
184 #define VAR_ROOT_SIZE "rootSize"
185 #define VAR_ROUTER "router"
186 #define VAR_ROUTER_ENABLE "router_enable"
187 #define VAR_ROUTERFLAGS "router_flags"
188 #define VAR_SENDMAIL_ENABLE "sendmail_enable"
189 #define VAR_SERIAL_SPEED "serialSpeed"
190 #define VAR_SLOW_ETHER "slowEthernetCard"
191 #define VAR_SWAP_SIZE "swapSize"
192 #define VAR_TAPE_BLOCKSIZE "tapeBlocksize"
193 #define VAR_TRY_DHCP "tryDHCP"
194 #define VAR_TRY_RTSOL "tryRTSOL"
195 #define VAR_SKIP_PCCARD "skipPCCARD"
196 #define VAR_UFS_PATH "ufs"
197 #define VAR_USR_SIZE "usrSize"
198 #define VAR_VAR_SIZE "varSize"
199 #define VAR_TMP_SIZE "tmpSize"
200 #define VAR_HOME_SIZE "homeSize"
201 #define VAR_XORG_CONFIG "_xorgconfig"
202 #define VAR_TERM "TERM"
203 #define VAR_CONSTERM "_consterm"
205 #define DEFAULT_TAPE_BLOCKSIZE "20"
207 /* One MB worth of blocks */
209 #define ONE_GIG (ONE_MEG * 1024)
211 /* Which selection attributes to use */
212 #define ATTR_SELECTED (ColorDisplay ? item_selected_attr : item_attr)
213 #define ATTR_TITLE button_active_attr
215 /* Handy strncpy() macro */
216 #define SAFE_STRCPY(to, from) sstrncpy((to), (from), sizeof (to) - 1)
220 typedef struct disk Disk;
221 typedef struct chunk Chunk;
223 /* Bitfields for menu options */
224 #define DMENU_NORMAL_TYPE 0x1 /* Normal dialog menu */
225 #define DMENU_RADIO_TYPE 0x2 /* Radio dialog menu */
226 #define DMENU_CHECKLIST_TYPE 0x4 /* Multiple choice menu */
227 #define DMENU_SELECTION_RETURNS 0x8 /* Immediate return on item selection */
229 typedef struct _dmenu {
230 int type; /* What sort of menu we are */
231 char *title; /* Our title */
232 char *prompt; /* Our prompt */
233 char *helpline; /* Line of help at bottom */
234 char *helpfile; /* Help file for "F1" */
235 #if (__STDC_VERSION__ >= 199901L) || (__GNUC__ >= 3)
236 dialogMenuItem items[]; /* Array of menu items */
238 dialogMenuItem items[0]; /* Array of menu items */
240 #error "Create hack for C89 and K&R compilers."
244 /* An rc.conf variable */
245 typedef struct _variable {
246 struct _variable *next;
252 #define NO_ECHO_OBJ(type) ((type) | (DITEM_NO_ECHO << 16))
253 #define TYPE_OF_OBJ(type) ((type) & 0xff)
254 #define ATTR_OF_OBJ(type) ((type) >> 16)
256 /* A screen layout structure */
257 typedef struct _layout {
258 int y; /* x & Y co-ordinates */
260 int len; /* The size of the dialog on the screen */
261 int maxlen; /* How much the user can type in ... */
262 char *prompt; /* The string for the prompt */
263 char *help; /* The display for the help line */
264 void *var; /* The var to set when this changes */
265 int type; /* The type of the dialog to create */
266 void *obj; /* The obj pointer returned by libdialog */
284 /* CDROM mount codes */
285 #define CD_UNMOUNTED 0
286 #define CD_ALREADY_MOUNTED 1
287 #define CD_WE_MOUNTED_IT 2
289 /* A "device" from sysinstall's point of view */
290 typedef struct _device {
291 char name[DEV_NAME_MAX];
296 Boolean (*init)(struct _device *dev);
297 FILE * (*get)(struct _device *dev, char *file, Boolean probe);
298 void (*shutdown)(struct _device *dev);
304 /* Some internal representations of partitions */
314 #define NEWFS_UFS_CMD "newfs"
315 #define NEWFS_MSDOS_CMD "newfs_msdos"
317 enum newfs_type { NEWFS_UFS, NEWFS_MSDOS, NEWFS_CUSTOM };
318 #define NEWFS_UFS_STRING "UFS"
319 #define NEWFS_MSDOS_STRING "FAT"
320 #define NEWFS_CUSTOM_STRING "CST"
322 /* The longest set of custom command line arguments we'll pass. */
323 #define NEWFS_CMD_ARGS_MAX 256
325 typedef struct _part_info {
326 char mountpoint[FILENAME_MAX];
328 /* Is invocation of newfs desired? */
331 enum newfs_type newfs_type;
334 char user_options[NEWFS_CMD_ARGS_MAX];
335 Boolean acls; /* unused */
336 Boolean multilabel; /* unused */
344 char command[NEWFS_CMD_ARGS_MAX];
350 typedef struct _opt {
353 enum { OPT_IS_STRING, OPT_IS_INT, OPT_IS_FUNC, OPT_IS_VAR } type;
359 /* Weird index nodey things we use for keeping track of package information */
360 typedef enum { PACKAGE, PLACE } node_type; /* Types of nodes */
362 typedef struct _pkgnode { /* A node in the reconstructed hierarchy */
363 struct _pkgnode *next; /* My next sibling */
364 node_type type; /* What am I? */
365 char *name; /* My name */
366 char *desc; /* My description (Hook) */
367 struct _pkgnode *kids; /* My little children */
368 void *data; /* A place to hang my data */
370 typedef PkgNode *PkgNodePtr;
372 /* A single package */
373 typedef struct _indexEntry { /* A single entry in an INDEX file */
374 char *name; /* name */
375 char *path; /* full path to port */
376 char *prefix; /* port prefix */
377 char *comment; /* one line description */
378 char *descrfile; /* path to description file */
379 char *deps; /* packages this depends on */
380 int depc; /* how many depend on me */
381 int installed; /* indicates if it is installed */
382 char *maintainer; /* maintainer */
383 unsigned int volume; /* Volume of package */
385 typedef IndexEntry *IndexEntryPtr;
387 typedef int (*commandFunc)(char *key, void *data);
389 #define HOSTNAME_FIELD_LEN 128
390 #define IPADDR_FIELD_LEN 16
391 #define EXTRAS_FIELD_LEN 128
393 /* This is the structure that Network devices carry around in their private, erm, structures */
394 typedef struct _devPriv {
397 char ipaddr[IPADDR_FIELD_LEN];
398 char netmask[IPADDR_FIELD_LEN];
399 char extras[EXTRAS_FIELD_LEN];
404 extern jmp_buf BailOut; /* Used to get the heck out */
405 extern int CDROMInitQuiet; /* Don't whine if mount(2) fails */
406 extern int DebugFD; /* Where diagnostic output goes */
407 extern Boolean Fake; /* Don't actually modify anything - testing */
408 extern Boolean Restarting; /* Are we restarting sysinstall? */
409 extern Boolean SystemWasInstalled; /* Did we install it? */
410 extern Boolean RunningAsInit; /* Are we running stand-alone? */
411 extern Boolean DialogActive; /* Is the dialog() stuff up? */
412 extern Boolean ColorDisplay; /* Are we on a color display? */
413 extern Boolean OnVTY; /* On a syscons VTY? */
414 extern Variable *VarHead; /* The head of the variable chain */
415 extern Device *mediaDevice; /* Where we're getting our distribution from */
416 extern unsigned int Dists; /* Which distributions we want */
417 extern unsigned int SrcDists; /* Which src distributions we want */
418 extern unsigned int XOrgDists; /* Which X.Org dists we want */
419 extern int BootMgr; /* Which boot manager to use */
420 extern int StatusLine; /* Where to print our status messages */
421 extern DMenu MenuInitial; /* Initial installation menu */
422 extern DMenu MenuFixit; /* Fixit repair menu */
423 #if defined(__i386__) || defined(__amd64__)
425 extern DMenu MenuIPLType; /* Type of IPL to write on the disk */
427 extern DMenu MenuMBRType; /* Type of MBR to write on the disk */
430 extern DMenu MenuConfigure; /* Final configuration menu */
431 extern DMenu MenuDocumentation; /* Documentation menu */
432 extern DMenu MenuFTPOptions; /* FTP Installation options */
433 extern DMenu MenuIndex; /* Index menu */
434 extern DMenu MenuOptions; /* Installation options */
435 extern DMenu MenuOptionsLanguage; /* Language options menu */
436 extern DMenu MenuKLD; /* Prototype KLD menu */
437 extern DMenu MenuMedia; /* Media type menu */
439 extern DMenu MenuMouse; /* Mouse type menu */
441 extern DMenu MenuMediaCDROM; /* CDROM media menu */
442 extern DMenu MenuMediaDOS; /* DOS media menu */
443 extern DMenu MenuMediaFloppy; /* Floppy media menu */
444 extern DMenu MenuMediaFTP; /* FTP media menu */
445 extern DMenu MenuMediaTape; /* Tape media menu */
446 extern DMenu MenuNetworkDevice; /* Network device menu */
447 extern DMenu MenuNTP; /* NTP time server menu */
448 extern DMenu MenuSecurity; /* System security options menu */
449 extern DMenu MenuSecurelevel; /* Securelevel menu */
450 extern DMenu MenuStartup; /* Startup services menu */
452 extern DMenu MenuSyscons; /* System console configuration menu */
453 extern DMenu MenuSysconsFont; /* System console font configuration menu */
454 extern DMenu MenuSysconsKeymap; /* System console keymap configuration menu */
455 extern DMenu MenuSysconsKeyrate; /* System console keyrate configuration menu */
456 extern DMenu MenuSysconsSaver; /* System console saver configuration menu */
457 extern DMenu MenuSysconsScrnmap; /* System console screenmap configuration menu */
458 extern DMenu MenuSysconsTtys; /* System console terminal type menu */
460 extern DMenu MenuNetworking; /* Network configuration menu */
461 extern DMenu MenuMTA; /* MTA selection menu */
462 extern DMenu MenuInstallCustom; /* Custom Installation menu */
463 extern DMenu MenuDistributions; /* Distribution menu */
464 extern DMenu MenuDiskDevices; /* Disk type devices */
465 extern DMenu MenuSubDistributions; /* Custom distribution menu */
466 extern DMenu MenuSrcDistributions; /* Source distribution menu */
467 extern DMenu MenuXOrg; /* X.Org main menu */
468 extern DMenu MenuXOrgSelect; /* X.Org distribution selection menu */
469 extern DMenu MenuXOrgSelectCore; /* X.Org core distribution menu */
470 extern DMenu MenuXOrgSelectServer; /* X.Org server distribution menu */
471 extern DMenu MenuXOrgSelectFonts; /* X.Org font selection menu */
472 extern DMenu MenuXDesktops; /* X Desktops menu */
473 extern DMenu MenuHTMLDoc; /* HTML Documentation menu */
474 extern DMenu MenuUsermgmt; /* User management menu */
475 extern DMenu MenuFixit; /* Fixit floppy/CDROM/shell menu */
476 extern DMenu MenuXOrgConfig; /* Select X.Org configuration tool */
477 extern int FixItMode; /* FixItMode starts shell onc urrent device (ie Serial port) */
478 extern const char * StartName; /* Which name we were started as */
480 /* Important chunks. */
481 extern Chunk *HomeChunk;
482 extern Chunk *RootChunk;
483 extern Chunk *SwapChunk;
484 extern Chunk *TmpChunk;
485 extern Chunk *UsrChunk;
486 extern Chunk *VarChunk;
488 extern Chunk *EfiChunk;
491 /* Stuff from libdialog which isn't properly declared outside */
492 extern void display_helpfile(void);
493 extern void display_helpline(WINDOW *w, int y, int width);
498 extern int configAnonFTP(dialogMenuItem *self);
501 extern Boolean mediaInitCDROM(Device *dev);
502 extern FILE *mediaGetCDROM(Device *dev, char *file, Boolean probe);
503 extern void mediaShutdownCDROM(Device *dev);
506 extern void command_clear(void);
507 extern void command_sort(void);
508 extern void command_execute(void);
509 extern void command_shell_add(char *key, char *fmt, ...) __printflike(2, 3);
510 extern void command_func_add(char *key, commandFunc func, void *data);
513 extern void configEnvironmentRC_conf(void);
514 extern void configEnvironmentResolv(char *config);
515 extern void configRC_conf(void);
516 extern int configFstab(dialogMenuItem *self);
517 extern int configRC(dialogMenuItem *self);
518 extern int configResolv(dialogMenuItem *self);
519 extern int configPackages(dialogMenuItem *self);
520 extern int configSaver(dialogMenuItem *self);
521 extern int configSaverTimeout(dialogMenuItem *self);
523 extern int configLinux(dialogMenuItem *self);
525 extern int configNTP(dialogMenuItem *self);
527 extern int configOSF1(dialogMenuItem *self);
529 extern int configUsers(dialogMenuItem *self);
530 extern int configRouter(dialogMenuItem *self);
531 extern int configPCNFSD(dialogMenuItem *self);
532 extern int configInetd(dialogMenuItem *self);
533 extern int configNFSServer(dialogMenuItem *self);
534 extern int configMTAPostfix(dialogMenuItem *self);
535 extern int configMTAExim(dialogMenuItem *self);
536 extern int configRpcBind(dialogMenuItem *self);
537 extern int configWriteRC_conf(dialogMenuItem *self);
538 extern int configSecurelevel(dialogMenuItem *self);
539 extern int configSecurelevelDisabled(dialogMenuItem *self);
540 extern int configSecurelevelSecure(dialogMenuItem *self);
541 extern int configSecurelevelHighlySecure(dialogMenuItem *self);
542 extern int configSecurelevelNetworkSecure(dialogMenuItem *self);
543 extern int configEtcTtys(dialogMenuItem *self);
545 extern int checkLoaderACPI(void);
546 extern int configLoaderACPI(int);
550 extern DMenu *deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)(dialogMenuItem *d),
551 int (*check)(dialogMenuItem *d));
552 extern void deviceGetAll(void);
553 extern void deviceReset(void);
554 extern void deviceRescan(void);
555 extern Device **deviceFind(char *name, DeviceType type);
556 extern Device **deviceFindDescr(char *name, char *desc, DeviceType class);
557 extern int deviceCount(Device **devs);
558 extern Device *new_device(char *name);
559 extern Device *deviceRegister(char *name, char *desc, char *devname, DeviceType type, Boolean enabled,
560 Boolean (*init)(Device *mediadev),
561 FILE * (*get)(Device *dev, char *file, Boolean probe),
562 void (*shutDown)(Device *mediadev),
564 extern Boolean dummyInit(Device *dev);
565 extern FILE *dummyGet(Device *dev, char *dist, Boolean probe);
566 extern void dummyShutdown(Device *dev);
569 extern int dhcpParseLeases(char *file, char *hostname, char *domain, char *nameserver,
570 char *ipaddr, char *gateway, char *netmask);
574 extern void diskPartition(Device *dev);
575 extern int diskPartitionEditor(dialogMenuItem *self);
577 extern int diskPartitionWrite(dialogMenuItem *self);
578 extern int diskGetSelectCount(Device ***devs);
581 extern int dispatchCommand(char *command);
582 extern int dispatch_load_floppy(dialogMenuItem *self);
583 extern int dispatch_load_file_int(int);
584 extern int dispatch_load_file(dialogMenuItem *self);
588 extern int distReset(dialogMenuItem *self);
589 extern int distConfig(dialogMenuItem *self);
590 extern int distSetCustom(dialogMenuItem *self);
591 extern int distUnsetCustom(dialogMenuItem *self);
592 extern int distSetDeveloper(dialogMenuItem *self);
593 extern int distSetXDeveloper(dialogMenuItem *self);
594 extern int distSetKernDeveloper(dialogMenuItem *self);
595 extern int distSetXKernDeveloper(dialogMenuItem *self);
596 extern int distSetUser(dialogMenuItem *self);
597 extern int distSetXUser(dialogMenuItem *self);
598 extern int distSetMinimum(dialogMenuItem *self);
599 extern int distSetEverything(dialogMenuItem *self);
600 extern int distSetSrc(dialogMenuItem *self);
601 extern int distSetXOrg(dialogMenuItem *self);
602 extern int distExtractAll(dialogMenuItem *self);
605 extern int dmenuDisplayFile(dialogMenuItem *tmp);
606 extern int dmenuSubmenu(dialogMenuItem *tmp);
607 extern int dmenuSystemCommand(dialogMenuItem *tmp);
608 extern int dmenuSystemCommandBox(dialogMenuItem *tmp);
609 extern int dmenuExit(dialogMenuItem *tmp);
610 extern int dmenuISetVariable(dialogMenuItem *tmp);
611 extern int dmenuSetVariable(dialogMenuItem *tmp);
612 extern int dmenuSetKmapVariable(dialogMenuItem *tmp);
613 extern int dmenuSetVariables(dialogMenuItem *tmp);
614 extern int dmenuToggleVariable(dialogMenuItem *tmp);
615 extern int dmenuSetFlag(dialogMenuItem *tmp);
616 extern int dmenuSetValue(dialogMenuItem *tmp);
617 extern Boolean dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max, Boolean buttons);
618 extern Boolean dmenuOpenSimple(DMenu *menu, Boolean buttons);
619 extern int dmenuVarCheck(dialogMenuItem *item);
620 extern int dmenuVarsCheck(dialogMenuItem *item);
621 extern int dmenuFlagCheck(dialogMenuItem *item);
622 extern int dmenuRadioCheck(dialogMenuItem *item);
625 extern int docBrowser(dialogMenuItem *self);
626 extern int docShowDocument(dialogMenuItem *self);
629 extern Boolean mediaCloseDOS(Device *dev, FILE *fp);
630 extern Boolean mediaInitDOS(Device *dev);
631 extern FILE *mediaGetDOS(Device *dev, char *file, Boolean probe);
632 extern void mediaShutdownDOS(Device *dev);
635 extern int getRootFloppy(void);
636 extern Boolean mediaInitFloppy(Device *dev);
637 extern FILE *mediaGetFloppy(Device *dev, char *file, Boolean probe);
638 extern void mediaShutdownFloppy(Device *dev);
641 extern Boolean mediaCloseFTP(Device *dev, FILE *fp);
642 extern Boolean mediaInitFTP(Device *dev);
643 extern FILE *mediaGetFTP(Device *dev, char *file, Boolean probe);
644 extern void mediaShutdownFTP(Device *dev);
647 extern Boolean mediaInitHTTP(Device *dev);
648 extern FILE *mediaGetHTTP(Device *dev, char *file, Boolean probe);
651 extern void globalsInit(void);
654 int index_read(FILE *fp, PkgNodePtr papa);
655 int index_menu(PkgNodePtr root, PkgNodePtr top, PkgNodePtr plist, int *pos, int *scroll);
656 void index_init(PkgNodePtr top, PkgNodePtr plist);
657 void index_node_free(PkgNodePtr top, PkgNodePtr plist);
658 void index_sort(PkgNodePtr top);
659 void index_print(PkgNodePtr top, int level);
660 int index_extract(Device *dev, PkgNodePtr top, PkgNodePtr who, Boolean depended);
661 int index_initialize(char *path);
662 PkgNodePtr index_search(PkgNodePtr top, char *str, PkgNodePtr *tp);
665 extern Boolean checkLabels(Boolean whinge);
666 extern int installCommit(dialogMenuItem *self);
667 extern int installCustomCommit(dialogMenuItem *self);
668 extern int installExpress(dialogMenuItem *self);
669 extern int installStandard(dialogMenuItem *self);
670 extern int installFixitHoloShell(dialogMenuItem *self);
671 extern int installFixitCDROM(dialogMenuItem *self);
672 extern int installFixitFloppy(dialogMenuItem *self);
673 extern int installFixupBase(dialogMenuItem *self);
674 extern int installUpgrade(dialogMenuItem *self);
675 extern int installFilesystems(dialogMenuItem *self);
676 extern int installVarDefaults(dialogMenuItem *self);
677 extern void installEnvironment(void);
678 extern Boolean copySelf(void);
681 extern int kget(char *out);
684 extern int loadKeymap(const char *lang);
687 extern int diskLabelEditor(dialogMenuItem *self);
688 extern int diskLabelCommit(dialogMenuItem *self);
690 /* makedevs.c (auto-generated) */
691 extern const char termcap_ansi[];
692 extern const char termcap_vt100[];
693 extern const char termcap_cons25w[];
694 extern const char termcap_cons25[];
695 extern const char termcap_cons25_m[];
696 extern const char termcap_cons25r[];
697 extern const char termcap_cons25r_m[];
698 extern const char termcap_cons25l1[];
699 extern const char termcap_cons25l1_m[];
700 extern const char termcap_xterm[];
701 extern const u_char font_iso_8x16[];
702 extern const u_char font_cp850_8x16[];
703 extern const u_char font_cp866_8x16[];
704 extern const u_char koi8_r2cp866[];
705 extern u_char default_scrnmap[];
708 extern char *cpioVerbosity(void);
709 extern void mediaClose(void);
710 extern int mediaTimeout(void);
711 extern int mediaSetCDROM(dialogMenuItem *self);
712 extern int mediaSetFloppy(dialogMenuItem *self);
713 extern int mediaSetDOS(dialogMenuItem *self);
714 extern int mediaSetTape(dialogMenuItem *self);
715 extern int mediaSetFTP(dialogMenuItem *self);
716 extern int mediaSetFTPActive(dialogMenuItem *self);
717 extern int mediaSetFTPPassive(dialogMenuItem *self);
718 extern int mediaSetHTTP(dialogMenuItem *self);
719 extern int mediaSetUFS(dialogMenuItem *self);
720 extern int mediaSetNFS(dialogMenuItem *self);
721 extern int mediaSetFTPUserPass(dialogMenuItem *self);
722 extern int mediaSetCPIOVerbosity(dialogMenuItem *self);
723 extern int mediaGetType(dialogMenuItem *self);
724 extern Boolean mediaExtractDist(char *dir, char *dist, FILE *fp);
725 extern Boolean mediaExtractDistBegin(char *dir, int *fd, int *zpid, int *cpic);
726 extern Boolean mediaExtractDistEnd(int zpid, int cpid);
727 extern Boolean mediaVerify(void);
728 extern FILE *mediaGenericGet(char *base, const char *file);
731 extern Boolean file_readable(char *fname);
732 extern Boolean file_executable(char *fname);
733 extern Boolean directory_exists(const char *dirname);
734 extern char *root_bias(char *path);
735 extern char *itoa(int value);
736 extern char *string_concat(char *p1, char *p2);
737 extern char *string_concat3(char *p1, char *p2, char *p3);
738 extern char *string_prune(char *str);
739 extern char *string_skipwhite(char *str);
740 extern char *string_copy(char *s1, char *s2);
741 extern char *pathBaseName(const char *path);
742 extern void safe_free(void *ptr);
743 extern void *safe_malloc(size_t size);
744 extern void *safe_realloc(void *orig, size_t size);
745 extern dialogMenuItem *item_add(dialogMenuItem *list, char *prompt, char *title,
746 int (*checked)(dialogMenuItem *self),
747 int (*fire)(dialogMenuItem *self),
748 void (*selected)(dialogMenuItem *self, int is_selected),
749 void *data, int *aux, int *curr, int *max);
750 extern void items_free(dialogMenuItem *list, int *curr, int *max);
751 extern int Mkdir(char *);
752 extern int Mkdir_command(char *key, void *data);
753 extern int Mount(char *, void *data);
754 extern int Mount_msdosfs(char *mountp, void *devname);
755 extern WINDOW *openLayoutDialog(char *helpfile, char *title, int x, int y, int width, int height);
756 extern ComposeObj *initLayoutDialog(WINDOW *win, Layout *layout, int x, int y, int *max);
757 extern int layoutDialogLoop(WINDOW *win, Layout *layout, ComposeObj **obj,
758 int *n, int max, int *cbutton, int *cancel);
760 extern WINDOW *savescr(void);
761 extern void restorescr(WINDOW *w);
762 extern char *sstrncpy(char *dst, const char *src, int size);
765 extern void driverFloppyCheck(void);
766 extern void moduleInitialize(void);
767 extern int kldBrowser(dialogMenuItem *self);
770 extern int mousedTest(dialogMenuItem *self);
771 extern int mousedDisable(dialogMenuItem *self);
772 extern int setMouseFlags(dialogMenuItem *self);
775 extern Boolean isDebug(void);
776 extern void msgInfo(char *fmt, ...) __printf0like(1, 2);
777 extern void msgYap(char *fmt, ...) __printflike(1, 2);
778 extern void msgWarn(char *fmt, ...) __printflike(1, 2);
779 extern void msgDebug(char *fmt, ...) __printflike(1, 2);
780 extern void msgError(char *fmt, ...) __printflike(1, 2);
781 extern void msgFatal(char *fmt, ...) __printflike(1, 2);
782 extern void msgConfirm(char *fmt, ...) __printflike(1, 2);
783 extern void msgNotify(char *fmt, ...) __printflike(1, 2);
784 extern void msgWeHaveOutput(char *fmt, ...) __printflike(1, 2);
785 extern int msgYesNo(char *fmt, ...) __printflike(1, 2);
786 extern int msgNoYes(char *fmt, ...) __printflike(1, 2);
787 extern char *msgGetInput(char *buf, char *fmt, ...) __printflike(2, 3);
788 extern int msgSimpleConfirm(char *);
789 extern int msgSimpleNotify(char *);
792 extern Boolean mediaInitNetwork(Device *dev);
793 extern void mediaShutdownNetwork(Device *dev);
796 extern Boolean mediaInitNFS(Device *dev);
797 extern FILE *mediaGetNFS(Device *dev, char *file, Boolean probe);
798 extern void mediaShutdownNFS(Device *dev);
801 extern int optionsEditor(dialogMenuItem *self);
804 extern int packageAdd(dialogMenuItem *self);
805 extern int package_add(char *name);
806 extern int package_extract(Device *dev, char *name, Boolean depended);
807 extern Boolean package_installed(char *name);
810 extern void pccardInitialize(void);
813 extern void systemInitialize(int argc, char **argv);
814 extern void systemShutdown(int status);
815 extern int execExecute(char *cmd, char *name);
816 extern int systemExecute(char *cmd);
817 extern void systemSuspendDialog(void);
818 extern void systemResumeDialog(void);
819 extern int systemDisplayHelp(char *file);
820 extern char *systemHelpFile(char *file, char *buf);
821 extern void systemChangeFont(const u_char font[]);
822 extern void systemChangeLang(char *lang);
823 extern void systemChangeTerminal(char *color, const u_char c_termcap[], char *mono, const u_char m_termcap[]);
824 extern void systemChangeScreenmap(const u_char newmap[]);
825 extern void systemCreateHoloshell(void);
826 extern int vsystem(char *fmt, ...) __printflike(1, 2);
829 extern char *mediaTapeBlocksize(void);
830 extern Boolean mediaInitTape(Device *dev);
831 extern FILE *mediaGetTape(Device *dev, char *file, Boolean probe);
832 extern void mediaShutdownTape(Device *dev);
835 extern int tcpOpenDialog(Device *dev);
836 extern int tcpMenuSelect(dialogMenuItem *self);
837 extern Device *tcpDeviceSelect(void);
840 extern int set_termcap(void);
843 extern void configTtys(void);
846 extern void mediaShutdownUFS(Device *dev);
847 extern Boolean mediaInitUFS(Device *dev);
848 extern FILE *mediaGetUFS(Device *dev, char *file, Boolean probe);
851 extern void usbInitialize(void);
854 extern int userAddGroup(dialogMenuItem *self);
855 extern int userAddUser(dialogMenuItem *self);
858 extern void variable_set(char *var, int dirty);
859 extern void variable_set2(char *name, char *value, int dirty);
860 extern char *variable_get(char *var);
861 extern int variable_cmp(char *var, char *value);
862 extern void variable_unset(char *var);
863 extern char *variable_get_value(char *var, char *prompt, int dirty);
864 extern int variable_check(char *data);
865 extern int variable_check2(char *data);
866 extern int dump_variables(dialogMenuItem *self);
867 extern void free_variables(void);
868 extern void pvariable_set(char *var);
869 extern char *pvariable_get(char *var);
872 extern void slice_wizard(Disk *d);
875 * Macros. Please find a better place for us!
877 #define DEVICE_INIT(d) ((d) != NULL ? (d)->init((d)) : (Boolean)0)
878 #define DEVICE_GET(d, b, f) ((d) != NULL ? (d)->get((d), (b), (f)) : NULL)
879 #define DEVICE_SHUTDOWN(d) ((d) != NULL ? (d)->shutdown((d)) : (void)0)
882 #define UNZIPPER "gunzip"
884 #define UNZIPPER "bunzip2"
888 /* _SYSINSTALL_H_INCLUDE */