diff --git a/release/sysinstall/config.c b/release/sysinstall/config.c index 62af84a40a34..bf61a2a60610 100644 --- a/release/sysinstall/config.c +++ b/release/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/release/sysinstall/disks.c b/release/sysinstall/disks.c index b4f09009619f..7351710870eb 100644 --- a/release/sysinstall/disks.c +++ b/release/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/release/sysinstall/dist.c b/release/sysinstall/dist.c index c8455f727ff8..cf2b3c7d2469 100644 --- a/release/sysinstall/dist.c +++ b/release/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/release/sysinstall/doc.c b/release/sysinstall/doc.c index c5b579b77d43..17da2c6607aa 100644 --- a/release/sysinstall/doc.c +++ b/release/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/release/sysinstall/dos.c b/release/sysinstall/dos.c index 0e3ccecd796c..abc3debd8150 100644 --- a/release/sysinstall/dos.c +++ b/release/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/release/sysinstall/floppy.c b/release/sysinstall/floppy.c index bc5b6322fff3..b58501650bb1 100644 --- a/release/sysinstall/floppy.c +++ b/release/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/release/sysinstall/ftp.c b/release/sysinstall/ftp.c index 1c5a6e613a38..07c4528ae404 100644 --- a/release/sysinstall/ftp.c +++ b/release/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/release/sysinstall/install.c b/release/sysinstall/install.c index 4d726ac0dc84..ea3db2297d9a 100644 --- a/release/sysinstall/install.c +++ b/release/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/release/sysinstall/installUpgrade.c b/release/sysinstall/installUpgrade.c index b6e00605986e..2dcc66f76158 100644 --- a/release/sysinstall/installUpgrade.c +++ b/release/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/release/sysinstall/media.c b/release/sysinstall/media.c index 7a3f29ef1745..8bade8adf5a3 100644 --- a/release/sysinstall/media.c +++ b/release/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/release/sysinstall/network.c b/release/sysinstall/network.c index 836f21ca9d32..2ca782b268bb 100644 --- a/release/sysinstall/network.c +++ b/release/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/release/sysinstall/samba.c b/release/sysinstall/samba.c index 2f61c1232415..5c9624f9c5a4 100644 --- a/release/sysinstall/samba.c +++ b/release/sysinstall/samba.c @@ -155,6 +155,5 @@ configSamba(dialogMenuItem *self) if (DITEM_STATUS(i) == DITEM_SUCCESS) variable_set2("samba", "YES"); restorescr(w); - return i | DITEM_RECREATE; + return i | DITEM_RESTORE; } - diff --git a/release/sysinstall/tape.c b/release/sysinstall/tape.c index a77cf0c8fc36..31c99dd3c80d 100644 --- a/release/sysinstall/tape.c +++ b/release/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/release/sysinstall/tcpip.c b/release/sysinstall/tcpip.c index 00c9024f6e62..11bc16e3f3f3 100644 --- a/release/sysinstall/tcpip.c +++ b/release/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; } diff --git a/usr.sbin/sade/config.c b/usr.sbin/sade/config.c index 62af84a40a34..bf61a2a60610 100644 --- a/usr.sbin/sade/config.c +++ b/usr.sbin/sade/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/sade/disks.c b/usr.sbin/sade/disks.c index b4f09009619f..7351710870eb 100644 --- a/usr.sbin/sade/disks.c +++ b/usr.sbin/sade/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/sade/install.c b/usr.sbin/sade/install.c index 4d726ac0dc84..ea3db2297d9a 100644 --- a/usr.sbin/sade/install.c +++ b/usr.sbin/sade/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/config.c b/usr.sbin/sysinstall/config.c index 62af84a40a34..bf61a2a60610 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 b4f09009619f..7351710870eb 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 c8455f727ff8..cf2b3c7d2469 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 c5b579b77d43..17da2c6607aa 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 0e3ccecd796c..abc3debd8150 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 bc5b6322fff3..b58501650bb1 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 1c5a6e613a38..07c4528ae404 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 4d726ac0dc84..ea3db2297d9a 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 b6e00605986e..2dcc66f76158 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 7a3f29ef1745..8bade8adf5a3 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 836f21ca9d32..2ca782b268bb 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 a77cf0c8fc36..31c99dd3c80d 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 00c9024f6e62..11bc16e3f3f3 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; }