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 DEV_NAME_MAX 128 /* The maximum length of a device name */
70 #define DEV_MAX 100 /* The maximum number of devices we'll deal with */
71 #define INTERFACE_MAX 50 /* Maximum number of network interfaces we'll deal with */
72 #define IO_ERROR -2 /* Status code for I/O error rather than normal EOF */
74 /* Number of seconds to wait for data to come off even the slowest media */
75 #define MEDIA_TIMEOUT 300
78 * I make some pretty gross assumptions about having a max of 50 chunks
79 * total - 8 slices and 42 partitions. I can't easily display many more
80 * than that on the screen at once!
82 * For 2.1 I'll revisit this and try to make it more dynamic, but since
83 * this will catch 99.99% of all possible cases, I'm not too worried.
87 /* Internal environment variable names */
88 #define DISK_PARTITIONED "_diskPartitioned"
89 #define DISK_LABELLED "_diskLabelled"
90 #define DISK_SELECTED "_diskSelected"
91 #define SYSTEM_STATE "_systemState"
92 #define RUNNING_ON_ROOT "_runningOnRoot"
93 #define TCP_CONFIGURED "_tcpConfigured"
95 /* Ones that can be tweaked from config files */
96 #define VAR_BLANKTIME "blanktime"
97 #define VAR_BOOTMGR "bootManager"
98 #define VAR_BROWSER_BINARY "browserBinary"
99 #define VAR_BROWSER_PACKAGE "browserPackage"
100 #define VAR_CPIO_VERBOSITY "cpioVerbose"
101 #define VAR_DEBUG "debug"
102 #define VAR_DESKSTYLE "_deskStyle"
103 #define VAR_DISK "disk"
104 #define VAR_DISKINTERACTIVE "diskInteractive"
105 #define VAR_DISTS "dists"
106 #define VAR_DIST_MAIN "distMain"
107 #define VAR_DIST_SRC "distSRC"
108 #define VAR_DIST_X11 "distX11"
109 #define VAR_DEDICATE_DISK "dedicateDisk"
110 #define VAR_DOMAINNAME "domainname"
111 #define VAR_EDITOR "editor"
112 #define VAR_EXTRAS "ifconfig_"
113 #define VAR_COMMAND "command"
114 #define VAR_CONFIG_FILE "configFile"
115 #define VAR_FIXIT_TTY "fixitTty"
116 #define VAR_FTP_DIR "ftpDirectory"
117 #define VAR_FTP_PASS "ftpPass"
118 #define VAR_FTP_PATH "_ftpPath"
119 #define VAR_FTP_PORT "ftpPort"
120 #define VAR_FTP_STATE "ftpState"
121 #define VAR_FTP_USER "ftpUser"
122 #define VAR_FTP_HOST "ftpHost"
123 #define VAR_HTTP_PATH "_httpPath"
124 #define VAR_HTTP_PROXY "httpProxy"
125 #define VAR_HTTP_PORT "httpPort"
126 #define VAR_HTTP_HOST "httpHost"
127 #define VAR_HTTP_FTP_MODE "httpFtpMode"
128 #define VAR_GATEWAY "defaultrouter"
129 #define VAR_GEOMETRY "geometry"
130 #define VAR_HOSTNAME "hostname"
131 #define VAR_IFCONFIG "ifconfig_"
132 #define VAR_INSTALL_CFG "installConfig"
133 #define VAR_INSTALL_ROOT "installRoot"
134 #define VAR_IPADDR "ipaddr"
135 #define VAR_IPV6_ENABLE "ipv6_enable"
136 #define VAR_IPV6ADDR "ipv6addr"
137 #define VAR_KERN_SECURELEVEL "kern_securelevel"
138 #define VAR_KEYMAP "keymap"
139 #define VAR_LABEL "label"
140 #define VAR_LABEL_COUNT "labelCount"
141 #define VAR_LINUX_ENABLE "linux_enable"
142 #define VAR_MEDIA_TYPE "mediaType"
143 #define VAR_MEDIA_TIMEOUT "MEDIA_TIMEOUT"
144 #define VAR_MOUSED "moused_enable"
145 #define VAR_MOUSED_FLAGS "moused_flags"
146 #define VAR_MOUSED_PORT "moused_port"
147 #define VAR_MOUSED_TYPE "moused_type"
148 #define VAR_NAMESERVER "nameserver"
149 #define VAR_NETINTERACTIVE "netInteractive"
150 #define VAR_NETMASK "netmask"
151 #define VAR_NETWORK_DEVICE "netDev"
152 #define VAR_NEWFS_ARGS "newfsArgs"
153 #define VAR_NFS_PATH "nfs"
154 #define VAR_NFS_HOST "nfsHost"
155 #define VAR_NFS_V3 "nfs_use_v3"
156 #define VAR_NFS_TCP "nfs_use_tcp"
157 #define VAR_NFS_SECURE "nfs_reserved_port_only"
158 #define VAR_NFS_SERVER "nfs_server_enable"
159 #define VAR_NO_CONFIRM "noConfirm"
160 #define VAR_NO_ERROR "noError"
161 #define VAR_NO_HOLOSHELL "noHoloShell"
162 #define VAR_NO_INET6 "noInet6"
163 #define VAR_NO_WARN "noWarn"
164 #define VAR_NO_USR "noUsr"
165 #define VAR_NO_TMP "noTmp"
166 #define VAR_NO_HOME "noHome"
167 #define VAR_NONINTERACTIVE "nonInteractive"
168 #define VAR_NOVELL "novell"
169 #define VAR_OSF1_ENABLE "osf1_enable"
170 #define VAR_RPCBIND_ENABLE "rpcbind_enable"
171 #define VAR_NTPDATE_FLAGS "ntpdate_flags"
172 #define VAR_PACKAGE "package"
173 #define VAR_PARTITION "partition"
174 #define VAR_PCNFSD "pcnfsd"
175 #define VAR_PKG_TMPDIR "PKG_TMPDIR"
176 #define VAR_PORTS_PATH "ports"
177 #define VAR_PPP_ENABLE "ppp_enable"
178 #define VAR_PPP_PROFILE "ppp_profile"
179 #define VAR_RELNAME "releaseName"
180 #define VAR_ROOT_SIZE "rootSize"
181 #define VAR_ROUTER "router"
182 #define VAR_ROUTER_ENABLE "router_enable"
183 #define VAR_ROUTERFLAGS "router_flags"
184 #define VAR_SENDMAIL_ENABLE "sendmail_enable"
185 #define VAR_SERIAL_SPEED "serialSpeed"
186 #define VAR_SLOW_ETHER "slowEthernetCard"
187 #define VAR_SWAP_SIZE "swapSize"
188 #define VAR_TAPE_BLOCKSIZE "tapeBlocksize"
189 #define VAR_TRY_DHCP "tryDHCP"
190 #define VAR_TRY_RTSOL "tryRTSOL"
191 #define VAR_SKIP_PCCARD "skipPCCARD"
192 #define VAR_UFS_PATH "ufs"
193 #define VAR_USR_SIZE "usrSize"
194 #define VAR_VAR_SIZE "varSize"
195 #define VAR_TMP_SIZE "tmpSize"
196 #define VAR_HOME_SIZE "homeSize"
197 #define VAR_XORG_CONFIG "_xorgconfig"
198 #define VAR_TERM "TERM"
199 #define VAR_CONSTERM "_consterm"
201 #define DEFAULT_TAPE_BLOCKSIZE "20"
203 /* One MB worth of blocks */
205 #define ONE_GIG (ONE_MEG * 1024)
207 /* Which selection attributes to use */
208 #define ATTR_SELECTED (ColorDisplay ? item_selected_attr : item_attr)
209 #define ATTR_TITLE button_active_attr
211 /* Handy strncpy() macro */
212 #define SAFE_STRCPY(to, from) sstrncpy((to), (from), sizeof (to) - 1)
216 typedef struct disk Disk;
217 typedef struct chunk Chunk;
219 /* Bitfields for menu options */
220 #define DMENU_NORMAL_TYPE 0x1 /* Normal dialog menu */
221 #define DMENU_RADIO_TYPE 0x2 /* Radio dialog menu */
222 #define DMENU_CHECKLIST_TYPE 0x4 /* Multiple choice menu */
223 #define DMENU_SELECTION_RETURNS 0x8 /* Immediate return on item selection */
225 typedef struct _dmenu {
226 int type; /* What sort of menu we are */
227 char *title; /* Our title */
228 char *prompt; /* Our prompt */
229 char *helpline; /* Line of help at bottom */
230 char *helpfile; /* Help file for "F1" */
231 #if (__STDC_VERSION__ >= 199901L) || (__GNUC__ >= 3)
232 dialogMenuItem items[]; /* Array of menu items */
234 dialogMenuItem items[0]; /* Array of menu items */
236 #error "Create hack for C89 and K&R compilers."
240 /* An rc.conf variable */
241 typedef struct _variable {
242 struct _variable *next;
248 #define NO_ECHO_OBJ(type) ((type) | (DITEM_NO_ECHO << 16))
249 #define TYPE_OF_OBJ(type) ((type) & 0xff)
250 #define ATTR_OF_OBJ(type) ((type) >> 16)
252 /* A screen layout structure */
253 typedef struct _layout {
254 int y; /* x & Y co-ordinates */
256 int len; /* The size of the dialog on the screen */
257 int maxlen; /* How much the user can type in ... */
258 char *prompt; /* The string for the prompt */
259 char *help; /* The display for the help line */
260 void *var; /* The var to set when this changes */
261 int type; /* The type of the dialog to create */
262 void *obj; /* The obj pointer returned by libdialog */
280 /* CDROM mount codes */
281 #define CD_UNMOUNTED 0
282 #define CD_ALREADY_MOUNTED 1
283 #define CD_WE_MOUNTED_IT 2
285 /* A "device" from sysinstall's point of view */
286 typedef struct _device {
287 char name[DEV_NAME_MAX];
292 Boolean (*init)(struct _device *dev);
293 FILE * (*get)(struct _device *dev, char *file, Boolean probe);
294 void (*shutdown)(struct _device *dev);
300 /* Some internal representations of partitions */
310 #define NEWFS_UFS_CMD "newfs"
311 #define NEWFS_MSDOS_CMD "newfs_msdos"
313 enum newfs_type { NEWFS_UFS, NEWFS_MSDOS, NEWFS_CUSTOM };
314 #define NEWFS_UFS_STRING "UFS"
315 #define NEWFS_MSDOS_STRING "FAT"
316 #define NEWFS_CUSTOM_STRING "CST"
318 /* The longest set of custom command line arguments we'll pass. */
319 #define NEWFS_CMD_ARGS_MAX 256
321 typedef struct _part_info {
322 char mountpoint[FILENAME_MAX];
324 /* Is invocation of newfs desired? */
327 enum newfs_type newfs_type;
330 char user_options[NEWFS_CMD_ARGS_MAX];
331 Boolean acls; /* unused */
332 Boolean multilabel; /* unused */
340 char command[NEWFS_CMD_ARGS_MAX];
346 typedef struct _opt {
349 enum { OPT_IS_STRING, OPT_IS_INT, OPT_IS_FUNC, OPT_IS_VAR } type;
355 /* Weird index nodey things we use for keeping track of package information */
356 typedef enum { PACKAGE, PLACE } node_type; /* Types of nodes */
358 typedef struct _pkgnode { /* A node in the reconstructed hierarchy */
359 struct _pkgnode *next; /* My next sibling */
360 node_type type; /* What am I? */
361 char *name; /* My name */
362 char *desc; /* My description (Hook) */
363 struct _pkgnode *kids; /* My little children */
364 void *data; /* A place to hang my data */
366 typedef PkgNode *PkgNodePtr;
368 /* A single package */
369 typedef struct _indexEntry { /* A single entry in an INDEX file */
370 char *name; /* name */
371 char *path; /* full path to port */
372 char *prefix; /* port prefix */
373 char *comment; /* one line description */
374 char *descrfile; /* path to description file */
375 char *deps; /* packages this depends on */
376 int depc; /* how many depend on me */
377 int installed; /* indicates if it is installed */
378 char *maintainer; /* maintainer */
379 unsigned int volume; /* Volume of package */
381 typedef IndexEntry *IndexEntryPtr;
383 typedef int (*commandFunc)(char *key, void *data);
385 #define HOSTNAME_FIELD_LEN 128
386 #define IPADDR_FIELD_LEN 16
387 #define EXTRAS_FIELD_LEN 128
389 /* This is the structure that Network devices carry around in their private, erm, structures */
390 typedef struct _devPriv {
393 char ipaddr[IPADDR_FIELD_LEN];
394 char netmask[IPADDR_FIELD_LEN];
395 char extras[EXTRAS_FIELD_LEN];
400 extern jmp_buf BailOut; /* Used to get the heck out */
401 extern int CDROMInitQuiet; /* Don't whine if mount(2) fails */
402 extern int DebugFD; /* Where diagnostic output goes */
403 extern Boolean Fake; /* Don't actually modify anything - testing */
404 extern Boolean Restarting; /* Are we restarting sysinstall? */
405 extern Boolean SystemWasInstalled; /* Did we install it? */
406 extern Boolean RunningAsInit; /* Are we running stand-alone? */
407 extern Boolean DialogActive; /* Is the dialog() stuff up? */
408 extern Boolean ColorDisplay; /* Are we on a color display? */
409 extern Boolean OnVTY; /* On a syscons VTY? */
410 extern Variable *VarHead; /* The head of the variable chain */
411 extern Device *mediaDevice; /* Where we're getting our distribution from */
412 extern unsigned int Dists; /* Which distributions we want */
413 extern unsigned int SrcDists; /* Which src distributions we want */
414 extern unsigned int XOrgDists; /* Which X.Org dists we want */
415 extern int BootMgr; /* Which boot manager to use */
416 extern int StatusLine; /* Where to print our status messages */
417 extern DMenu MenuInitial; /* Initial installation menu */
418 extern DMenu MenuFixit; /* Fixit repair menu */
419 #if defined(__i386__) || defined(__amd64__)
421 extern DMenu MenuIPLType; /* Type of IPL to write on the disk */
423 extern DMenu MenuMBRType; /* Type of MBR to write on the disk */
426 extern DMenu MenuConfigure; /* Final configuration menu */
427 extern DMenu MenuDocumentation; /* Documentation menu */
428 extern DMenu MenuFTPOptions; /* FTP Installation options */
429 extern DMenu MenuIndex; /* Index menu */
430 extern DMenu MenuOptions; /* Installation options */
431 extern DMenu MenuOptionsLanguage; /* Language options menu */
432 extern DMenu MenuKLD; /* Prototype KLD menu */
433 extern DMenu MenuMedia; /* Media type menu */
435 extern DMenu MenuMouse; /* Mouse type menu */
437 extern DMenu MenuMediaCDROM; /* CDROM media menu */
438 extern DMenu MenuMediaDOS; /* DOS media menu */
439 extern DMenu MenuMediaFloppy; /* Floppy media menu */
440 extern DMenu MenuMediaFTP; /* FTP media menu */
441 extern DMenu MenuMediaTape; /* Tape media menu */
442 extern DMenu MenuNetworkDevice; /* Network device menu */
443 extern DMenu MenuNTP; /* NTP time server menu */
444 extern DMenu MenuSecurity; /* System security options menu */
445 extern DMenu MenuSecurelevel; /* Securelevel menu */
446 extern DMenu MenuStartup; /* Startup services menu */
448 extern DMenu MenuSyscons; /* System console configuration menu */
449 extern DMenu MenuSysconsFont; /* System console font configuration menu */
450 extern DMenu MenuSysconsKeymap; /* System console keymap configuration menu */
451 extern DMenu MenuSysconsKeyrate; /* System console keyrate configuration menu */
452 extern DMenu MenuSysconsSaver; /* System console saver configuration menu */
453 extern DMenu MenuSysconsScrnmap; /* System console screenmap configuration menu */
454 extern DMenu MenuSysconsTtys; /* System console terminal type menu */
456 extern DMenu MenuNetworking; /* Network configuration menu */
457 extern DMenu MenuMTA; /* MTA selection menu */
458 extern DMenu MenuInstallCustom; /* Custom Installation menu */
459 extern DMenu MenuDistributions; /* Distribution menu */
460 extern DMenu MenuDiskDevices; /* Disk type devices */
461 extern DMenu MenuSubDistributions; /* Custom distribution menu */
462 extern DMenu MenuSrcDistributions; /* Source distribution menu */
463 extern DMenu MenuXOrg; /* X.Org main menu */
464 extern DMenu MenuXOrgSelect; /* X.Org distribution selection menu */
465 extern DMenu MenuXOrgSelectCore; /* X.Org core distribution menu */
466 extern DMenu MenuXOrgSelectServer; /* X.Org server distribution menu */
467 extern DMenu MenuXOrgSelectFonts; /* X.Org font selection menu */
468 extern DMenu MenuXDesktops; /* X Desktops menu */
469 extern DMenu MenuHTMLDoc; /* HTML Documentation menu */
470 extern DMenu MenuUsermgmt; /* User management menu */
471 extern DMenu MenuFixit; /* Fixit floppy/CDROM/shell menu */
472 extern DMenu MenuXOrgConfig; /* Select X.Org configuration tool */
473 extern int FixItMode; /* FixItMode starts shell onc urrent device (ie Serial port) */
474 extern const char * StartName; /* Which name we were started as */
476 /* Important chunks. */
477 extern Chunk *HomeChunk;
478 extern Chunk *RootChunk;
479 extern Chunk *SwapChunk;
480 extern Chunk *TmpChunk;
481 extern Chunk *UsrChunk;
482 extern Chunk *VarChunk;
484 extern Chunk *EfiChunk;
487 /* Stuff from libdialog which isn't properly declared outside */
488 extern void display_helpfile(void);
489 extern void display_helpline(WINDOW *w, int y, int width);
494 extern int configAnonFTP(dialogMenuItem *self);
497 extern Boolean mediaInitCDROM(Device *dev);
498 extern FILE *mediaGetCDROM(Device *dev, char *file, Boolean probe);
499 extern void mediaShutdownCDROM(Device *dev);
502 extern void command_clear(void);
503 extern void command_sort(void);
504 extern void command_execute(void);
505 extern void command_shell_add(char *key, char *fmt, ...) __printflike(2, 3);
506 extern void command_func_add(char *key, commandFunc func, void *data);
509 extern void configEnvironmentRC_conf(void);
510 extern void configEnvironmentResolv(char *config);
511 extern void configRC_conf(void);
512 extern int configFstab(dialogMenuItem *self);
513 extern int configRC(dialogMenuItem *self);
514 extern int configResolv(dialogMenuItem *self);
515 extern int configPackages(dialogMenuItem *self);
516 extern int configSaver(dialogMenuItem *self);
517 extern int configSaverTimeout(dialogMenuItem *self);
519 extern int configLinux(dialogMenuItem *self);
521 extern int configNTP(dialogMenuItem *self);
523 extern int configOSF1(dialogMenuItem *self);
525 extern int configUsers(dialogMenuItem *self);
526 extern int configRouter(dialogMenuItem *self);
527 extern int configPCNFSD(dialogMenuItem *self);
528 extern int configInetd(dialogMenuItem *self);
529 extern int configNFSServer(dialogMenuItem *self);
530 extern int configMTAPostfix(dialogMenuItem *self);
531 extern int configMTAExim(dialogMenuItem *self);
532 extern int configRpcBind(dialogMenuItem *self);
533 extern int configWriteRC_conf(dialogMenuItem *self);
534 extern int configSecurelevel(dialogMenuItem *self);
535 extern int configSecurelevelDisabled(dialogMenuItem *self);
536 extern int configSecurelevelSecure(dialogMenuItem *self);
537 extern int configSecurelevelHighlySecure(dialogMenuItem *self);
538 extern int configSecurelevelNetworkSecure(dialogMenuItem *self);
539 extern int configEtcTtys(dialogMenuItem *self);
541 extern int checkLoaderACPI(void);
542 extern int configLoaderACPI(int);
546 extern DMenu *deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)(dialogMenuItem *d),
547 int (*check)(dialogMenuItem *d));
548 extern void deviceGetAll(void);
549 extern void deviceReset(void);
550 extern void deviceRescan(void);
551 extern Device **deviceFind(char *name, DeviceType type);
552 extern Device **deviceFindDescr(char *name, char *desc, DeviceType class);
553 extern int deviceCount(Device **devs);
554 extern Device *new_device(char *name);
555 extern Device *deviceRegister(char *name, char *desc, char *devname, DeviceType type, Boolean enabled,
556 Boolean (*init)(Device *mediadev),
557 FILE * (*get)(Device *dev, char *file, Boolean probe),
558 void (*shutDown)(Device *mediadev),
560 extern Boolean dummyInit(Device *dev);
561 extern FILE *dummyGet(Device *dev, char *dist, Boolean probe);
562 extern void dummyShutdown(Device *dev);
565 extern int dhcpParseLeases(char *file, char *hostname, char *domain, char *nameserver,
566 char *ipaddr, char *gateway, char *netmask);
570 extern void diskPartition(Device *dev);
571 extern int diskPartitionEditor(dialogMenuItem *self);
573 extern int diskPartitionWrite(dialogMenuItem *self);
574 extern int diskGetSelectCount(Device ***devs);
577 extern int dispatchCommand(char *command);
578 extern int dispatch_load_floppy(dialogMenuItem *self);
579 extern int dispatch_load_file_int(int);
580 extern int dispatch_load_file(dialogMenuItem *self);
584 extern int distReset(dialogMenuItem *self);
585 extern int distConfig(dialogMenuItem *self);
586 extern int distSetCustom(dialogMenuItem *self);
587 extern int distUnsetCustom(dialogMenuItem *self);
588 extern int distSetDeveloper(dialogMenuItem *self);
589 extern int distSetXDeveloper(dialogMenuItem *self);
590 extern int distSetKernDeveloper(dialogMenuItem *self);
591 extern int distSetXKernDeveloper(dialogMenuItem *self);
592 extern int distSetUser(dialogMenuItem *self);
593 extern int distSetXUser(dialogMenuItem *self);
594 extern int distSetMinimum(dialogMenuItem *self);
595 extern int distSetEverything(dialogMenuItem *self);
596 extern int distSetSrc(dialogMenuItem *self);
597 extern int distSetXOrg(dialogMenuItem *self);
598 extern int distExtractAll(dialogMenuItem *self);
601 extern int dmenuDisplayFile(dialogMenuItem *tmp);
602 extern int dmenuSubmenu(dialogMenuItem *tmp);
603 extern int dmenuSystemCommand(dialogMenuItem *tmp);
604 extern int dmenuSystemCommandBox(dialogMenuItem *tmp);
605 extern int dmenuExit(dialogMenuItem *tmp);
606 extern int dmenuISetVariable(dialogMenuItem *tmp);
607 extern int dmenuSetVariable(dialogMenuItem *tmp);
608 extern int dmenuSetKmapVariable(dialogMenuItem *tmp);
609 extern int dmenuSetVariables(dialogMenuItem *tmp);
610 extern int dmenuToggleVariable(dialogMenuItem *tmp);
611 extern int dmenuSetFlag(dialogMenuItem *tmp);
612 extern int dmenuSetValue(dialogMenuItem *tmp);
613 extern Boolean dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max, Boolean buttons);
614 extern Boolean dmenuOpenSimple(DMenu *menu, Boolean buttons);
615 extern int dmenuVarCheck(dialogMenuItem *item);
616 extern int dmenuVarsCheck(dialogMenuItem *item);
617 extern int dmenuFlagCheck(dialogMenuItem *item);
618 extern int dmenuRadioCheck(dialogMenuItem *item);
621 extern int docBrowser(dialogMenuItem *self);
622 extern int docShowDocument(dialogMenuItem *self);
625 extern Boolean mediaCloseDOS(Device *dev, FILE *fp);
626 extern Boolean mediaInitDOS(Device *dev);
627 extern FILE *mediaGetDOS(Device *dev, char *file, Boolean probe);
628 extern void mediaShutdownDOS(Device *dev);
631 extern int getRootFloppy(void);
632 extern Boolean mediaInitFloppy(Device *dev);
633 extern FILE *mediaGetFloppy(Device *dev, char *file, Boolean probe);
634 extern void mediaShutdownFloppy(Device *dev);
637 extern Boolean mediaCloseFTP(Device *dev, FILE *fp);
638 extern Boolean mediaInitFTP(Device *dev);
639 extern FILE *mediaGetFTP(Device *dev, char *file, Boolean probe);
640 extern void mediaShutdownFTP(Device *dev);
643 extern Boolean mediaInitHTTP(Device *dev);
644 extern FILE *mediaGetHTTP(Device *dev, char *file, Boolean probe);
647 extern void globalsInit(void);
650 int index_read(FILE *fp, PkgNodePtr papa);
651 int index_menu(PkgNodePtr root, PkgNodePtr top, PkgNodePtr plist, int *pos, int *scroll);
652 void index_init(PkgNodePtr top, PkgNodePtr plist);
653 void index_node_free(PkgNodePtr top, PkgNodePtr plist);
654 void index_sort(PkgNodePtr top);
655 void index_print(PkgNodePtr top, int level);
656 int index_extract(Device *dev, PkgNodePtr top, PkgNodePtr who, Boolean depended);
657 int index_initialize(char *path);
658 PkgNodePtr index_search(PkgNodePtr top, char *str, PkgNodePtr *tp);
661 extern Boolean checkLabels(Boolean whinge);
662 extern int installCommit(dialogMenuItem *self);
663 extern int installCustomCommit(dialogMenuItem *self);
664 extern int installExpress(dialogMenuItem *self);
665 extern int installStandard(dialogMenuItem *self);
666 extern int installFixitHoloShell(dialogMenuItem *self);
667 extern int installFixitCDROM(dialogMenuItem *self);
668 extern int installFixitFloppy(dialogMenuItem *self);
669 extern int installFixupBase(dialogMenuItem *self);
670 extern int installUpgrade(dialogMenuItem *self);
671 extern int installFilesystems(dialogMenuItem *self);
672 extern int installVarDefaults(dialogMenuItem *self);
673 extern void installEnvironment(void);
674 extern Boolean copySelf(void);
677 extern int kget(char *out);
680 extern int loadKeymap(const char *lang);
683 extern int diskLabelEditor(dialogMenuItem *self);
684 extern int diskLabelCommit(dialogMenuItem *self);
686 /* makedevs.c (auto-generated) */
687 extern const char termcap_ansi[];
688 extern const char termcap_vt100[];
689 extern const char termcap_cons25w[];
690 extern const char termcap_cons25[];
691 extern const char termcap_cons25_m[];
692 extern const char termcap_cons25r[];
693 extern const char termcap_cons25r_m[];
694 extern const char termcap_cons25l1[];
695 extern const char termcap_cons25l1_m[];
696 extern const char termcap_xterm[];
697 extern const u_char font_iso_8x16[];
698 extern const u_char font_cp850_8x16[];
699 extern const u_char font_cp866_8x16[];
700 extern const u_char koi8_r2cp866[];
701 extern u_char default_scrnmap[];
704 extern char *cpioVerbosity(void);
705 extern void mediaClose(void);
706 extern int mediaTimeout(void);
707 extern int mediaSetCDROM(dialogMenuItem *self);
708 extern int mediaSetFloppy(dialogMenuItem *self);
709 extern int mediaSetDOS(dialogMenuItem *self);
710 extern int mediaSetTape(dialogMenuItem *self);
711 extern int mediaSetFTP(dialogMenuItem *self);
712 extern int mediaSetFTPActive(dialogMenuItem *self);
713 extern int mediaSetFTPPassive(dialogMenuItem *self);
714 extern int mediaSetHTTP(dialogMenuItem *self);
715 extern int mediaSetUFS(dialogMenuItem *self);
716 extern int mediaSetNFS(dialogMenuItem *self);
717 extern int mediaSetFTPUserPass(dialogMenuItem *self);
718 extern int mediaSetCPIOVerbosity(dialogMenuItem *self);
719 extern int mediaGetType(dialogMenuItem *self);
720 extern Boolean mediaExtractDist(char *dir, char *dist, FILE *fp);
721 extern Boolean mediaExtractDistBegin(char *dir, int *fd, int *zpid, int *cpic);
722 extern Boolean mediaExtractDistEnd(int zpid, int cpid);
723 extern Boolean mediaVerify(void);
724 extern FILE *mediaGenericGet(char *base, const char *file);
727 extern Boolean file_readable(char *fname);
728 extern Boolean file_executable(char *fname);
729 extern Boolean directory_exists(const char *dirname);
730 extern char *root_bias(char *path);
731 extern char *itoa(int value);
732 extern char *string_concat(char *p1, char *p2);
733 extern char *string_concat3(char *p1, char *p2, char *p3);
734 extern char *string_prune(char *str);
735 extern char *string_skipwhite(char *str);
736 extern char *string_copy(char *s1, char *s2);
737 extern char *pathBaseName(const char *path);
738 extern void safe_free(void *ptr);
739 extern void *safe_malloc(size_t size);
740 extern void *safe_realloc(void *orig, size_t size);
741 extern dialogMenuItem *item_add(dialogMenuItem *list, char *prompt, char *title,
742 int (*checked)(dialogMenuItem *self),
743 int (*fire)(dialogMenuItem *self),
744 void (*selected)(dialogMenuItem *self, int is_selected),
745 void *data, int *aux, int *curr, int *max);
746 extern void items_free(dialogMenuItem *list, int *curr, int *max);
747 extern int Mkdir(char *);
748 extern int Mkdir_command(char *key, void *data);
749 extern int Mount(char *, void *data);
750 extern int Mount_msdosfs(char *mountp, void *devname);
751 extern WINDOW *openLayoutDialog(char *helpfile, char *title, int x, int y, int width, int height);
752 extern ComposeObj *initLayoutDialog(WINDOW *win, Layout *layout, int x, int y, int *max);
753 extern int layoutDialogLoop(WINDOW *win, Layout *layout, ComposeObj **obj,
754 int *n, int max, int *cbutton, int *cancel);
756 extern WINDOW *savescr(void);
757 extern void restorescr(WINDOW *w);
758 extern char *sstrncpy(char *dst, const char *src, int size);
761 extern void driverFloppyCheck(void);
762 extern void moduleInitialize(void);
763 extern int kldBrowser(dialogMenuItem *self);
766 extern int mousedTest(dialogMenuItem *self);
767 extern int mousedDisable(dialogMenuItem *self);
768 extern int setMouseFlags(dialogMenuItem *self);
771 extern Boolean isDebug(void);
772 extern void msgInfo(char *fmt, ...) __printf0like(1, 2);
773 extern void msgYap(char *fmt, ...) __printflike(1, 2);
774 extern void msgWarn(char *fmt, ...) __printflike(1, 2);
775 extern void msgDebug(char *fmt, ...) __printflike(1, 2);
776 extern void msgError(char *fmt, ...) __printflike(1, 2);
777 extern void msgFatal(char *fmt, ...) __printflike(1, 2);
778 extern void msgConfirm(char *fmt, ...) __printflike(1, 2);
779 extern void msgNotify(char *fmt, ...) __printflike(1, 2);
780 extern void msgWeHaveOutput(char *fmt, ...) __printflike(1, 2);
781 extern int msgYesNo(char *fmt, ...) __printflike(1, 2);
782 extern int msgNoYes(char *fmt, ...) __printflike(1, 2);
783 extern char *msgGetInput(char *buf, char *fmt, ...) __printflike(2, 3);
784 extern int msgSimpleConfirm(char *);
785 extern int msgSimpleNotify(char *);
788 extern Boolean mediaInitNetwork(Device *dev);
789 extern void mediaShutdownNetwork(Device *dev);
792 extern Boolean mediaInitNFS(Device *dev);
793 extern FILE *mediaGetNFS(Device *dev, char *file, Boolean probe);
794 extern void mediaShutdownNFS(Device *dev);
797 extern int optionsEditor(dialogMenuItem *self);
800 extern int packageAdd(dialogMenuItem *self);
801 extern int package_add(char *name);
802 extern int package_extract(Device *dev, char *name, Boolean depended);
803 extern Boolean package_installed(char *name);
806 extern void pccardInitialize(void);
809 extern void systemInitialize(int argc, char **argv);
810 extern void systemShutdown(int status);
811 extern int execExecute(char *cmd, char *name);
812 extern int systemExecute(char *cmd);
813 extern void systemSuspendDialog(void);
814 extern void systemResumeDialog(void);
815 extern int systemDisplayHelp(char *file);
816 extern char *systemHelpFile(char *file, char *buf);
817 extern void systemChangeFont(const u_char font[]);
818 extern void systemChangeLang(char *lang);
819 extern void systemChangeTerminal(char *color, const u_char c_termcap[], char *mono, const u_char m_termcap[]);
820 extern void systemChangeScreenmap(const u_char newmap[]);
821 extern void systemCreateHoloshell(void);
822 extern int vsystem(char *fmt, ...) __printflike(1, 2);
825 extern char *mediaTapeBlocksize(void);
826 extern Boolean mediaInitTape(Device *dev);
827 extern FILE *mediaGetTape(Device *dev, char *file, Boolean probe);
828 extern void mediaShutdownTape(Device *dev);
831 extern int tcpOpenDialog(Device *dev);
832 extern int tcpMenuSelect(dialogMenuItem *self);
833 extern Device *tcpDeviceSelect(void);
836 extern int set_termcap(void);
839 extern void configTtys(void);
842 extern void mediaShutdownUFS(Device *dev);
843 extern Boolean mediaInitUFS(Device *dev);
844 extern FILE *mediaGetUFS(Device *dev, char *file, Boolean probe);
847 extern void usbInitialize(void);
850 extern int userAddGroup(dialogMenuItem *self);
851 extern int userAddUser(dialogMenuItem *self);
854 extern void variable_set(char *var, int dirty);
855 extern void variable_set2(char *name, char *value, int dirty);
856 extern char *variable_get(char *var);
857 extern int variable_cmp(char *var, char *value);
858 extern void variable_unset(char *var);
859 extern char *variable_get_value(char *var, char *prompt, int dirty);
860 extern int variable_check(char *data);
861 extern int variable_check2(char *data);
862 extern int dump_variables(dialogMenuItem *self);
863 extern void free_variables(void);
864 extern void pvariable_set(char *var);
865 extern char *pvariable_get(char *var);
868 extern void slice_wizard(Disk *d);
871 * Macros. Please find a better place for us!
873 #define DEVICE_INIT(d) ((d) != NULL ? (d)->init((d)) : (Boolean)0)
874 #define DEVICE_GET(d, b, f) ((d) != NULL ? (d)->get((d), (b), (f)) : NULL)
875 #define DEVICE_SHUTDOWN(d) ((d) != NULL ? (d)->shutdown((d)) : (void)0)
878 #define UNZIPPER "gunzip"
880 #define UNZIPPER "bunzip2"
884 /* _SYSINSTALL_H_INCLUDE */