diff options
-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/doc.c | 6 | ||||
-rw-r--r-- | release/sysinstall/install.c | 24 | ||||
-rw-r--r-- | release/sysinstall/installUpgrade.c | 38 | ||||
-rw-r--r-- | release/sysinstall/media.c | 36 | ||||
-rw-r--r-- | release/sysinstall/sysinstall.h | 4 | ||||
-rw-r--r-- | release/sysinstall/system.c | 23 | ||||
-rw-r--r-- | usr.sbin/sade/config.c | 17 | ||||
-rw-r--r-- | usr.sbin/sade/disks.c | 4 | ||||
-rw-r--r-- | usr.sbin/sade/dmenu.c | 4 | ||||
-rw-r--r-- | usr.sbin/sade/install.c | 24 | ||||
-rw-r--r-- | usr.sbin/sade/sade.h | 4 | ||||
-rw-r--r-- | usr.sbin/sade/system.c | 23 | ||||
-rw-r--r-- | usr.sbin/sysinstall/config.c | 17 | ||||
-rw-r--r-- | usr.sbin/sysinstall/disks.c | 4 | ||||
-rw-r--r-- | usr.sbin/sysinstall/dmenu.c | 4 | ||||
-rw-r--r-- | usr.sbin/sysinstall/doc.c | 6 | ||||
-rw-r--r-- | usr.sbin/sysinstall/install.c | 24 | ||||
-rw-r--r-- | usr.sbin/sysinstall/installUpgrade.c | 38 | ||||
-rw-r--r-- | usr.sbin/sysinstall/media.c | 36 | ||||
-rw-r--r-- | usr.sbin/sysinstall/sysinstall.h | 4 | ||||
-rw-r--r-- | usr.sbin/sysinstall/system.c | 23 |
24 files changed, 222 insertions, 166 deletions
diff --git a/release/sysinstall/config.c b/release/sysinstall/config.c index cba9514..d8ef40a 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.42 1996/07/02 09:12:34 jkh Exp $ + * $Id: config.c,v 1.43 1996/07/04 23:11:54 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 c8eebd3..abc5d4d 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.52 1996/06/25 18:41:08 jkh Exp $ + * $Id: disks.c,v 1.53 1996/07/02 01:03:33 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 57cd535..bb679a9 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.20 1996/06/12 14:02:05 jkh Exp $ + * $Id: dmenu.c,v 1.21 1996/07/02 01:03:39 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/doc.c b/release/sysinstall/doc.c index 9f85935..50fdc90 100644 --- a/release/sysinstall/doc.c +++ b/release/sysinstall/doc.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: doc.c,v 1.16 1996/05/16 11:47:28 jkh Exp $ + * $Id: doc.c,v 1.17 1996/07/02 01:03:40 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -76,9 +76,9 @@ docBrowser(dialogMenuItem *self) /* Run browser on the appropriate doc */ if (dmenuOpenSimple(&MenuHTMLDoc, FALSE)) - return DITEM_SUCCESS | DITEM_RESTORE | DITEM_RECREATE; + return DITEM_SUCCESS | DITEM_RECREATE; else - return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RECREATE; } /* Try to show one of the documents requested from the HTML doc menu */ diff --git a/release/sysinstall/install.c b/release/sysinstall/install.c index 3031e3f..29ac6f5 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.106 1996/07/02 10:57:52 jkh Exp $ + * $Id: install.c,v 1.107 1996/07/04 23:11:56 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/installUpgrade.c b/release/sysinstall/installUpgrade.c index d686080..cada516 100644 --- a/release/sysinstall/installUpgrade.c +++ b/release/sysinstall/installUpgrade.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: installUpgrade.c,v 1.26 1996/05/29 01:35:29 jkh Exp $ + * $Id: installUpgrade.c,v 1.27 1996/07/02 01:03:43 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -170,11 +170,11 @@ traverseHitlist(HitList *h) ++h; } } - + int installUpgrade(dialogMenuItem *self) { - char *saved_etc = NULL; + char *saved_etc; Boolean extractingBin = TRUE; struct termios foo; @@ -187,9 +187,10 @@ installUpgrade(dialogMenuItem *self) variable_set2(SYSTEM_STATE, "upgrade"); systemDisplayHelp("upgrade"); + dialog_clear(); if (msgYesNo("Given all that scary stuff you just read, are you sure you want to\n" "risk it all and proceed with this upgrade?")) - return DITEM_FAILURE; + return DITEM_FAILURE | DITEM_RESTORE; if (!Dists) { msgConfirm("You haven't specified any distributions yet. The upgrade procedure will\n" @@ -198,7 +199,7 @@ installUpgrade(dialogMenuItem *self) "to select those portions of 2.1 you wish to install on top of your 2.0.5\n" "system."); if (!dmenuOpenSimple(&MenuDistributions, FALSE)) - return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RECREATE; } /* No bin selected? Not much of an upgrade.. */ @@ -218,22 +219,22 @@ installUpgrade(dialogMenuItem *self) if (!mediaDevice) { msgConfirm("Now you must specify an installation medium for the upgrade."); if (!dmenuOpenSimple(&MenuMedia, FALSE) || !mediaDevice) - return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RECREATE; } msgConfirm("OK. First, we're going to go to the disk label editor. In this editor\n" "you will be expected to *Mount* any partitions you're interested in\n" - "upgrading. Don't set the Newfs flag to Y on anything in the label editor\n" + "upgrading. DO NOT set the Newfs flag to Y on anything in the label editor\n" "unless you're absolutely sure you know what you're doing! In this\n" "instance, you'll be using the label editor as little more than a fancy\n" - "screen-oriented filesystem mounting utility, so think of it that way.\n\n" + "screen-oriented way of labeling existing partitions.\n\n" "Once you're done in the label editor, press Q to return here for the next\n" "step."); if (DITEM_STATUS(diskLabelEditor(self)) == DITEM_FAILURE) { msgConfirm("The disk label editor failed to work properly! Upgrade operation\n" "aborted."); - return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RECREATE; } /* Don't write out MBR info */ @@ -242,29 +243,31 @@ installUpgrade(dialogMenuItem *self) msgConfirm("Not all file systems were properly mounted. Upgrade operation\n" "aborted."); variable_unset(DISK_PARTITIONED); - return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RECREATE; } if (!copySelf()) { msgConfirm("Couldn't clone the boot floppy onto the root file system.\n" "Aborting."); - return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RECREATE; } if (DITEM_STATUS(chroot("/mnt")) == DITEM_FAILURE) { msgConfirm("Unable to chroot to /mnt - something is wrong with the\n" "root partition or the way it's mounted if this doesn't work."); variable_unset(DISK_PARTITIONED); - return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RECREATE; } chdir("/"); systemCreateHoloshell(); + saved_etc = NULL; if (extractingBin) { while (!saved_etc) { saved_etc = msgGetInput("/usr/tmp/etc", "Under which directory do you wish to save your current /etc?"); if (!saved_etc || !*saved_etc || Mkdir(saved_etc, NULL)) { + saved_etc = NULL; if (msgYesNo("Directory was not specified, was invalid or user selected Cancel.\n\n" "Doing an upgrade without first backing up your /etc directory is a very\n" "bad idea! Do you want to go back and specify the save directory again?")) @@ -274,8 +277,10 @@ installUpgrade(dialogMenuItem *self) if (saved_etc) { msgNotify("Preserving /etc directory.."); - /* cp returns a bogus status, so we can't check the status meaningfully. Bleah. */ - (void)vsystem("cp -pr /etc/* %s", saved_etc); + if (vsystem("tar -cf - -C /etc . | tar -xpf - -C %s", saved_etc)) + if (msgYesNo("Unable to backup your /etc into %s.\n" + "Do you want to continue anyway?")) + return DITEM_FAILURE | DITEM_RECREATE; } if (file_readable("/kernel")) { msgNotify("Moving old kernel to /kernel.prev"); @@ -319,7 +324,7 @@ installUpgrade(dialogMenuItem *self) "Next comes stage 2, where we attempt to resurrect your /etc\n" "directory!"); - if (chdir(saved_etc)) { + if (saved_etc && chdir(saved_etc)) { msgConfirm("Unable to go to your saved /etc directory in %s?! Argh!\n" "Something went seriously wrong! It's quite possible that\n" "your former /etc is toast. I hope you didn't have any\n" @@ -354,10 +359,9 @@ installUpgrade(dialogMenuItem *self) printf("Well, good luck! When you're done, please type \"reboot\" or exit\n" "the shell to reboot the new system.\n"); if (!Fake) - execlp("sh", "-sh", 0); + system("/bin/sh"); else exit(0); - msgDebug("Was unable to execute sh for post-upgrade shell!\n"); if (RunningAsInit) reboot(0); /* NOTREACHED */ diff --git a/release/sysinstall/media.c b/release/sysinstall/media.c index 95fede1..421eba6 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.43 1996/06/25 04:28:22 jkh Exp $ + * $Id: media.c,v 1.44 1996/07/02 01:03:46 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 d4d7f80..baa2bf9 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.69 1996/07/02 10:57:56 jkh Exp $ + * $Id: sysinstall.h,v 1.70 1996/07/04 23:12:02 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 b826f3e..936456b 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.58 1996/05/01 03:31:08 jkh Exp $ + * $Id: system.c,v 1.59 1996/05/16 11:47:46 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; diff --git a/usr.sbin/sade/config.c b/usr.sbin/sade/config.c index cba9514..d8ef40a 100644 --- a/usr.sbin/sade/config.c +++ b/usr.sbin/sade/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.42 1996/07/02 09:12:34 jkh Exp $ + * $Id: config.c,v 1.43 1996/07/04 23:11:54 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/usr.sbin/sade/disks.c b/usr.sbin/sade/disks.c index c8eebd3..abc5d4d 100644 --- a/usr.sbin/sade/disks.c +++ b/usr.sbin/sade/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.52 1996/06/25 18:41:08 jkh Exp $ + * $Id: disks.c,v 1.53 1996/07/02 01:03:33 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/usr.sbin/sade/dmenu.c b/usr.sbin/sade/dmenu.c index 57cd535..bb679a9 100644 --- a/usr.sbin/sade/dmenu.c +++ b/usr.sbin/sade/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.20 1996/06/12 14:02:05 jkh Exp $ + * $Id: dmenu.c,v 1.21 1996/07/02 01:03:39 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/usr.sbin/sade/install.c b/usr.sbin/sade/install.c index 3031e3f..29ac6f5 100644 --- a/usr.sbin/sade/install.c +++ b/usr.sbin/sade/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.106 1996/07/02 10:57:52 jkh Exp $ + * $Id: install.c,v 1.107 1996/07/04 23:11:56 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/usr.sbin/sade/sade.h b/usr.sbin/sade/sade.h index d4d7f80..baa2bf9 100644 --- a/usr.sbin/sade/sade.h +++ b/usr.sbin/sade/sade.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.69 1996/07/02 10:57:56 jkh Exp $ + * $Id: sysinstall.h,v 1.70 1996/07/04 23:12:02 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/usr.sbin/sade/system.c b/usr.sbin/sade/system.c index b826f3e..936456b 100644 --- a/usr.sbin/sade/system.c +++ b/usr.sbin/sade/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.58 1996/05/01 03:31:08 jkh Exp $ + * $Id: system.c,v 1.59 1996/05/16 11:47:46 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; diff --git a/usr.sbin/sysinstall/config.c b/usr.sbin/sysinstall/config.c index cba9514..d8ef40a 100644 --- a/usr.sbin/sysinstall/config.c +++ b/usr.sbin/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.42 1996/07/02 09:12:34 jkh Exp $ + * $Id: config.c,v 1.43 1996/07/04 23:11:54 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/usr.sbin/sysinstall/disks.c b/usr.sbin/sysinstall/disks.c index c8eebd3..abc5d4d 100644 --- a/usr.sbin/sysinstall/disks.c +++ b/usr.sbin/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.52 1996/06/25 18:41:08 jkh Exp $ + * $Id: disks.c,v 1.53 1996/07/02 01:03:33 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/usr.sbin/sysinstall/dmenu.c b/usr.sbin/sysinstall/dmenu.c index 57cd535..bb679a9 100644 --- a/usr.sbin/sysinstall/dmenu.c +++ b/usr.sbin/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.20 1996/06/12 14:02:05 jkh Exp $ + * $Id: dmenu.c,v 1.21 1996/07/02 01:03:39 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/usr.sbin/sysinstall/doc.c b/usr.sbin/sysinstall/doc.c index 9f85935..50fdc90 100644 --- a/usr.sbin/sysinstall/doc.c +++ b/usr.sbin/sysinstall/doc.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: doc.c,v 1.16 1996/05/16 11:47:28 jkh Exp $ + * $Id: doc.c,v 1.17 1996/07/02 01:03:40 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -76,9 +76,9 @@ docBrowser(dialogMenuItem *self) /* Run browser on the appropriate doc */ if (dmenuOpenSimple(&MenuHTMLDoc, FALSE)) - return DITEM_SUCCESS | DITEM_RESTORE | DITEM_RECREATE; + return DITEM_SUCCESS | DITEM_RECREATE; else - return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RECREATE; } /* Try to show one of the documents requested from the HTML doc menu */ diff --git a/usr.sbin/sysinstall/install.c b/usr.sbin/sysinstall/install.c index 3031e3f..29ac6f5 100644 --- a/usr.sbin/sysinstall/install.c +++ b/usr.sbin/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.106 1996/07/02 10:57:52 jkh Exp $ + * $Id: install.c,v 1.107 1996/07/04 23:11:56 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/usr.sbin/sysinstall/installUpgrade.c b/usr.sbin/sysinstall/installUpgrade.c index d686080..cada516 100644 --- a/usr.sbin/sysinstall/installUpgrade.c +++ b/usr.sbin/sysinstall/installUpgrade.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: installUpgrade.c,v 1.26 1996/05/29 01:35:29 jkh Exp $ + * $Id: installUpgrade.c,v 1.27 1996/07/02 01:03:43 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -170,11 +170,11 @@ traverseHitlist(HitList *h) ++h; } } - + int installUpgrade(dialogMenuItem *self) { - char *saved_etc = NULL; + char *saved_etc; Boolean extractingBin = TRUE; struct termios foo; @@ -187,9 +187,10 @@ installUpgrade(dialogMenuItem *self) variable_set2(SYSTEM_STATE, "upgrade"); systemDisplayHelp("upgrade"); + dialog_clear(); if (msgYesNo("Given all that scary stuff you just read, are you sure you want to\n" "risk it all and proceed with this upgrade?")) - return DITEM_FAILURE; + return DITEM_FAILURE | DITEM_RESTORE; if (!Dists) { msgConfirm("You haven't specified any distributions yet. The upgrade procedure will\n" @@ -198,7 +199,7 @@ installUpgrade(dialogMenuItem *self) "to select those portions of 2.1 you wish to install on top of your 2.0.5\n" "system."); if (!dmenuOpenSimple(&MenuDistributions, FALSE)) - return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RECREATE; } /* No bin selected? Not much of an upgrade.. */ @@ -218,22 +219,22 @@ installUpgrade(dialogMenuItem *self) if (!mediaDevice) { msgConfirm("Now you must specify an installation medium for the upgrade."); if (!dmenuOpenSimple(&MenuMedia, FALSE) || !mediaDevice) - return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RECREATE; } msgConfirm("OK. First, we're going to go to the disk label editor. In this editor\n" "you will be expected to *Mount* any partitions you're interested in\n" - "upgrading. Don't set the Newfs flag to Y on anything in the label editor\n" + "upgrading. DO NOT set the Newfs flag to Y on anything in the label editor\n" "unless you're absolutely sure you know what you're doing! In this\n" "instance, you'll be using the label editor as little more than a fancy\n" - "screen-oriented filesystem mounting utility, so think of it that way.\n\n" + "screen-oriented way of labeling existing partitions.\n\n" "Once you're done in the label editor, press Q to return here for the next\n" "step."); if (DITEM_STATUS(diskLabelEditor(self)) == DITEM_FAILURE) { msgConfirm("The disk label editor failed to work properly! Upgrade operation\n" "aborted."); - return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RECREATE; } /* Don't write out MBR info */ @@ -242,29 +243,31 @@ installUpgrade(dialogMenuItem *self) msgConfirm("Not all file systems were properly mounted. Upgrade operation\n" "aborted."); variable_unset(DISK_PARTITIONED); - return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RECREATE; } if (!copySelf()) { msgConfirm("Couldn't clone the boot floppy onto the root file system.\n" "Aborting."); - return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RECREATE; } if (DITEM_STATUS(chroot("/mnt")) == DITEM_FAILURE) { msgConfirm("Unable to chroot to /mnt - something is wrong with the\n" "root partition or the way it's mounted if this doesn't work."); variable_unset(DISK_PARTITIONED); - return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RECREATE; } chdir("/"); systemCreateHoloshell(); + saved_etc = NULL; if (extractingBin) { while (!saved_etc) { saved_etc = msgGetInput("/usr/tmp/etc", "Under which directory do you wish to save your current /etc?"); if (!saved_etc || !*saved_etc || Mkdir(saved_etc, NULL)) { + saved_etc = NULL; if (msgYesNo("Directory was not specified, was invalid or user selected Cancel.\n\n" "Doing an upgrade without first backing up your /etc directory is a very\n" "bad idea! Do you want to go back and specify the save directory again?")) @@ -274,8 +277,10 @@ installUpgrade(dialogMenuItem *self) if (saved_etc) { msgNotify("Preserving /etc directory.."); - /* cp returns a bogus status, so we can't check the status meaningfully. Bleah. */ - (void)vsystem("cp -pr /etc/* %s", saved_etc); + if (vsystem("tar -cf - -C /etc . | tar -xpf - -C %s", saved_etc)) + if (msgYesNo("Unable to backup your /etc into %s.\n" + "Do you want to continue anyway?")) + return DITEM_FAILURE | DITEM_RECREATE; } if (file_readable("/kernel")) { msgNotify("Moving old kernel to /kernel.prev"); @@ -319,7 +324,7 @@ installUpgrade(dialogMenuItem *self) "Next comes stage 2, where we attempt to resurrect your /etc\n" "directory!"); - if (chdir(saved_etc)) { + if (saved_etc && chdir(saved_etc)) { msgConfirm("Unable to go to your saved /etc directory in %s?! Argh!\n" "Something went seriously wrong! It's quite possible that\n" "your former /etc is toast. I hope you didn't have any\n" @@ -354,10 +359,9 @@ installUpgrade(dialogMenuItem *self) printf("Well, good luck! When you're done, please type \"reboot\" or exit\n" "the shell to reboot the new system.\n"); if (!Fake) - execlp("sh", "-sh", 0); + system("/bin/sh"); else exit(0); - msgDebug("Was unable to execute sh for post-upgrade shell!\n"); if (RunningAsInit) reboot(0); /* NOTREACHED */ diff --git a/usr.sbin/sysinstall/media.c b/usr.sbin/sysinstall/media.c index 95fede1..421eba6 100644 --- a/usr.sbin/sysinstall/media.c +++ b/usr.sbin/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.43 1996/06/25 04:28:22 jkh Exp $ + * $Id: media.c,v 1.44 1996/07/02 01:03:46 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/usr.sbin/sysinstall/sysinstall.h b/usr.sbin/sysinstall/sysinstall.h index d4d7f80..baa2bf9 100644 --- a/usr.sbin/sysinstall/sysinstall.h +++ b/usr.sbin/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.69 1996/07/02 10:57:56 jkh Exp $ + * $Id: sysinstall.h,v 1.70 1996/07/04 23:12:02 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/usr.sbin/sysinstall/system.c b/usr.sbin/sysinstall/system.c index b826f3e..936456b 100644 --- a/usr.sbin/sysinstall/system.c +++ b/usr.sbin/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.58 1996/05/01 03:31:08 jkh Exp $ + * $Id: system.c,v 1.59 1996/05/16 11:47:46 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; |