summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--release/sysinstall/Makefile9
-rw-r--r--release/sysinstall/anonFTP.c15
-rw-r--r--release/sysinstall/apache.c116
-rw-r--r--release/sysinstall/config.c22
-rw-r--r--release/sysinstall/disks.c4
-rw-r--r--release/sysinstall/dist.c11
-rw-r--r--release/sysinstall/doc.c11
-rw-r--r--release/sysinstall/dos.c4
-rw-r--r--release/sysinstall/ftp_strat.c12
-rw-r--r--release/sysinstall/index.c15
-rw-r--r--release/sysinstall/install.c34
-rw-r--r--release/sysinstall/installUpgrade.c12
-rw-r--r--release/sysinstall/label.c10
-rw-r--r--release/sysinstall/media.c38
-rw-r--r--release/sysinstall/menus.c22
-rw-r--r--release/sysinstall/misc.c3
-rw-r--r--release/sysinstall/package.c9
-rw-r--r--release/sysinstall/samba.c8
-rw-r--r--release/sysinstall/system.c11
-rw-r--r--usr.sbin/sade/Makefile9
-rw-r--r--usr.sbin/sade/config.c22
-rw-r--r--usr.sbin/sade/disks.c4
-rw-r--r--usr.sbin/sade/install.c34
-rw-r--r--usr.sbin/sade/label.c10
-rw-r--r--usr.sbin/sade/menus.c22
-rw-r--r--usr.sbin/sade/misc.c3
-rw-r--r--usr.sbin/sade/system.c11
-rw-r--r--usr.sbin/sysinstall/Makefile9
-rw-r--r--usr.sbin/sysinstall/anonFTP.c15
-rw-r--r--usr.sbin/sysinstall/config.c22
-rw-r--r--usr.sbin/sysinstall/disks.c4
-rw-r--r--usr.sbin/sysinstall/dist.c11
-rw-r--r--usr.sbin/sysinstall/doc.c11
-rw-r--r--usr.sbin/sysinstall/dos.c4
-rw-r--r--usr.sbin/sysinstall/index.c15
-rw-r--r--usr.sbin/sysinstall/install.c34
-rw-r--r--usr.sbin/sysinstall/installUpgrade.c12
-rw-r--r--usr.sbin/sysinstall/label.c10
-rw-r--r--usr.sbin/sysinstall/media.c38
-rw-r--r--usr.sbin/sysinstall/menus.c22
-rw-r--r--usr.sbin/sysinstall/misc.c3
-rw-r--r--usr.sbin/sysinstall/package.c9
-rw-r--r--usr.sbin/sysinstall/system.c11
43 files changed, 391 insertions, 320 deletions
diff --git a/release/sysinstall/Makefile b/release/sysinstall/Makefile
index 9c2c6b3..a7cf997 100644
--- a/release/sysinstall/Makefile
+++ b/release/sysinstall/Makefile
@@ -7,11 +7,10 @@ DEBUG_FLAGS+= -g3
SRCS= anonFTP.c apache.c attr.c cdrom.c command.c config.c \
devices.c disks.c dist.c dmenu.c doc.c dos.c floppy.c ftp.c \
- ftp_strat.c globals.c index.c install.c installFinal.c \
- installUpgrade.c label.c lndir.c main.c makedevs.c media.c \
- menus.c misc.c msg.c network.c nfs.c options.c \
- package.c samba.c system.c tape.c tcpip.c termcap.c ufs.c \
- variable.c wizard.c
+ ftp_strat.c globals.c index.c install.c installUpgrade.c \
+ label.c lndir.c main.c makedevs.c media.c menus.c misc.c \
+ msg.c network.c nfs.c options.c package.c samba.c system.c \
+ tape.c tcpip.c termcap.c ufs.c variable.c wizard.c
CFLAGS+= -Wall -I${.CURDIR}/../../gnu/lib/libdialog
diff --git a/release/sysinstall/anonFTP.c b/release/sysinstall/anonFTP.c
index 436d27f..591589f 100644
--- a/release/sysinstall/anonFTP.c
+++ b/release/sysinstall/anonFTP.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: anonFTP.c,v 1.12 1996/04/23 01:29:07 jkh Exp $
+ * $Id: anonFTP.c,v 1.13 1996/04/28 01:07:19 jkh Exp $
*
* Copyright (c) 1995
* Coranth Gryphon. All rights reserved.
@@ -206,7 +206,6 @@ createFtpUser(void)
fclose(fptr);
msgNotify("Remaking password file: %s", _PATH_MASTERPASSWD);
vsystem("pwd_mkdb -p %s", _PATH_MASTERPASSWD);
-
return (DITEM_SUCCESS);
}
@@ -404,9 +403,9 @@ configAnonFTP(dialogMenuItem *self)
dialog_clear();
i = anonftpOpenDialog();
- if (i != DITEM_SUCCESS) {
+ if (DITEM_STATUS(i) != DITEM_SUCCESS) {
msgConfirm("Configuration of Anonymous FTP cancelled per user request.");
- return DITEM_SUCCESS | DITEM_RESTORE;
+ return i | DITEM_RESTORE;
}
/*** Use defaults for any invalid values ***/
@@ -421,8 +420,8 @@ configAnonFTP(dialogMenuItem *self)
/*** If the user did not specify a directory, use default ***/
- if (tconf.homedir[strlen(tconf.homedir)-1] == '/')
- tconf.homedir[strlen(tconf.homedir)-1] = '\0';
+ if (tconf.homedir[strlen(tconf.homedir) - 1] == '/')
+ tconf.homedir[strlen(tconf.homedir) - 1] = '\0';
if (!tconf.homedir[0])
strcpy(tconf.homedir, FTP_HOMEDIR);
@@ -443,7 +442,7 @@ configAnonFTP(dialogMenuItem *self)
vsystem("mkdir -p %s/%s", tconf.homedir, tconf.upload);
vsystem("chmod 1777 %s/%s", tconf.homedir, tconf.upload);
- if (createFtpUser() == DITEM_SUCCESS) {
+ if (DITEM_STATUS(createFtpUser()) == DITEM_SUCCESS) {
msgNotify("Copying password information for anon FTP.");
vsystem("cp /etc/pwd.db %s/etc && chmod 444 %s/etc/pwd.db", tconf.homedir, tconf.homedir);
vsystem("cp /etc/passwd %s/etc && chmod 444 %s/etc/passwd", tconf.homedir, tconf.homedir);
@@ -471,5 +470,7 @@ configAnonFTP(dialogMenuItem *self)
"Anonymous FTP will not be set up.", tconf.homedir);
i = DITEM_FAILURE;
}
+ if (DITEM_STATUS(i) == DITEM_SUCCESS)
+ variable_set2("anon_ftp", "YES");
return i | DITEM_RESTORE;
}
diff --git a/release/sysinstall/apache.c b/release/sysinstall/apache.c
index b0c36d4..3a2f4b2 100644
--- a/release/sysinstall/apache.c
+++ b/release/sysinstall/apache.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: apache.c,v 1.19 1996/04/23 01:29:08 jkh Exp $
+ * $Id: apache.c,v 1.20 1996/04/28 01:07:20 jkh Exp $
*
* Copyright (c) 1995
* Coranth Gryphon. All rights reserved.
@@ -388,8 +388,8 @@ apacheOpenDialog(void)
use_helpfile(NULL);
if (cancel)
- return DITEM_FAILURE;
- return DITEM_SUCCESS;
+ return DITEM_FAILURE | DITEM_RESTORE;
+ return DITEM_SUCCESS | DITEM_RESTORE;
}
int
@@ -406,37 +406,37 @@ configApache(dialogMenuItem *self)
msgConfirm("Since you elected to install the WEB server, we'll now add the\n"
"Apache HTTPD package and set up a few configuration files.");
i = package_add(APACHE_PACKAGE);
- if (i != DITEM_SUCCESS) {
+ if (DITEM_STATUS(i) != DITEM_SUCCESS) {
msgConfirm("Hmmmmm. Looks like we weren't able to fetch the Apache WEB server\n"
"package. You may wish to fetch and configure it by hand by looking\n"
"in /usr/ports/net/apache (in the ports collection) or looking for the\n"
"precompiled apache package in packages/networking/%s.", APACHE_PACKAGE);
- return DITEM_FAILURE;
+ return i;
}
dialog_clear();
i = apacheOpenDialog();
- if (i != DITEM_SUCCESS) {
+ if (DITEM_STATUS(i) != DITEM_SUCCESS) {
msgConfirm("Configuration of the Apache WEB server was cancelled per\n"
"user request.");
- return DITEM_FAILURE | DITEM_RESTORE;
+ return i;
}
/*** Fix defaults for invalid value ***/
- if (! tconf.logdir[0])
+ if (!tconf.logdir[0])
strcpy(tconf.logdir, LOGS_SUBDIR);
- if (! tconf.accesslog[0])
+ if (!tconf.accesslog[0])
strcpy(tconf.accesslog, ACCESS_LOGNAME);
- if (! tconf.errorlog[0])
+ if (!tconf.errorlog[0])
strcpy(tconf.errorlog, ERROR_LOGNAME);
- if (! tconf.welcome[0])
+ if (!tconf.welcome[0])
strcpy(tconf.welcome, WELCOME_FILE);
- if (! tconf.userdir[0])
+ if (!tconf.userdir[0])
strcpy(tconf.userdir, USER_HOMEDIR);
- if (! tconf.defuser[0])
+ if (!tconf.defuser[0])
strcpy(tconf.defuser, DEFAULT_USER);
- if (! tconf.defgroup[0])
+ if (!tconf.defgroup[0])
strcpy(tconf.defgroup, DEFAULT_GROUP);
/*** If the user did not specify a directory, use default ***/
@@ -445,7 +445,7 @@ configApache(dialogMenuItem *self)
tconf.docroot[strlen(tconf.docroot) - 1] = '\0';
if (!tconf.docroot[0])
- sprintf(tconf.docroot,"%s/%s",APACHE_BASE,DATA_SUBDIR);
+ sprintf(tconf.docroot, "%s/%s", APACHE_BASE, DATA_SUBDIR);
/*** If DocRoot does not exist, create it ***/
@@ -453,7 +453,7 @@ configApache(dialogMenuItem *self)
vsystem("mkdir -p %s", tconf.docroot);
if (directory_exists(tconf.docroot)) {
- sprintf(file,"%s/%s", tconf.docroot, tconf.welcome);
+ sprintf(file, "%s/%s", tconf.docroot, tconf.welcome);
if (!file_readable(file)) {
tptr = msgGetInput(NULL, "What is your company name?");
if (tptr && tptr[0])
@@ -464,24 +464,24 @@ configApache(dialogMenuItem *self)
msgNotify("Creating sample web page...");
fptr = fopen(file,"w");
if (fptr) {
- fprintf(fptr,"<CENTER>\n<TITLE>Welcome Page</TITLE>\n");
- fprintf(fptr,"<H1>Welcome to %s </H1>\n</CENTER>\n",company);
- fprintf(fptr,"<P><HR SIZE=4>\n<CENTER>\n");
- fprintf(fptr,"<A HREF=\"http://www.FreeBSD.org/What\">\n");
- fprintf(fptr,"<IMG SRC=\"./power.gif\" ALIGN=CENTER BORDER=0 ");
- fprintf(fptr," ALT=\"Powered by FreeBSD\"></A>\n");
- if (! tconf.email[0]) {
+ fprintf(fptr, "<CENTER>\n<TITLE>Welcome Page</TITLE>\n");
+ fprintf(fptr, "<H1>Welcome to %s </H1>\n</CENTER>\n",company);
+ fprintf(fptr, "<P><HR SIZE=4>\n<CENTER>\n");
+ fprintf(fptr, "<A HREF=\"http://www.FreeBSD.org/What\">\n");
+ fprintf(fptr, "<IMG SRC=\"./power.gif\" ALIGN=CENTER BORDER=0 ");
+ fprintf(fptr, " ALT=\"Powered by FreeBSD\"></A>\n");
+ if (!tconf.email[0]) {
if ((tptr = variable_get(VAR_DOMAINNAME)))
- sprintf(tconf.email,"root@%s",tptr);
+ sprintf(tconf.email, "root@%s", tptr);
}
if (tconf.email[0]) {
- fprintf(fptr,"<ADDRESS><H4>\n");
- fprintf(fptr," For questions or comments, please send mail to:\n");
- fprintf(fptr," <A HREF=\"mailto:%s\">%s</A>\n",
+ fprintf(fptr, "<ADDRESS><H4>\n");
+ fprintf(fptr, " For questions or comments, please send mail to:\n");
+ fprintf(fptr, " <A HREF=\"mailto:%s\">%s</A>\n",
tconf.email, tconf.email);
- fprintf(fptr,"</H4></ADDRESS>\n");
+ fprintf(fptr, "</H4></ADDRESS>\n");
}
- fprintf(fptr,"</CENTER>\n\n");
+ fprintf(fptr, "</CENTER>\n\n");
fclose(fptr);
if (file_readable(FREEBSD_GIF))
vsystem("cp %s %s", FREEBSD_GIF, tconf.docroot);
@@ -506,15 +506,15 @@ configApache(dialogMenuItem *self)
fptr = fopen(file,"w");
if (fptr) {
- fprintf(fptr,"<Directory %s/cgi-bin>\n", APACHE_BASE);
- fprintf(fptr,"Options Indexes FollowSymLinks\n");
- fprintf(fptr,"</Directory>\n");
- fprintf(fptr,"\n");
- fprintf(fptr,"<Directory %s>\n", tconf.docroot);
- fprintf(fptr,"Options Indexes FollowSymLinks\n");
- fprintf(fptr,"AllowOverride All\n");
- fprintf(fptr,"</Directory>\n");
- fprintf(fptr,"\n");
+ fprintf(fptr, "<Directory %s/cgi-bin>\n", APACHE_BASE);
+ fprintf(fptr, "Options Indexes FollowSymLinks\n");
+ fprintf(fptr, "</Directory>\n");
+ fprintf(fptr, "\n");
+ fprintf(fptr, "<Directory %s>\n", tconf.docroot);
+ fprintf(fptr, "Options Indexes FollowSymLinks\n");
+ fprintf(fptr, "AllowOverride All\n");
+ fprintf(fptr, "</Directory>\n");
+ fprintf(fptr, "\n");
fclose(fptr);
}
else {
@@ -528,28 +528,28 @@ configApache(dialogMenuItem *self)
fptr = fopen(file,"w");
if (fptr) {
- fprintf(fptr,"ServerType standalone\n");
- fprintf(fptr,"Port 80\n");
- fprintf(fptr,"TimeOut 400\n");
- fprintf(fptr,"\n");
- fprintf(fptr,"ErrorLog %s/%s\n", LOGS_SUBDIR, ERROR_LOGNAME);
- fprintf(fptr,"TransferLog %s/%s\n", LOGS_SUBDIR, ACCESS_LOGNAME);
- fprintf(fptr,"PidFile /var/run/httpd.pid\n");
- fprintf(fptr,"\n");
- fprintf(fptr,"StartServers 5\n");
- fprintf(fptr,"MinSpareServers 5\n");
- fprintf(fptr,"MaxSpareServers 10\n");
- fprintf(fptr,"MaxRequestsPerChild 30\n");
- fprintf(fptr,"MaxClients 150\n");
- fprintf(fptr,"\n");
- fprintf(fptr,"User %s\n",tconf.defuser);
- fprintf(fptr,"Group %s\n",tconf.defgroup);
- fprintf(fptr,"\n");
+ fprintf(fptr, "ServerType standalone\n");
+ fprintf(fptr, "Port 80\n");
+ fprintf(fptr, "TimeOut 400\n");
+ fprintf(fptr, "\n");
+ fprintf(fptr, "ErrorLog %s/%s\n", LOGS_SUBDIR, ERROR_LOGNAME);
+ fprintf(fptr, "TransferLog %s/%s\n", LOGS_SUBDIR, ACCESS_LOGNAME);
+ fprintf(fptr, "PidFile /var/run/httpd.pid\n");
+ fprintf(fptr, "\n");
+ fprintf(fptr, "StartServers 5\n");
+ fprintf(fptr, "MinSpareServers 5\n");
+ fprintf(fptr, "MaxSpareServers 10\n");
+ fprintf(fptr, "MaxRequestsPerChild 30\n");
+ fprintf(fptr, "MaxClients 150\n");
+ fprintf(fptr, "\n");
+ fprintf(fptr, "User %s\n",tconf.defuser);
+ fprintf(fptr, "Group %s\n",tconf.defgroup);
+ fprintf(fptr, "\n");
if (tconf.email[0])
- fprintf(fptr,"ServerAdmin %s\n",tconf.email);
+ fprintf(fptr, "ServerAdmin %s\n", tconf.email);
if (tconf.hostname[0])
- fprintf(fptr,"ServerName %s\n",tconf.hostname);
+ fprintf(fptr, "ServerName %s\n", tconf.hostname);
fclose(fptr);
}
@@ -606,7 +606,7 @@ configApache(dialogMenuItem *self)
msgConfirm("Could not create %s",file);
i = DITEM_FAILURE;
}
- if (i != DITEM_FAILURE)
+ if (DITEM_STATUS(i) == DITEM_SUCCESS)
variable_set2("apache_httpd", "YES");
return i | DITEM_RESTORE;
}
diff --git a/release/sysinstall/config.c b/release/sysinstall/config.c
index 5577fc5..22fc801 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.25 1996/04/23 01:29:11 jkh Exp $
+ * $Id: config.c,v 1.26 1996/04/28 01:07:21 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -459,9 +459,9 @@ configPackages(dialogMenuItem *self)
/* Now show the packing list menu */
pos = scroll = 0;
ret = index_menu(&plist, NULL, &pos, &scroll);
- if (ret == DITEM_LEAVE_MENU)
+ if (ret & DITEM_LEAVE_MENU)
break;
- else if (ret != DITEM_FAILURE) {
+ else if (DITEM_STATUS(ret) != DITEM_FAILURE) {
index_extract(mediaDevice, &top, &plist);
break;
}
@@ -525,7 +525,7 @@ configPorts(dialogMenuItem *self)
}
}
msgNotify("Making a link tree from %s to %s.", dist, cp);
- if (lndir(dist, cp) != DITEM_SUCCESS) {
+ if (DITEM_STATUS(lndir(dist, cp)) != DITEM_SUCCESS) {
msgConfirm("The lndir function returned an error status and may not have.\n"
"successfully generated the link tree. You may wish to inspect\n"
"the /usr/ports directory carefully for any missing link files.");
@@ -548,18 +548,24 @@ configPorts(dialogMenuItem *self)
int
configGated(dialogMenuItem *self)
{
- if (package_add("gated-3.5a11") == DITEM_SUCCESS)
+ int ret;
+
+ ret = package_add("gated-3.5a11");
+ if (DITEM_STATUS(ret) == DITEM_SUCCESS)
variable_set2("gated", "YES");
- return DITEM_SUCCESS;
+ return ret;
}
/* Load pcnfsd package */
int
configPCNFSD(dialogMenuItem *self)
{
- if (package_add("pcnfsd-93.02.16") == DITEM_SUCCESS)
+ int ret;
+
+ ret = package_add("pcnfsd-93.02.16");
+ if (DITEM_STATUS(ret) == DITEM_SUCCESS)
variable_set2("pcnfsd", "YES");
- return DITEM_SUCCESS;
+ return ret;
}
int
diff --git a/release/sysinstall/disks.c b/release/sysinstall/disks.c
index fec4cf2..0c62dac 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.42 1996/04/25 17:31:14 jkh Exp $
+ * $Id: disks.c,v 1.43 1996/04/28 00:37:28 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -352,7 +352,7 @@ diskPartition(Device *dev, Disk *d)
&& (mbrContents = getBootMgr(d->name)) != NULL)
Set_Boot_Mgr(d, mbrContents);
- if (diskPartitionWrite(NULL) != DITEM_SUCCESS)
+ if (DITEM_STATUS(diskPartitionWrite(NULL)) != DITEM_SUCCESS)
msgConfirm("Disk partition write returned an error status!");
else
msgConfirm("Wrote FDISK partition information out successfully.");
diff --git a/release/sysinstall/dist.c b/release/sysinstall/dist.c
index ab42ba8..ecd3d71 100644
--- a/release/sysinstall/dist.c
+++ b/release/sysinstall/dist.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: dist.c,v 1.43 1996/04/25 17:31:15 jkh Exp $
+ * $Id: dist.c,v 1.44 1996/04/28 00:37:29 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -354,7 +354,7 @@ distExtract(char *parent, Distribution *me)
if (isDebug())
msgDebug("Parsing attributes file for distribution %s\n", dist);
dist_attr = safe_malloc(sizeof(Attribs) * MAX_ATTRIBS);
- if (attr_parse_file(dist_attr, buf) == DITEM_FAILURE)
+ if (DITEM_STATUS(attr_parse_file(dist_attr, buf)) == DITEM_FAILURE)
msgConfirm("Cannot load information file for %s distribution!\n"
"Please verify that your media is valid and try again.", dist);
else {
@@ -472,12 +472,15 @@ distExtractAll(dialogMenuItem *self)
char buf[512];
/* First try to initialize the state of things */
- if (!mediaDevice->init(mediaDevice))
- return DITEM_FAILURE;
if (!Dists) {
msgConfirm("You haven't selected any distributions to extract.");
return DITEM_FAILURE;
}
+ if (!mediaVerify())
+ return DITEM_FAILURE;
+
+ if (!mediaDevice->init(mediaDevice))
+ return DITEM_FAILURE;
dialog_clear();
msgNotify("Attempting to install all selected distributions..");
/* Try for 3 times around the loop, then give up. */
diff --git a/release/sysinstall/doc.c b/release/sysinstall/doc.c
index dd92a4c..069e145 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.13 1996/04/23 01:29:18 jkh Exp $
+ * $Id: doc.c,v 1.14 1996/04/25 17:31:17 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -44,6 +44,7 @@
int
docBrowser(dialogMenuItem *self)
{
+ int ret;
char *browser = variable_get(VAR_BROWSER_PACKAGE);
if (RunningAsInit && !strstr(variable_get(SYSTEM_STATE), "install")) {
@@ -56,12 +57,14 @@ docBrowser(dialogMenuItem *self)
return DITEM_FAILURE;
/* First, make sure we have whatever browser we've chosen is here */
- if (package_add(browser) != DITEM_SUCCESS) {
+ ret = package_add(browser);
+ if (DITEM_STATUS(ret) != DITEM_SUCCESS) {
msgConfirm("Unable to install the %s HTML browser package. You may\n"
"wish to verify that your media is configured correctly and\n"
"try again.", browser);
- return DITEM_FAILURE;
+ return ret;
}
+
if (!file_executable(variable_get(VAR_BROWSER_BINARY))) {
if (!msgYesNo("Hmmm. The %s package claims to have installed, but I can't\n"
"find its binary in %s! You may wish to try a different\n"
@@ -70,7 +73,7 @@ docBrowser(dialogMenuItem *self)
"I suggest that we remove the version that was extracted since it does\n"
"not appear to be correct. Would you like me to do that now?"))
vsystem("pkg_delete %s %s", !strcmp(variable_get(VAR_CPIO_VERBOSITY), "high") ? "-v" : "", browser);
- return DITEM_FAILURE;
+ return DITEM_FAILURE | DITEM_RESTORE;
}
/* Run browser on the appropriate doc */
diff --git a/release/sysinstall/dos.c b/release/sysinstall/dos.c
index fa24cdb..9e4ed9b 100644
--- a/release/sysinstall/dos.c
+++ b/release/sysinstall/dos.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: dos.c,v 1.10 1996/04/13 13:31:33 jkh Exp $
+ * $Id: dos.c,v 1.11 1996/04/23 01:29:19 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -59,7 +59,7 @@ mediaInitDOS(Device *dev)
if (!RunningAsInit || DOSMounted)
return TRUE;
- if (Mkdir("/dos", NULL) != DITEM_SUCCESS)
+ if (DITEM_STATUS(Mkdir("/dos", NULL)) != DITEM_SUCCESS)
return FALSE;
memset(&args, 0, sizeof(args));
diff --git a/release/sysinstall/ftp_strat.c b/release/sysinstall/ftp_strat.c
index 480b725..01ba03a 100644
--- a/release/sysinstall/ftp_strat.c
+++ b/release/sysinstall/ftp_strat.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: ftp_strat.c,v 1.12 1996/04/13 13:31:37 jkh Exp $
+ * $Id: ftp_strat.c,v 1.13 1996/04/23 01:29:21 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -68,7 +68,7 @@ get_new_host(Device *dev, Boolean probe)
MenuMediaFTP.title = "Request failed - please select another site";
j = mediaSetFTP(NULL);
MenuMediaFTP.title = oldTitle;
- if (j == DITEM_SUCCESS) {
+ if (DITEM_STATUS(j) == DITEM_SUCCESS) {
/* Bounce the link if necessary */
if (ftpInitted) {
msgDebug("Bouncing FTP connection before reselecting new host.\n");
@@ -99,6 +99,7 @@ ftpShouldAbort(Device *dev, int retries)
if (isDebug())
msgDebug("Aborting FTP connection.\n");
dev->shutdown(dev);
+ (void)dev->init(dev);
}
return rval;
}
@@ -116,18 +117,23 @@ mediaInitFTP(Device *dev)
if (isDebug())
msgDebug("Init routine for FTP called. Net device is %x\n", netDevice);
- if (!netDevice->init(netDevice))
+ if (!netDevice->init(netDevice)) {
+ if (isDebug())
+ msgDebug("InitFTP: Net device init returns FALSE\n");
return FALSE;
+ }
if (!ftp && (ftp = FtpInit()) == NULL) {
msgConfirm("FTP initialisation failed!");
return FALSE;
}
+
cp = variable_get(VAR_FTP_PATH);
if (!cp) {
msgConfirm("%s is not set!", VAR_FTP_PATH);
return FALSE;
}
+
if (isDebug())
msgDebug("Attempting to open connection for URL: %s\n", cp);
hostname = variable_get(VAR_HOSTNAME);
diff --git a/release/sysinstall/index.c b/release/sysinstall/index.c
index 754740f..bea8857 100644
--- a/release/sysinstall/index.c
+++ b/release/sysinstall/index.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: index.c,v 1.23 1996/04/13 13:31:39 jkh Exp $
+ * $Id: index.c,v 1.24 1996/04/23 01:29:21 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -57,9 +57,10 @@ _strdup(char *ptr)
static char *descrs[] = {
"Package Selection", "To mark a package or select a category, move to it and press SPACE.\n"
- "To unmark a package, press SPACE again. To go to a previous menu, select the Cancel\n"
- "button. To search for a package by name, press ESC. To finally extract packages, you\n"
- "should Cancel all the way out of any submenus and this top menu.",
+ "To unmark a package, press SPACE again. To go to a previous menu,\n"
+ "select the Cancel button. To search for a package by name, press ESC.\n"
+ "To finally extract packages, you should Cancel all the way out of any\n"
+ "submenus and then this top menu.",
"Package Targets", "These are the packages you've selected for extraction.\n\n"
"If you're sure of these choices, select OK.\n"
"If not, select Cancel to go back to the package selection menu.\n",
@@ -528,12 +529,12 @@ index_extract_one(Device *dev, PkgNodePtr top, PkgNodePtr who, Boolean depended)
strcpy(t, id->deps);
cp = t;
- while (cp && status == DITEM_SUCCESS) {
+ while (cp && DITEM_STATUS(status) == DITEM_SUCCESS) {
if ((cp2 = index(cp, ' ')) != NULL)
*cp2 = '\0';
if ((tmp2 = index_search(top, cp, NULL)) != NULL) {
status = index_extract_one(dev, top, tmp2, TRUE);
- if (status != DITEM_SUCCESS) {
+ if (DITEM_STATUS(status) != DITEM_SUCCESS) {
if (variable_get(VAR_NO_CONFIRM))
msgNotify("Loading of dependant package %s failed", cp);
else
@@ -547,7 +548,7 @@ index_extract_one(Device *dev, PkgNodePtr top, PkgNodePtr who, Boolean depended)
}
}
/* Done with the deps? Load the real m'coy */
- if (status == DITEM_SUCCESS)
+ if (DITEM_STATUS(status) == DITEM_SUCCESS)
status = package_extract(dev, who->name, depended);
return status;
}
diff --git a/release/sysinstall/install.c b/release/sysinstall/install.c
index d03bc34..524b5c1 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.87 1996/04/28 00:37:32 jkh Exp $
+ * $Id: install.c,v 1.88 1996/04/28 01:07:22 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -174,7 +174,7 @@ installInitial(void)
"We can take no responsibility for lost disk contents!"))
return DITEM_FAILURE;
- if (diskLabelCommit(NULL) != DITEM_SUCCESS) {
+ if (DITEM_STATUS(diskLabelCommit(NULL)) != DITEM_SUCCESS) {
msgConfirm("Couldn't make filesystems properly. Aborting.");
return DITEM_FAILURE;
}
@@ -235,14 +235,14 @@ installFixitFloppy(dialogMenuItem *self)
if (!directory_exists("/tmp"))
(void)symlink("/mnt2/tmp", "/tmp");
if (!directory_exists("/var/tmp/vi.recover")) {
- if (Mkdir("/var/tmp/vi.recover", NULL) != DITEM_SUCCESS) {
+ if (DITEM_STATUS(Mkdir("/var/tmp/vi.recover", NULL)) != DITEM_SUCCESS) {
msgConfirm("Warning: Was unable to create a /var/tmp/vi.recover directory.\n"
"vi will kvetch and moan about it as a result but should still\n"
"be essentially usable.");
}
}
/* Link the spwd.db file */
- if (Mkdir("/etc", NULL) != DITEM_SUCCESS)
+ if (DITEM_STATUS(Mkdir("/etc", NULL)) != DITEM_SUCCESS)
msgConfirm("Unable to create an /etc directory! Things are weird on this floppy..");
else if (symlink("/mnt2/etc/spwd.db", "/etc/spwd.db") == -1)
msgConfirm("Couldn't symlink the /etc/spwd.db file! I'm not sure I like this..");
@@ -282,10 +282,10 @@ int
installExpress(dialogMenuItem *self)
{
variable_set2(SYSTEM_STATE, "express");
- if (diskPartitionEditor(self) == DITEM_FAILURE)
+ if (DITEM_STATUS(diskPartitionEditor(self)) == DITEM_FAILURE)
return DITEM_FAILURE;
- if (diskLabelEditor(self) == DITEM_FAILURE)
+ if (DITEM_STATUS(diskLabelEditor(self)) == DITEM_FAILURE)
return DITEM_FAILURE;
if (!Dists) {
@@ -298,7 +298,7 @@ installExpress(dialogMenuItem *self)
return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE;
}
- if (installCommit(self) == DITEM_FAILURE)
+ if (DITEM_STATUS(installCommit(self)) == DITEM_FAILURE)
return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE;
return DITEM_LEAVE_MENU | DITEM_RESTORE | DITEM_RECREATE;
@@ -317,7 +317,7 @@ installNovice(dialogMenuItem *self)
"by a (Q)uit. If you wish to allocate only free space to FreeBSD, move to a\n"
"partition marked \"unused\" and use the (C)reate command.");
- if (diskPartitionEditor(self) == DITEM_FAILURE)
+ if (DITEM_STATUS(diskPartitionEditor(self)) == DITEM_FAILURE)
return DITEM_FAILURE;
dialog_clear();
@@ -328,7 +328,7 @@ installNovice(dialogMenuItem *self)
"care for the layout chosen by (A)uto, press F1 for more information on\n"
"manual layout.");
- if (diskLabelEditor(self) == DITEM_FAILURE)
+ if (DITEM_STATUS(diskLabelEditor(self)) == DITEM_FAILURE)
return DITEM_FAILURE;
dialog_clear();
@@ -351,7 +351,7 @@ installNovice(dialogMenuItem *self)
return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE;
}
- if (installCommit(self) == DITEM_FAILURE)
+ if (DITEM_STATUS(installCommit(self)) == DITEM_FAILURE)
return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE;
return DITEM_LEAVE_MENU | DITEM_RESTORE | DITEM_RECREATE;
@@ -378,9 +378,9 @@ installCommit(dialogMenuItem *self)
str = variable_get(SYSTEM_STATE);
i = DITEM_LEAVE_MENU;
if (RunningAsInit) {
- if (installInitial() == DITEM_FAILURE)
+ if (DITEM_STATUS(installInitial()) == DITEM_FAILURE)
return DITEM_FAILURE;
- if (configFstab() == DITEM_FAILURE)
+ if (DITEM_STATUS(configFstab()) == DITEM_FAILURE)
return DITEM_FAILURE;
if (!rootExtract()) {
msgConfirm("Failed to load the ROOT distribution. Please correct\n"
@@ -389,13 +389,13 @@ installCommit(dialogMenuItem *self)
}
}
- if (distExtractAll(self) == DITEM_FAILURE)
+ if (DITEM_STATUS(distExtractAll(self)) == DITEM_FAILURE)
i = DITEM_FAILURE;
- if (installFixup(self) == DITEM_FAILURE)
+ if (DITEM_STATUS(installFixup(self)) == DITEM_FAILURE)
i = DITEM_FAILURE;
- if (i != DITEM_FAILURE && !strcmp(str, "novice")) {
+ if (DITEM_STATUS(i) != DITEM_FAILURE && !strcmp(str, "novice")) {
msgConfirm("Since you're running the novice installation, a few post-configuration\n"
"questions will be asked at this point. For any option you do not wish\n"
"to configure, select Cancel.");
@@ -479,7 +479,7 @@ installCommit(dialogMenuItem *self)
/* Don't print this if we're express or novice installing */
if (strcmp(str, "express") && strcmp(str, "novice")) {
- if (Dists || i == DITEM_FAILURE)
+ if (Dists || DITEM_STATUS(i) == DITEM_FAILURE)
msgConfirm("Installation completed with some errors. You may wish to\n"
"scroll through the debugging messages on VTY1 with the\n"
"scroll-lock feature.");
@@ -737,7 +737,7 @@ installVarDefaults(dialogMenuItem *self)
variable_set2(VAR_RELNAME, RELEASE_NAME);
variable_set2(VAR_CPIO_VERBOSITY, "high");
variable_set2(VAR_TAPE_BLOCKSIZE, DEFAULT_TAPE_BLOCKSIZE);
- variable_set2(VAR_EDITOR, "/stand/ee");
+ variable_set2(VAR_EDITOR, RunningAsInit ? "/stand/ee" : "/usr/bin/ee");
variable_set2(VAR_FTP_USER, "ftp");
variable_set2(VAR_BROWSER_PACKAGE, "lynx-2.4fm");
variable_set2(VAR_BROWSER_BINARY, "/usr/local/bin/lynx");
diff --git a/release/sysinstall/installUpgrade.c b/release/sysinstall/installUpgrade.c
index 72393bd3..562302e 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.21 1996/04/23 01:29:24 jkh Exp $
+ * $Id: installUpgrade.c,v 1.22 1996/04/25 17:31:20 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -230,7 +230,7 @@ installUpgrade(dialogMenuItem *self)
"Once you're done in the label editor, press Q to return here for the next\n"
"step.");
- if (diskLabelEditor(self) == DITEM_FAILURE) {
+ 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;
@@ -238,7 +238,7 @@ installUpgrade(dialogMenuItem *self)
/* Don't write out MBR info */
variable_set2(DISK_PARTITIONED, "written");
- if (diskLabelCommit(self) == DITEM_FAILURE) {
+ if (DITEM_STATUS(diskLabelCommit(self)) == DITEM_FAILURE) {
msgConfirm("Not all file systems were properly mounted. Upgrade operation\n"
"aborted.");
variable_unset(DISK_PARTITIONED);
@@ -251,7 +251,7 @@ installUpgrade(dialogMenuItem *self)
return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE;
}
- if (chroot("/mnt") == DITEM_FAILURE) {
+ 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);
@@ -297,7 +297,7 @@ installUpgrade(dialogMenuItem *self)
}
msgNotify("Beginning extraction of distributions..");
- if (distExtractAll(self) == DITEM_FAILURE) {
+ if (DITEM_STATUS(distExtractAll(self)) == DITEM_FAILURE) {
if (extractingBin && (Dists & DIST_BIN)) {
msgConfirm("Hmmmm. We couldn't even extract the bin distribution. This upgrade\n"
"should be considered a failure and started from the beginning, sorry!\n"
@@ -315,7 +315,7 @@ installUpgrade(dialogMenuItem *self)
"/dev entries and such that a 2.1 system expects to see. I'll also perform a\n"
"few \"fixup\" operations to repair the effects of splatting a bin distribution\n"
"on top of an existing system..");
- if (installFixup(self) == DITEM_FAILURE) {
+ if (DITEM_STATUS(installFixup(self)) == DITEM_FAILURE) {
msgConfirm("Hmmmmm. The fixups don't seem to have been very happy.\n"
"You may wish to examine the system a little more closely when\n"
"it comes time to merge your /etc customizations back.");
diff --git a/release/sysinstall/label.c b/release/sysinstall/label.c
index 239b3a5..ed01da6 100644
--- a/release/sysinstall/label.c
+++ b/release/sysinstall/label.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: label.c,v 1.43 1996/04/23 01:29:25 jkh Exp $
+ * $Id: label.c,v 1.44 1996/04/25 17:31:21 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -97,11 +97,11 @@ diskLabelEditor(dialogMenuItem *self)
}
if (!enabled) {
devs[0]->enabled = TRUE;
- if (diskPartitionEditor(self) == DITEM_FAILURE)
+ if (DITEM_STATUS(diskPartitionEditor(self)) == DITEM_FAILURE)
return DITEM_FAILURE;
}
i = diskLabel(devs[0]->name);
- if (i != DITEM_FAILURE)
+ if (DITEM_STATUS(i) != DITEM_FAILURE)
variable_set2(DISK_LABELLED, "yes");
return i;
}
@@ -122,9 +122,9 @@ diskLabelCommit(dialogMenuItem *self)
i = DITEM_FAILURE;
}
/* The routine will guard against redundant writes, just as this one does */
- else if (diskPartitionWrite(self) != DITEM_SUCCESS)
+ else if (DITEM_STATUS(diskPartitionWrite(self)) != DITEM_SUCCESS)
i = DITEM_FAILURE;
- else if (installFilesystems(self) != DITEM_SUCCESS)
+ else if (DITEM_STATUS(installFilesystems(self)) != DITEM_SUCCESS)
i = DITEM_FAILURE;
else {
msgInfo("All filesystem information written successfully.");
diff --git a/release/sysinstall/media.c b/release/sysinstall/media.c
index d020b24..d61654d 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.36 1996/04/28 00:37:33 jkh Exp $
+ * $Id: media.c,v 1.37 1996/04/28 01:07:24 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -364,6 +364,8 @@ mediaExtractDistBegin(char *dir, int *fd, int *zpid, int *cpid)
pipe(qfd);
*zpid = fork();
if (!*zpid) {
+ char *gunzip = RunningAsInit ? "/stand/gunzip" : "/usr/bin/gunzip";
+
dup2(qfd[0], 0); close(qfd[0]);
dup2(pfd[1], 1); close(pfd[1]);
if (DebugFD != -1)
@@ -374,15 +376,17 @@ mediaExtractDistBegin(char *dir, int *fd, int *zpid, int *cpid)
}
close(qfd[1]);
close(pfd[0]);
- i = execl("/stand/gunzip", "/stand/gunzip", 0);
+ i = execl(gunzip, gunzip, 0);
if (isDebug())
- msgDebug("/stand/gunzip command returns %d status\n", i);
+ msgDebug("%s command returns %d status\n", gunzip, i);
exit(i);
}
*fd = qfd[1];
close(qfd[0]);
*cpid = fork();
if (!*cpid) {
+ char *cpio = RunningAsInit ? "/stand/cpio" : "/usr/bin/cpio";
+
dup2(pfd[0], 0); close(pfd[0]);
close(pfd[1]);
close(qfd[1]);
@@ -395,11 +399,11 @@ mediaExtractDistBegin(char *dir, int *fd, int *zpid, int *cpid)
dup2(1, 2);
}
if (strlen(cpioVerbosity()))
- i = execl("/stand/cpio", "/stand/cpio", "-idum", cpioVerbosity(), "--block-size", mediaTapeBlocksize(), 0);
+ i = execl(cpio, cpio, "-idum", cpioVerbosity(), "--block-size", mediaTapeBlocksize(), 0);
else
- i = execl("/stand/cpio", "/stand/cpio", "-idum", "--block-size", mediaTapeBlocksize(), 0);
+ i = execl(cpio, cpio, "-idum", "--block-size", mediaTapeBlocksize(), 0);
if (isDebug())
- msgDebug("/stand/cpio command returns %d status\n", i);
+ msgDebug("%s command returns %d status\n", cpio, i);
exit(i);
}
close(pfd[0]);
@@ -413,7 +417,8 @@ mediaExtractDistEnd(int zpid, int cpid)
int i,j;
i = waitpid(zpid, &j, 0);
- if (i < 0) { /* Don't check status - gunzip seems to return a bogus one! */
+ /* Don't check status - gunzip seems to return a bogus one! */
+ if (i < 0) {
if (isDebug())
msgDebug("wait for gunzip returned status of %d!\n", i);
return FALSE;
@@ -441,6 +446,8 @@ mediaExtractDist(char *dir, int fd)
pipe(pfd);
zpid = fork();
if (!zpid) {
+ char *gunzip = RunningAsInit ? "/stand/gunzip" : "/usr/bin/gunzip";
+
dup2(fd, 0); close(fd);
dup2(pfd[1], 1); close(pfd[1]);
if (DebugFD != -1)
@@ -450,13 +457,15 @@ mediaExtractDist(char *dir, int fd)
open("/dev/null", O_WRONLY);
}
close(pfd[0]);
- i = execl("/stand/gunzip", "/stand/gunzip", 0);
+ i = execl(gunzip, gunzip, 0);
if (isDebug())
- msgDebug("/stand/gunzip command returns %d status\n", i);
+ msgDebug("%s command returns %d status\n", gunzip, i);
exit(i);
}
cpid = fork();
if (!cpid) {
+ char *cpio = RunningAsInit ? "/stand/cpio" : "/usr/bin/cpio";
+
dup2(pfd[0], 0); close(pfd[0]);
close(fd);
close(pfd[1]);
@@ -469,18 +478,19 @@ mediaExtractDist(char *dir, int fd)
dup2(1, 2);
}
if (strlen(cpioVerbosity()))
- i = execl("/stand/cpio", "/stand/cpio", "-idum", cpioVerbosity(), "--block-size", mediaTapeBlocksize(), 0);
+ i = execl(cpio, cpio, "-idum", cpioVerbosity(), "--block-size", mediaTapeBlocksize(), 0);
else
- i = execl("/stand/cpio", "/stand/cpio", "-idum", "--block-size", mediaTapeBlocksize(), 0);
+ i = execl(cpio, cpio, "-idum", "--block-size", mediaTapeBlocksize(), 0);
if (isDebug())
- msgDebug("/stand/cpio command returns %d status\n", i);
+ msgDebug("%s command returns %d status\n", cpio, i);
exit(i);
}
close(pfd[0]);
close(pfd[1]);
i = waitpid(zpid, &j, 0);
- if (i < 0) { /* Don't check status - gunzip seems to return a bogus one! */
+ /* Don't check status - gunzip seems to return a bogus one! */
+ if (i < 0) {
if (isDebug())
msgDebug("wait for gunzip returned status of %d!\n", i);
return FALSE;
@@ -510,7 +520,7 @@ mediaVerify(void)
if (!mediaDevice) {
msgConfirm("Media type not set! Please select a media type\n"
"from the Installation menu before proceeding.");
- return mediaGetType(NULL) == DITEM_SUCCESS;
+ return DITEM_STATUS(mediaGetType(NULL)) == DITEM_SUCCESS;
}
return TRUE;
}
diff --git a/release/sysinstall/menus.c b/release/sysinstall/menus.c
index d381536..420a218 100644
--- a/release/sysinstall/menus.c
+++ b/release/sysinstall/menus.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: menus.c,v 1.54 1996/04/27 07:04:12 jkh Exp $
+ * $Id: menus.c,v 1.55 1996/04/28 00:37:34 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -54,12 +54,6 @@ clearSrc(dialogMenuItem *self)
}
static int
-checkSrc(dialogMenuItem *self)
-{
- return ((Dists & DIST_SRC) && (SrcDists == DIST_SRC_ALL | DIST_SRC_SMAILCF));
-}
-
-static int
setX11All(dialogMenuItem *self)
{
XF86Dists = DIST_XF86_ALL;
@@ -956,11 +950,11 @@ aspects of your system's network configuration.",
{ "NFS client", "This machine will be an NFS client",
dmenuVarCheck, dmenuSetVariable, NULL, "nfs_client=YES" },
{ "NFS server", "This machine will be an NFS server",
- NULL, configNFSServer },
+ dmenuVarCheck, configNFSServer, NULL, "nfs_server" },
{ "Gateway", "This machine will route packets between interfaces",
dmenuVarCheck, dmenuSetVariable, NULL, "gateway=YES" },
{ "Gated", "This machine wants to run gated instead of routed",
- NULL, configGated },
+ dmenuVarCheck, configGated, NULL, "gated" },
{ "Ntpdate", "Select a clock-syncronization server",
dmenuVarCheck, dmenuSubmenu, NULL, &MenuNTP, '[', 'X', ']', (int)"ntpdate" },
{ "Routed", "Set flags for routed (default: -q)",
@@ -968,20 +962,20 @@ aspects of your system's network configuration.",
{ "Rwhod", "This machine wants to run the rwho daemon",
dmenuVarCheck, dmenuSetVariable, NULL, "rwhod=YES" },
{ "Anon FTP", "This machine wishes to allow anonymous FTP.",
- NULL, configAnonFTP },
+ dmenuVarCheck, configAnonFTP, NULL, "anon_ftp" },
{ "WEB Server", "This machine wishes to be a WWW server.",
- NULL, configApache },
+ dmenuVarCheck, configApache, NULL, "apache_httpd" },
{ "Samba", "Install Samba for LanManager (NETBUI) access.",
- NULL, configSamba },
+ dmenuVarCheck, configSamba, NULL, "samba" },
{ "PCNFSD", "Run authentication server for clients with PC-NFS.",
- NULL, configPCNFSD },
+ dmenuVarCheck, configPCNFSD, NULL, "pcnfsd" },
{ "Exit", "Exit this menu (returning to previous)",
checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' },
{ NULL } },
};
DMenu MenuNTP = {
- DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
+ DMENU_RADIO_TYPE | DMENU_SELECTION_RETURNS,
"NTPDATE Server Selection",
"There are a number of time syncronization servers available\n\
for public use around the Internet. Please select one reasonably\n\
diff --git a/release/sysinstall/misc.c b/release/sysinstall/misc.c
index 2da5dd7..3f84540 100644
--- a/release/sysinstall/misc.c
+++ b/release/sysinstall/misc.c
@@ -1,7 +1,7 @@
/*
* Miscellaneous support routines..
*
- * $Id: misc.c,v 1.16 1996/04/13 13:32:00 jkh Exp $
+ * $Id: misc.c,v 1.17 1996/04/23 01:29:29 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -213,6 +213,7 @@ item_add(dialogMenuItem *list, char *prompt, char *title,
list = (dialogMenuItem *)realloc(list, sizeof(dialogMenuItem) * *max);
}
d = &list[(*curr)++];
+ bzero(d, sizeof(*d));
d->prompt = prompt ? strdup(prompt) : NULL;
d->title = title ? strdup(title) : NULL;
d->checked = checked;
diff --git a/release/sysinstall/package.c b/release/sysinstall/package.c
index c374181..7087b0f 100644
--- a/release/sysinstall/package.c
+++ b/release/sysinstall/package.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: package.c,v 1.31 1996/04/13 13:32:07 jkh Exp $
+ * $Id: package.c,v 1.32 1996/04/23 01:29:32 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -97,7 +97,7 @@ package_extract(Device *dev, char *name, Boolean depended)
if (!pid) {
dup2(pfd[0], 0); close(pfd[0]);
dup2(DebugFD, 1);
- dup2(DebugFD, 2);
+ close(2);
close(pfd[1]);
i = execl("/usr/sbin/pkg_add", "/usr/sbin/pkg_add", "-", 0);
if (isDebug())
@@ -105,6 +105,7 @@ package_extract(Device *dev, char *name, Boolean depended)
}
else {
char buf[BUFSIZ];
+ WINDOW *w = savescr();
tot = 0;
while ((i = read(fd, buf, BUFSIZ)) > 0) {
@@ -133,6 +134,8 @@ package_extract(Device *dev, char *name, Boolean depended)
}
else
msgNotify("Package %s was added successfully", name);
+ sleep(1);
+ restorescr(w);
}
}
else {
@@ -146,5 +149,5 @@ package_extract(Device *dev, char *name, Boolean depended)
}
ret = DITEM_FAILURE;
}
- return ret | DITEM_RESTORE;
+ return ret;
}
diff --git a/release/sysinstall/samba.c b/release/sysinstall/samba.c
index e01fab8..cbd9c15 100644
--- a/release/sysinstall/samba.c
+++ b/release/sysinstall/samba.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: installFinal.c,v 1.28 1996/04/25 17:31:19 jkh Exp $
+ * $Id: samba.c,v 1.1 1996/04/28 01:07:26 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard & Coranth Gryphon. All rights reserved.
@@ -61,7 +61,7 @@ configSamba(dialogMenuItem *self)
if (!dmenuOpenSimple(&MenuSamba))
i = DITEM_FAILURE;
- else if (package_add("samba-1.9.15p8") != DITEM_SUCCESS)
+ else if (DITEM_STATUS(package_add("samba-1.9.15p8")) != DITEM_SUCCESS)
i = DITEM_FAILURE;
else {
FILE *fptr;
@@ -70,7 +70,7 @@ configSamba(dialogMenuItem *self)
fptr = fopen("/tmp/smb.conf","w");
if (fptr) {
- strcpy(tbuf,"FreeBSD - Samba %v");
+ strcpy(tbuf, "FreeBSD - Samba %v");
if (variable_get("SAMBA_string")) {
tptr = msgGetInput("FreeBSD - Samba %%v", "What should this server list as its description?\n"
"Note that the \"%%v\" refers to the samba version number.");
@@ -148,6 +148,8 @@ configSamba(dialogMenuItem *self)
msgConfirm("Unable to open temporary smb.conf file.\n"
"Samba will have to be configured by hand.");
}
+ if (DITEM_STATUS(i) == DITEM_SUCCESS)
+ variable_set2("samba", "YES");
return i | DITEM_RESTORE | DITEM_RECREATE;
}
diff --git a/release/sysinstall/system.c b/release/sysinstall/system.c
index 98362ed..adb89e8 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.53 1996/04/26 18:19:38 jkh Exp $
+ * $Id: system.c,v 1.54 1996/04/28 01:07:27 jkh Exp $
*
* Jordan Hubbard
*
@@ -215,7 +215,14 @@ vsystem(char *fmt, ...)
dup2(DebugFD, 1);
dup2(DebugFD, 2);
}
- execl("/stand/sh", "sh", "-c", cmd, (char *)NULL);
+ else {
+ close(1); open("/dev/null", O_WRONLY);
+ dup2(1, 2);
+ }
+ if (!RunningAsInit)
+ execl("/bin/sh", "/bin/sh", "-c", cmd, (char *)NULL);
+ else
+ execl("/stand/sh", "/stand/sh", "-c", cmd, (char *)NULL);
exit(1);
}
else {
diff --git a/usr.sbin/sade/Makefile b/usr.sbin/sade/Makefile
index 9c2c6b3..a7cf997 100644
--- a/usr.sbin/sade/Makefile
+++ b/usr.sbin/sade/Makefile
@@ -7,11 +7,10 @@ DEBUG_FLAGS+= -g3
SRCS= anonFTP.c apache.c attr.c cdrom.c command.c config.c \
devices.c disks.c dist.c dmenu.c doc.c dos.c floppy.c ftp.c \
- ftp_strat.c globals.c index.c install.c installFinal.c \
- installUpgrade.c label.c lndir.c main.c makedevs.c media.c \
- menus.c misc.c msg.c network.c nfs.c options.c \
- package.c samba.c system.c tape.c tcpip.c termcap.c ufs.c \
- variable.c wizard.c
+ ftp_strat.c globals.c index.c install.c installUpgrade.c \
+ label.c lndir.c main.c makedevs.c media.c menus.c misc.c \
+ msg.c network.c nfs.c options.c package.c samba.c system.c \
+ tape.c tcpip.c termcap.c ufs.c variable.c wizard.c
CFLAGS+= -Wall -I${.CURDIR}/../../gnu/lib/libdialog
diff --git a/usr.sbin/sade/config.c b/usr.sbin/sade/config.c
index 5577fc5..22fc801 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.25 1996/04/23 01:29:11 jkh Exp $
+ * $Id: config.c,v 1.26 1996/04/28 01:07:21 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -459,9 +459,9 @@ configPackages(dialogMenuItem *self)
/* Now show the packing list menu */
pos = scroll = 0;
ret = index_menu(&plist, NULL, &pos, &scroll);
- if (ret == DITEM_LEAVE_MENU)
+ if (ret & DITEM_LEAVE_MENU)
break;
- else if (ret != DITEM_FAILURE) {
+ else if (DITEM_STATUS(ret) != DITEM_FAILURE) {
index_extract(mediaDevice, &top, &plist);
break;
}
@@ -525,7 +525,7 @@ configPorts(dialogMenuItem *self)
}
}
msgNotify("Making a link tree from %s to %s.", dist, cp);
- if (lndir(dist, cp) != DITEM_SUCCESS) {
+ if (DITEM_STATUS(lndir(dist, cp)) != DITEM_SUCCESS) {
msgConfirm("The lndir function returned an error status and may not have.\n"
"successfully generated the link tree. You may wish to inspect\n"
"the /usr/ports directory carefully for any missing link files.");
@@ -548,18 +548,24 @@ configPorts(dialogMenuItem *self)
int
configGated(dialogMenuItem *self)
{
- if (package_add("gated-3.5a11") == DITEM_SUCCESS)
+ int ret;
+
+ ret = package_add("gated-3.5a11");
+ if (DITEM_STATUS(ret) == DITEM_SUCCESS)
variable_set2("gated", "YES");
- return DITEM_SUCCESS;
+ return ret;
}
/* Load pcnfsd package */
int
configPCNFSD(dialogMenuItem *self)
{
- if (package_add("pcnfsd-93.02.16") == DITEM_SUCCESS)
+ int ret;
+
+ ret = package_add("pcnfsd-93.02.16");
+ if (DITEM_STATUS(ret) == DITEM_SUCCESS)
variable_set2("pcnfsd", "YES");
- return DITEM_SUCCESS;
+ return ret;
}
int
diff --git a/usr.sbin/sade/disks.c b/usr.sbin/sade/disks.c
index fec4cf2..0c62dac 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.42 1996/04/25 17:31:14 jkh Exp $
+ * $Id: disks.c,v 1.43 1996/04/28 00:37:28 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -352,7 +352,7 @@ diskPartition(Device *dev, Disk *d)
&& (mbrContents = getBootMgr(d->name)) != NULL)
Set_Boot_Mgr(d, mbrContents);
- if (diskPartitionWrite(NULL) != DITEM_SUCCESS)
+ if (DITEM_STATUS(diskPartitionWrite(NULL)) != DITEM_SUCCESS)
msgConfirm("Disk partition write returned an error status!");
else
msgConfirm("Wrote FDISK partition information out successfully.");
diff --git a/usr.sbin/sade/install.c b/usr.sbin/sade/install.c
index d03bc34..524b5c1 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.87 1996/04/28 00:37:32 jkh Exp $
+ * $Id: install.c,v 1.88 1996/04/28 01:07:22 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -174,7 +174,7 @@ installInitial(void)
"We can take no responsibility for lost disk contents!"))
return DITEM_FAILURE;
- if (diskLabelCommit(NULL) != DITEM_SUCCESS) {
+ if (DITEM_STATUS(diskLabelCommit(NULL)) != DITEM_SUCCESS) {
msgConfirm("Couldn't make filesystems properly. Aborting.");
return DITEM_FAILURE;
}
@@ -235,14 +235,14 @@ installFixitFloppy(dialogMenuItem *self)
if (!directory_exists("/tmp"))
(void)symlink("/mnt2/tmp", "/tmp");
if (!directory_exists("/var/tmp/vi.recover")) {
- if (Mkdir("/var/tmp/vi.recover", NULL) != DITEM_SUCCESS) {
+ if (DITEM_STATUS(Mkdir("/var/tmp/vi.recover", NULL)) != DITEM_SUCCESS) {
msgConfirm("Warning: Was unable to create a /var/tmp/vi.recover directory.\n"
"vi will kvetch and moan about it as a result but should still\n"
"be essentially usable.");
}
}
/* Link the spwd.db file */
- if (Mkdir("/etc", NULL) != DITEM_SUCCESS)
+ if (DITEM_STATUS(Mkdir("/etc", NULL)) != DITEM_SUCCESS)
msgConfirm("Unable to create an /etc directory! Things are weird on this floppy..");
else if (symlink("/mnt2/etc/spwd.db", "/etc/spwd.db") == -1)
msgConfirm("Couldn't symlink the /etc/spwd.db file! I'm not sure I like this..");
@@ -282,10 +282,10 @@ int
installExpress(dialogMenuItem *self)
{
variable_set2(SYSTEM_STATE, "express");
- if (diskPartitionEditor(self) == DITEM_FAILURE)
+ if (DITEM_STATUS(diskPartitionEditor(self)) == DITEM_FAILURE)
return DITEM_FAILURE;
- if (diskLabelEditor(self) == DITEM_FAILURE)
+ if (DITEM_STATUS(diskLabelEditor(self)) == DITEM_FAILURE)
return DITEM_FAILURE;
if (!Dists) {
@@ -298,7 +298,7 @@ installExpress(dialogMenuItem *self)
return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE;
}
- if (installCommit(self) == DITEM_FAILURE)
+ if (DITEM_STATUS(installCommit(self)) == DITEM_FAILURE)
return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE;
return DITEM_LEAVE_MENU | DITEM_RESTORE | DITEM_RECREATE;
@@ -317,7 +317,7 @@ installNovice(dialogMenuItem *self)
"by a (Q)uit. If you wish to allocate only free space to FreeBSD, move to a\n"
"partition marked \"unused\" and use the (C)reate command.");
- if (diskPartitionEditor(self) == DITEM_FAILURE)
+ if (DITEM_STATUS(diskPartitionEditor(self)) == DITEM_FAILURE)
return DITEM_FAILURE;
dialog_clear();
@@ -328,7 +328,7 @@ installNovice(dialogMenuItem *self)
"care for the layout chosen by (A)uto, press F1 for more information on\n"
"manual layout.");
- if (diskLabelEditor(self) == DITEM_FAILURE)
+ if (DITEM_STATUS(diskLabelEditor(self)) == DITEM_FAILURE)
return DITEM_FAILURE;
dialog_clear();
@@ -351,7 +351,7 @@ installNovice(dialogMenuItem *self)
return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE;
}
- if (installCommit(self) == DITEM_FAILURE)
+ if (DITEM_STATUS(installCommit(self)) == DITEM_FAILURE)
return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE;
return DITEM_LEAVE_MENU | DITEM_RESTORE | DITEM_RECREATE;
@@ -378,9 +378,9 @@ installCommit(dialogMenuItem *self)
str = variable_get(SYSTEM_STATE);
i = DITEM_LEAVE_MENU;
if (RunningAsInit) {
- if (installInitial() == DITEM_FAILURE)
+ if (DITEM_STATUS(installInitial()) == DITEM_FAILURE)
return DITEM_FAILURE;
- if (configFstab() == DITEM_FAILURE)
+ if (DITEM_STATUS(configFstab()) == DITEM_FAILURE)
return DITEM_FAILURE;
if (!rootExtract()) {
msgConfirm("Failed to load the ROOT distribution. Please correct\n"
@@ -389,13 +389,13 @@ installCommit(dialogMenuItem *self)
}
}
- if (distExtractAll(self) == DITEM_FAILURE)
+ if (DITEM_STATUS(distExtractAll(self)) == DITEM_FAILURE)
i = DITEM_FAILURE;
- if (installFixup(self) == DITEM_FAILURE)
+ if (DITEM_STATUS(installFixup(self)) == DITEM_FAILURE)
i = DITEM_FAILURE;
- if (i != DITEM_FAILURE && !strcmp(str, "novice")) {
+ if (DITEM_STATUS(i) != DITEM_FAILURE && !strcmp(str, "novice")) {
msgConfirm("Since you're running the novice installation, a few post-configuration\n"
"questions will be asked at this point. For any option you do not wish\n"
"to configure, select Cancel.");
@@ -479,7 +479,7 @@ installCommit(dialogMenuItem *self)
/* Don't print this if we're express or novice installing */
if (strcmp(str, "express") && strcmp(str, "novice")) {
- if (Dists || i == DITEM_FAILURE)
+ if (Dists || DITEM_STATUS(i) == DITEM_FAILURE)
msgConfirm("Installation completed with some errors. You may wish to\n"
"scroll through the debugging messages on VTY1 with the\n"
"scroll-lock feature.");
@@ -737,7 +737,7 @@ installVarDefaults(dialogMenuItem *self)
variable_set2(VAR_RELNAME, RELEASE_NAME);
variable_set2(VAR_CPIO_VERBOSITY, "high");
variable_set2(VAR_TAPE_BLOCKSIZE, DEFAULT_TAPE_BLOCKSIZE);
- variable_set2(VAR_EDITOR, "/stand/ee");
+ variable_set2(VAR_EDITOR, RunningAsInit ? "/stand/ee" : "/usr/bin/ee");
variable_set2(VAR_FTP_USER, "ftp");
variable_set2(VAR_BROWSER_PACKAGE, "lynx-2.4fm");
variable_set2(VAR_BROWSER_BINARY, "/usr/local/bin/lynx");
diff --git a/usr.sbin/sade/label.c b/usr.sbin/sade/label.c
index 239b3a5..ed01da6 100644
--- a/usr.sbin/sade/label.c
+++ b/usr.sbin/sade/label.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: label.c,v 1.43 1996/04/23 01:29:25 jkh Exp $
+ * $Id: label.c,v 1.44 1996/04/25 17:31:21 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -97,11 +97,11 @@ diskLabelEditor(dialogMenuItem *self)
}
if (!enabled) {
devs[0]->enabled = TRUE;
- if (diskPartitionEditor(self) == DITEM_FAILURE)
+ if (DITEM_STATUS(diskPartitionEditor(self)) == DITEM_FAILURE)
return DITEM_FAILURE;
}
i = diskLabel(devs[0]->name);
- if (i != DITEM_FAILURE)
+ if (DITEM_STATUS(i) != DITEM_FAILURE)
variable_set2(DISK_LABELLED, "yes");
return i;
}
@@ -122,9 +122,9 @@ diskLabelCommit(dialogMenuItem *self)
i = DITEM_FAILURE;
}
/* The routine will guard against redundant writes, just as this one does */
- else if (diskPartitionWrite(self) != DITEM_SUCCESS)
+ else if (DITEM_STATUS(diskPartitionWrite(self)) != DITEM_SUCCESS)
i = DITEM_FAILURE;
- else if (installFilesystems(self) != DITEM_SUCCESS)
+ else if (DITEM_STATUS(installFilesystems(self)) != DITEM_SUCCESS)
i = DITEM_FAILURE;
else {
msgInfo("All filesystem information written successfully.");
diff --git a/usr.sbin/sade/menus.c b/usr.sbin/sade/menus.c
index d381536..420a218 100644
--- a/usr.sbin/sade/menus.c
+++ b/usr.sbin/sade/menus.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: menus.c,v 1.54 1996/04/27 07:04:12 jkh Exp $
+ * $Id: menus.c,v 1.55 1996/04/28 00:37:34 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -54,12 +54,6 @@ clearSrc(dialogMenuItem *self)
}
static int
-checkSrc(dialogMenuItem *self)
-{
- return ((Dists & DIST_SRC) && (SrcDists == DIST_SRC_ALL | DIST_SRC_SMAILCF));
-}
-
-static int
setX11All(dialogMenuItem *self)
{
XF86Dists = DIST_XF86_ALL;
@@ -956,11 +950,11 @@ aspects of your system's network configuration.",
{ "NFS client", "This machine will be an NFS client",
dmenuVarCheck, dmenuSetVariable, NULL, "nfs_client=YES" },
{ "NFS server", "This machine will be an NFS server",
- NULL, configNFSServer },
+ dmenuVarCheck, configNFSServer, NULL, "nfs_server" },
{ "Gateway", "This machine will route packets between interfaces",
dmenuVarCheck, dmenuSetVariable, NULL, "gateway=YES" },
{ "Gated", "This machine wants to run gated instead of routed",
- NULL, configGated },
+ dmenuVarCheck, configGated, NULL, "gated" },
{ "Ntpdate", "Select a clock-syncronization server",
dmenuVarCheck, dmenuSubmenu, NULL, &MenuNTP, '[', 'X', ']', (int)"ntpdate" },
{ "Routed", "Set flags for routed (default: -q)",
@@ -968,20 +962,20 @@ aspects of your system's network configuration.",
{ "Rwhod", "This machine wants to run the rwho daemon",
dmenuVarCheck, dmenuSetVariable, NULL, "rwhod=YES" },
{ "Anon FTP", "This machine wishes to allow anonymous FTP.",
- NULL, configAnonFTP },
+ dmenuVarCheck, configAnonFTP, NULL, "anon_ftp" },
{ "WEB Server", "This machine wishes to be a WWW server.",
- NULL, configApache },
+ dmenuVarCheck, configApache, NULL, "apache_httpd" },
{ "Samba", "Install Samba for LanManager (NETBUI) access.",
- NULL, configSamba },
+ dmenuVarCheck, configSamba, NULL, "samba" },
{ "PCNFSD", "Run authentication server for clients with PC-NFS.",
- NULL, configPCNFSD },
+ dmenuVarCheck, configPCNFSD, NULL, "pcnfsd" },
{ "Exit", "Exit this menu (returning to previous)",
checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' },
{ NULL } },
};
DMenu MenuNTP = {
- DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
+ DMENU_RADIO_TYPE | DMENU_SELECTION_RETURNS,
"NTPDATE Server Selection",
"There are a number of time syncronization servers available\n\
for public use around the Internet. Please select one reasonably\n\
diff --git a/usr.sbin/sade/misc.c b/usr.sbin/sade/misc.c
index 2da5dd7..3f84540 100644
--- a/usr.sbin/sade/misc.c
+++ b/usr.sbin/sade/misc.c
@@ -1,7 +1,7 @@
/*
* Miscellaneous support routines..
*
- * $Id: misc.c,v 1.16 1996/04/13 13:32:00 jkh Exp $
+ * $Id: misc.c,v 1.17 1996/04/23 01:29:29 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -213,6 +213,7 @@ item_add(dialogMenuItem *list, char *prompt, char *title,
list = (dialogMenuItem *)realloc(list, sizeof(dialogMenuItem) * *max);
}
d = &list[(*curr)++];
+ bzero(d, sizeof(*d));
d->prompt = prompt ? strdup(prompt) : NULL;
d->title = title ? strdup(title) : NULL;
d->checked = checked;
diff --git a/usr.sbin/sade/system.c b/usr.sbin/sade/system.c
index 98362ed..adb89e8 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.53 1996/04/26 18:19:38 jkh Exp $
+ * $Id: system.c,v 1.54 1996/04/28 01:07:27 jkh Exp $
*
* Jordan Hubbard
*
@@ -215,7 +215,14 @@ vsystem(char *fmt, ...)
dup2(DebugFD, 1);
dup2(DebugFD, 2);
}
- execl("/stand/sh", "sh", "-c", cmd, (char *)NULL);
+ else {
+ close(1); open("/dev/null", O_WRONLY);
+ dup2(1, 2);
+ }
+ if (!RunningAsInit)
+ execl("/bin/sh", "/bin/sh", "-c", cmd, (char *)NULL);
+ else
+ execl("/stand/sh", "/stand/sh", "-c", cmd, (char *)NULL);
exit(1);
}
else {
diff --git a/usr.sbin/sysinstall/Makefile b/usr.sbin/sysinstall/Makefile
index 9c2c6b3..a7cf997 100644
--- a/usr.sbin/sysinstall/Makefile
+++ b/usr.sbin/sysinstall/Makefile
@@ -7,11 +7,10 @@ DEBUG_FLAGS+= -g3
SRCS= anonFTP.c apache.c attr.c cdrom.c command.c config.c \
devices.c disks.c dist.c dmenu.c doc.c dos.c floppy.c ftp.c \
- ftp_strat.c globals.c index.c install.c installFinal.c \
- installUpgrade.c label.c lndir.c main.c makedevs.c media.c \
- menus.c misc.c msg.c network.c nfs.c options.c \
- package.c samba.c system.c tape.c tcpip.c termcap.c ufs.c \
- variable.c wizard.c
+ ftp_strat.c globals.c index.c install.c installUpgrade.c \
+ label.c lndir.c main.c makedevs.c media.c menus.c misc.c \
+ msg.c network.c nfs.c options.c package.c samba.c system.c \
+ tape.c tcpip.c termcap.c ufs.c variable.c wizard.c
CFLAGS+= -Wall -I${.CURDIR}/../../gnu/lib/libdialog
diff --git a/usr.sbin/sysinstall/anonFTP.c b/usr.sbin/sysinstall/anonFTP.c
index 436d27f..591589f 100644
--- a/usr.sbin/sysinstall/anonFTP.c
+++ b/usr.sbin/sysinstall/anonFTP.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: anonFTP.c,v 1.12 1996/04/23 01:29:07 jkh Exp $
+ * $Id: anonFTP.c,v 1.13 1996/04/28 01:07:19 jkh Exp $
*
* Copyright (c) 1995
* Coranth Gryphon. All rights reserved.
@@ -206,7 +206,6 @@ createFtpUser(void)
fclose(fptr);
msgNotify("Remaking password file: %s", _PATH_MASTERPASSWD);
vsystem("pwd_mkdb -p %s", _PATH_MASTERPASSWD);
-
return (DITEM_SUCCESS);
}
@@ -404,9 +403,9 @@ configAnonFTP(dialogMenuItem *self)
dialog_clear();
i = anonftpOpenDialog();
- if (i != DITEM_SUCCESS) {
+ if (DITEM_STATUS(i) != DITEM_SUCCESS) {
msgConfirm("Configuration of Anonymous FTP cancelled per user request.");
- return DITEM_SUCCESS | DITEM_RESTORE;
+ return i | DITEM_RESTORE;
}
/*** Use defaults for any invalid values ***/
@@ -421,8 +420,8 @@ configAnonFTP(dialogMenuItem *self)
/*** If the user did not specify a directory, use default ***/
- if (tconf.homedir[strlen(tconf.homedir)-1] == '/')
- tconf.homedir[strlen(tconf.homedir)-1] = '\0';
+ if (tconf.homedir[strlen(tconf.homedir) - 1] == '/')
+ tconf.homedir[strlen(tconf.homedir) - 1] = '\0';
if (!tconf.homedir[0])
strcpy(tconf.homedir, FTP_HOMEDIR);
@@ -443,7 +442,7 @@ configAnonFTP(dialogMenuItem *self)
vsystem("mkdir -p %s/%s", tconf.homedir, tconf.upload);
vsystem("chmod 1777 %s/%s", tconf.homedir, tconf.upload);
- if (createFtpUser() == DITEM_SUCCESS) {
+ if (DITEM_STATUS(createFtpUser()) == DITEM_SUCCESS) {
msgNotify("Copying password information for anon FTP.");
vsystem("cp /etc/pwd.db %s/etc && chmod 444 %s/etc/pwd.db", tconf.homedir, tconf.homedir);
vsystem("cp /etc/passwd %s/etc && chmod 444 %s/etc/passwd", tconf.homedir, tconf.homedir);
@@ -471,5 +470,7 @@ configAnonFTP(dialogMenuItem *self)
"Anonymous FTP will not be set up.", tconf.homedir);
i = DITEM_FAILURE;
}
+ if (DITEM_STATUS(i) == DITEM_SUCCESS)
+ variable_set2("anon_ftp", "YES");
return i | DITEM_RESTORE;
}
diff --git a/usr.sbin/sysinstall/config.c b/usr.sbin/sysinstall/config.c
index 5577fc5..22fc801 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.25 1996/04/23 01:29:11 jkh Exp $
+ * $Id: config.c,v 1.26 1996/04/28 01:07:21 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -459,9 +459,9 @@ configPackages(dialogMenuItem *self)
/* Now show the packing list menu */
pos = scroll = 0;
ret = index_menu(&plist, NULL, &pos, &scroll);
- if (ret == DITEM_LEAVE_MENU)
+ if (ret & DITEM_LEAVE_MENU)
break;
- else if (ret != DITEM_FAILURE) {
+ else if (DITEM_STATUS(ret) != DITEM_FAILURE) {
index_extract(mediaDevice, &top, &plist);
break;
}
@@ -525,7 +525,7 @@ configPorts(dialogMenuItem *self)
}
}
msgNotify("Making a link tree from %s to %s.", dist, cp);
- if (lndir(dist, cp) != DITEM_SUCCESS) {
+ if (DITEM_STATUS(lndir(dist, cp)) != DITEM_SUCCESS) {
msgConfirm("The lndir function returned an error status and may not have.\n"
"successfully generated the link tree. You may wish to inspect\n"
"the /usr/ports directory carefully for any missing link files.");
@@ -548,18 +548,24 @@ configPorts(dialogMenuItem *self)
int
configGated(dialogMenuItem *self)
{
- if (package_add("gated-3.5a11") == DITEM_SUCCESS)
+ int ret;
+
+ ret = package_add("gated-3.5a11");
+ if (DITEM_STATUS(ret) == DITEM_SUCCESS)
variable_set2("gated", "YES");
- return DITEM_SUCCESS;
+ return ret;
}
/* Load pcnfsd package */
int
configPCNFSD(dialogMenuItem *self)
{
- if (package_add("pcnfsd-93.02.16") == DITEM_SUCCESS)
+ int ret;
+
+ ret = package_add("pcnfsd-93.02.16");
+ if (DITEM_STATUS(ret) == DITEM_SUCCESS)
variable_set2("pcnfsd", "YES");
- return DITEM_SUCCESS;
+ return ret;
}
int
diff --git a/usr.sbin/sysinstall/disks.c b/usr.sbin/sysinstall/disks.c
index fec4cf2..0c62dac 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.42 1996/04/25 17:31:14 jkh Exp $
+ * $Id: disks.c,v 1.43 1996/04/28 00:37:28 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -352,7 +352,7 @@ diskPartition(Device *dev, Disk *d)
&& (mbrContents = getBootMgr(d->name)) != NULL)
Set_Boot_Mgr(d, mbrContents);
- if (diskPartitionWrite(NULL) != DITEM_SUCCESS)
+ if (DITEM_STATUS(diskPartitionWrite(NULL)) != DITEM_SUCCESS)
msgConfirm("Disk partition write returned an error status!");
else
msgConfirm("Wrote FDISK partition information out successfully.");
diff --git a/usr.sbin/sysinstall/dist.c b/usr.sbin/sysinstall/dist.c
index ab42ba8..ecd3d71 100644
--- a/usr.sbin/sysinstall/dist.c
+++ b/usr.sbin/sysinstall/dist.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: dist.c,v 1.43 1996/04/25 17:31:15 jkh Exp $
+ * $Id: dist.c,v 1.44 1996/04/28 00:37:29 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -354,7 +354,7 @@ distExtract(char *parent, Distribution *me)
if (isDebug())
msgDebug("Parsing attributes file for distribution %s\n", dist);
dist_attr = safe_malloc(sizeof(Attribs) * MAX_ATTRIBS);
- if (attr_parse_file(dist_attr, buf) == DITEM_FAILURE)
+ if (DITEM_STATUS(attr_parse_file(dist_attr, buf)) == DITEM_FAILURE)
msgConfirm("Cannot load information file for %s distribution!\n"
"Please verify that your media is valid and try again.", dist);
else {
@@ -472,12 +472,15 @@ distExtractAll(dialogMenuItem *self)
char buf[512];
/* First try to initialize the state of things */
- if (!mediaDevice->init(mediaDevice))
- return DITEM_FAILURE;
if (!Dists) {
msgConfirm("You haven't selected any distributions to extract.");
return DITEM_FAILURE;
}
+ if (!mediaVerify())
+ return DITEM_FAILURE;
+
+ if (!mediaDevice->init(mediaDevice))
+ return DITEM_FAILURE;
dialog_clear();
msgNotify("Attempting to install all selected distributions..");
/* Try for 3 times around the loop, then give up. */
diff --git a/usr.sbin/sysinstall/doc.c b/usr.sbin/sysinstall/doc.c
index dd92a4c..069e145 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.13 1996/04/23 01:29:18 jkh Exp $
+ * $Id: doc.c,v 1.14 1996/04/25 17:31:17 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -44,6 +44,7 @@
int
docBrowser(dialogMenuItem *self)
{
+ int ret;
char *browser = variable_get(VAR_BROWSER_PACKAGE);
if (RunningAsInit && !strstr(variable_get(SYSTEM_STATE), "install")) {
@@ -56,12 +57,14 @@ docBrowser(dialogMenuItem *self)
return DITEM_FAILURE;
/* First, make sure we have whatever browser we've chosen is here */
- if (package_add(browser) != DITEM_SUCCESS) {
+ ret = package_add(browser);
+ if (DITEM_STATUS(ret) != DITEM_SUCCESS) {
msgConfirm("Unable to install the %s HTML browser package. You may\n"
"wish to verify that your media is configured correctly and\n"
"try again.", browser);
- return DITEM_FAILURE;
+ return ret;
}
+
if (!file_executable(variable_get(VAR_BROWSER_BINARY))) {
if (!msgYesNo("Hmmm. The %s package claims to have installed, but I can't\n"
"find its binary in %s! You may wish to try a different\n"
@@ -70,7 +73,7 @@ docBrowser(dialogMenuItem *self)
"I suggest that we remove the version that was extracted since it does\n"
"not appear to be correct. Would you like me to do that now?"))
vsystem("pkg_delete %s %s", !strcmp(variable_get(VAR_CPIO_VERBOSITY), "high") ? "-v" : "", browser);
- return DITEM_FAILURE;
+ return DITEM_FAILURE | DITEM_RESTORE;
}
/* Run browser on the appropriate doc */
diff --git a/usr.sbin/sysinstall/dos.c b/usr.sbin/sysinstall/dos.c
index fa24cdb..9e4ed9b 100644
--- a/usr.sbin/sysinstall/dos.c
+++ b/usr.sbin/sysinstall/dos.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: dos.c,v 1.10 1996/04/13 13:31:33 jkh Exp $
+ * $Id: dos.c,v 1.11 1996/04/23 01:29:19 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -59,7 +59,7 @@ mediaInitDOS(Device *dev)
if (!RunningAsInit || DOSMounted)
return TRUE;
- if (Mkdir("/dos", NULL) != DITEM_SUCCESS)
+ if (DITEM_STATUS(Mkdir("/dos", NULL)) != DITEM_SUCCESS)
return FALSE;
memset(&args, 0, sizeof(args));
diff --git a/usr.sbin/sysinstall/index.c b/usr.sbin/sysinstall/index.c
index 754740f..bea8857 100644
--- a/usr.sbin/sysinstall/index.c
+++ b/usr.sbin/sysinstall/index.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: index.c,v 1.23 1996/04/13 13:31:39 jkh Exp $
+ * $Id: index.c,v 1.24 1996/04/23 01:29:21 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -57,9 +57,10 @@ _strdup(char *ptr)
static char *descrs[] = {
"Package Selection", "To mark a package or select a category, move to it and press SPACE.\n"
- "To unmark a package, press SPACE again. To go to a previous menu, select the Cancel\n"
- "button. To search for a package by name, press ESC. To finally extract packages, you\n"
- "should Cancel all the way out of any submenus and this top menu.",
+ "To unmark a package, press SPACE again. To go to a previous menu,\n"
+ "select the Cancel button. To search for a package by name, press ESC.\n"
+ "To finally extract packages, you should Cancel all the way out of any\n"
+ "submenus and then this top menu.",
"Package Targets", "These are the packages you've selected for extraction.\n\n"
"If you're sure of these choices, select OK.\n"
"If not, select Cancel to go back to the package selection menu.\n",
@@ -528,12 +529,12 @@ index_extract_one(Device *dev, PkgNodePtr top, PkgNodePtr who, Boolean depended)
strcpy(t, id->deps);
cp = t;
- while (cp && status == DITEM_SUCCESS) {
+ while (cp && DITEM_STATUS(status) == DITEM_SUCCESS) {
if ((cp2 = index(cp, ' ')) != NULL)
*cp2 = '\0';
if ((tmp2 = index_search(top, cp, NULL)) != NULL) {
status = index_extract_one(dev, top, tmp2, TRUE);
- if (status != DITEM_SUCCESS) {
+ if (DITEM_STATUS(status) != DITEM_SUCCESS) {
if (variable_get(VAR_NO_CONFIRM))
msgNotify("Loading of dependant package %s failed", cp);
else
@@ -547,7 +548,7 @@ index_extract_one(Device *dev, PkgNodePtr top, PkgNodePtr who, Boolean depended)
}
}
/* Done with the deps? Load the real m'coy */
- if (status == DITEM_SUCCESS)
+ if (DITEM_STATUS(status) == DITEM_SUCCESS)
status = package_extract(dev, who->name, depended);
return status;
}
diff --git a/usr.sbin/sysinstall/install.c b/usr.sbin/sysinstall/install.c
index d03bc34..524b5c1 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.87 1996/04/28 00:37:32 jkh Exp $
+ * $Id: install.c,v 1.88 1996/04/28 01:07:22 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -174,7 +174,7 @@ installInitial(void)
"We can take no responsibility for lost disk contents!"))
return DITEM_FAILURE;
- if (diskLabelCommit(NULL) != DITEM_SUCCESS) {
+ if (DITEM_STATUS(diskLabelCommit(NULL)) != DITEM_SUCCESS) {
msgConfirm("Couldn't make filesystems properly. Aborting.");
return DITEM_FAILURE;
}
@@ -235,14 +235,14 @@ installFixitFloppy(dialogMenuItem *self)
if (!directory_exists("/tmp"))
(void)symlink("/mnt2/tmp", "/tmp");
if (!directory_exists("/var/tmp/vi.recover")) {
- if (Mkdir("/var/tmp/vi.recover", NULL) != DITEM_SUCCESS) {
+ if (DITEM_STATUS(Mkdir("/var/tmp/vi.recover", NULL)) != DITEM_SUCCESS) {
msgConfirm("Warning: Was unable to create a /var/tmp/vi.recover directory.\n"
"vi will kvetch and moan about it as a result but should still\n"
"be essentially usable.");
}
}
/* Link the spwd.db file */
- if (Mkdir("/etc", NULL) != DITEM_SUCCESS)
+ if (DITEM_STATUS(Mkdir("/etc", NULL)) != DITEM_SUCCESS)
msgConfirm("Unable to create an /etc directory! Things are weird on this floppy..");
else if (symlink("/mnt2/etc/spwd.db", "/etc/spwd.db") == -1)
msgConfirm("Couldn't symlink the /etc/spwd.db file! I'm not sure I like this..");
@@ -282,10 +282,10 @@ int
installExpress(dialogMenuItem *self)
{
variable_set2(SYSTEM_STATE, "express");
- if (diskPartitionEditor(self) == DITEM_FAILURE)
+ if (DITEM_STATUS(diskPartitionEditor(self)) == DITEM_FAILURE)
return DITEM_FAILURE;
- if (diskLabelEditor(self) == DITEM_FAILURE)
+ if (DITEM_STATUS(diskLabelEditor(self)) == DITEM_FAILURE)
return DITEM_FAILURE;
if (!Dists) {
@@ -298,7 +298,7 @@ installExpress(dialogMenuItem *self)
return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE;
}
- if (installCommit(self) == DITEM_FAILURE)
+ if (DITEM_STATUS(installCommit(self)) == DITEM_FAILURE)
return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE;
return DITEM_LEAVE_MENU | DITEM_RESTORE | DITEM_RECREATE;
@@ -317,7 +317,7 @@ installNovice(dialogMenuItem *self)
"by a (Q)uit. If you wish to allocate only free space to FreeBSD, move to a\n"
"partition marked \"unused\" and use the (C)reate command.");
- if (diskPartitionEditor(self) == DITEM_FAILURE)
+ if (DITEM_STATUS(diskPartitionEditor(self)) == DITEM_FAILURE)
return DITEM_FAILURE;
dialog_clear();
@@ -328,7 +328,7 @@ installNovice(dialogMenuItem *self)
"care for the layout chosen by (A)uto, press F1 for more information on\n"
"manual layout.");
- if (diskLabelEditor(self) == DITEM_FAILURE)
+ if (DITEM_STATUS(diskLabelEditor(self)) == DITEM_FAILURE)
return DITEM_FAILURE;
dialog_clear();
@@ -351,7 +351,7 @@ installNovice(dialogMenuItem *self)
return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE;
}
- if (installCommit(self) == DITEM_FAILURE)
+ if (DITEM_STATUS(installCommit(self)) == DITEM_FAILURE)
return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE;
return DITEM_LEAVE_MENU | DITEM_RESTORE | DITEM_RECREATE;
@@ -378,9 +378,9 @@ installCommit(dialogMenuItem *self)
str = variable_get(SYSTEM_STATE);
i = DITEM_LEAVE_MENU;
if (RunningAsInit) {
- if (installInitial() == DITEM_FAILURE)
+ if (DITEM_STATUS(installInitial()) == DITEM_FAILURE)
return DITEM_FAILURE;
- if (configFstab() == DITEM_FAILURE)
+ if (DITEM_STATUS(configFstab()) == DITEM_FAILURE)
return DITEM_FAILURE;
if (!rootExtract()) {
msgConfirm("Failed to load the ROOT distribution. Please correct\n"
@@ -389,13 +389,13 @@ installCommit(dialogMenuItem *self)
}
}
- if (distExtractAll(self) == DITEM_FAILURE)
+ if (DITEM_STATUS(distExtractAll(self)) == DITEM_FAILURE)
i = DITEM_FAILURE;
- if (installFixup(self) == DITEM_FAILURE)
+ if (DITEM_STATUS(installFixup(self)) == DITEM_FAILURE)
i = DITEM_FAILURE;
- if (i != DITEM_FAILURE && !strcmp(str, "novice")) {
+ if (DITEM_STATUS(i) != DITEM_FAILURE && !strcmp(str, "novice")) {
msgConfirm("Since you're running the novice installation, a few post-configuration\n"
"questions will be asked at this point. For any option you do not wish\n"
"to configure, select Cancel.");
@@ -479,7 +479,7 @@ installCommit(dialogMenuItem *self)
/* Don't print this if we're express or novice installing */
if (strcmp(str, "express") && strcmp(str, "novice")) {
- if (Dists || i == DITEM_FAILURE)
+ if (Dists || DITEM_STATUS(i) == DITEM_FAILURE)
msgConfirm("Installation completed with some errors. You may wish to\n"
"scroll through the debugging messages on VTY1 with the\n"
"scroll-lock feature.");
@@ -737,7 +737,7 @@ installVarDefaults(dialogMenuItem *self)
variable_set2(VAR_RELNAME, RELEASE_NAME);
variable_set2(VAR_CPIO_VERBOSITY, "high");
variable_set2(VAR_TAPE_BLOCKSIZE, DEFAULT_TAPE_BLOCKSIZE);
- variable_set2(VAR_EDITOR, "/stand/ee");
+ variable_set2(VAR_EDITOR, RunningAsInit ? "/stand/ee" : "/usr/bin/ee");
variable_set2(VAR_FTP_USER, "ftp");
variable_set2(VAR_BROWSER_PACKAGE, "lynx-2.4fm");
variable_set2(VAR_BROWSER_BINARY, "/usr/local/bin/lynx");
diff --git a/usr.sbin/sysinstall/installUpgrade.c b/usr.sbin/sysinstall/installUpgrade.c
index 72393bd3..562302e 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.21 1996/04/23 01:29:24 jkh Exp $
+ * $Id: installUpgrade.c,v 1.22 1996/04/25 17:31:20 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -230,7 +230,7 @@ installUpgrade(dialogMenuItem *self)
"Once you're done in the label editor, press Q to return here for the next\n"
"step.");
- if (diskLabelEditor(self) == DITEM_FAILURE) {
+ 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;
@@ -238,7 +238,7 @@ installUpgrade(dialogMenuItem *self)
/* Don't write out MBR info */
variable_set2(DISK_PARTITIONED, "written");
- if (diskLabelCommit(self) == DITEM_FAILURE) {
+ if (DITEM_STATUS(diskLabelCommit(self)) == DITEM_FAILURE) {
msgConfirm("Not all file systems were properly mounted. Upgrade operation\n"
"aborted.");
variable_unset(DISK_PARTITIONED);
@@ -251,7 +251,7 @@ installUpgrade(dialogMenuItem *self)
return DITEM_FAILURE | DITEM_RESTORE | DITEM_RECREATE;
}
- if (chroot("/mnt") == DITEM_FAILURE) {
+ 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);
@@ -297,7 +297,7 @@ installUpgrade(dialogMenuItem *self)
}
msgNotify("Beginning extraction of distributions..");
- if (distExtractAll(self) == DITEM_FAILURE) {
+ if (DITEM_STATUS(distExtractAll(self)) == DITEM_FAILURE) {
if (extractingBin && (Dists & DIST_BIN)) {
msgConfirm("Hmmmm. We couldn't even extract the bin distribution. This upgrade\n"
"should be considered a failure and started from the beginning, sorry!\n"
@@ -315,7 +315,7 @@ installUpgrade(dialogMenuItem *self)
"/dev entries and such that a 2.1 system expects to see. I'll also perform a\n"
"few \"fixup\" operations to repair the effects of splatting a bin distribution\n"
"on top of an existing system..");
- if (installFixup(self) == DITEM_FAILURE) {
+ if (DITEM_STATUS(installFixup(self)) == DITEM_FAILURE) {
msgConfirm("Hmmmmm. The fixups don't seem to have been very happy.\n"
"You may wish to examine the system a little more closely when\n"
"it comes time to merge your /etc customizations back.");
diff --git a/usr.sbin/sysinstall/label.c b/usr.sbin/sysinstall/label.c
index 239b3a5..ed01da6 100644
--- a/usr.sbin/sysinstall/label.c
+++ b/usr.sbin/sysinstall/label.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: label.c,v 1.43 1996/04/23 01:29:25 jkh Exp $
+ * $Id: label.c,v 1.44 1996/04/25 17:31:21 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -97,11 +97,11 @@ diskLabelEditor(dialogMenuItem *self)
}
if (!enabled) {
devs[0]->enabled = TRUE;
- if (diskPartitionEditor(self) == DITEM_FAILURE)
+ if (DITEM_STATUS(diskPartitionEditor(self)) == DITEM_FAILURE)
return DITEM_FAILURE;
}
i = diskLabel(devs[0]->name);
- if (i != DITEM_FAILURE)
+ if (DITEM_STATUS(i) != DITEM_FAILURE)
variable_set2(DISK_LABELLED, "yes");
return i;
}
@@ -122,9 +122,9 @@ diskLabelCommit(dialogMenuItem *self)
i = DITEM_FAILURE;
}
/* The routine will guard against redundant writes, just as this one does */
- else if (diskPartitionWrite(self) != DITEM_SUCCESS)
+ else if (DITEM_STATUS(diskPartitionWrite(self)) != DITEM_SUCCESS)
i = DITEM_FAILURE;
- else if (installFilesystems(self) != DITEM_SUCCESS)
+ else if (DITEM_STATUS(installFilesystems(self)) != DITEM_SUCCESS)
i = DITEM_FAILURE;
else {
msgInfo("All filesystem information written successfully.");
diff --git a/usr.sbin/sysinstall/media.c b/usr.sbin/sysinstall/media.c
index d020b24..d61654d 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.36 1996/04/28 00:37:33 jkh Exp $
+ * $Id: media.c,v 1.37 1996/04/28 01:07:24 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -364,6 +364,8 @@ mediaExtractDistBegin(char *dir, int *fd, int *zpid, int *cpid)
pipe(qfd);
*zpid = fork();
if (!*zpid) {
+ char *gunzip = RunningAsInit ? "/stand/gunzip" : "/usr/bin/gunzip";
+
dup2(qfd[0], 0); close(qfd[0]);
dup2(pfd[1], 1); close(pfd[1]);
if (DebugFD != -1)
@@ -374,15 +376,17 @@ mediaExtractDistBegin(char *dir, int *fd, int *zpid, int *cpid)
}
close(qfd[1]);
close(pfd[0]);
- i = execl("/stand/gunzip", "/stand/gunzip", 0);
+ i = execl(gunzip, gunzip, 0);
if (isDebug())
- msgDebug("/stand/gunzip command returns %d status\n", i);
+ msgDebug("%s command returns %d status\n", gunzip, i);
exit(i);
}
*fd = qfd[1];
close(qfd[0]);
*cpid = fork();
if (!*cpid) {
+ char *cpio = RunningAsInit ? "/stand/cpio" : "/usr/bin/cpio";
+
dup2(pfd[0], 0); close(pfd[0]);
close(pfd[1]);
close(qfd[1]);
@@ -395,11 +399,11 @@ mediaExtractDistBegin(char *dir, int *fd, int *zpid, int *cpid)
dup2(1, 2);
}
if (strlen(cpioVerbosity()))
- i = execl("/stand/cpio", "/stand/cpio", "-idum", cpioVerbosity(), "--block-size", mediaTapeBlocksize(), 0);
+ i = execl(cpio, cpio, "-idum", cpioVerbosity(), "--block-size", mediaTapeBlocksize(), 0);
else
- i = execl("/stand/cpio", "/stand/cpio", "-idum", "--block-size", mediaTapeBlocksize(), 0);
+ i = execl(cpio, cpio, "-idum", "--block-size", mediaTapeBlocksize(), 0);
if (isDebug())
- msgDebug("/stand/cpio command returns %d status\n", i);
+ msgDebug("%s command returns %d status\n", cpio, i);
exit(i);
}
close(pfd[0]);
@@ -413,7 +417,8 @@ mediaExtractDistEnd(int zpid, int cpid)
int i,j;
i = waitpid(zpid, &j, 0);
- if (i < 0) { /* Don't check status - gunzip seems to return a bogus one! */
+ /* Don't check status - gunzip seems to return a bogus one! */
+ if (i < 0) {
if (isDebug())
msgDebug("wait for gunzip returned status of %d!\n", i);
return FALSE;
@@ -441,6 +446,8 @@ mediaExtractDist(char *dir, int fd)
pipe(pfd);
zpid = fork();
if (!zpid) {
+ char *gunzip = RunningAsInit ? "/stand/gunzip" : "/usr/bin/gunzip";
+
dup2(fd, 0); close(fd);
dup2(pfd[1], 1); close(pfd[1]);
if (DebugFD != -1)
@@ -450,13 +457,15 @@ mediaExtractDist(char *dir, int fd)
open("/dev/null", O_WRONLY);
}
close(pfd[0]);
- i = execl("/stand/gunzip", "/stand/gunzip", 0);
+ i = execl(gunzip, gunzip, 0);
if (isDebug())
- msgDebug("/stand/gunzip command returns %d status\n", i);
+ msgDebug("%s command returns %d status\n", gunzip, i);
exit(i);
}
cpid = fork();
if (!cpid) {
+ char *cpio = RunningAsInit ? "/stand/cpio" : "/usr/bin/cpio";
+
dup2(pfd[0], 0); close(pfd[0]);
close(fd);
close(pfd[1]);
@@ -469,18 +478,19 @@ mediaExtractDist(char *dir, int fd)
dup2(1, 2);
}
if (strlen(cpioVerbosity()))
- i = execl("/stand/cpio", "/stand/cpio", "-idum", cpioVerbosity(), "--block-size", mediaTapeBlocksize(), 0);
+ i = execl(cpio, cpio, "-idum", cpioVerbosity(), "--block-size", mediaTapeBlocksize(), 0);
else
- i = execl("/stand/cpio", "/stand/cpio", "-idum", "--block-size", mediaTapeBlocksize(), 0);
+ i = execl(cpio, cpio, "-idum", "--block-size", mediaTapeBlocksize(), 0);
if (isDebug())
- msgDebug("/stand/cpio command returns %d status\n", i);
+ msgDebug("%s command returns %d status\n", cpio, i);
exit(i);
}
close(pfd[0]);
close(pfd[1]);
i = waitpid(zpid, &j, 0);
- if (i < 0) { /* Don't check status - gunzip seems to return a bogus one! */
+ /* Don't check status - gunzip seems to return a bogus one! */
+ if (i < 0) {
if (isDebug())
msgDebug("wait for gunzip returned status of %d!\n", i);
return FALSE;
@@ -510,7 +520,7 @@ mediaVerify(void)
if (!mediaDevice) {
msgConfirm("Media type not set! Please select a media type\n"
"from the Installation menu before proceeding.");
- return mediaGetType(NULL) == DITEM_SUCCESS;
+ return DITEM_STATUS(mediaGetType(NULL)) == DITEM_SUCCESS;
}
return TRUE;
}
diff --git a/usr.sbin/sysinstall/menus.c b/usr.sbin/sysinstall/menus.c
index d381536..420a218 100644
--- a/usr.sbin/sysinstall/menus.c
+++ b/usr.sbin/sysinstall/menus.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: menus.c,v 1.54 1996/04/27 07:04:12 jkh Exp $
+ * $Id: menus.c,v 1.55 1996/04/28 00:37:34 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -54,12 +54,6 @@ clearSrc(dialogMenuItem *self)
}
static int
-checkSrc(dialogMenuItem *self)
-{
- return ((Dists & DIST_SRC) && (SrcDists == DIST_SRC_ALL | DIST_SRC_SMAILCF));
-}
-
-static int
setX11All(dialogMenuItem *self)
{
XF86Dists = DIST_XF86_ALL;
@@ -956,11 +950,11 @@ aspects of your system's network configuration.",
{ "NFS client", "This machine will be an NFS client",
dmenuVarCheck, dmenuSetVariable, NULL, "nfs_client=YES" },
{ "NFS server", "This machine will be an NFS server",
- NULL, configNFSServer },
+ dmenuVarCheck, configNFSServer, NULL, "nfs_server" },
{ "Gateway", "This machine will route packets between interfaces",
dmenuVarCheck, dmenuSetVariable, NULL, "gateway=YES" },
{ "Gated", "This machine wants to run gated instead of routed",
- NULL, configGated },
+ dmenuVarCheck, configGated, NULL, "gated" },
{ "Ntpdate", "Select a clock-syncronization server",
dmenuVarCheck, dmenuSubmenu, NULL, &MenuNTP, '[', 'X', ']', (int)"ntpdate" },
{ "Routed", "Set flags for routed (default: -q)",
@@ -968,20 +962,20 @@ aspects of your system's network configuration.",
{ "Rwhod", "This machine wants to run the rwho daemon",
dmenuVarCheck, dmenuSetVariable, NULL, "rwhod=YES" },
{ "Anon FTP", "This machine wishes to allow anonymous FTP.",
- NULL, configAnonFTP },
+ dmenuVarCheck, configAnonFTP, NULL, "anon_ftp" },
{ "WEB Server", "This machine wishes to be a WWW server.",
- NULL, configApache },
+ dmenuVarCheck, configApache, NULL, "apache_httpd" },
{ "Samba", "Install Samba for LanManager (NETBUI) access.",
- NULL, configSamba },
+ dmenuVarCheck, configSamba, NULL, "samba" },
{ "PCNFSD", "Run authentication server for clients with PC-NFS.",
- NULL, configPCNFSD },
+ dmenuVarCheck, configPCNFSD, NULL, "pcnfsd" },
{ "Exit", "Exit this menu (returning to previous)",
checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' },
{ NULL } },
};
DMenu MenuNTP = {
- DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
+ DMENU_RADIO_TYPE | DMENU_SELECTION_RETURNS,
"NTPDATE Server Selection",
"There are a number of time syncronization servers available\n\
for public use around the Internet. Please select one reasonably\n\
diff --git a/usr.sbin/sysinstall/misc.c b/usr.sbin/sysinstall/misc.c
index 2da5dd7..3f84540 100644
--- a/usr.sbin/sysinstall/misc.c
+++ b/usr.sbin/sysinstall/misc.c
@@ -1,7 +1,7 @@
/*
* Miscellaneous support routines..
*
- * $Id: misc.c,v 1.16 1996/04/13 13:32:00 jkh Exp $
+ * $Id: misc.c,v 1.17 1996/04/23 01:29:29 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -213,6 +213,7 @@ item_add(dialogMenuItem *list, char *prompt, char *title,
list = (dialogMenuItem *)realloc(list, sizeof(dialogMenuItem) * *max);
}
d = &list[(*curr)++];
+ bzero(d, sizeof(*d));
d->prompt = prompt ? strdup(prompt) : NULL;
d->title = title ? strdup(title) : NULL;
d->checked = checked;
diff --git a/usr.sbin/sysinstall/package.c b/usr.sbin/sysinstall/package.c
index c374181..7087b0f 100644
--- a/usr.sbin/sysinstall/package.c
+++ b/usr.sbin/sysinstall/package.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: package.c,v 1.31 1996/04/13 13:32:07 jkh Exp $
+ * $Id: package.c,v 1.32 1996/04/23 01:29:32 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -97,7 +97,7 @@ package_extract(Device *dev, char *name, Boolean depended)
if (!pid) {
dup2(pfd[0], 0); close(pfd[0]);
dup2(DebugFD, 1);
- dup2(DebugFD, 2);
+ close(2);
close(pfd[1]);
i = execl("/usr/sbin/pkg_add", "/usr/sbin/pkg_add", "-", 0);
if (isDebug())
@@ -105,6 +105,7 @@ package_extract(Device *dev, char *name, Boolean depended)
}
else {
char buf[BUFSIZ];
+ WINDOW *w = savescr();
tot = 0;
while ((i = read(fd, buf, BUFSIZ)) > 0) {
@@ -133,6 +134,8 @@ package_extract(Device *dev, char *name, Boolean depended)
}
else
msgNotify("Package %s was added successfully", name);
+ sleep(1);
+ restorescr(w);
}
}
else {
@@ -146,5 +149,5 @@ package_extract(Device *dev, char *name, Boolean depended)
}
ret = DITEM_FAILURE;
}
- return ret | DITEM_RESTORE;
+ return ret;
}
diff --git a/usr.sbin/sysinstall/system.c b/usr.sbin/sysinstall/system.c
index 98362ed..adb89e8 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.53 1996/04/26 18:19:38 jkh Exp $
+ * $Id: system.c,v 1.54 1996/04/28 01:07:27 jkh Exp $
*
* Jordan Hubbard
*
@@ -215,7 +215,14 @@ vsystem(char *fmt, ...)
dup2(DebugFD, 1);
dup2(DebugFD, 2);
}
- execl("/stand/sh", "sh", "-c", cmd, (char *)NULL);
+ else {
+ close(1); open("/dev/null", O_WRONLY);
+ dup2(1, 2);
+ }
+ if (!RunningAsInit)
+ execl("/bin/sh", "/bin/sh", "-c", cmd, (char *)NULL);
+ else
+ execl("/stand/sh", "/stand/sh", "-c", cmd, (char *)NULL);
exit(1);
}
else {
OpenPOWER on IntegriCloud