diff options
| author | Jordan K. Hubbard <jkh@FreeBSD.org> | 1996-07-05 08:44:10 +0000 |
|---|---|---|
| committer | Jordan K. Hubbard <jkh@FreeBSD.org> | 1996-07-05 08:44:10 +0000 |
| commit | ab9d0aa3e35bc9b30241e073c37b5d5227e9ae79 (patch) | |
| tree | 6c436ce54fc3eb22b175108cd802558edff5a1c2 /release/sysinstall | |
| parent | 6a55af626db8654631c97ac7c8b4c4d1921106a3 (diff) | |
Notes
Diffstat (limited to 'release/sysinstall')
| -rw-r--r-- | release/sysinstall/config.c | 17 | ||||
| -rw-r--r-- | release/sysinstall/disks.c | 4 | ||||
| -rw-r--r-- | release/sysinstall/dmenu.c | 4 | ||||
| -rw-r--r-- | release/sysinstall/install.c | 24 | ||||
| -rw-r--r-- | release/sysinstall/media.c | 36 | ||||
| -rw-r--r-- | release/sysinstall/sysinstall.h | 4 | ||||
| -rw-r--r-- | release/sysinstall/system.c | 23 |
7 files changed, 64 insertions, 48 deletions
diff --git a/release/sysinstall/config.c b/release/sysinstall/config.c index efc951bfd42f..c2619f255d9c 100644 --- a/release/sysinstall/config.c +++ b/release/sysinstall/config.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: config.c,v 1.16.2.55 1996/07/03 01:31:06 jkh Exp $ + * $Id: config.c,v 1.16.2.56 1996/07/05 00:55:13 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -244,7 +244,7 @@ configFstab(void) #define MAX_LINES 2000 /* Some big number we're not likely to ever reach - I'm being really lazy here, I know */ void -configSysconfig(void) +configSysconfig(char *config) { FILE *fp; char *lines[MAX_LINES], *cp; @@ -252,13 +252,12 @@ configSysconfig(void) Variable *v; int i, nlines; - fp = fopen("/etc/sysconfig", "r"); + fp = fopen(config, "r"); if (!fp) { - msgConfirm("Unable to open /etc/sysconfig file! Things may work\n" - "rather strangely as a result of this."); + msgConfirm("Unable to open %s file! This is bad!", config); return; } - msgNotify("Writing configuration changes to /etc/sysconfig file.."); + msgNotify("Writing configuration changes to %s file..", config); nlines = 0; /* Read in the entire file */ @@ -267,7 +266,7 @@ configSysconfig(void) break; lines[nlines++] = strdup(line); } - msgDebug("Read %d lines from sysconfig.\n", nlines); + msgDebug("Read %d lines from %s.\n", nlines, config); /* Now do variable substitutions */ for (v = VarHead; v; v = v->next) { for (i = 0; i < nlines; i++) { @@ -293,11 +292,11 @@ configSysconfig(void) /* Now write it all back out again */ fclose(fp); if (Fake) { - msgDebug("Writing sysconfig out to debugging screen..\n"); + msgDebug("Writing %s out to debugging screen..\n", config); fp = fdopen(DebugFD, "w"); } else - fp = fopen("/etc/sysconfig", "w"); + fp = fopen(config, "w"); for (i = 0; i < nlines; i++) { static Boolean firstTime = TRUE; diff --git a/release/sysinstall/disks.c b/release/sysinstall/disks.c index 71332e226aca..2db577d8d1b0 100644 --- a/release/sysinstall/disks.c +++ b/release/sysinstall/disks.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: disks.c,v 1.31.2.45 1996/06/26 09:31:45 jkh Exp $ + * $Id: disks.c,v 1.31.2.46 1996/07/03 01:31:07 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -497,7 +497,7 @@ diskPartitionEditor(dialogMenuItem *self) i = dmenuOpenSimple(menu, FALSE) ? DITEM_SUCCESS : DITEM_FAILURE; free(menu); } - i = i | DITEM_RESTORE | DITEM_RECREATE; + i = i | DITEM_RECREATE; } return i; } diff --git a/release/sysinstall/dmenu.c b/release/sysinstall/dmenu.c index 3ee020e2613e..36c5ca0a21fe 100644 --- a/release/sysinstall/dmenu.c +++ b/release/sysinstall/dmenu.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated for what's essentially a complete rewrite. * - * $Id: dmenu.c,v 1.12.2.11 1996/06/14 18:35:07 jkh Exp $ + * $Id: dmenu.c,v 1.12.2.12 1996/07/03 01:31:10 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -52,7 +52,7 @@ int dmenuSubmenu(dialogMenuItem *tmp) { return (dmenuOpenSimple((DMenu *)(tmp->data), FALSE) ? DITEM_SUCCESS : DITEM_FAILURE) | - DITEM_RESTORE | DITEM_RECREATE; + DITEM_RECREATE; } int diff --git a/release/sysinstall/install.c b/release/sysinstall/install.c index 40162f0cc038..9bf528ae9d6d 100644 --- a/release/sysinstall/install.c +++ b/release/sysinstall/install.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: install.c,v 1.71.2.95 1996/07/03 01:31:11 jkh Exp $ + * $Id: install.c,v 1.71.2.96 1996/07/05 00:55:14 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -299,13 +299,13 @@ installExpress(dialogMenuItem *self) if (!Dists) { dialog_clear(); if (!dmenuOpenSimple(&MenuDistributions, FALSE) && !Dists) - return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RECREATE; } if (!mediaDevice) { dialog_clear(); if (!dmenuOpenSimple(&MenuMedia, FALSE) || !mediaDevice) - return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RECREATE; } if (DITEM_STATUS((i = installCommit(self))) == DITEM_SUCCESS) { @@ -315,9 +315,9 @@ installExpress(dialogMenuItem *self) /* Now write out any changes .. */ configResolv(); - configSysconfig(); + configSysconfig("/etc/sysconfig"); } - return i | DITEM_RESTORE | DITEM_RECREATE; + return i | DITEM_RECREATE; } /* Novice mode installation */ @@ -357,7 +357,7 @@ installNovice(dialogMenuItem *self) "of distributions if none of the provided ones are suitable."); while (1) { if (!dmenuOpenSimple(&MenuDistributions, FALSE) && !Dists) - return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RECREATE; if (Dists || !msgYesNo("No distributions selected. Are you sure you wish to continue?")) break; @@ -367,7 +367,7 @@ installNovice(dialogMenuItem *self) dialog_clear(); msgConfirm("Finally, you must specify an installation medium."); if (!dmenuOpenSimple(&MenuMedia, FALSE) || !mediaDevice) - return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RECREATE; } if (DITEM_STATUS((i = installCommit(self))) == DITEM_FAILURE) { @@ -376,7 +376,7 @@ installNovice(dialogMenuItem *self) "scroll-lock feature. You can also chose \"No\" at the next\n" "prompt and go back into the installation menus to try and retry\n" "whichever operations have failed."); - return i | DITEM_RESTORE | DITEM_RECREATE; + return i | DITEM_RECREATE; } else @@ -468,9 +468,9 @@ installNovice(dialogMenuItem *self) /* Now write out any changes .. */ configResolv(); - configSysconfig(); + configSysconfig("/etc/sysconfig"); - return DITEM_LEAVE_MENU | DITEM_RESTORE | DITEM_RECREATE; + return DITEM_LEAVE_MENU | DITEM_RECREATE; } /* The version of commit we call from the Install Custom menu */ @@ -486,7 +486,7 @@ installCustomCommit(dialogMenuItem *self) /* Now write out any changes .. */ configResolv(); - configSysconfig(); + configSysconfig("/etc/sysconfig"); return i; } else @@ -543,7 +543,7 @@ installCommit(dialogMenuItem *self) "see the Interfaces configuration item on the Configuration menu."); } variable_set2(SYSTEM_STATE, DITEM_STATUS(i) == DITEM_FAILURE ? "error-install" : "full-install"); - return i | DITEM_RESTORE | DITEM_RECREATE; + return i | DITEM_RECREATE; } static void diff --git a/release/sysinstall/media.c b/release/sysinstall/media.c index 26c6fcd6e433..75be5e2e94ea 100644 --- a/release/sysinstall/media.c +++ b/release/sysinstall/media.c @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: media.c,v 1.25.2.34 1996/06/25 05:33:38 jkh Exp $ + * $Id: media.c,v 1.25.2.35 1996/07/03 01:31:13 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -108,11 +108,11 @@ mediaSetCDROM(dialogMenuItem *self) status = dmenuOpenSimple(menu, FALSE); free(menu); if (!status) - return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RECREATE; } else mediaDevice = devs[0]; - return (mediaDevice ? DITEM_SUCCESS | DITEM_LEAVE_MENU : DITEM_FAILURE) | DITEM_RESTORE | DITEM_RECREATE; + return (mediaDevice ? DITEM_SUCCESS | DITEM_LEAVE_MENU : DITEM_FAILURE) | DITEM_RECREATE; } static int @@ -149,11 +149,11 @@ mediaSetFloppy(dialogMenuItem *self) status = dmenuOpenSimple(menu, FALSE); free(menu); if (!status) - return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RECREATE; } else mediaDevice = devs[0]; - return (mediaDevice ? DITEM_LEAVE_MENU : DITEM_FAILURE) | DITEM_RESTORE | DITEM_RECREATE; + return (mediaDevice ? DITEM_LEAVE_MENU : DITEM_FAILURE) | DITEM_RECREATE; } static int @@ -188,11 +188,11 @@ mediaSetDOS(dialogMenuItem *self) status = dmenuOpenSimple(menu, FALSE); free(menu); if (!status) - return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RECREATE; } else mediaDevice = devs[0]; - return (mediaDevice ? DITEM_LEAVE_MENU : DITEM_FAILURE) | DITEM_RESTORE | DITEM_RECREATE; + return (mediaDevice ? DITEM_LEAVE_MENU : DITEM_FAILURE) | DITEM_RECREATE; } static int @@ -229,7 +229,7 @@ mediaSetTape(dialogMenuItem *self) status = dmenuOpenSimple(menu, FALSE); free(menu); if (!status) - return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RECREATE; } else mediaDevice = devs[0]; @@ -246,7 +246,7 @@ mediaSetTape(dialogMenuItem *self) else mediaDevice->private = strdup(val); } - return (mediaDevice ? DITEM_LEAVE_MENU : DITEM_FAILURE) | DITEM_RESTORE | DITEM_RECREATE; + return (mediaDevice ? DITEM_LEAVE_MENU : DITEM_FAILURE) | DITEM_RECREATE; } /* @@ -262,12 +262,12 @@ mediaSetFTP(dialogMenuItem *self) dialog_clear(); if (!dmenuOpenSimple(&MenuMediaFTP, FALSE)) - return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RECREATE; else cp = variable_get(VAR_FTP_PATH); if (!cp) { msgConfirm("%s not set! Not setting an FTP installation path, OK?", VAR_FTP_PATH); - return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RECREATE; } else if (!strcmp(cp, "other")) { variable_set2(VAR_FTP_PATH, "ftp://"); @@ -279,20 +279,20 @@ mediaSetFTP(dialogMenuItem *self) "Where <path> is relative to the anonymous ftp directory or the\n" "home directory of the user being logged in as."); if (!cp || !*cp) - return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RECREATE; } if (strncmp("ftp://", cp, 6)) { msgConfirm("Sorry, %s is an invalid URL!", cp); - return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RECREATE; } strcpy(ftpDevice.name, cp); if (!tcpDeviceSelect()) - return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RECREATE; if (!mediaDevice || !mediaDevice->init(mediaDevice)) { if (isDebug()) msgDebug("mediaSetFTP: Net device init failed.\n"); - return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RECREATE; } hostname = cp + 6; if ((cp = index(hostname, ':')) != NULL) { @@ -312,7 +312,7 @@ mediaSetFTP(dialogMenuItem *self) if ((gethostbyname(hostname) == NULL) && (inet_addr(hostname) == INADDR_NONE)) { msgConfirm("Cannot resolve hostname `%s'! Are you sure that your\n" "name server, gateway and network interface are correctly configured?", hostname); - return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RECREATE; } variable_set2(VAR_FTP_HOST, hostname); variable_set2(VAR_FTP_DIR, dir ? dir : "/"); @@ -324,7 +324,7 @@ mediaSetFTP(dialogMenuItem *self) ftpDevice.shutdown = mediaShutdownFTP; ftpDevice.private = mediaDevice; /* Set to network device by tcpDeviceSelect() */ mediaDevice = &ftpDevice; - return DITEM_LEAVE_MENU | DITEM_RESTORE | DITEM_RECREATE; + return DITEM_LEAVE_MENU | DITEM_RECREATE; } int @@ -564,7 +564,7 @@ mediaGetType(dialogMenuItem *self) int i; i = dmenuOpenSimple(&MenuMedia, FALSE) ? DITEM_SUCCESS : DITEM_FAILURE; - return i | DITEM_RESTORE | DITEM_RECREATE; + return i | DITEM_RECREATE; } /* Return TRUE if all the media variables are set up correctly */ diff --git a/release/sysinstall/sysinstall.h b/release/sysinstall/sysinstall.h index 198136bf8f6c..cd55f130999f 100644 --- a/release/sysinstall/sysinstall.h +++ b/release/sysinstall/sysinstall.h @@ -4,7 +4,7 @@ * This is probably the last attempt in the `sysinstall' line, the next * generation being slated to essentially a complete rewrite. * - * $Id: sysinstall.h,v 1.42.2.60 1996/07/03 01:31:17 jkh Exp $ + * $Id: sysinstall.h,v 1.42.2.61 1996/07/05 00:55:17 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -355,7 +355,7 @@ extern void command_func_add(char *key, commandFunc func, void *data); /* config.c */ extern int configFstab(void); -extern void configSysconfig(void); +extern void configSysconfig(char *config); extern void configResolv(void); extern int configPorts(dialogMenuItem *self); extern int configPackages(dialogMenuItem *self); diff --git a/release/sysinstall/system.c b/release/sysinstall/system.c index fb5a0ccd4a8d..5c4d12d55095 100644 --- a/release/sysinstall/system.c +++ b/release/sysinstall/system.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: system.c,v 1.59 1996/05/16 11:47:46 jkh Exp $ + * $Id: system.c,v 1.44.2.22 1996/05/24 06:09:04 jkh Exp $ * * Jordan Hubbard * @@ -24,6 +24,10 @@ #include <sys/ioctl.h> #include <sys/wait.h> + +/* Where we stick our temporary expanded doc file */ +#define DOC_TMP_FILE "/tmp/doc.tmp" + /* * Handle interrupt signals - this probably won't work in all cases * due to our having bogotified the internal state of dialog or curses, @@ -36,6 +40,16 @@ handle_intr(int sig) systemShutdown(1); } +/* Expand a file into a convenient location, nuking it each time */ +static char * +expand(char *fname) +{ + unlink(DOC_TMP_FILE); + if (vsystem("gzip -c -d %s > %s", fname, DOC_TMP_FILE)) + return NULL; + return DOC_TMP_FILE; +} + /* Initialize system defaults */ void systemInitialize(int argc, char **argv) @@ -94,6 +108,9 @@ systemShutdown(int status) /* Shut down curses */ endwin(); + /* If we have a temporary doc file lying around, nuke it */ + unlink(DOC_TMP_FILE); + /* REALLY exit! */ if (RunningAsInit) { /* Put the console back */ @@ -160,9 +177,9 @@ systemHelpFile(char *file, char *buf) if (!file) return NULL; - snprintf(buf, FILENAME_MAX, "/stand/help/%s.hlp", file); + snprintf(buf, FILENAME_MAX, "/stand/help/%s.hlp.gz", file); if (file_readable(buf)) - return buf; + return expand(buf); snprintf(buf, FILENAME_MAX, "/usr/src/release/sysinstall/help/%s.hlp", file); if (file_readable(buf)) return buf; |
