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).
This commit is contained in:
Jordan K. Hubbard 1997-01-17 08:47:13 +00:00
parent a59ff6e254
commit 3b9b7e6177
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=21792
30 changed files with 179 additions and 149 deletions

View File

@ -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

View File

@ -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;
}

View File

@ -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

View File

@ -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 */

View File

@ -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;
}

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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");

View File

@ -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 */

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
}

View File

@ -361,5 +361,5 @@ int
tcpMenuSelect(dialogMenuItem *self)
{
(void)tcpDeviceSelect();
return DITEM_SUCCESS | DITEM_RECREATE | DITEM_RESTORE;
return DITEM_SUCCESS | DITEM_RESTORE;
}

View File

@ -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

View File

@ -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;
}

View File

@ -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

View File

@ -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

View File

@ -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;
}

View File

@ -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

View File

@ -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 */

View File

@ -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;
}

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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");

View File

@ -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 */

View File

@ -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;

View File

@ -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;
}

View File

@ -361,5 +361,5 @@ int
tcpMenuSelect(dialogMenuItem *self)
{
(void)tcpDeviceSelect();
return DITEM_SUCCESS | DITEM_RECREATE | DITEM_RESTORE;
return DITEM_SUCCESS | DITEM_RESTORE;
}