diff options
author | jkh <jkh@FreeBSD.org> | 1997-01-17 08:47:13 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1997-01-17 08:47:13 +0000 |
commit | 01b3e9a58be60d613a1575a5cd4341ab143f4ad3 (patch) | |
tree | 1d6cafcedb59c96ea3e9343e95b8c4dc482c6a3b /usr.sbin/sysinstall | |
parent | 83c2f5687e154ea6600cc012b5003a582b4f0dee (diff) | |
download | FreeBSD-src-01b3e9a58be60d613a1575a5cd4341ab143f4ad3.zip FreeBSD-src-01b3e9a58be60d613a1575a5cd4341ab143f4ad3.tar.gz |
Now that I know which parts of the installation really need it (since
there's no menu display bug to work around now), be far more selective
in my use of DITEM_RECREATE (which is slow and involves much screen I/O).
Diffstat (limited to 'usr.sbin/sysinstall')
-rw-r--r-- | usr.sbin/sysinstall/config.c | 2 | ||||
-rw-r--r-- | usr.sbin/sysinstall/disks.c | 2 | ||||
-rw-r--r-- | usr.sbin/sysinstall/dist.c | 8 | ||||
-rw-r--r-- | usr.sbin/sysinstall/doc.c | 4 | ||||
-rw-r--r-- | usr.sbin/sysinstall/dos.c | 3 | ||||
-rw-r--r-- | usr.sbin/sysinstall/floppy.c | 3 | ||||
-rw-r--r-- | usr.sbin/sysinstall/ftp.c | 24 | ||||
-rw-r--r-- | usr.sbin/sysinstall/install.c | 39 | ||||
-rw-r--r-- | usr.sbin/sysinstall/installUpgrade.c | 14 | ||||
-rw-r--r-- | usr.sbin/sysinstall/media.c | 22 | ||||
-rw-r--r-- | usr.sbin/sysinstall/network.c | 10 | ||||
-rw-r--r-- | usr.sbin/sysinstall/tape.c | 8 | ||||
-rw-r--r-- | usr.sbin/sysinstall/tcpip.c | 2 |
13 files changed, 77 insertions, 64 deletions
diff --git a/usr.sbin/sysinstall/config.c b/usr.sbin/sysinstall/config.c index 62af84a..bf61a2a 100644 --- a/usr.sbin/sysinstall/config.c +++ b/usr.sbin/sysinstall/config.c @@ -575,7 +575,7 @@ configPackages(dialogMenuItem *self) tmp = tmp2; } index_init(NULL, &plist); - return DITEM_SUCCESS | DITEM_RESTORE | DITEM_RECREATE; + return DITEM_SUCCESS | DITEM_RESTORE; } #ifdef NETCON_EXTENTIONS diff --git a/usr.sbin/sysinstall/disks.c b/usr.sbin/sysinstall/disks.c index b4f0900..7351710 100644 --- a/usr.sbin/sysinstall/disks.c +++ b/usr.sbin/sysinstall/disks.c @@ -514,7 +514,7 @@ diskPartitionEditor(dialogMenuItem *self) i = dmenuOpenSimple(menu, FALSE) ? DITEM_SUCCESS : DITEM_FAILURE; free(menu); } - i = i | DITEM_RECREATE; + i = i | DITEM_RESTORE; } return i; } diff --git a/usr.sbin/sysinstall/dist.c b/usr.sbin/sysinstall/dist.c index c8455f7..cf2b3c7 100644 --- a/usr.sbin/sysinstall/dist.c +++ b/usr.sbin/sysinstall/dist.c @@ -269,7 +269,7 @@ distSetDES(dialogMenuItem *self) } else i = DITEM_FAILURE; - return i | DITEM_RECREATE | DITEM_RESTORE; + return i | DITEM_RECREATE; } static int @@ -300,7 +300,7 @@ distMaybeSetDES(dialogMenuItem *self) else i = DITEM_FAILURE; } - return i | DITEM_RECREATE | DITEM_RESTORE; + return i | DITEM_RECREATE; } int @@ -316,7 +316,7 @@ distSetSrc(dialogMenuItem *self) } else i = DITEM_FAILURE; - return i | DITEM_RECREATE | DITEM_RESTORE; + return i | DITEM_RECREATE; } int @@ -336,7 +336,7 @@ distSetXF86(dialogMenuItem *self) } else i = DITEM_FAILURE; - return i | DITEM_RECREATE | DITEM_RESTORE; + return i | DITEM_RECREATE; } static Boolean diff --git a/usr.sbin/sysinstall/doc.c b/usr.sbin/sysinstall/doc.c index c5b579b..17da2c6 100644 --- a/usr.sbin/sysinstall/doc.c +++ b/usr.sbin/sysinstall/doc.c @@ -76,9 +76,9 @@ docBrowser(dialogMenuItem *self) /* Run browser on the appropriate doc */ if (dmenuOpenSimple(&MenuHTMLDoc, FALSE)) - return DITEM_SUCCESS | DITEM_RECREATE; + return DITEM_SUCCESS | DITEM_RESTORE; else - return DITEM_FAILURE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RESTORE; } /* Try to show one of the documents requested from the HTML doc menu */ diff --git a/usr.sbin/sysinstall/dos.c b/usr.sbin/sysinstall/dos.c index 0e3ccec..abc3deb 100644 --- a/usr.sbin/sysinstall/dos.c +++ b/usr.sbin/sysinstall/dos.c @@ -60,8 +60,7 @@ mediaInitDOS(Device *dev) return FALSE; } DOSMounted = TRUE; - if (isDebug()) - msgDebug("DOS partition %s mounted\n", dev->devname); + msgDebug("DOS partition %s mounted\n", dev->devname); return TRUE; } diff --git a/usr.sbin/sysinstall/floppy.c b/usr.sbin/sysinstall/floppy.c index bc5b632..b585016 100644 --- a/usr.sbin/sysinstall/floppy.c +++ b/usr.sbin/sysinstall/floppy.c @@ -161,7 +161,8 @@ mediaGetFloppy(Device *dev, char *file, Boolean probe) snprintf(buf, PATH_MAX, "/dist/%s", file); - msgDebug("Request for %s from floppy on /dist, probe is %d.\n", buf, probe); + if (isDebug()) + msgDebug("Request for %s from floppy on /dist, probe is %d.\n", buf, probe); if (!file_readable(buf)) { if (probe) return NULL; diff --git a/usr.sbin/sysinstall/ftp.c b/usr.sbin/sysinstall/ftp.c index 1c5a6e6..07c4528 100644 --- a/usr.sbin/sysinstall/ftp.c +++ b/usr.sbin/sysinstall/ftp.c @@ -73,15 +73,20 @@ mediaInitFTP(Device *dev) try: cp = variable_get(VAR_FTP_PATH); if (!cp) { - if (DITEM_STATUS(mediaSetFTP(NULL)) == DITEM_FAILURE || (cp = variable_get(VAR_FTP_PATH)) == NULL) - return FALSE; + if (DITEM_STATUS(mediaSetFTP(NULL)) == DITEM_FAILURE || (cp = variable_get(VAR_FTP_PATH)) == NULL) { + msgConfirm("Unable to get proper FTP path. FTP media not initialized."); + netdev->shutdown(netdev); + return FALSE; + } } hostname = variable_get(VAR_FTP_HOST); dir = variable_get(VAR_FTP_DIR); - if (!hostname || !dir) - msgFatal("Missing FTP host or directory specification - something's wrong!"); - + if (!hostname || !dir) { + msgConfirm("Missing FTP host or directory specification. FTP media not initialized,"); + netdev->shutdown(netdev); + return FALSE; + } user = variable_get(VAR_FTP_USER); login_name = (!user || !*user) ? "anonymous" : user; @@ -91,10 +96,7 @@ try: sprintf(password, "installer@%s", variable_get(VAR_HOSTNAME)); msgNotify("Logging in to %s@%s..", login_name, hostname); if ((OpenConn = ftpLogin(hostname, login_name, password, FtpPort, isDebug(), &code)) == NULL) { - if (variable_get(VAR_NO_CONFIRM)) - msgNotify("Couldn't open FTP connection to %s, errcode = %d", hostname, code); - else - msgConfirm("Couldn't open FTP connection to %s, errcode = %d", hostname, code); + msgConfirm("Couldn't open FTP connection to %s, errcode = %d", hostname, code); goto punt; } @@ -145,6 +147,7 @@ punt: fclose(OpenConn); OpenConn = NULL; } + netdev->shutdown(netdev); variable_unset(VAR_FTP_PATH); return FALSE; } @@ -215,8 +218,7 @@ mediaShutdownFTP(Device *dev) if (!ftpInitted) return; - if (isDebug()) - msgDebug("FTP shutdown called. OpenConn = %x\n", OpenConn); + msgDebug("FTP shutdown called. OpenConn = %x\n", OpenConn); if (OpenConn != NULL) { fclose(OpenConn); OpenConn = NULL; diff --git a/usr.sbin/sysinstall/install.c b/usr.sbin/sysinstall/install.c index 4d726ac..ea3db22 100644 --- a/usr.sbin/sysinstall/install.c +++ b/usr.sbin/sysinstall/install.c @@ -443,25 +443,27 @@ installExpress(dialogMenuItem *self) if (!Dists) { dialog_clear_norefresh(); - if (!dmenuOpenSimple(&MenuDistributions, FALSE) && !Dists) - return DITEM_FAILURE | DITEM_RECREATE; + if (!dmenuOpenSimple(&MenuDistributions, FALSE) || !Dists) + return DITEM_FAILURE | DITEM_RESTORE; } if (!mediaDevice) { dialog_clear_norefresh(); if (!dmenuOpenSimple(&MenuMedia, FALSE) || !mediaDevice) - return DITEM_FAILURE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RESTORE; } + if (!mediaDevice->init(mediaDevice)) + return DITEM_FAILURE | DITEM_REDRAW; + if (DITEM_STATUS((i = installCommit(self))) == DITEM_SUCCESS) { i |= DITEM_LEAVE_MENU; /* Give user the option of one last configuration spree */ installConfigure(); - - /* Now write out any changes .. */ - configSysconfig("/etc/sysconfig"); } - return i | DITEM_RECREATE; + /* Now write out any changes .. */ + configSysconfig("/etc/sysconfig"); + return i | DITEM_RESTORE; } /* Novice mode installation */ @@ -495,15 +497,18 @@ installNovice(dialogMenuItem *self) while (1) { dialog_clear_norefresh(); - if (!dmenuOpenSimple(&MenuDistributions, FALSE) && !Dists) - return DITEM_FAILURE | DITEM_RECREATE; + if (!dmenuOpenSimple(&MenuDistributions, FALSE)) + return DITEM_FAILURE | DITEM_RESTORE; - if (Dists || !msgYesNo("No distributions selected. Are you sure you wish to continue?")) - break; + if (!Dists && msgYesNo("No distributions selected. Revisit the distributions menu?")) + return DITEM_FAILURE | DITEM_RESTORE; } if (!mediaDevice && (!dmenuOpenSimple(&MenuMedia, FALSE) || !mediaDevice)) - return DITEM_FAILURE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RESTORE; + + if (!mediaDevice->init(mediaDevice)) + return DITEM_FAILURE | DITEM_RESTORE; if (DITEM_STATUS((i = installCommit(self))) == DITEM_FAILURE) { dialog_clear_norefresh(); @@ -512,7 +517,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_RECREATE; + return i | DITEM_RESTORE; } else { @@ -624,7 +629,7 @@ installNovice(dialogMenuItem *self) /* Now write out any changes .. */ configSysconfig("/etc/sysconfig"); - return DITEM_LEAVE_MENU | DITEM_RECREATE; + return DITEM_LEAVE_MENU | DITEM_RESTORE; } /* The version of commit we call from the Install Custom menu */ @@ -668,7 +673,7 @@ installCommit(dialogMenuItem *self) if (!msgYesNo("No distributions are selected for installation! Do you\n" "want to do this now?")) { if (!dmenuOpenSimple(&MenuDistributions, FALSE) && !Dists) - return DITEM_FAILURE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RESTORE; } else return DITEM_FAILURE | DITEM_RESTORE; @@ -678,7 +683,7 @@ installCommit(dialogMenuItem *self) if (!msgYesNo("You need to select a media type first. Do you want\n" "to do this now?")) { if (!dmenuOpenSimple(&MenuMedia, FALSE) || !mediaDevice) - return DITEM_FAILURE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RESTORE; } else return DITEM_FAILURE | DITEM_RESTORE; @@ -713,7 +718,7 @@ installCommit(dialogMenuItem *self) else i = DITEM_FAILURE; variable_set2(SYSTEM_STATE, DITEM_STATUS(i) == DITEM_FAILURE ? "error-install" : "full-install"); - return i | DITEM_RECREATE; + return i | DITEM_RESTORE; } static void diff --git a/usr.sbin/sysinstall/installUpgrade.c b/usr.sbin/sysinstall/installUpgrade.c index b6e0060..2dcc66f 100644 --- a/usr.sbin/sysinstall/installUpgrade.c +++ b/usr.sbin/sysinstall/installUpgrade.c @@ -167,7 +167,7 @@ installUpgrade(dialogMenuItem *self) "to select those portions of the new system you wish to install on top of\n" "the old."); if (!dmenuOpenSimple(&MenuDistributions, FALSE) || !Dists) - return DITEM_FAILURE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RESTORE; dialog_clear_norefresh(); } else if (!(Dists & DIST_BIN)) { /* No bin selected? Not much of an upgrade.. */ @@ -176,7 +176,7 @@ installUpgrade(dialogMenuItem *self) "want to select the bin distribution? Chose No to bring up the Distributions\n" "menu.") != 0) { if (!dmenuOpenSimple(&MenuDistributions, FALSE)) - return DITEM_FAILURE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RESTORE; dialog_clear_norefresh(); } } @@ -189,7 +189,7 @@ installUpgrade(dialogMenuItem *self) msgConfirm("Now you must specify an installation medium for the upgrade."); media: if (!dmenuOpenSimple(&MenuMedia, FALSE) || !mediaDevice) - return DITEM_FAILURE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RESTORE; } if (!mediaDevice->init(mediaDevice)) { @@ -232,7 +232,7 @@ media: if (DITEM_STATUS(diskLabelEditor(self)) == DITEM_FAILURE) { msgConfirm("The disk label editor returned an error status. Upgrade operation\n" "aborted."); - return DITEM_FAILURE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RESTORE; } /* Don't write out MBR info */ @@ -241,14 +241,14 @@ media: msgConfirm("Not all file systems were properly mounted. Upgrade operation\n" "aborted."); variable_unset(DISK_PARTITIONED); - return DITEM_FAILURE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RESTORE; } 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_RECREATE; + return DITEM_FAILURE | DITEM_RESTORE; } chdir("/"); systemCreateHoloshell(); @@ -272,7 +272,7 @@ media: 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?", saved_etc) != 0) - return DITEM_FAILURE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RESTORE; } if (file_readable("/kernel")) { msgNotify("Moving old kernel to /kernel.prev"); diff --git a/usr.sbin/sysinstall/media.c b/usr.sbin/sysinstall/media.c index 7a3f29e..8bade8a 100644 --- a/usr.sbin/sysinstall/media.c +++ b/usr.sbin/sysinstall/media.c @@ -105,11 +105,11 @@ mediaSetCDROM(dialogMenuItem *self) status = dmenuOpenSimple(menu, FALSE); free(menu); if (!status) - return DITEM_FAILURE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RESTORE; } else mediaDevice = devs[0]; - return (mediaDevice ? DITEM_SUCCESS | DITEM_LEAVE_MENU : DITEM_FAILURE) | DITEM_RECREATE; + return (mediaDevice ? DITEM_SUCCESS | DITEM_LEAVE_MENU : DITEM_FAILURE) | DITEM_RESTORE; } static int @@ -146,11 +146,11 @@ mediaSetFloppy(dialogMenuItem *self) status = dmenuOpenSimple(menu, FALSE); free(menu); if (!status) - return DITEM_FAILURE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RESTORE; } else mediaDevice = devs[0]; - return (mediaDevice ? DITEM_LEAVE_MENU : DITEM_FAILURE) | DITEM_RECREATE; + return (mediaDevice ? DITEM_LEAVE_MENU : DITEM_FAILURE) | DITEM_RESTORE; } static int @@ -185,11 +185,11 @@ mediaSetDOS(dialogMenuItem *self) status = dmenuOpenSimple(menu, FALSE); free(menu); if (!status) - return DITEM_FAILURE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RESTORE; } else mediaDevice = devs[0]; - return (mediaDevice ? DITEM_LEAVE_MENU : DITEM_FAILURE) | DITEM_RECREATE; + return (mediaDevice ? DITEM_LEAVE_MENU : DITEM_FAILURE) | DITEM_RESTORE; } static int @@ -226,7 +226,7 @@ mediaSetTape(dialogMenuItem *self) status = dmenuOpenSimple(menu, FALSE); free(menu); if (!status) - return DITEM_FAILURE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RESTORE; } else mediaDevice = devs[0]; @@ -243,7 +243,7 @@ mediaSetTape(dialogMenuItem *self) else mediaDevice->private = strdup(val); } - return (mediaDevice ? DITEM_LEAVE_MENU : DITEM_FAILURE) | DITEM_RECREATE; + return (mediaDevice ? DITEM_LEAVE_MENU : DITEM_FAILURE) | DITEM_RESTORE; } /* @@ -267,10 +267,10 @@ mediaSetFTP(dialogMenuItem *self) if (!cp) { dialog_clear_norefresh(); if (!dmenuOpenSimple(&MenuMediaFTP, FALSE)) - return DITEM_FAILURE | DITEM_RECREATE; + return DITEM_FAILURE | DITEM_RESTORE; else cp = variable_get(VAR_FTP_PATH); - what = DITEM_RECREATE; + what = DITEM_RESTORE; } if (!cp) return DITEM_FAILURE | what; @@ -625,7 +625,7 @@ mediaGetType(dialogMenuItem *self) int i; i = dmenuOpenSimple(&MenuMedia, FALSE) ? DITEM_SUCCESS : DITEM_FAILURE; - return i | DITEM_RECREATE; + return i | DITEM_RESTORE; } /* Return TRUE if all the media variables are set up correctly */ diff --git a/usr.sbin/sysinstall/network.c b/usr.sbin/sysinstall/network.c index 836f21c..2ca782b 100644 --- a/usr.sbin/sysinstall/network.c +++ b/usr.sbin/sysinstall/network.c @@ -64,6 +64,7 @@ mediaInitNetwork(Device *dev) /* Old PPP process lying around? */ if (pppPID) { + msgNotify("Killing previous PPP process %d.", pppPID); kill(pppPID, SIGTERM); pppPID = 0; } @@ -91,8 +92,10 @@ mediaInitNetwork(Device *dev) "correctness (default here is: VJ compression, Hardware flow-\n" "control, ignore carrier and 9600 baud data rate). When you're\n" "ready, press [ENTER] to execute it."); - if (!val) + if (!val) { + msgConfirm("slattach command was empty. Try again!"); return FALSE; + } else SAFE_STRCPY(attach, val); /* @@ -102,7 +105,7 @@ mediaInitNetwork(Device *dev) */ if (vsystem(attach)) { msgConfirm("slattach returned a bad status! Please verify that\n" - "the command is correct and try again."); + "the command is correct and try this operation again."); return FALSE; } } @@ -145,8 +148,7 @@ mediaShutdownNetwork(Device *dev) if (!RunningAsInit || !networkInitialized) return; - if (isDebug()) - msgDebug("Shutdown called for network device %s\n", dev->name); + msgDebug("Shutdown called for network device %s\n", dev->name); /* Not a serial device? */ if (strncmp("sl", dev->name, 2) && strncmp("ppp", dev->name, 3)) { int i; diff --git a/usr.sbin/sysinstall/tape.c b/usr.sbin/sysinstall/tape.c index a77cf0c..31c99dd 100644 --- a/usr.sbin/sysinstall/tape.c +++ b/usr.sbin/sysinstall/tape.c @@ -59,8 +59,11 @@ mediaInitTape(Device *dev) msgDebug("Tape init routine called for %s (private dir is %s)\n", dev->name, dev->private); Mkdir(dev->private); - if (chdir(dev->private)) + if (chdir(dev->private)) { + msgConfirm("Unable to CD to %s before extracting tape!\n" + "Tape media not selected.", dev->private); return FALSE; + } /* We know the tape is already in the drive, so go for it */ msgNotify("Attempting to extract from %s...", dev->description); if (!strcmp(dev->name, "rft0")) @@ -73,7 +76,8 @@ mediaInitTape(Device *dev) return TRUE; } else - msgConfirm("Tape extract command failed with status %d!", i); + msgConfirm("Tape extract command failed with status %d!\n" + "Unable to use tape media.", i); return FALSE; } diff --git a/usr.sbin/sysinstall/tcpip.c b/usr.sbin/sysinstall/tcpip.c index 00c9024..11bc16e 100644 --- a/usr.sbin/sysinstall/tcpip.c +++ b/usr.sbin/sysinstall/tcpip.c @@ -361,5 +361,5 @@ int tcpMenuSelect(dialogMenuItem *self) { (void)tcpDeviceSelect(); - return DITEM_SUCCESS | DITEM_RECREATE | DITEM_RESTORE; + return DITEM_SUCCESS | DITEM_RESTORE; } |