summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorrgrimes <rgrimes@FreeBSD.org>1995-06-11 19:33:05 +0000
committerrgrimes <rgrimes@FreeBSD.org>1995-06-11 19:33:05 +0000
commit1b1ee5553889e207087539ddafa5dfd4e28bd585 (patch)
treeba998dfb4fcad03e00a5cbf58e2a0ad648bab6e6 /usr.sbin
parentb1a97daa1e06ab0de3071f979965878fd056292b (diff)
downloadFreeBSD-src-1b1ee5553889e207087539ddafa5dfd4e28bd585.zip
FreeBSD-src-1b1ee5553889e207087539ddafa5dfd4e28bd585.tar.gz
Merge RELENG_2_0_5 into HEAD
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/bad144/bad144.c60
-rw-r--r--usr.sbin/inetd/inetd.c9
-rw-r--r--usr.sbin/kbdcontrol/kbdcontrol.112
-rw-r--r--usr.sbin/kbdcontrol/kbdcontrol.c9
-rw-r--r--usr.sbin/mountd/mountd.c13
-rw-r--r--usr.sbin/pkg_install/add/perform.c17
-rw-r--r--usr.sbin/pkg_manage/pkg_main.c17
-rw-r--r--usr.sbin/pkg_manage/pkg_manage.c2
-rw-r--r--usr.sbin/pkg_manage/pkg_ui.c31
-rw-r--r--usr.sbin/sade/Makefile21
-rw-r--r--usr.sbin/sade/config.c142
-rw-r--r--usr.sbin/sade/devices.c63
-rw-r--r--usr.sbin/sade/disks.c40
-rw-r--r--usr.sbin/sade/dmenu.c120
-rw-r--r--usr.sbin/sade/globals.c13
-rw-r--r--usr.sbin/sade/install.c264
-rw-r--r--usr.sbin/sade/label.c26
-rw-r--r--usr.sbin/sade/main.c16
-rw-r--r--usr.sbin/sade/menus.c553
-rw-r--r--usr.sbin/sade/misc.c33
-rw-r--r--usr.sbin/sade/msg.c13
-rw-r--r--usr.sbin/sade/sade.h83
-rw-r--r--usr.sbin/sade/system.c121
-rw-r--r--usr.sbin/sade/termcap.c28
-rw-r--r--usr.sbin/sade/variable.c13
-rw-r--r--usr.sbin/sade/wizard.c35
-rw-r--r--usr.sbin/sysctl/sysctl.c4
-rw-r--r--usr.sbin/sysinstall/Makefile21
-rw-r--r--usr.sbin/sysinstall/cdrom.c8
-rw-r--r--usr.sbin/sysinstall/config.c142
-rw-r--r--usr.sbin/sysinstall/devices.c63
-rw-r--r--usr.sbin/sysinstall/disks.c40
-rw-r--r--usr.sbin/sysinstall/dist.c353
-rw-r--r--usr.sbin/sysinstall/dist.h62
-rw-r--r--usr.sbin/sysinstall/dmenu.c120
-rw-r--r--usr.sbin/sysinstall/dos.c13
-rw-r--r--usr.sbin/sysinstall/floppy.c105
-rw-r--r--usr.sbin/sysinstall/ftp.c217
-rw-r--r--usr.sbin/sysinstall/globals.c13
-rw-r--r--usr.sbin/sysinstall/install.c264
-rw-r--r--usr.sbin/sysinstall/label.c26
-rw-r--r--usr.sbin/sysinstall/main.c16
-rw-r--r--usr.sbin/sysinstall/media.c94
-rw-r--r--usr.sbin/sysinstall/menus.c553
-rw-r--r--usr.sbin/sysinstall/misc.c33
-rw-r--r--usr.sbin/sysinstall/msg.c13
-rw-r--r--usr.sbin/sysinstall/network.c125
-rw-r--r--usr.sbin/sysinstall/nfs.c22
-rw-r--r--usr.sbin/sysinstall/sysinstall.h83
-rw-r--r--usr.sbin/sysinstall/system.c121
-rw-r--r--usr.sbin/sysinstall/tape.c34
-rw-r--r--usr.sbin/sysinstall/tcpip.c58
-rw-r--r--usr.sbin/sysinstall/termcap.c28
-rw-r--r--usr.sbin/sysinstall/ufs.c8
-rw-r--r--usr.sbin/sysinstall/variable.c13
-rw-r--r--usr.sbin/sysinstall/wizard.c35
-rw-r--r--usr.sbin/tzsetup/main.c6
57 files changed, 2558 insertions, 1889 deletions
diff --git a/usr.sbin/bad144/bad144.c b/usr.sbin/bad144/bad144.c
index f22324b..628b80d 100644
--- a/usr.sbin/bad144/bad144.c
+++ b/usr.sbin/bad144/bad144.c
@@ -63,6 +63,7 @@ static const char sccsid[] = "@(#)bad144.c 8.1 (Berkeley) 6/6/93";
#include <ufs/ffs/fs.h>
#include <errno.h>
+#include <err.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -78,11 +79,9 @@ int badfile = -1; /* copy of badsector table to use, -1 if any */
struct dkbad curbad, oldbad;
#define DKBAD_MAGIC 0x4321
-char *buf;
-char label[BBSIZE];
daddr_t size;
struct disklabel *dp;
-char name[BUFSIZ];
+char *name;
u_short dkcksum __P((struct disklabel *lp));
@@ -109,12 +108,15 @@ bad_scan(argc, argv, dp, f, bstart, bend)
int ss = dp->d_secsize;
int trk = dp->d_nsectors;
int i;
- static char *nargv[DKBAD_MAXBAD];
- static int nargc;
+ char **nargv,*buf;
+ int nargc;
setbuf(stdout, NULL);
setbuf(stderr, NULL);
+ nargv = (char **)malloc(sizeof *nargv * DKBAD_MAXBAD);
+ if (!nargv)
+ err(20,"Out of memory, malloc failed\n");
i = 1;
n = ioctl(f,DIOCSBADSCAN,&i);
if (n < 0)
@@ -122,13 +124,9 @@ bad_scan(argc, argv, dp, f, bstart, bend)
nargc = *argc;
memcpy(nargv,*argv,nargc * sizeof nargv[0]);
- if (buf == (char *)NULL) {
- buf = malloc((unsigned)(trk*ss));
- if (buf == (char *)NULL) {
- fprintf(stderr, "Out of memory\n");
- exit(20);
- }
- }
+ buf = alloca((unsigned)(trk*ss));
+ if (buf == (char *)NULL)
+ err(20,"Out of memory, alloca failed");
/* scan the entire disk a sector at a time. Because of all the
* clustering in the kernel, we cannot scan a track at a time,
@@ -154,6 +152,11 @@ bad_scan(argc, argv, dp, f, bstart, bend)
curr_sec);
sprintf(buf,"%d",curr_sec);
nargv[nargc++] = strdup(buf);
+ if (nargc >= DKBAD_MAXBAD) {
+ fprintf(stderr,
+ "Too many bad sectors, can only handle %d per slice.\n",DKBAD_MAXBAD);
+ exit(1);
+ }
}
}
fprintf(stderr, "\n");
@@ -175,6 +178,7 @@ main(argc, argv)
daddr_t sn, bn[DKBAD_MAXBAD];
int i, f, nbad, new, bad, errs;
daddr_t bstart, bend;
+ char label[BBSIZE];
argc--, argv++;
while (argc > 0 && **argv == '-') {
@@ -231,10 +235,11 @@ usage:
exit(1);
}
if (argv[0][0] != '/')
- (void)sprintf(name, "%sr%s%c", _PATH_DEV, argv[0],
+ (void)sprintf(label, "%sr%s%c", _PATH_DEV, argv[0],
'a' + RAW_PART);
else
- strcpy(name, argv[0]);
+ strcpy(label, argv[0]);
+ name = strdup(label);
f = open(name, !sflag && argc == 1? O_RDONLY : O_RDWR);
if (f < 0)
Perror(name);
@@ -558,14 +563,12 @@ blkcopy(f, s1, s2)
daddr_t s1, s2;
{
register tries, n;
+ char *buf;
+
+ buf = alloca((unsigned)dp->d_secsize);
+ if (buf == (char *)NULL)
+ err(20, "Out of memory, alloca failed\n");
- if (buf == (char *)NULL) {
- buf = malloc((unsigned)dp->d_secsize);
- if (buf == (char *)NULL) {
- fprintf(stderr, "Out of memory\n");
- exit(20);
- }
- }
for (tries = 0; tries < RETRIES; tries++) {
if (lseek(f, (off_t)dp->d_secsize * s1, SEEK_SET) < 0)
Perror("lseek");
@@ -591,21 +594,20 @@ blkcopy(f, s1, s2)
return(1);
}
-char *zbuf;
void
blkzero(f, sn)
int f;
daddr_t sn;
{
+ char *zbuf;
+
+ zbuf = alloca((unsigned)dp->d_secsize);
+ if (zbuf == (char *)NULL)
+ err(20, "Out of memory, alloca failed\n");
+
+ memset(zbuf, 0, dp->d_secsize);
- if (zbuf == (char *)NULL) {
- zbuf = malloc((unsigned)dp->d_secsize);
- if (zbuf == (char *)NULL) {
- fprintf(stderr, "Out of memory\n");
- exit(20);
- }
- }
if (lseek(f, (off_t)dp->d_secsize * sn, SEEK_SET) < 0)
Perror("lseek");
if (verbose)
diff --git a/usr.sbin/inetd/inetd.c b/usr.sbin/inetd/inetd.c
index 5f8fa49..3d921f2 100644
--- a/usr.sbin/inetd/inetd.c
+++ b/usr.sbin/inetd/inetd.c
@@ -40,7 +40,7 @@ static char copyright[] =
#ifndef lint
/* from: @(#)inetd.c 8.4 (Berkeley) 4/13/94"; */
static char inetd_c_rcsid[] =
- "$Id: inetd.c,v 1.4 1994/12/21 19:08:45 wollman Exp $";
+ "$Id: inetd.c,v 1.5.2.1 1995/06/05 01:01:19 davidg Exp $";
#endif /* not lint */
/*
@@ -372,11 +372,14 @@ main(argc, argv, envp)
*/
if (sep->se_bi &&
sep->se_bi->bi_fn == (void (*)()) tcpmux) {
- sep = tcpmux(ctrl);
- if (sep == NULL) {
+ struct servtab *tsep;
+
+ tsep = tcpmux(ctrl);
+ if (tsep == NULL) {
close(ctrl);
continue;
}
+ sep = tsep;
}
} else
ctrl = sep->se_fd;
diff --git a/usr.sbin/kbdcontrol/kbdcontrol.1 b/usr.sbin/kbdcontrol/kbdcontrol.1
index 40c31d1..0c33da5 100644
--- a/usr.sbin/kbdcontrol/kbdcontrol.1
+++ b/usr.sbin/kbdcontrol/kbdcontrol.1
@@ -30,13 +30,12 @@ characteristics etc.
.TP
The following command line options are supported.
.TP
-.BI "\-b\ " [ duration.pitch ]
+.BI "\-b\ " [ duration.pitch | normal | visual ]
Set the bell duration and pitch values. Argument may also be one of
.BI "normal"
which set sound parameters back to normal values, or
.BI "visual"
which set the bell to visual mode, ie flashes the screen instead.
-
.TP
.BI "\-r\ " [ delay.repeat | slow | fast | normal ]
Set keyboard
@@ -66,8 +65,11 @@ to send
.BI "\-F\ "
Set function keys back to the standard definitions.
.TP
-.B \-v
-Turns on verbose output.
+.B "\-x "
+Use hexadecimal numbers in keyboard map dump.
+.TP
+.BI "\-h " #
+Set history buffer size (in lines).
.PP
.SH FILES
/usr/share/syscons/keymaps
@@ -76,6 +78,6 @@ Report when found.
.SH "SEE ALSO"
.BR vidcontrol (1) ,
.BR keyboard (4) ,
-.BR screen (4) ,
+.BR screen (4) .
.SH AUTHORS
Søren Schmidt (sos@FreeBSD.org)
diff --git a/usr.sbin/kbdcontrol/kbdcontrol.c b/usr.sbin/kbdcontrol/kbdcontrol.c
index 7e1d6b7..ecaf6c2 100644
--- a/usr.sbin/kbdcontrol/kbdcontrol.c
+++ b/usr.sbin/kbdcontrol/kbdcontrol.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: kbdcontrol.c,v 1.5 1995/01/30 21:41:10 sos Exp $
+ * $Id: kbdcontrol.c,v 1.6.2.1 1995/06/05 09:23:13 davidg Exp $
*/
#include <ctype.h>
@@ -54,11 +54,11 @@ char fkey_table[96][MAXFK] = {
/* 33-36 */ "\033[s", "\033[t", "\033[u", "\033[v",
/* 37-40 */ "\033[w", "\033[x", "\033[y", "\033[z",
/* 41-44 */ "\033[@", "\033[[", "\033[\\","\033[]",
-/* 45-48 */ "\033[^", "\033[_", "\033[`", "\033[",
+/* 45-48 */ "\033[^", "\033[_", "\033[`", "\033[{",
/* 49-52 */ "\033[H", "\033[A", "\033[I", "-" ,
/* 53-56 */ "\033[D", "\033[E", "\033[C", "+" ,
/* 57-60 */ "\033[F", "\033[B", "\033[G", "\033[L",
-/* 61-64 */ "\033[J", "\033[K", "\033[}", "" ,
+/* 61-64 */ "\177", "\033[J", "\033[~", "\033[}",
/* 65-68 */ "" , "" , "" , "" ,
/* 69-72 */ "" , "" , "" , "" ,
/* 73-76 */ "" , "" , "" , "" ,
@@ -283,7 +283,7 @@ print_entry(FILE *fp, int value)
fprintf(fp, " %s ", ctrl_names[val]);
else if (val == 127)
fprintf(fp, " del ");
- else if (isprint(val))
+ else if (isascii(val) && isprint(val))
fprintf(fp, " '%c' ", val);
else if (hex)
fprintf(fp, " 0x%02x ", val);
@@ -537,6 +537,7 @@ usage()
" -r slow (set keyboard delay & repeat to slow)\n"
" -r normal (set keyboard delay & repeat to normal)\n"
" -r fast (set keyboard delay & repeat to fast)\n"
+" -x (use hexadecimal numbers in -d option)\n"
);
}
diff --git a/usr.sbin/mountd/mountd.c b/usr.sbin/mountd/mountd.c
index 0446087..4434244 100644
--- a/usr.sbin/mountd/mountd.c
+++ b/usr.sbin/mountd/mountd.c
@@ -43,7 +43,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "From: @(#)mountd.c 8.8 (Berkeley) 2/20/94";*/
static const char rcsid[] =
- "$Id: mountd.c,v 1.6 1995/05/21 19:31:09 phk Exp $";
+ "$Id: mountd.c,v 1.7.2.1 1995/06/08 04:34:11 davidg Exp $";
#endif /*not lint*/
#include <sys/param.h>
@@ -236,7 +236,7 @@ main(argc, argv)
int argc;
char **argv;
{
- SVCXPRT *transp;
+ SVCXPRT *udptransp, *tcptransp;
int c;
struct vfsconf *vfc;
@@ -295,13 +295,16 @@ main(argc, argv)
fclose(pidfile);
}
}
- if ((transp = svcudp_create(RPC_ANYSOCK)) == NULL) {
+ if ((udptransp = svcudp_create(RPC_ANYSOCK)) == NULL ||
+ (tcptransp = svctcp_create(RPC_ANYSOCK, 0, 0)) == NULL) {
syslog(LOG_ERR, "Can't create socket");
exit(1);
}
pmap_unset(RPCPROG_MNT, RPCMNT_VER1);
- if (!svc_register(transp, RPCPROG_MNT, RPCMNT_VER1, mntsrv,
- IPPROTO_UDP)) {
+ if (!svc_register(udptransp, RPCPROG_MNT, RPCMNT_VER1, mntsrv,
+ IPPROTO_UDP) ||
+ !svc_register(tcptransp, RPCPROG_MNT, RPCMNT_VER1, mntsrv,
+ IPPROTO_TCP)) {
syslog(LOG_ERR, "Can't register mount");
exit(1);
}
diff --git a/usr.sbin/pkg_install/add/perform.c b/usr.sbin/pkg_install/add/perform.c
index 2266129..575fef6 100644
--- a/usr.sbin/pkg_install/add/perform.c
+++ b/usr.sbin/pkg_install/add/perform.c
@@ -1,5 +1,5 @@
#ifndef lint
-static const char *rcsid = "$Id: perform.c,v 1.24 1995/04/28 04:16:30 jkh Exp $";
+static const char *rcsid = "$Id: perform.c,v 1.25.2.2 1995/06/10 09:04:13 jkh Exp $";
#endif
/*
@@ -213,7 +213,7 @@ pkg_do(char *pkg)
if (Verbose)
printf(" which is not currently loaded");
if (!isURL(p->name)) {
- snprintf(path, FILENAME_MAX, "%s/%s", Home, p->name);
+ snprintf(path, FILENAME_MAX, "%s/%s.tgz", Home, p->name);
if (fexists(path))
cp = path;
else
@@ -393,14 +393,13 @@ pkg_do(char *pkg)
(tmp = getenv(PKG_DBDIR)) ? tmp : DEF_LOG_DIR,
basename_of(p->name), REQUIRED_BY_FNAME);
cfile = fopen(contents, "a");
- if (!cfile) {
- whinge("Can't open dependency file '%s'!\n\tDependency registration incomplete.",
- contents);
- continue;
+ if (!cfile)
+ whinge("Warning: Can't open dependency file '%s'!\n\tDependency registration is incomplete.", contents);
+ else {
+ fprintf(cfile, "%s\n", basename_of(PkgName));
+ if (fclose(cfile) == EOF)
+ warn("Cannot properly close file %s", contents);
}
- fprintf(cfile, "%s\n", basename_of(PkgName));
- if (fclose(cfile) == EOF)
- warn("Cannot properly close file %s", contents);
}
if (Verbose)
printf("Package %s registered in %s\n", PkgName, LogDir);
diff --git a/usr.sbin/pkg_manage/pkg_main.c b/usr.sbin/pkg_manage/pkg_main.c
index 3d8043b..d767513 100644
--- a/usr.sbin/pkg_manage/pkg_main.c
+++ b/usr.sbin/pkg_manage/pkg_main.c
@@ -23,8 +23,6 @@
extern PKG_info p_inf;
-char *StartDir;
-
/*
* Main
*/
@@ -35,12 +33,17 @@ main(int argc, char **argv)
init_dialog();
p_inf.Nitems = 0; /* Initialize p_inf */
- if (argc > 1)
- StartDir = argv[1];
- else
- StartDir = NULL;
+
get_pkginfo();
- run_menu();
+
+ /* start in the pkg add menu when giving the -add option */
+ if (argc > 1) {
+ if (strcmp(argv[1], "-add") == 0) {
+ install_pkgs_indir();
+ }
+ } else {
+ run_menu();
+ }
if (p_inf.Nitems > 0) {
FreeInfo();
diff --git a/usr.sbin/pkg_manage/pkg_manage.c b/usr.sbin/pkg_manage/pkg_manage.c
index cc9c0b5..c97fd10 100644
--- a/usr.sbin/pkg_manage/pkg_manage.c
+++ b/usr.sbin/pkg_manage/pkg_manage.c
@@ -192,7 +192,9 @@ get_pkginfo(void)
}
if (sb.st_size == 0) {
+#if 0
dialog_notify("No packages installed or no info available");
+#endif
fclose(f);
unlink(tmp_file);
free(tmp_file);
diff --git a/usr.sbin/pkg_manage/pkg_ui.c b/usr.sbin/pkg_manage/pkg_ui.c
index e5dec9f..ae4fa44 100644
--- a/usr.sbin/pkg_manage/pkg_ui.c
+++ b/usr.sbin/pkg_manage/pkg_ui.c
@@ -27,7 +27,7 @@
#include "ui_objects.h"
extern PKG_info p_inf;
-extern char *StartDir;
+
/*
* Local prototypes
@@ -171,7 +171,7 @@ preview_pkg(void)
use_helpfile(PREVIEW_FS_HLP);
use_helpline("Select package to preview");
- fname = dialog_fselect(StartDir ? StartDir : ".", "*.tgz");
+ fname = dialog_fselect(".", "*.tgz");
while (fname) {
use_helpfile(PREVIEW_HLP);
use_helpline("use PgUp and PgDn and arrow-keys to move through the text");
@@ -191,7 +191,7 @@ preview_pkg(void)
free(tmp_file);
use_helpfile(PREVIEW_FS_HLP);
use_helpline("Select package to preview");
- fname = dialog_fselect(StartDir ? StartDir : ".", "*.tgz");
+ fname = dialog_fselect(".", "*.tgz");
}
if (fname) free(fname);
use_helpfile(NULL);
@@ -211,16 +211,14 @@ install_batch(void)
use_helpfile(DS_INSTALL_HLP);
quit = FALSE;
while (!quit) {
- if (StartDir)
+ use_helpline("Select directory where the pkg's reside");
+ if (dialog_dselect(".", "*.tgz")) {
+ quit = TRUE;
+ } else {
install_pkgs_indir();
- else {
- use_helpline("Select directory where the pkg's reside");
- if (dialog_dselect(".", "*.tgz"))
- quit = TRUE;
- else
- install_pkgs_indir();
- }
+ }
}
+
return;
} /* install_batch() */
@@ -274,7 +272,7 @@ install_pkgs_indir(void)
/* now build a list of the packages in the chosen directory */
/* and display them in a list */
- get_dir(StartDir ? StartDir : ".", "*.tgz", &d, &n);
+ get_dir(".", "*.tgz", &d, &n);
get_filenames(d, n, &fnames, &nf);
FreeDir(d, n); /* free the space allocated to d */
@@ -325,11 +323,12 @@ install_pkgs_indir(void)
if (getenv("TMPDIR")) {
sprintf(tmp_dir, "%s/%s", getenv("TMP_DIR"), tmp_file);
} else {
- sprintf(tmp_dir, "/tmp/%s", tmp_file);
+ sprintf(tmp_dir, "/usr/tmp/%s", tmp_file);
+ mkdir("/usr/tmp", S_IRWXU);
}
free(tmp_file);
if (mkdir(tmp_dir, S_IRWXU)) {
- dialog_notify("Could not create temporary directory in /tmp, exiting");
+ dialog_notify("Could not create temporary directory in /usr/tmp, exiting");
free(names);
free(comment);
free(desc);
@@ -505,6 +504,8 @@ install_pkgs_indir(void)
}
if (install) {
+ int ninstalled = 0;
+
/* check if any of the packages marked for installation are */
/* already installed */
i=0;
@@ -527,7 +528,7 @@ install_pkgs_indir(void)
for (i=0; i<nf; i++) {
if (pkg_obj->seld[i]) {
dialog_gauge("Installing packages:", names[i], LINES/2-3,
- COLS/2-30, 7, 60, (int) ((float) (i+1)/n*100));
+ COLS/2-30, 7, 60, (int) ((float) ++ninstalled/n*100));
install_package(fnames[i]);
}
}
diff --git a/usr.sbin/sade/Makefile b/usr.sbin/sade/Makefile
index 481ce83..c70dfc4 100644
--- a/usr.sbin/sade/Makefile
+++ b/usr.sbin/sade/Makefile
@@ -4,13 +4,13 @@ CLEANFILES= makedevs.c rtermcap
.PATH: ${.CURDIR}/../disklabel ${.CURDIR}/../../usr.bin/cksum
-SRCS= attr.c cdrom.c command.c config.c crc.c decode.c devices.c disks.c dist.c \
+SRCS= attr.c cdrom.c command.c config.c decode.c devices.c disks.c dist.c \
dmenu.c dos.c floppy.c ftp.c ftp_strat.c globals.c install.c label.c lang.c \
main.c makedevs.c media.c menus.c misc.c msg.c network.c nfs.c system.c tape.c \
tcpip.c termcap.c ufs.c variable.c wizard.c
-CFLAGS+= -Wall -g -I${.CURDIR}/../libdisk \
+CFLAGS+= -Wall -I${.CURDIR}/../libdisk \
-I${.CURDIR}/../../gnu/lib/libdialog
LDADD= -ldialog -lncurses -lmytinfo -lutil
@@ -22,30 +22,15 @@ LDADD+= -L${.CURDIR}/../libdisk -ldisk
DPADD= ${LIBDIALOG} ${LIBNCURSES} ${LIBMYTINFO} ${LIBUTIL}
-.if exists(${.CURDIR}/../../sys/i386/boot/biosboot/obj)
-BOOTS=${.CURDIR}/../../sys/i386/boot/biosboot/obj
-.else
-BOOTS=${.CURDIR}/../../sys/i386/boot/biosboot
-.endif
-
.if exists(${.CURDIR}/../../share/syscons/scrnmaps/obj)
MKSCRNMAP=${.CURDIR}/../../share/syscons/scrnmaps/obj/koi8-r2cp866.mk
.else
MKSCRNMAP=${.CURDIR}/../../share/syscons/scrnmaps/koi8-r2cp866.mk
.endif
-makedevs.c: dev2c.sh Makefile rtermcap
+makedevs.c: Makefile rtermcap
rm -f makedevs.tmp
- mkdir -p dev
echo '#include <sys/types.h>' > makedevs.tmp
- cp ${.CURDIR}/../../etc/etc.i386/MAKEDEV dev
- ( cd dev; sh ./MAKEDEV all )
- sh ${.CURDIR}/dev2c.sh dev > makedevs.tmp
- rm -rf dev
- uudecode < ${.CURDIR}/bteasy17.uu
- file2c 'const unsigned char boot0[] = {' '};' \
- < bteasy17 >> makedevs.tmp
- rm -rf bteasy17
./rtermcap cons25 | \
file2c 'const char termcap_cons25[] = {' ',0};' \
>> makedevs.tmp
diff --git a/usr.sbin/sade/config.c b/usr.sbin/sade/config.c
index 09209fd..ee82d28 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.14 1995/05/29 13:37:41 jkh Exp $
+ * $Id: config.c,v 1.15.2.28 1995/06/10 08:24:28 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -83,10 +83,10 @@ nameof(Chunk *c1)
static char *
mount_point(Chunk *c1)
{
- if (c1->type == fat || (c1->type == part && c1->subtype != FS_SWAP))
- return ((PartInfo *)c1->private)->mountpoint;
- else if (c1->type == part && c1->subtype == FS_SWAP)
+ if (c1->type == part && c1->subtype == FS_SWAP)
return "none";
+ else if (c1->type == part || c1->type == fat)
+ return ((PartInfo *)c1->private)->mountpoint;
return "/bogus";
}
@@ -101,7 +101,7 @@ fstype(Chunk *c1)
else
return "swap";
}
- return "bogfs";
+ return "bogus";
}
static char *
@@ -121,13 +121,9 @@ fstype_short(Chunk *c1)
static int
seq_num(Chunk *c1)
{
- if (c1->type == part) {
- if (c1->subtype != FS_SWAP)
- return 1;
- else
- return 0;
- }
- return -1;
+ if (c1->type == part && c1->subtype != FS_SWAP)
+ return 1;
+ return 0;
}
void
@@ -139,6 +135,12 @@ configFstab(void)
int i, cnt;
Chunk *c1, *c2;
+ if (!RunningAsInit) {
+ if (file_readable("/etc/fstab"))
+ return;
+ else
+ msgConfirm("Attempting to rebuild your /etc/fstab file.\nWarning: If you had any CD devices in use before running\nsysinstall then they may NOT be found in this run!");
+ }
devs = deviceFind(NULL, DEVICE_TYPE_DISK);
if (!devs) {
msgConfirm("No disks found!");
@@ -146,6 +148,7 @@ configFstab(void)
}
/* Record all the chunks */
+ nchunks = 0;
for (i = 0; devs[i]; i++) {
if (!devs[i]->enabled)
continue;
@@ -155,11 +158,11 @@ configFstab(void)
for (c1 = disk->chunks->part; c1; c1 = c1->next) {
if (c1->type == freebsd) {
for (c2 = c1->part; c2; c2 = c2->next) {
- if (c2->type == part && c2->private)
+ if (c2->type == part && (c2->subtype == FS_SWAP || c2->private))
chunk_list[nchunks++] = c2;
}
}
- else if (c1->type == fat)
+ else if (c1->type == fat && c1->private)
chunk_list[nchunks++] = c1;
}
}
@@ -175,14 +178,11 @@ configFstab(void)
/* Go for the burn */
msgDebug("Generating /etc/fstab file\n");
- for (i = 0; i < nchunks; i++) {
- fprintf(fstab, "/dev/%s\t\t\t%s\t\t%s %s %d %d\n", nameof(chunk_list[i]), mount_point(chunk_list[i]),
- fstype(chunk_list[i]), fstype_short(chunk_list[i]), seq_num(chunk_list[i]),
- seq_num(chunk_list[i]));
- }
-
+ for (i = 0; i < nchunks; i++)
+ fprintf(fstab, "/dev/%s\t\t\t%s\t\t%s\t%s %d %d\n", nameof(chunk_list[i]), mount_point(chunk_list[i]),
+ fstype(chunk_list[i]), fstype_short(chunk_list[i]), seq_num(chunk_list[i]), seq_num(chunk_list[i]));
Mkdir("/proc", NULL);
- fprintf(fstab, "proc\t\t\t\t/proc\t\tprocfs rw 0 0\n");
+ fprintf(fstab, "proc\t\t\t\t/proc\t\tprocfs\trw 0 0\n");
/* Now look for the CDROMs */
devs = deviceFind(NULL, DEVICE_TYPE_CDROM);
@@ -191,7 +191,7 @@ configFstab(void)
/* Write the first one out as /cdrom */
if (cnt) {
Mkdir("/cdrom", NULL);
- fprintf(fstab, "/dev/%s\t\t\t/cdrom\t\tcd9660 ro 0 0\n", devs[0]->name);
+ fprintf(fstab, "/dev/%s\t\t\t/cdrom\t\tcd9660\tro 0 0\n", devs[0]->name);
}
/* Write the others out as /cdrom<n> */
@@ -200,9 +200,11 @@ configFstab(void)
sprintf(cdname, "/cdrom%d", i);
Mkdir(cdname, NULL);
- fprintf(fstab, "/dev/%s\t\t\t%s\t\tcd9660 ro 0 0\n", devs[i]->name, cdname);
+ fprintf(fstab, "/dev/%s\t\t\t%s\t\tcd9660\tro 0 0\n", devs[i]->name, cdname);
}
fclose(fstab);
+ if (isDebug())
+ msgDebug("Wrote out /etc/fstab file\n");
}
/*
@@ -266,7 +268,7 @@ configSysconfig(void)
devp = deviceFind(NULL, DEVICE_TYPE_NETWORK);
cnt = deviceCount(devp);
for (j = 0; j < cnt; j++) {
- if (devp[j]->private) {
+ if (devp[j]->private && strncmp(devp[j]->name, "cuaa", 4)) {
char iname[64];
snprintf(iname, 64, "%s%s", VAR_IFCONFIG, devp[j]->name);
@@ -277,6 +279,12 @@ configSysconfig(void)
}
}
fclose(fp);
+
+ /* If we're an NFS server, we need an exports file */
+ if (getenv("nfs_server") && !file_readable("/etc/exports")) {
+ msgConfirm("You have chosen to be an NFS server but have not yet configured\nthe /etc/exports file. The format for an exports entry is:\n <mountpoint> <opts> <host [..host]>\nWhere <mounpoint> is the name of a filesystem as specified\nin the Label editor, <opts> is a list of special options we\nwon't concern ourselves with here (``man exports'' when the\nsystem is fully installed) and <host> is one or more host\nnames who are allowed to mount this file system. Press\n[ENTER] now to invoke the editor on /etc/exports");
+ systemExecute("vi /etc/exports");
+ }
}
int
@@ -290,14 +298,30 @@ configSaverTimeout(char *str)
return 0;
}
+int
+configNTP(char *str)
+{
+ char *val;
+
+ val = msgGetInput(NULL, "Enter the name of an NTP server");
+ if (val)
+ variable_set2("ntpdate", val);
+ return 0;
+}
+
void
configResolv(void)
{
FILE *fp;
+ char *cp;
- if (!getenv(VAR_DOMAINNAME) || !getenv(VAR_NAMESERVER)) {
- msgConfirm("Warning: You haven't set a domain name or nameserver. You will need\nto configure your /etc/resolv.conf file manually to fully use network services.");
+ if (!RunningAsInit && file_readable("/etc/resolv.conf"))
return;
+
+ if (!getenv(VAR_NAMESERVER)) {
+ if (mediaDevice && (mediaDevice->type == DEVICE_TYPE_NFS || mediaDevice->type == DEVICE_TYPE_FTP))
+ msgConfirm("Warning: Missing name server value - network operations\nmay fail as a result!");
+ goto skip;
}
Mkdir("/etc", NULL);
fp = fopen("/etc/resolv.conf", "w");
@@ -305,9 +329,34 @@ configResolv(void)
msgConfirm("Unable to open /etc/resolv.conf! You will need to do this manually.");
return;
}
- fprintf(fp, "domain\t%s\n", getenv(VAR_DOMAINNAME));
+ if (getenv(VAR_DOMAINNAME))
+ fprintf(fp, "domain\t%s\n", getenv(VAR_DOMAINNAME));
fprintf(fp, "nameserver\t%s\n", getenv(VAR_NAMESERVER));
fclose(fp);
+ if (isDebug())
+ msgDebug("Wrote out /etc/resolv.conf\n");
+
+skip:
+ /* Tack ourselves at the end of /etc/hosts */
+ cp = getenv(VAR_IPADDR);
+ if (cp && *cp != '0' && getenv(VAR_HOSTNAME)) {
+ fp = fopen("/etc/hosts", "a");
+ fprintf(fp, "%s\t\t%s\n", cp, getenv(VAR_HOSTNAME));
+ fclose(fp);
+ if (isDebug())
+ msgDebug("Appended entry for %s to /etc/hosts\n", cp);
+ }
+}
+
+int
+configRoutedFlags(char *str)
+{
+ char *val;
+
+ val = msgGetInput("-q", "Specify the flags for routed; -q is the default, -s is\na good choice for gateway machines.");
+ if (val)
+ variable_set2("routedflags", val);
+ return 0;
}
int
@@ -317,39 +366,26 @@ configPackages(char *str)
pid_t pid;
Boolean onCD;
- onCD = FALSE;
+ msgConfirm("Warning: This utility (pkg_manage) is still somewhat experimental\nand may not function for all packages. If it fails to load the\npackages you want, try running it directly once the system is up or use the\npkg_add, pkg_info and pkg_delete utilities directly.");
i = -1;
- if (!mediaDevice || mediaDevice->type != DEVICE_TYPE_CDROM) {
- if (getpid() == 1) {
- if (!mediaSetCDROM(NULL))
- onCD = FALSE;
- else
+ /* If we're running as init, we know that a CD in the drive is probably ours */
+ onCD = file_readable("/cdrom/packages");
+ if (!onCD && RunningAsInit) {
+ if (mediaSetCDROM(NULL)) {
+ if ((*mediaDevice->init)(mediaDevice))
onCD = TRUE;
}
- else
- onCD = FALSE;
}
- else if (mediaDevice && mediaDevice->type == DEVICE_TYPE_CDROM)
- onCD = TRUE;
- if (onCD) {
- if (!(pid = fork())) {
- execl("/stand/sh", "sh", "-c", "pkg_manage /cdrom", (char *)NULL);
+
+ if (!(pid = fork())) {
+ if (onCD && chdir("/cdrom/packages/All"))
exit(1);
- }
- else {
- pid = waitpid(pid, (int *)&pstat, 0);
- i = (pid == -1) ? -1 : WEXITSTATUS(pstat);
- }
+ execl("/usr/sbin/pkg_manage", "/usr/sbin/pkg_manage", (char *)NULL);
+ exit(1);
}
else {
- if (!(pid = fork())) {
- execl("/stand/sh", "sh", "-c", "pkg_manage", (char *)NULL);
- exit(1);
- }
- else {
- pid = waitpid(pid, (int *)&pstat, 0);
- i = (pid == -1) ? -1 : WEXITSTATUS(pstat);
- }
+ pid = waitpid(pid, (int *)&pstat, 0);
+ i = (pid == -1) ? -1 : WEXITSTATUS(pstat);
}
if (i != 0 && isDebug())
msgDebug("pkg_manage returns status of %d\n", i);
diff --git a/usr.sbin/sade/devices.c b/usr.sbin/sade/devices.c
index 14225fb..b1b91d7 100644
--- a/usr.sbin/sade/devices.c
+++ b/usr.sbin/sade/devices.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: devices.c,v 1.34 1995/05/29 11:01:08 jkh Exp $
+ * $Id: devices.c,v 1.35.2.9 1995/06/05 12:03:46 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -88,14 +88,15 @@ static struct {
{ DEVICE_TYPE_TAPE, "wt0", "Wangtek tape drive" },
{ DEVICE_TYPE_DISK, "sd", "SCSI disk device" },
{ DEVICE_TYPE_DISK, "wd", "IDE/ESDI/MFM/ST506 disk device" },
- { DEVICE_TYPE_FLOPPY, "rfd0", "floppy drive unit A" },
- { DEVICE_TYPE_FLOPPY, "rfd1", "floppy drive unit B" },
+ { DEVICE_TYPE_FLOPPY, "fd0", "floppy drive unit A" },
+ { DEVICE_TYPE_FLOPPY, "fd1", "floppy drive unit B" },
{ DEVICE_TYPE_NETWORK, "cuaa0", "Serial port (COM1) - possible PPP/SLIP device" },
{ DEVICE_TYPE_NETWORK, "cuaa1", "Serial port (COM2) - possible PPP/SLIP device" },
{ DEVICE_TYPE_NETWORK, "lp0", "Parallel Port IP (PLIP) using laplink cable" },
{ DEVICE_TYPE_NETWORK, "lo", "Loop-back (local) network interface" },
{ DEVICE_TYPE_NETWORK, "sl", "Serial-line IP (SLIP) interface" },
{ DEVICE_TYPE_NETWORK, "ppp", "Point-to-Point Protocol (PPP) interface" },
+ { DEVICE_TYPE_NETWORK, "de", "DEC DE435 PCI NIC or other DC21040-AA based card" },
{ DEVICE_TYPE_NETWORK, "ed", "WD/SMC 80xx; Novell NE1000/2000; 3Com 3C503 cards" },
{ DEVICE_TYPE_NETWORK, "ep", "3Com 3C509 ethernet card" },
{ DEVICE_TYPE_NETWORK, "el", "3Com 3C501 ethernet card" },
@@ -115,13 +116,39 @@ new_device(char *name)
Device *dev;
dev = safe_malloc(sizeof(Device));
+ bzero(dev, sizeof(Device));
if (name)
strcpy(dev->name, name);
- else
- dev->name[0] = '\0';
return dev;
}
+/* Stubs for unimplemented strategy routines */
+Boolean
+dummyInit(Device *dev)
+{
+ return TRUE;
+}
+
+int
+dummyGet(Device *dev, char *dist, Attribs *dist_attrs)
+{
+ return -1;
+}
+
+Boolean
+dummyClose(Device *dev, int fd)
+{
+ if (!close(fd))
+ return TRUE;
+ return FALSE;
+}
+
+void
+dummyShutdown(Device *dev)
+{
+ return;
+}
+
static int
deviceTry(char *name, char *try)
{
@@ -136,17 +163,11 @@ deviceTry(char *name, char *try)
return fd;
}
-static void
-deviceDiskFree(Device *dev)
-{
- Free_Disk(dev->private);
-}
-
/* Register a new device in the devices array */
Device *
deviceRegister(char *name, char *desc, char *devname, DeviceType type, Boolean enabled,
- Boolean (*init)(Device *), int (*get)(char *), Boolean (*close)(Device *, int),
- void (*shutdown)(Device *), void *private)
+ Boolean (*init)(Device *), int (*get)(Device *, char *, Attribs *),
+ Boolean (*close)(Device *, int), void (*shutdown)(Device *), void *private)
{
Device *newdev;
@@ -157,10 +178,10 @@ deviceRegister(char *name, char *desc, char *devname, DeviceType type, Boolean e
newdev->devname = devname;
newdev->type = type;
newdev->enabled = enabled;
- newdev->init = init;
- newdev->get = get;
- newdev->close = close;
- newdev->shutdown = shutdown;
+ newdev->init = init ? init : dummyInit;
+ newdev->get = get ? get : dummyGet;
+ newdev->close = close ? close : dummyClose;
+ newdev->shutdown = shutdown ? shutdown : dummyShutdown;
newdev->private = private;
Devices[numDevs] = newdev;
Devices[++numDevs] = NULL;
@@ -197,9 +218,11 @@ deviceGetAll(void)
for (c1 = d->chunks->part; c1; c1 = c1->next) {
if (c1->type == fat) {
Device *dev;
+ char devname[80];
/* Got one! */
- dev = deviceRegister(c1->name, c1->name, c1->name, DEVICE_TYPE_DOS, TRUE,
+ sprintf(devname, "/dev/%s", c1->name);
+ dev = deviceRegister(c1->name, c1->name, strdup(devname), DEVICE_TYPE_DOS, TRUE,
mediaInitDOS, mediaGetDOS, NULL, mediaShutdownDOS, NULL);
dev->private = c1;
msgDebug("Found a DOS partition %s on drive %s\n", c1->name, d->name);
@@ -355,8 +378,7 @@ deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)())
for (i = 0; devs[i]; i++) {
tmp->items[i].title = devs[i]->name;
for (j = 0; device_names[j].name; j++) {
- if (!strncmp(devs[i]->name, device_names[j].name,
- strlen(device_names[j].name))) {
+ if (!strncmp(devs[i]->name, device_names[j].name, strlen(device_names[j].name))) {
tmp->items[i].prompt = device_names[j].description;
break;
}
@@ -366,6 +388,7 @@ deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)())
tmp->items[i].type = DMENU_CALL;
tmp->items[i].ptr = hook;
tmp->items[i].disabled = FALSE;
+ tmp->items[i].check = NULL;
}
tmp->items[i].type = DMENU_NOP;
tmp->items[i].title = NULL;
diff --git a/usr.sbin/sade/disks.c b/usr.sbin/sade/disks.c
index 3aeb539..da5c62e 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.29 1995/05/28 20:28:09 jkh Exp $
+ * $Id: disks.c,v 1.30.2.7 1995/06/08 09:48:31 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -79,11 +79,14 @@ print_chunks(Disk *d)
int row;
int i;
+ if ((!d->bios_cyl || d->bios_cyl > 65536) || (!d->bios_hd || d->bios_hd > 256) || (!d->bios_sect || d->bios_sect >= 64))
+ msgConfirm("WARNING: The detected geometry is incorrect! Please adjust it to\nthe correct values manually with the (G)eometry command. If you are\nunsure about the correct geometry (which may be \"translated\"), please\nconsult the Hardware Guide in the Documentation submenu.");
+
attrset(A_NORMAL);
mvaddstr(0, 0, "Disk name:\t");
clrtobot();
attrset(A_REVERSE); addstr(d->name); attrset(A_NORMAL);
- attrset(A_REVERSE); mvaddstr(0, 55, "Master Partition Editor"); attrset(A_NORMAL);
+ attrset(A_REVERSE); mvaddstr(0, 55, "FDISK Partition Editor"); attrset(A_NORMAL);
mvprintw(1, 0,
"BIOS Geometry:\t%lu cyls/%lu heads/%lu sectors",
d->bios_cyl, d->bios_hd, d->bios_sect);
@@ -93,11 +96,11 @@ print_chunks(Disk *d)
for (i = 0, row = CHUNK_START_ROW; chunk_info[i]; i++, row++) {
if (i == current_chunk)
attrset(A_REVERSE);
- mvprintw(row, 2, "%10ld %10lu %10lu %8s %8d %8s %8d %6lx",
+ mvprintw(row, 2, "%10ld %10lu %10lu %8s %8d %8s %8d\t%-6s",
chunk_info[i]->offset, chunk_info[i]->size,
chunk_info[i]->end, chunk_info[i]->name,
chunk_info[i]->type, chunk_n[chunk_info[i]->type],
- chunk_info[i]->subtype, chunk_info[i]->flags);
+ chunk_info[i]->subtype, ShowChunkFlags(chunk_info[i]));
if (i == current_chunk)
attrset(A_NORMAL);
}
@@ -109,7 +112,7 @@ print_command_summary()
mvprintw(14, 0, "The following commands are supported (in upper or lower case):");
mvprintw(16, 0, "A = Use Entire Disk B = Bad Block Scan C = Create Partition");
mvprintw(17, 0, "D = Delete Partition G = Set BIOS Geometry S = Set Bootable");
- mvprintw(18, 0, "U = Undo All Changes ESC = Exit this screen");
+ mvprintw(18, 0, "U = Undo All Changes Q = Finish");
mvprintw(20, 0, "The currently selected partition is displayed in ");
attrset(A_REVERSE); addstr("reverse"); attrset(A_NORMAL); addstr(" video.");
mvprintw(21, 0, "Use F1 or ? to get more help, arrow keys to move.");
@@ -265,7 +268,7 @@ diskPartition(Disk *d)
msg = "Wise choice!";
break;
- case 27: /* ESC */
+ case 'Q':
chunking = FALSE;
break;
@@ -322,14 +325,27 @@ int
diskPartitionEditor(char *str)
{
DMenu *menu;
-
- menu = deviceCreateMenu(&MenuDiskDevices, DEVICE_TYPE_DISK, partitionHook);
- if (!menu) {
- msgConfirm("No devices suitable for installation found!\n\nPlease verify that your disk controller (and attached drives) were detected properly. This can be done by selecting the ``Bootmsg'' option on the main menu and reviewing the boot messages carefully.");
+ Device **devs;
+ int cnt;
+
+ devs = deviceFind(NULL, DEVICE_TYPE_DISK);
+ cnt = deviceCount(devs);
+ if (!cnt) {
+ msgConfirm("No disks found! Please verify that your disk controller is being\nproperly probed at boot time. See the Hardware Guide on the Documentation menu\nfor clues on diagnosing this type of problem.");
+ return 0;
+ }
+ else if (cnt == 1) {
+ devs[0]->private = diskPartition((Disk *)devs[0]->private);
+ devs[0]->enabled = TRUE;
}
else {
- dmenuOpenSimple(menu);
- free(menu);
+ menu = deviceCreateMenu(&MenuDiskDevices, DEVICE_TYPE_DISK, partitionHook);
+ if (!menu)
+ msgConfirm("No devices suitable for installation found!\n\nPlease verify that your disk controller (and attached drives) were detected properly. This can be done by selecting the ``Bootmsg'' option on the main menu and reviewing the boot messages carefully.");
+ else {
+ dmenuOpenSimple(menu);
+ free(menu);
+ }
}
return 0;
}
diff --git a/usr.sbin/sade/dmenu.c b/usr.sbin/sade/dmenu.c
index 636408a..ff059c7 100644
--- a/usr.sbin/sade/dmenu.c
+++ b/usr.sbin/sade/dmenu.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated for what's essentially a complete rewrite.
*
- * $Id: dmenu.c,v 1.10 1995/05/24 17:49:13 jkh Exp $
+ * $Id: dmenu.c,v 1.11.2.11 1995/06/10 19:44:54 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -42,23 +42,66 @@
*/
#include "sysinstall.h"
+#include <sys/types.h>
-#define MAX_MENU 10
-
-static DMenuItem shellAction = { NULL, NULL, DMENU_SHELL_ESCAPE, NULL, 0 };
+#define MAX_MENU 8
/* Traverse menu but give user no control over positioning */
-void
+Boolean
dmenuOpenSimple(DMenu *menu)
{
int choice, scroll, curr, max;
choice = scroll = curr = max = 0;
- dmenuOpen(menu, &choice, &scroll, &curr, &max);
+ return dmenuOpen(menu, &choice, &scroll, &curr, &max);
+}
+
+/* Work functions for the state hook */
+char *
+dmenuFlagCheck(DMenuItem *item)
+{
+ if (*((unsigned int *)item->ptr) & item->parm)
+ return "ON";
+ return "OFF";
+}
+
+char *
+dmenuVarCheck(DMenuItem *item)
+{
+ char *cp, *cp2, tmp[256];
+
+ strncpy(tmp, (char *)item->ptr, 256);
+ if ((cp = index(tmp, '=')) != NULL) {
+ *(cp++) = '\0';
+ cp2 = getenv(tmp);
+ if (cp2)
+ return !strcmp(cp, cp2) ? "ON" : "OFF";
+ else
+ return "OFF";
+ }
+ else
+ return getenv(tmp) ? "ON" : "OFF";
+}
+
+char *
+dmenuRadioCheck(DMenuItem *item)
+{
+ if (*((unsigned int *)item->ptr) == item->parm)
+ return "ON";
+ return "OFF";
+}
+
+static char *
+checkHookVal(DMenuItem *item)
+{
+
+ if (!item->check)
+ return "OFF";
+ return (*item->check)(item);
}
/* Traverse over an internal menu */
-void
+Boolean
dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max)
{
char result[FILENAME_MAX];
@@ -69,21 +112,9 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max)
/* First, construct the menu */
for (tmp = menu->items; tmp->title; tmp++) {
if (!tmp->disabled) {
- char *addme = NULL;
- char *title = tmp->title;
- char *prompt = tmp->prompt;
-
- if (menu->options & (DMENU_RADIO_TYPE | DMENU_MULTIPLE_TYPE)) {
- if (*title == '*') {
- addme = "ON";
- ++title;
- }
- else
- addme = "OFF";
- }
- nitems = item_add_pair(nitems, title, prompt, curr, max);
- if (addme)
- nitems = item_add(nitems, addme, curr, max);
+ nitems = item_add_pair(nitems, tmp->title, tmp->prompt, curr, max);
+ if (menu->options & (DMENU_RADIO_TYPE | DMENU_MULTIPLE_TYPE))
+ nitems = item_add(nitems, checkHookVal(tmp), curr, max);
++n;
}
}
@@ -98,32 +129,16 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max)
/* Pop up that dialog! */
if (menu->options & DMENU_NORMAL_TYPE) {
- rval = dialog_menu((unsigned char *)menu->title,
- (unsigned char *)menu->prompt,
- -1, -1,
- n > MAX_MENU ? MAX_MENU : n,
- n,
- (unsigned char **)nitems,
- (unsigned char *)result,
- choice, scroll);
+ rval = dialog_menu((u_char *)menu->title, (u_char *)menu->prompt, -1, -1,
+ n > MAX_MENU ? MAX_MENU : n, n, (u_char **)nitems, (u_char *)result, choice, scroll);
}
else if (menu->options & DMENU_RADIO_TYPE) {
- rval = dialog_radiolist((unsigned char *)menu->title,
- (unsigned char *)menu->prompt,
- -1, -1,
- n > MAX_MENU ? MAX_MENU : n,
- n,
- (unsigned char **)nitems,
- (unsigned char *)result);
+ rval = dialog_radiolist((u_char *)menu->title, (u_char *)menu->prompt, -1, -1,
+ n > MAX_MENU ? MAX_MENU : n, n, (u_char **)nitems, (u_char *)result);
}
else if (menu->options & DMENU_MULTIPLE_TYPE) {
- rval = dialog_checklist((unsigned char *)menu->title,
- (unsigned char *)menu->prompt,
- -1, -1,
- n > MAX_MENU ? MAX_MENU : n,
- n,
- (unsigned char **)nitems,
- (unsigned char *)result);
+ rval = dialog_checklist((u_char *)menu->title, (u_char *)menu->prompt, -1, -1,
+ n > MAX_MENU ? MAX_MENU : n, n, (u_char **)nitems, (u_char *)result);
}
/* This seems to be the only technique that works for getting the display to look right */
@@ -137,25 +152,22 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max)
if (decode_and_dispatch_multiple(menu, result) ||
menu->options & DMENU_SELECTION_RETURNS) {
items_free(nitems, curr, max);
- return;
+ return TRUE;
}
}
}
else {
if ((tmp = decode(menu, result)) == NULL)
- msgFatal("Menu item `%s' not found??", result);
+ return FALSE;
+ }
+ if (dispatch(tmp, result) || (menu->options & DMENU_SELECTION_RETURNS)) {
+ items_free(nitems, curr, max);
+ return TRUE;
}
}
- else if (rval == -1)
- tmp = &shellAction;
else {
items_free(nitems, curr, max);
- return;
- }
- if (dispatch(tmp, result) ||
- menu->options & DMENU_SELECTION_RETURNS) {
- items_free(nitems, curr, max);
- return;
+ return FALSE;
}
}
}
diff --git a/usr.sbin/sade/globals.c b/usr.sbin/sade/globals.c
index a2ccbce..2041024 100644
--- a/usr.sbin/sade/globals.c
+++ b/usr.sbin/sade/globals.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: globals.c,v 1.8 1995/05/25 18:48:25 jkh Exp $
+ * $Id: globals.c,v 1.9.2.2 1995/06/05 03:15:38 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -48,16 +48,16 @@
* whatever values we feel are appropriate.
*/
-int RootFD; /* The file descriptor for our ROOT floppy */
int DebugFD; /* Where diagnostic output goes */
-Boolean OnCDROM; /* Are we running off of a CDROM? */
-Boolean OnSerial; /* Are we on a serial console? */
Boolean RunningAsInit; /* Are we running as init? */
Boolean DialogActive;
Boolean ColorDisplay;
Boolean OnVTY;
Variable *VarHead; /* The head of the variable chain */
Device *mediaDevice; /* Where we're installing from */
+unsigned int OptFlags; /* Option flags */
+int BootMgr;
+char *InstallPrefix; /* Always install under here */
/*
* Yes, I know some of these are already automatically initialized as
@@ -66,14 +66,13 @@ Device *mediaDevice; /* Where we're installing from */
void
globalsInit(void)
{
- RootFD = -1;
DebugFD = -1;
- OnCDROM = FALSE;
- OnSerial = FALSE;
ColorDisplay = FALSE;
OnVTY = FALSE;
DialogActive = FALSE;
VarHead = NULL;
mediaDevice = NULL;
RunningAsInit = FALSE;
+ OptFlags = 0;
+ InstallPrefix = NULL;
}
diff --git a/usr.sbin/sade/install.c b/usr.sbin/sade/install.c
index 48f75f1..d69984d 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.69 1995/05/30 05:50:53 jkh Exp $
+ * $Id: install.c,v 1.70.2.41 1995/06/10 07:58:37 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -49,11 +49,11 @@
#include <sys/wait.h>
#include <unistd.h>
-Boolean SystemWasInstalled;
+Boolean SystemWasInstalled = FALSE;
-static void make_filesystems(void);
-static void copy_self(void);
-static void root_extract(void);
+static Boolean make_filesystems(void);
+static Boolean copy_self(void);
+static Boolean root_extract(void);
static Chunk *rootdev;
@@ -62,9 +62,10 @@ checkLabels(void)
{
Device **devs;
Disk *disk;
- Chunk *c1, *c2, *swapdev = NULL;
+ Chunk *c1, *c2, *swapdev, *usrdev;
int i;
+ rootdev = swapdev = usrdev = NULL;
devs = deviceFind(NULL, DEVICE_TYPE_DISK);
/* First verify that we have a root device */
for (i = 0; devs[i]; i++) {
@@ -77,9 +78,21 @@ checkLabels(void)
for (c1 = disk->chunks->part; c1; c1 = c1->next) {
if (c1->type == freebsd) {
for (c2 = c1->part; c2; c2 = c2->next) {
- if (c2->type == part && c2->subtype != FS_SWAP && c2->private && c2->flags & CHUNK_IS_ROOT) {
- rootdev = c2;
- break;
+ if (c2->type == part && c2->subtype != FS_SWAP && c2->private) {
+ if (c2->flags & CHUNK_IS_ROOT) {
+ if (rootdev) {
+ msgConfirm("WARNING: You have more than one root device set?!\nUsing the first one found.");
+ continue;
+ }
+ rootdev = c2;
+ }
+ else if (!strcmp(((PartInfo *)c2->private)->mountpoint, "/usr")) {
+ if (usrdev) {
+ msgConfirm("WARNING: You have more than one /usr filesystem.\nUsing the first one found.");
+ continue;
+ }
+ usrdev = c2;
+ }
}
}
}
@@ -116,6 +129,8 @@ checkLabels(void)
msgConfirm("No swap devices found - you must create at least one\nswap partition.");
return FALSE;
}
+ if (!usrdev)
+ msgConfirm("WARNING: No /usr filesystem found. This is not technically\nan error if your root filesystem is big enough (or you later\nintend to get your /usr filesystem over NFS), but it may otherwise\ncause you trouble and is not recommended procedure!");
return TRUE;
}
@@ -128,7 +143,6 @@ installInitial(void)
Device **devs;
int i;
static Boolean alreadyDone = FALSE;
- char *cp;
if (alreadyDone)
return TRUE;
@@ -145,14 +159,21 @@ installInitial(void)
return FALSE;
/* Figure out what kind of MBR the user wants */
- dmenuOpenSimple(&MenuMBRType);
- mbrContents = NULL;
- cp = getenv("bootManager");
- if (cp) {
- if (!strcmp(cp, "bteasy"))
- mbrContents = bteasy17;
- else if (!strcmp(cp, "mbr"))
- mbrContents = mbr;
+ if (!dmenuOpenSimple(&MenuMBRType))
+ return FALSE;
+
+ switch (BootMgr) {
+ case 0:
+ mbrContents = bteasy17;
+ break;
+
+ case 1:
+ mbrContents = mbr;
+ break;
+
+ case 2:
+ default:
+ mbrContents = NULL;
}
/* If we refuse to proceed, bail. */
@@ -190,32 +211,38 @@ installInitial(void)
}
}
}
- make_filesystems();
- copy_self();
+ if (!make_filesystems()) {
+ msgConfirm("Couldn't make filesystems properly. Aborting.");
+ return 0;
+ }
+ if (!copy_self()) {
+ msgConfirm("Couldn't clone the boot floppy onto the root file system.\nAborting.");
+ return 0;
+ }
dialog_clear();
chroot("/mnt");
chdir("/");
variable_set2(RUNNING_ON_ROOT, "yes");
/* stick a helpful shell over on the 4th VTY */
- msgDebug("Sticking a potentially helpful shell over on the 4th screen\n");
- if (!fork()) {
+ if (OnVTY && !fork()) {
int i, fd;
extern int login_tty(int);
+ msgDebug("Starting an emergency holographic shell over on the 4th screen\n");
for (i = 0; i < 64; i++)
close(i);
fd = open("/dev/ttyv3", O_RDWR);
ioctl(0, TIOCSCTTY, &fd);
dup2(0, 1);
dup2(0, 2);
- if (login_tty(fd)==-1) {
- msgConfirm("Can't set controlling terminal");
+ if (login_tty(fd) == -1) {
+ msgNotify("Can't set controlling terminal");
exit(1);
}
+ printf("Warning: This shell is chroot()'d to /mnt\n");
execlp("sh", "-sh", 0);
exit(1);
}
- root_extract();
alreadyDone = TRUE;
return TRUE;
}
@@ -229,8 +256,8 @@ installInitial(void)
int
installCommit(char *str)
{
- FILE *fp;
- static Boolean hostsModified = FALSE;
+ Device **devs;
+ int i;
if (!Dists) {
msgConfirm("You haven't told me what distributions to load yet!\nPlease select a distribution from the Distributions menu.");
@@ -239,32 +266,75 @@ installCommit(char *str)
if (!mediaVerify())
return 0;
- if (RunningAsInit) {
+ if (RunningAsInit && !SystemWasInstalled) {
if (!installInitial())
return 0;
configFstab();
- configResolv();
}
+ if (!SystemWasInstalled && !root_extract()) {
+ msgConfirm("Failed to load the ROOT distribution. Please correct\nthis problem and try again.");
+ return 0;
+ }
+
+ /* If we're about to extract the bin dist again, reset the installed state */
+ if (Dists & DIST_BIN)
+ SystemWasInstalled = FALSE;
+
distExtractAll();
- /* Tack ourselves at the end of /etc/hosts */
- if (RunningAsInit && getenv(VAR_IPADDR) && !hostsModified) {
- fp = fopen("/etc/hosts", "a");
- fprintf(fp, "%s\t\t%s\n", getenv(VAR_IPADDR), getenv(VAR_HOSTNAME));
- fclose(fp);
- hostsModified = TRUE;
+ if (!SystemWasInstalled && access("/kernel", R_OK)) {
+ if (vsystem("ln -f /kernel.GENERIC /kernel")) {
+ msgConfirm("Unable to link /kernel into place!");
+ return 0;
+ }
}
- /* If there's no kernel but there is a kernel.GENERIC, link it over */
- if (access("/kernel", R_OK))
- vsystem("ln -f /kernel.GENERIC /kernel");
- msgConfirm("Installation completed successfully.\nHit return now to go back to the main menu.");
+ /* Resurrect /dev after bin distribution screws it up */
+ if (!SystemWasInstalled) {
+ msgNotify("Remaking all devices.. Please wait!");
+ if (vsystem("cd /dev; sh MAKEDEV all"))
+ msgConfirm("MAKEDEV returned non-zero status");
+
+ msgNotify("Resurrecting /dev entries for slices..");
+ devs = deviceFind(NULL, DEVICE_TYPE_DISK);
+ if (!devs)
+ msgFatal("Couldn't get a disk device list!");
+ /* Resurrect the slices that the former clobbered */
+ for (i = 0; devs[i]; i++) {
+ Disk *disk = (Disk *)devs[i]->private;
+ Chunk *c1;
+
+ if (!disk->chunks)
+ msgFatal("No chunk list found for %s!", disk->name);
+ for (c1 = disk->chunks->part; c1; c1 = c1->next) {
+ if (c1->type == freebsd) {
+ msgNotify("Making slice entries for %s", c1->name);
+ if (vsystem("cd /dev; sh MAKEDEV %sh", c1->name))
+ msgConfirm("Unable to make slice entries for %s!", c1->name);
+ }
+ }
+ }
+ }
+
+ /* XXX Do all the last ugly work-arounds here which we'll try and excise someday right?? XXX */
+ /* BOGON #1: XFree86 extracting /usr/X11R6 with root-only perms */
+ if (file_readable("/usr/X11R6"))
+ (void)system("chmod 755 /usr/X11R6");
+
+ /* BOGON #2: We leave /etc in a bad state */
+ (void)system("chmod 755 /etc");
+
+ dialog_clear();
+ if (Dists)
+ msgConfirm("Installation completed with some errors. You may wish\nto scroll through the debugging messages on ALT-F2 with the scroll-lock\nfeature. Press [ENTER] to return to the installation menu.");
+ else
+ msgConfirm("Installation completed successfully, now press [ENTER] to return\nto the main menu. If you have any network devices you have not yet\nconfigured, see the Interface configuration item on the\nConfiguration menu.");
SystemWasInstalled = TRUE;
return 0;
}
/* Go newfs and/or mount all the filesystems we've been asked to */
-static void
+static Boolean
make_filesystems(void)
{
int i;
@@ -273,6 +343,7 @@ make_filesystems(void)
Device **devs;
char dname[40];
PartInfo *p = (PartInfo *)rootdev->private;
+ Boolean RootReadOnly;
command_clear();
devs = deviceFind(NULL, DEVICE_TYPE_DISK);
@@ -289,10 +360,12 @@ make_filesystems(void)
i = vsystem("%s %s", p->newfs_cmd, dname);
if (i) {
msgConfirm("Unable to make new root filesystem! Command returned status %d", i);
- return;
+ return FALSE;
}
+ RootReadOnly = FALSE;
}
else {
+ RootReadOnly = TRUE;
msgConfirm("Warning: You have selected a Read-Only root device\nand may be unable to find the appropriate device entries on it\nif it is from an older pre-slice version of FreeBSD.");
sprintf(dname, "/dev/r%sa", rootdev->disk->name);
msgNotify("Checking integrity of existing %s filesystem", dname);
@@ -303,19 +376,7 @@ make_filesystems(void)
sprintf(dname, "/dev/%sa", rootdev->disk->name);
if (Mount("/mnt", dname)) {
msgConfirm("Unable to mount the root file system! Giving up.");
- return;
- }
- else {
- extern int makedevs(void);
-
- msgNotify("Making device files");
- if (Mkdir("/mnt/dev", NULL) || chdir("/mnt/dev") || makedevs())
- msgConfirm("Failed to make some of the devices in /mnt!");
- if (Mkdir("/mnt/stand", NULL)) {
- msgConfirm("Unable to make /mnt/stand directory!");
- return;
- }
- chdir("/");
+ return FALSE;
}
/* Now buzz through the rest of the partitions and mount them too */
@@ -324,12 +385,16 @@ make_filesystems(void)
continue;
disk = (Disk *)devs[i]->private;
- if (!disk->chunks)
- msgFatal("No chunk list found for %s!", disk->name);
+ if (!disk->chunks) {
+ msgConfirm("No chunk list found for %s!", disk->name);
+ return FALSE;
+ }
/* Make the proper device mount points in /mnt/dev */
- MakeDevDisk(disk, "/mnt/dev");
-
+ if (!(RootReadOnly && disk == rootdev->disk)) {
+ Mkdir("/mnt/dev", NULL);
+ MakeDevDisk(disk, "/mnt/dev");
+ }
for (c1 = disk->chunks->part; c1; c1 = c1->next) {
if (c1->type == freebsd) {
for (c2 = c1->part; c2; c2 = c2->next) {
@@ -358,90 +423,103 @@ make_filesystems(void)
}
}
}
- else if (c1->type == fat) {
- PartInfo *tmp = (PartInfo *)c1->private;
+ else if (c1->type == fat && c1->private && !RootReadOnly) {
+ char name[FILENAME_MAX];
- if (!tmp)
- continue;
- command_func_add(tmp->mountpoint, Mount_DOS, c1->name);
+ sprintf(name, "/mnt%s", ((PartInfo *)c1->private)->mountpoint);
+ Mkdir(name, NULL);
}
}
}
+
+ /* Copy the boot floppy's dev files */
+ if (vsystem("find -x /dev | cpio -pdmV /mnt")) {
+ msgConfirm("Couldn't clone the /dev files!");
+ return FALSE;
+ }
+
command_sort();
command_execute();
+ return TRUE;
}
/* Copy the boot floppy contents into /stand */
-static void
+static Boolean
copy_self(void)
{
int i;
msgWeHaveOutput("Copying the boot floppy to /stand on root filesystem");
i = vsystem("find -x /stand | cpio -pdmV /mnt");
- if (i)
+ if (i) {
msgConfirm("Copy returned error status of %d!", i);
+ return FALSE;
+ }
/* Copy the /etc files into their rightful place */
- (void)vsystem("cd /mnt/stand; find etc | cpio -pdmv /mnt");
+ if (vsystem("cd /mnt/stand; find etc | cpio -pdmV /mnt")) {
+ msgConfirm("Couldn't copy up the /etc files!");
+ return TRUE;
+ }
+ return TRUE;
}
-static void loop_on_root_floppy();
+static Boolean loop_on_root_floppy(void);
-static void
+static Boolean
root_extract(void)
{
int fd;
+ static Boolean alreadyExtracted = FALSE;
+
+ if (alreadyExtracted)
+ return TRUE;
- if (OnCDROM) {
- fd = open("/floppies/root.flp", O_RDONLY);
- (void)mediaExtractDist("/", fd);
- return;
- }
if (mediaDevice) {
+ if (isDebug())
+ msgDebug("Attempting to extract root image from %s device\n", mediaDevice->description);
switch(mediaDevice->type) {
- case DEVICE_TYPE_TAPE:
case DEVICE_TYPE_FLOPPY:
- loop_on_root_floppy();
+ alreadyExtracted = loop_on_root_floppy();
break;
default:
- if (mediaDevice->init)
- if (!(*mediaDevice->init)(mediaDevice))
- break;
- fd = (*mediaDevice->get)("floppies/root.flp");
- if (fd != -1) {
- msgNotify("Loading root floppy from %s", mediaDevice->name);
- (void)mediaExtractDist("/", fd);
- if (mediaDevice->close)
- (*mediaDevice->close)(mediaDevice, fd);
- else
- close(fd);
+ if (!(*mediaDevice->init)(mediaDevice))
+ break;
+ fd = (*mediaDevice->get)(mediaDevice, "floppies/root.flp", NULL);
+ if (fd < 0) {
+ msgConfirm("Couldn't get root image from %s!\nWill try to get it from floppy.", mediaDevice->name);
+ (*mediaDevice->shutdown)(mediaDevice);
+ alreadyExtracted = loop_on_root_floppy();
}
else {
- msgConfirm("Couldn't get root floppy image from %s\n, falling back to floppy.", mediaDevice->name);
- if (mediaDevice->shutdown)
- (*mediaDevice->shutdown)(mediaDevice);
- loop_on_root_floppy();
+ msgNotify("Loading root image from %s", mediaDevice->name);
+ alreadyExtracted = mediaExtractDist("/", fd);
+ (*mediaDevice->close)(mediaDevice, fd);
}
break;
}
}
else
- loop_on_root_floppy();
+ alreadyExtracted = loop_on_root_floppy();
+ return alreadyExtracted;
}
-static void
+static Boolean
loop_on_root_floppy(void)
{
int fd;
+ int status = FALSE;
while (1) {
fd = getRootFloppy();
if (fd != -1) {
- mediaExtractDist("/", fd);
+ msgNotify("Extracting root floppy..");
+ status = mediaExtractDist("/", fd);
+ close(fd);
break;
}
}
+ return status;
}
diff --git a/usr.sbin/sade/label.c b/usr.sbin/sade/label.c
index e4533734..20d7a3a 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.30 1995/05/29 00:50:03 jkh Exp $
+ * $Id: label.c,v 1.31.2.4 1995/06/07 06:38:11 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -171,7 +171,10 @@ static PartInfo *
new_part(char *mpoint, Boolean newfs, u_long size)
{
PartInfo *ret;
- u_long target,divisor;
+ u_long target, divisor;
+
+ if (!mpoint)
+ mpoint = "/change_me";
ret = (PartInfo *)safe_malloc(sizeof(PartInfo));
strncpy(ret->mountpoint, mpoint, FILENAME_MAX);
@@ -382,8 +385,8 @@ static void
print_command_summary()
{
mvprintw(17, 0, "The following commands are valid here (upper or lower case):");
- mvprintw(19, 0, "C = Create New D = Delete M = Set Mountpoint");
- mvprintw(20, 0, "N = Newfs Options T = Toggle Newfs U = Undo ESC = Exit");
+ mvprintw(19, 0, "C = Create New D = Delete M = Set Mountpoint");
+ mvprintw(20, 0, "N = Newfs Options T = Toggle Newfs U = Undo Q = Finish");
mvprintw(21, 0, "The default target will be displayed in ");
attrset(A_REVERSE);
@@ -400,7 +403,7 @@ diskLabelEditor(char *str)
int sz, i, key = 0;
Boolean labeling;
char *msg = NULL;
- PartInfo *p;
+ PartInfo *p, *oldp;
PartType type;
Device **devs;
@@ -459,7 +462,7 @@ diskLabelEditor(char *str)
case KEY_F(1):
case '?':
- systemDisplayFile("disklabel.hlp");
+ systemDisplayFile("partition.hlp");
break;
case 'C':
@@ -580,9 +583,11 @@ diskLabelEditor(char *str)
case PART_FAT:
case PART_FILESYSTEM:
+ oldp = label_chunk_info[here].c->private;
p = get_mountpoint(label_chunk_info[here].c);
if (p) {
- p->newfs = FALSE;
+ if (!oldp)
+ p->newfs = FALSE;
if (label_chunk_info[here].type == PART_FAT
&& (!strcmp(p->mountpoint, "/") || !strcmp(p->mountpoint, "/usr")
|| !strcmp(p->mountpoint, "/var"))) {
@@ -608,10 +613,9 @@ diskLabelEditor(char *str)
break;
case 'T': /* Toggle newfs state */
- if (label_chunk_info[here].type == PART_FILESYSTEM &&
- label_chunk_info[here].c->private) {
+ if (label_chunk_info[here].type == PART_FILESYSTEM) {
PartInfo *pi = ((PartInfo *)label_chunk_info[here].c->private);
- label_chunk_info[here].c->private = new_part(pi->mountpoint, !pi->newfs, label_chunk_info[here].c->size);
+ label_chunk_info[here].c->private = new_part(pi ? pi->mountpoint : NULL, pi ? !pi->newfs : TRUE, label_chunk_info[here].c->size);
safe_free(pi);
label_chunk_info[here].c->private_free = safe_free;
}
@@ -659,7 +663,7 @@ diskLabelEditor(char *str)
msg = "A most prudent choice!";
break;
- case 27: /* ESC */
+ case 'Q':
labeling = FALSE;
break;
diff --git a/usr.sbin/sade/main.c b/usr.sbin/sade/main.c
index 649f1ad..9b648fc 100644
--- a/usr.sbin/sade/main.c
+++ b/usr.sbin/sade/main.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: main.c,v 1.11 1995/05/28 09:31:35 jkh Exp $
+ * $Id: main.c,v 1.12.2.4 1995/06/05 15:17:12 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -42,6 +42,7 @@
*/
#include "sysinstall.h"
+#include <stdio.h>
int
main(int argc, char **argv)
@@ -55,17 +56,19 @@ main(int argc, char **argv)
/* Set up whatever things need setting up */
systemInitialize(argc, argv);
+ /* Try to preserve our scroll-back buffer */
+ if (OnVTY)
+ for (curr = 0; curr < 25; curr++)
+ putchar('\n');
+
/* Probe for all relevant devices on the system */
deviceGetAll();
- /* Welcome user to FreeBSD */
- systemWelcome();
-
/* Default to English */
lang_set_English(NULL);
/* Default to passive mode ftp since it's the only thing we currently support :-( */
- variable_set2("ftpPassive", "yes");
+ OptFlags |= OPT_FTP_PASSIVE;
/* Begin user dialog at outer menu */
while (1) {
@@ -76,7 +79,8 @@ main(int argc, char **argv)
}
/* Write out any changes to /etc/sysconfig */
- configSysconfig();
+ if (SystemWasInstalled)
+ configSysconfig();
/* Say goodnight, Gracie */
systemShutdown();
diff --git a/usr.sbin/sade/menus.c b/usr.sbin/sade/menus.c
index 6811a91..3cbafe0 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.40 1995/05/30 05:13:23 jkh Exp $
+ * $Id: menus.c,v 1.41.2.39 1995/06/10 19:38:27 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -57,7 +57,7 @@ DMenu MenuInitial = {
"This is the main menu of the FreeBSD installation system. Please\n\
select one of the options below by using the arrow keys or typing the\n\
first character of the option name you're interested in. Invoke an\n\
-option by pressing enter. If you'd like a shell, press ESC", /* prompt */
+option by pressing [ENTER].", /* prompt */
"Press F1 for usage instructions", /* help line */
"usage.hlp", /* help file */
{ { "Usage", "Quick start - How to use this menu system.", /* U */
@@ -70,7 +70,7 @@ option by pressing enter. If you'd like a shell, press ESC", /* prompt */
DMENU_SUBMENU, &MenuOptions, 0, 0 },
{ "Proceed", "Go to the installation menu", /* P */
DMENU_SUBMENU, &MenuInstall, 0, 0 },
- { "Quit", "Exit this installation utility", /* Q */
+ { "Quit", "Exit this menu (and the installation)", /* Q */
DMENU_CANCEL, NULL, 0, 0 },
{ NULL } },
};
@@ -83,8 +83,7 @@ DMenu MenuDocumentation = {
or are looking to build a system specifically for FreeBSD, read the\n\
Hardware guide! New users should also read the Install document for\n\
a step-by-step tutorial on installing FreeBSD. For general information,\n\
-consult the README file. If you're having other problems, you may find\n\
-answers in the FAQ.",
+consult the README file.",
"Confused? Press F1 for help.",
"usage.hlp", /* help file */
{ { "README", "Read this for a general description of FreeBSD", /* R */
@@ -97,22 +96,18 @@ answers in the FAQ.",
DMENU_DISPLAY_FILE, "COPYRIGHT", 0, 0 },
{ "Release", "The release notes for this version of FreeBSD.", /* R */
DMENU_DISPLAY_FILE, "RELNOTES", 0, 0 },
- { "FAQ", "Frequently Asked Questions about FreeBSD.", /* F */
- DMENU_DISPLAY_FILE, "faq.hlp", 0, 0 },
+ { "Exit", "Exit this menu (returning to previous)", /* E */
+ DMENU_CANCEL, NULL, 0, 0 },
{ NULL } },
};
/*
* The language selection menu.
- *
- * Note: The RADIO menus use a slightly different syntax. If an item
- * name starts with `*', it's considered to be "ON" by default,
- * otherwise off.
*/
DMenu MenuOptionsLanguage = {
DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"Natural language selection", /* title */
- "Please specify the language you'd like to use by default.\n\n\
+ "Please specify the language you would like to use by default.\n\n\
While almost all of the system's documentation is still written\n\
in english (and may never be translated), there are a few guides\n\
and types of system documentation that may be written in your\n\
@@ -150,8 +145,8 @@ DMenu MenuMediaCDROM = {
DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"Choose a CDROM type",
"FreeBSD can be installed directly from a CDROM containing a valid\n\
-FreeBSD 2.0.5 distribution. If you are seeing this menu it's because\n\
-more than one CDROM drive on your system was found. Please select one\n\
+FreeBSD 2.0.5 distribution. If you are seeing this menu it is because\n\
+more than one CDROM drive was found on your system. Please select one\n\
of the following CDROM drives as your installation drive.",
"Press F1 to read the installation guide",
"install.hlp",
@@ -161,8 +156,8 @@ of the following CDROM drives as your installation drive.",
DMenu MenuMediaFloppy = {
DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"Choose a Floppy drive",
-"You have more than one floppy drive. Please chose the floppy\n\
-drive you'd like to use for this operation",
+"You have more than one floppy drive. Please chose the drive\n\
+you would like to use for this operation",
NULL,
NULL,
{ { NULL } },
@@ -171,13 +166,14 @@ drive you'd like to use for this operation",
DMenu MenuMediaDOS = {
DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"Choose a DOS partition",
-"FreeBSD can be installed directly from a DOS partition,\n\
-assuming of course that you've copied the relevant distributions\n\
-into your DOS partition before starting this installation. If\n\
-such is not the case, then you should reboot DOS at this time\n\
-and copy the distributions you want to install into a subdirectory\n\
-on one of your DOS partitions. Otherwise, please select the\n\
-DOS partition containing the FreeBSD distribution files.",
+"FreeBSD can be installed directly from a DOS partition\n\
+assuming, of course, that you have copied the relevant\n\
+distributions into your DOS partition before starting this\n\
+installation. If this is not the case then you should reboot\n\
+DOS at this time and copy the distributions you wish to install\n\
+into a \"FREEBSD\" subdirectory on one of your DOS partitions.\n\
+Otherwise, please select the DOS partition containing the FreeBSD\n\
+distribution files.",
"Press F1 to read the installation guide",
"install.hlp",
{ { NULL } },
@@ -192,66 +188,74 @@ choice. Also note that not all sites carry every possible distribution!\n\
Distributions other than the basic user set are only guaranteed to be\n\
available from the Primary site.\n\n\
If the first site selected doesn't respond, try one of the alternates.\n\
-You may also wish to investigate the Ftp options menu in case of trouble.\n\
+You may also wish to investigate the options menu in case of trouble.\n\
To specify a URL not in this list, chose \"other\".",
"Select a site that's close!",
"install.hlp",
{ { "Primary Site", "ftp.freebsd.org",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.freebsd.org/pub/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.freebsd.org/pub/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "Secondary Site", "freefall.cdrom.com",
- DMENU_SET_VARIABLE, "ftp=ftp://freefall.cdrom.com/pub/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://freefall.cdrom.com/pub/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "Other", "Specify some other ftp site by URL",
DMENU_SET_VARIABLE, "ftp=other", 0, 0 },
{ "Australia", "ftp.physics.usyd.edu.au",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.physics.usyd.edu.au/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.physics.usyd.edu.au/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "Finland", "nic.funet.fi",
- DMENU_SET_VARIABLE, "ftp=ftp://nic.funet.fi/pub/unix/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://nic.funet.fi/pub/unix/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "France", "ftp.ibp.fr",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.ibp.fr/pub/FreeBSD/2.0.5-ALPHA", 0, 0 },
- { "Germany", "ftp.uni-duisburg.de",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.uni-duisburg.de/pub/unix/FreeBSD/2.0.5-ALPHA", 0, },
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.ibp.fr/pub/FreeBSD/2.0.5-RELEASE", 0, 0 },
+ { "Germany", "ftp.fb9dv.uni-duisburg.de",
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.fb9dv.uni-duisburg.de/pub/unix/FreeBSD/2.0.5-RELEASE", 0, 0 },
+ { "Germany #2", "gil.physik.rwth-aachen.de",
+ DMENU_SET_VARIABLE, "ftp=ftp://gil.physik.rwth-aachen.de/pub/FreeBSD/2.0.5-RELEASE", 0, 0 },
+ { "Germany #3", "ftp.uni-paderborn.de",
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.uni-paderborn.de/freebsd/2.0.5-RELEASE", 0, 0 },
+ { "Hong Kong", "ftp.hk.super.net",
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.hk.super.net/pub/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "Israel", "orgchem.weizmann.ac.il",
- DMENU_SET_VARIABLE, "ftp=ftp://orgchem.weizmann.ac.il/pub/FreeBSD-2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://orgchem.weizmann.ac.il/pub/FreeBSD-2.0.5-RELEASE", 0, 0 },
{ "Japan", "ftp.sra.co.jp",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.sra.co.jp/pub/os/FreeBSD/distribution/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.sra.co.jp/pub/os/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "Japan #2", "ftp.mei.co.jp",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.mei.co.jp/free/PC-UNIX/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.mei.co.jp/free/PC-UNIX/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "Japan #3", "ftp.waseda.ac.jp",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.waseda.ac.jp/pub/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.waseda.ac.jp/pub/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "Japan #4", "ftp.pu-toyama.ac.jp",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.pu-toyama.ac.jp/pub/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.pu-toyama.ac.jp/pub/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "Japan #5", "ftpsv1.u-aizu.ac.jp",
- DMENU_SET_VARIABLE, "ftp=ftp://ftpsv1.u-aizu.ac.jp/pub/os/FreeBSD/2.0.5-ALPHA", 0, 0 },
- { "Japan #6", "tutserver.tutcc.tut.ac.jp",
- DMENU_SET_VARIABLE, "ftp=ftp://tutserver.tutcc.tut.ac.jp/FreeBSD/FreeBSD-2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://ftpsv1.u-aizu.ac.jp/pub/os/FreeBSD/2.0.5-RELEASE", 0, 0 },
+ { "Japan #6", "ftp.tut.ac.jp",
+ DMENU_SET_VARIABLE, "ftp://ftp.tut.ac.jp/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "Japan #7", "ftp.ee.uec.ac.jp",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.ee.uec.ac.jp/pub/os/FreeBSD.other/FreeBSD-2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.ee.uec.ac.jp/pub/os/mirror/ftp.freebsd.org/2.0.5-RELEASE", 0, 0 },
+ { "Japan #8", "ftp.tokyonet.ad.jp",
+ DMENU_SET_VARIABLE, "ftp://ftp.tokyonet.ad.jp/pub/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "Korea", "ftp.cau.ac.kr",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.cau.ac.kr/pub/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.cau.ac.kr/pub/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "Netherlands", "ftp.nl.net",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.nl.net/pub/os/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.nl.net/pub/os/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "Russia", "ftp.kiae.su",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.kiae.su/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.kiae.su/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "Sweden", "ftp.luth.se",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.luth.se/pub/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.luth.se/pub/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "Taiwan", "netbsd.csie.nctu.edu.tw",
- DMENU_SET_VARIABLE, "ftp=ftp://netbsd.csie.nctu.edu.tw/pub/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://netbsd.csie.nctu.edu.tw/pub/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "Thailand", "ftp.nectec.or.th",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.nectec.or.th/pub/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.nectec.or.th/pub/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "UK", "ftp.demon.co.uk",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.demon.co.uk/pub/BSD/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.demon.co.uk/pub/BSD/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "UK #2", "src.doc.ic.ac.uk",
- DMENU_SET_VARIABLE, "ftp=ftp://src.doc.ic.ac.uk/packages/unix/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://src.doc.ic.ac.uk/packages/unix/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "UK #3", "unix.hensa.ac.uk",
- DMENU_SET_VARIABLE, "ftp=ftp://unix.hensa.ac.uk/pub/walnut.creek/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://unix.hensa.ac.uk/mirrors/walnut.creek/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "USA", "ref.tfs.com",
- DMENU_SET_VARIABLE, "ftp=ftp://ref.tfs.com/pub/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://ref.tfs.com/pub/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "USA #2", "ftp.dataplex.net",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.dataplex.net/pub/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.dataplex.net/pub/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "USA #3", "kryten.atinc.com",
- DMENU_SET_VARIABLE, "ftp=ftp://kryten.atinc.com/pub/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://kryten.atinc.com/pub/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "USA #4", "ftp.neosoft.com",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.neosoft.com/systems/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.neosoft.com/systems/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ NULL } }
};
@@ -274,8 +278,8 @@ DMenu MenuNetworkDevice = {
"Choose a network interface type",
"FreeBSD can be installed directly over a network, using NFS or FTP.\n
If you are using PPP over a serial device (cuaa0 or cuaa1) as opposed\n\
-to a direct ethernet connection, then you may need to first dial your\n\
-service provider using a special utility we provide for that purpose.\n\
+to a direct ethernet connection, then you may first need to dial your\n\
+service provider using the ppp utility we provide for that purpose.\n\
You can also install over a parallel port using a special \"laplink\"\n\
cable, though this only works if you have another FreeBSD machine running\n\
a fairly recent (2.0R or later) release to talk to.\n\n\
@@ -323,12 +327,14 @@ DMenu MenuInstallType = {
These select what we consider to be the most reasonable defaults for the\n\
type of system in question. If you would prefer to pick and choose\n\
the list of distributions yourself, simply select \"custom\".",
- NULL,
- NULL,
+ "Press F1 for more information on these options.",
+ "distributions.hlp",
{ { "Developer", "Full sources, binaries and doc but no games [171MB]",
DMENU_CALL, distSetDeveloper, 0, 0 },
{ "X-Developer", "Same as above, but includes XFree86 [196MB]",
DMENU_CALL, distSetXDeveloper, 0, 0 },
+ { "Kern-Developer", "Full binaries and doc, kernel sources only [35MB]",
+ DMENU_CALL, distSetKernDeveloper, 0, 0 },
{ "User", "Average user - binaries and doc but no sources [19MB]",
DMENU_CALL, distSetUser, 0, 0 },
{ "X-User", "Same as above, but includes XFree86 [45MB]",
@@ -339,46 +345,93 @@ the list of distributions yourself, simply select \"custom\".",
DMENU_CALL, distSetEverything, 0, 0 },
{ "Custom", "Specify your own distribution set [?]",
DMENU_SUBMENU, &MenuDistributions, 0, 0 },
- { "Reset", "Reset selected distribution list to None",
+ { "Clear", "Reset selected distribution list to None",
DMENU_CALL, distReset, 0, 0 },
{ NULL } },
};
+static char *
+DESFlagCheck(DMenuItem *item)
+{
+ if (isDebug())
+ msgDebug("Dists & DIST_DES = %d\n", Dists & DIST_DES);
+ return (Dists & DIST_DES) ? "ON" : "OFF";
+}
+
+static char *
+srcFlagCheck(DMenuItem *item)
+{
+ if (isDebug())
+ msgDebug("Dists & DIST_SRC = %d\n", Dists & DIST_SRC);
+ return (Dists & DIST_SRC) ? "ON" : "OFF";
+}
+
+static char *
+x11FlagCheck(DMenuItem *item)
+{
+ if (isDebug())
+ msgDebug("Dists & DIST_XF86 = %d\n", Dists & DIST_XF86);
+ return (Dists & DIST_XF86) ? "ON" : "OFF";
+}
+
DMenu MenuDistributions = {
DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS,
"Select the distributions you wish to install.",
- "Please check off the distributions you wish to install. Some\n
-of the most generally useful distributions are already checked, and\n\
-selecting OK at this stage will chose them as defaults.",
+ "Please check off the distributions you wish to install. At the\n\
+very minimum, this should be \"bin\". WARNING: Do not export the\n\
+DES distribution out of the U.S.! It is for U.S. customers only.",
NULL,
NULL,
- { { "*bin", "Binary base distribution (required) [36MB]",
- DMENU_SET_FLAG, &Dists, DIST_BIN, 0 },
+ { { "bin", "Binary base distribution (required) [36MB]",
+ DMENU_SET_FLAG, &Dists, DIST_BIN, 0, dmenuFlagCheck },
{ "commercial", "Commercial demos and shareware [10MB]",
- DMENU_SET_FLAG, &Dists, DIST_COMMERCIAL, 0 },
- { "compat1x", "FreeBSD 1.x binary compatability package [2MB]",
- DMENU_SET_FLAG, &Dists, DIST_COMPAT1X, 0 },
- { "compat20", "FreeBSD 2.0 binary compatability package [2MB]",
- DMENU_SET_FLAG, &Dists, DIST_COMPAT20, 0 },
- { "DES", "DES encryption code and sources [.3MB]",
- DMENU_SET_FLAG, &Dists, DIST_DES, 0 },
- { "dict", "Spelling checker disctionary files [4.2MB]",
- DMENU_SET_FLAG, &Dists, DIST_DICT, 0 },
+ DMENU_SET_FLAG, &Dists, DIST_COMMERCIAL, 0, dmenuFlagCheck },
+ { "compat1x", "FreeBSD 1.x binary compatibility package [2MB]",
+ DMENU_SET_FLAG, &Dists, DIST_COMPAT1X, 0, dmenuFlagCheck },
+ { "compat20", "FreeBSD 2.0 binary compatibility package [2MB]",
+ DMENU_SET_FLAG, &Dists, DIST_COMPAT20, 0, dmenuFlagCheck },
+ { "DES", "NOT FOR EXPORT! DES encryption code [.3MB]",
+ DMENU_CALL, distSetDES, 0, 0, DESFlagCheck },
+ { "dict", "Spelling checker dictionary files [4.2MB]",
+ DMENU_SET_FLAG, &Dists, DIST_DICT, 0, dmenuFlagCheck },
{ "games", "Games and other amusements (non-commercial) [6.4MB]",
- DMENU_SET_FLAG, &Dists, DIST_GAMES, 0 },
+ DMENU_SET_FLAG, &Dists, DIST_GAMES, 0, dmenuFlagCheck },
{ "info", "GNU info files [4.1MB]",
- DMENU_SET_FLAG, &Dists, DIST_INFO, 0 },
- { "*man", "System manual pages - strongly recommended [3.3MB]",
- DMENU_SET_FLAG, &Dists, DIST_MANPAGES, 0 },
+ DMENU_SET_FLAG, &Dists, DIST_INFO, 0, dmenuFlagCheck },
+ { "man", "System manual pages - strongly recommended [3.3MB]",
+ DMENU_SET_FLAG, &Dists, DIST_MANPAGES, 0, dmenuFlagCheck },
{ "proflibs", "Profiled versions of the libraries [3.3MB]",
- DMENU_SET_FLAG, &Dists, DIST_PROFLIBS, 0 },
+ DMENU_SET_FLAG, &Dists, DIST_PROFLIBS, 0, dmenuFlagCheck },
{ "src", "Sources for everything but DES [120MB]",
- DMENU_CALL, distSetSrc, 0 },
- { "XFree86", "The XFree86 3.1.1L distribution [?]",
- DMENU_SUBMENU, &MenuXF86Select, 0 },
+ DMENU_CALL, distSetSrc, 0, 0, srcFlagCheck },
+ { "XFree86", "The XFree86 3.1.1u1 distribution [?]",
+ DMENU_CALL, distSetXF86, 0, 0, x11FlagCheck },
+ { "Experimental", "Work in progress!",
+ DMENU_SET_FLAG, &Dists, DIST_EXPERIMENTAL, 0, dmenuFlagCheck },
{ NULL } },
};
+DMenu MenuDESDistributions = {
+ DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS,
+ "Select the encryption facilities you wish to install.",
+ "Please check off any special DES-based encryption distributions\n\
+you would like to install. Please note that these services are NOT FOR\n\
+EXPORT from the United States, nor are they available on CDROM (for the\n\
+same reason). For information on non-U.S. FTP distributions of this\n\
+software, please consult the release notes.",
+ NULL,
+ NULL,
+ { { "des", "Basic DES services (rlogin, init, etc) [1MB]",
+ DMENU_SET_FLAG, &DESDists, DIST_DES_DES, 0, dmenuFlagCheck },
+ { "krb", "Kerberos encryption services [2MB]",
+ DMENU_SET_FLAG, &DESDists, DIST_DES_KERBEROS, 0, dmenuFlagCheck },
+ { "sebones", "Sources for eBones (Kerberos) [1MB]",
+ DMENU_SET_FLAG, &DESDists, DIST_DES_SEBONES, 0, dmenuFlagCheck },
+ { "ssecure", "Sources for DES libs and utilities [1MB]",
+ DMENU_SET_FLAG, &DESDists, DIST_DES_SSECURE, 0, dmenuFlagCheck },
+ { NULL } },
+};
+
DMenu MenuSrcDistributions = {
DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS,
"Select the sub-components of src you wish to install.",
@@ -387,81 +440,93 @@ you wish to install.",
NULL,
NULL,
{ { "base", "top-level files in /usr/src [300K]",
- DMENU_SET_FLAG, &SrcDists, DIST_SRC_BASE, 0 },
+ DMENU_SET_FLAG, &SrcDists, DIST_SRC_BASE, 0, dmenuFlagCheck },
{ "gnu", "/usr/src/gnu (software from the GNU Project) [42MB]]",
- DMENU_SET_FLAG, &SrcDists, DIST_SRC_GNU, 0 },
+ DMENU_SET_FLAG, &SrcDists, DIST_SRC_GNU, 0, dmenuFlagCheck },
{ "etc", "/usr/src/etc (miscellaneous system files) [460K]",
- DMENU_SET_FLAG, &SrcDists, DIST_SRC_ETC, 0 },
+ DMENU_SET_FLAG, &SrcDists, DIST_SRC_ETC, 0, dmenuFlagCheck },
{ "games", "/usr/src/games (diversions) [7.8MB]",
- DMENU_SET_FLAG, &SrcDists, DIST_SRC_GAMES, 0 },
+ DMENU_SET_FLAG, &SrcDists, DIST_SRC_GAMES, 0, dmenuFlagCheck },
{ "include", "/usr/src/include (header files) [467K]",
- DMENU_SET_FLAG, &SrcDists, DIST_SRC_INCLUDE, 0 },
+ DMENU_SET_FLAG, &SrcDists, DIST_SRC_INCLUDE, 0, dmenuFlagCheck },
{ "lib", "/usr/src/lib (system libraries) [9.2MB]",
- DMENU_SET_FLAG, &SrcDists, DIST_SRC_LIB, 0 },
+ DMENU_SET_FLAG, &SrcDists, DIST_SRC_LIB, 0, dmenuFlagCheck },
{ "libexec", "/usr/src/libexec (system programs) [1.2MB]",
- DMENU_SET_FLAG, &SrcDists, DIST_SRC_LIBEXEC, 0 },
+ DMENU_SET_FLAG, &SrcDists, DIST_SRC_LIBEXEC, 0, dmenuFlagCheck },
{ "lkm", "/usr/src/lkm (Loadable Kernel Modules) [193K]",
- DMENU_SET_FLAG, &SrcDists, DIST_SRC_LKM, 0 },
+ DMENU_SET_FLAG, &SrcDists, DIST_SRC_LKM, 0, dmenuFlagCheck },
{ "release", "/usr/src/release (release-generation tools) [533K]",
- DMENU_SET_FLAG, &SrcDists, DIST_SRC_RELEASE, 0 },
+ DMENU_SET_FLAG, &SrcDists, DIST_SRC_RELEASE, 0, dmenuFlagCheck },
{ "sbin", "/usr/src/sbin (system binaries) [1.3MB]",
- DMENU_SET_FLAG, &SrcDists, DIST_SRC_SBIN, 0 },
+ DMENU_SET_FLAG, &SrcDists, DIST_SRC_SBIN, 0, dmenuFlagCheck },
{ "share", "/usr/src/share (documents and shared files) [10MB]",
- DMENU_SET_FLAG, &SrcDists, DIST_SRC_SHARE, 0 },
+ DMENU_SET_FLAG, &SrcDists, DIST_SRC_SHARE, 0, dmenuFlagCheck },
{ "sys", "/usr/src/sys (FreeBSD kernel) [13MB]",
- DMENU_SET_FLAG, &SrcDists, DIST_SRC_SYS, 0 },
+ DMENU_SET_FLAG, &SrcDists, DIST_SRC_SYS, 0, dmenuFlagCheck },
{ "ubin", "/usr/src/usr.bin (user binaries) [13MB]",
- DMENU_SET_FLAG, &SrcDists, DIST_SRC_UBIN, 0 },
+ DMENU_SET_FLAG, &SrcDists, DIST_SRC_UBIN, 0, dmenuFlagCheck },
{ "usbin", "/usr/src/usr.sbin (aux system binaries) [14MB]",
- DMENU_SET_FLAG, &SrcDists, DIST_SRC_USBIN, 0 },
- { "XFree86", "XFree86 3.1.1L source + contrib distribution [200MB]",
- DMENU_SET_FLAG, &SrcDists, DIST_SRC_XF86, 0 },
+ DMENU_SET_FLAG, &SrcDists, DIST_SRC_USBIN, 0, dmenuFlagCheck },
{ NULL } },
};
+static int
+clearx11(char *str)
+{
+ XF86Dists = 0;
+ XF86ServerDists = 0;
+ XF86FontDists = 0;
+ Dists &= ~DIST_XF86;
+ return 0;
+}
+
DMenu MenuXF86Select = {
DMENU_NORMAL_TYPE,
"XFree86 3.1.1u1 Distribution",
"Please select the components you need from the XFree86 3.1.1u1\n\
distribution. We recommend that you select what you need from the basic\n\
-components set and at least one entry from the Server and Font set menus.\n\n\
-When you're finished, select Cancel.",
+components set and at least one entry from the Server and Font set menus.",
"Press F1 to read the XFree86 release notes for FreeBSD",
"XF86.hlp",
- { { "Basic", "Basic component menu (required)",
+ { { "Basic", "Basic component menu (required)", /* B */
DMENU_SUBMENU, &MenuXF86SelectCore, 0, 0 },
- { "Server", "X server menu",
+ { "Server", "X server menu", /* S */
DMENU_SUBMENU, &MenuXF86SelectServer, 0, 0 },
- { "Fonts", "Font set menu",
+ { "Fonts", "Font set menu", /* F */
DMENU_SUBMENU, &MenuXF86SelectFonts, 0, 0 },
+ { "Clear", "Reset XFree86 distribution list",
+ DMENU_CALL, clearx11, 0, 0, 0 },
+ { "Exit", "Exit this menu (returning to previous)", /* E */
+ DMENU_CANCEL, NULL, 0, 0 },
{ NULL } },
};
DMenu MenuXF86SelectCore = {
DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS,
"XFree86 3.1.1 base distribution types",
- "Please check off the basic XFree86 components you wish to install.\n\
-Those deemed most generally useful are already checked off for you.",
+ "Please check off the basic XFree86 components you wish to install.",
"Press F1 to read the XFree86 release notes for FreeBSD",
"XF86.hlp",
- { { "*bin", "X client applications and shared libs [4MB].",
- DMENU_SET_FLAG, &XF86Dists, DIST_XF86_BIN, 0 },
- { "*lib", "Data files needed at runtime [600K]",
- DMENU_SET_FLAG, &XF86Dists, DIST_XF86_LIB, 0 },
+ { { "bin", "X client applications and shared libs [4MB].",
+ DMENU_SET_FLAG, &XF86Dists, DIST_XF86_BIN, 0, dmenuFlagCheck },
+ { "lib", "Data files needed at runtime [600K]",
+ DMENU_SET_FLAG, &XF86Dists, DIST_XF86_LIB, 0, dmenuFlagCheck },
{ "xicf", "Customizable xinit runtime configuration file [100K]",
- DMENU_SET_FLAG, &XF86Dists, DIST_XF86_XINIT, 0 },
+ DMENU_SET_FLAG, &XF86Dists, DIST_XF86_XINIT, 0, dmenuFlagCheck },
{ "xdcf", "Customizable xdm runtime configuration file [100K]",
- DMENU_SET_FLAG, &XF86Dists, DIST_XF86_XDMCF, 0 },
+ DMENU_SET_FLAG, &XF86Dists, DIST_XF86_XDMCF, 0, dmenuFlagCheck },
{ "doc", "READMEs and XFree86 specific man pages [500K]",
- DMENU_SET_FLAG, &XF86Dists, DIST_XF86_DOC, 0 },
- { "*man", "Man pages (except XFree86 specific ones) [1.2MB]",
- DMENU_SET_FLAG, &XF86Dists, DIST_XF86_MAN, 0 },
+ DMENU_SET_FLAG, &XF86Dists, DIST_XF86_DOC, 0, dmenuFlagCheck },
+ { "man", "Man pages (except XFree86 specific ones) [1.2MB]",
+ DMENU_SET_FLAG, &XF86Dists, DIST_XF86_MAN, 0, dmenuFlagCheck },
{ "prog", "Programmer's header and library files [4MB]",
- DMENU_SET_FLAG, &XF86Dists, DIST_XF86_PROG, 0 },
+ DMENU_SET_FLAG, &XF86Dists, DIST_XF86_PROG, 0, dmenuFlagCheck },
{ "link", "X Server reconfiguration kit [7.8MB]",
- DMENU_SET_FLAG, &XF86Dists, DIST_XF86_LINK, 0 },
+ DMENU_SET_FLAG, &XF86Dists, DIST_XF86_LINK, 0, dmenuFlagCheck },
{ "pex", "PEX fonts and libs needed by PEX apps [500K]",
- DMENU_SET_FLAG, &XF86Dists, DIST_XF86_PEX, 0 },
+ DMENU_SET_FLAG, &XF86Dists, DIST_XF86_PEX, 0, dmenuFlagCheck },
+ { "sources", "XFree86 3.1.1u1 source + contrib distribution [200MB]",
+ DMENU_SET_FLAG, &XF86Dists, DIST_XF86_SRC, 0, dmenuFlagCheck },
{ NULL } },
};
@@ -474,16 +539,16 @@ install. At the minimum, you should install the standard\n\
(these are selected by default).",
"Press F1 to read the XFree86 release notes for FreeBSD",
"XF86.hlp",
- { { "*fnts", "Standard 75 DPI and miscellaneous fonts [3.6MB]",
- DMENU_SET_FLAG, &XF86FontDists, DIST_XF86_FONTS_MISC, 0 },
+ { { "fnts", "Standard 75 DPI and miscellaneous fonts [3.6MB]",
+ DMENU_SET_FLAG, &XF86FontDists, DIST_XF86_FONTS_MISC, 0, dmenuFlagCheck },
{ "f100", "100 DPI fonts [1.8MB]",
- DMENU_SET_FLAG, &XF86FontDists, DIST_XF86_FONTS_100, 0 },
+ DMENU_SET_FLAG, &XF86FontDists, DIST_XF86_FONTS_100, 0, dmenuFlagCheck },
{ "fscl", "Speedo and Type scalable fonts [1.6MB]",
- DMENU_SET_FLAG, &XF86FontDists, DIST_XF86_FONTS_SCALE, 0 },
+ DMENU_SET_FLAG, &XF86FontDists, DIST_XF86_FONTS_SCALE, 0, dmenuFlagCheck },
{ "non", "Japanese, Chinese and other non-english fonts [3.3MB]",
- DMENU_SET_FLAG, &XF86FontDists, DIST_XF86_FONTS_NON, 0 },
+ DMENU_SET_FLAG, &XF86FontDists, DIST_XF86_FONTS_NON, 0, dmenuFlagCheck },
{ "server", "Font server [0.3MB]",
- DMENU_SET_FLAG, &XF86FontDists, DIST_XF86_FONTS_SERVER, 0 },
+ DMENU_SET_FLAG, &XF86FontDists, DIST_XF86_FONTS_SERVER, 0, dmenuFlagCheck },
{ NULL } },
};
@@ -496,28 +561,30 @@ it is recommended that try the SVGA or VGA16 servers (the VGA16 and\n\
Mono servers are particularly well-suited to most LCD displays).",
"Press F1 to read the XFree86 release notes for FreeBSD",
"XF86.hlp",
- { { "*SVGA", "Standard VGA or Super VGA display [1MB]",
- DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_SVGA, 0 },
+ { { "SVGA", "Standard VGA or Super VGA display [1MB]",
+ DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_SVGA, 0, dmenuFlagCheck },
{ "VGA16", "Standard 16 color VGA display [1MB]",
- DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_VGA16, 0 },
+ DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_VGA16, 0, dmenuFlagCheck },
{ "Mono", "Standard Monochrome display [1MB]",
- DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_MONO, 0 },
+ DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_MONO, 0, dmenuFlagCheck },
{ "8514", "8-bit (256 color) IBM 8514 or compatible card [1MB]",
- DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_8514, 0 },
+ DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_8514, 0, dmenuFlagCheck },
{ "AGX", "8-bit AGX card [1MB]",
- DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_AGX, 0 },
- { "Mch3", "8 and 16-bit (65K color) for ATI Mach32 card [1MB]",
- DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_MACH32, 0 },
- { "Mch8", "8-bit ATI Mach8 card [1MB]",
- DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_MACH8, 0 },
+ DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_AGX, 0, dmenuFlagCheck },
+ { "Ma8", "8-bit ATI Mach8 card [1MB]",
+ DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_MACH8, 0, dmenuFlagCheck },
+ { "Ma32", "8 and 16-bit (65K color) for ATI Mach32 card [1MB]",
+ DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_MACH32, 0, dmenuFlagCheck },
+ { "Ma64", "8 and 16-bit (65K color) for ATI Mach64 card [1MB]",
+ DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_MACH64, 0, dmenuFlagCheck },
{ "P9K", "8, 16, and 24-bit color for Weitek P9000 based boards [1MB]",
- DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_P9000, 0 },
+ DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_P9000, 0, dmenuFlagCheck },
{ "S3", "8, 16 and 24-bit color for S3 based boards [1MB]",
- DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_S3, 0 },
+ DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_S3, 0, dmenuFlagCheck },
{ "W32", "8-bit Color for ET4000/W32, /W32i and /W32p cards [1MB]",
- DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_W32, 0 },
+ DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_W32, 0, dmenuFlagCheck },
{ "nest", "A nested server for testing purposes [1MB]",
- DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_NEST, 0 },
+ DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_NEST, 0, dmenuFlagCheck },
{ NULL } },
};
@@ -530,55 +597,77 @@ space, though FreeBSD can be installed across several drives if you do\n\
not have the required space on a single drive. If you wish to boot\n\
off a drive that's not a `zero drive', or have multiple operating\n\
systems on your machine, you will have the option to install a boot\n\
-manager later.",
+manager later. To select a drive, use the arrow keys to move to it\n\
+and press [SPACE].",
"Press F1 for important information regarding geometry!",
"drives.hlp",
{ { NULL } },
};
+/* Local work func for MenuOptions */
+static int
+clearFlags(char *str)
+{
+ OptFlags = 0;
+ return 1; /* Gross, but forces menu rebuild */
+}
+
+static char *
+userPassCheck(DMenuItem *item)
+{
+ char *cp = getenv(FTP_USER);
+
+ return (cp && *cp) ? "ON" : "OFF";
+}
+
+static char *
+ftpFlagCheck(DMenuItem *item)
+{
+ /* Verify that everything's sane */
+ if ((OptFlags & (OPT_FTP_ABORT + OPT_FTP_RESELECT)) == (OPT_FTP_ABORT + OPT_FTP_RESELECT))
+ OptFlags &= ~OPT_FTP_RESELECT;
+ if (!(OptFlags & (OPT_FTP_ABORT + OPT_FTP_RESELECT)))
+ OptFlags |= OPT_FTP_ABORT;
+ if ((OptFlags & (OPT_FTP_ACTIVE + OPT_FTP_PASSIVE)) == (OPT_FTP_ACTIVE + OPT_FTP_PASSIVE))
+ OptFlags &= ~OPT_FTP_ACTIVE;
+ if (!(OptFlags & (OPT_FTP_ACTIVE + OPT_FTP_PASSIVE)))
+ OptFlags |= OPT_FTP_PASSIVE;
+ if (*((unsigned int *)item->ptr) & item->parm)
+ return "ON";
+ return "OFF";
+}
+
/* The installation options menu */
DMenu MenuOptions = {
- DMENU_NORMAL_TYPE,
+ DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS,
"Choose Installation Options",
"The following options control how this utility will deal\n\
with various possible error conditions and how verbose it will\n\
-be at various stages.\n\n\
-When you're done setting options, select Cancel",
- NULL,
- NULL,
- { { "Ftp Options", "Ftp options menu",
- DMENU_SUBMENU, &MenuOptionsFTP, 0, 0 },
- { "NFS Secure", "NFS server talks only on a secure port",
- DMENU_SET_VARIABLE, "nfsServerSecure=yes", 0, 0 },
+be at various stages.",
+ "Press F1 for more help on these options",
+ "options.hlp",
+ { { "NFS Secure", "NFS server talks only on a secure port",
+ DMENU_SET_FLAG, &OptFlags, OPT_NFS_SECURE, 0, dmenuFlagCheck },
{ "NFS Slow", "User is using a slow PC or ethernet card",
- DMENU_SET_VARIABLE, "nfsSlowPC=yes", 0, 0 },
- { "Extra Debugging", "Toggle the extra debugging flag",
- DMENU_SET_VARIABLE, "debug=yes", 0, 0 },
- { "No Debugging", "Turn the extra debugging flag off",
- DMENU_SET_VARIABLE, "debug=no", 0, 0 },
- { "Yes To All", "Assume \"Yes\" answers to all non-critical dialogs",
- DMENU_SET_VARIABLE, "noConfirmation=Yes", 0, 0 },
- { NULL } },
-};
-
-DMenu MenuOptionsFTP = {
- DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
- "Choose FTP Options",
- "Please indicate how you would like FTP to deal with potential error\n\
-conditions, the default behavior being to Abort on transfer errors. If you\n\
-are behind an IP firewall, you will also probably wish to select passive\n\
-mode transfers (it's generally OK to set this in any case as almost all\n\
-servers support it, firewall or no).",
- NULL,
- NULL,
- { { "FTP Retry", "On transfer failure, retry same host",
- DMENU_SET_VARIABLE, "ftpRetryType=loop", 0, 0 },
+ DMENU_SET_FLAG, &OptFlags, OPT_SLOW_ETHER, 0, dmenuFlagCheck },
+ { "FTP Abort", "On transfer failure, abort",
+ DMENU_SET_FLAG, &OptFlags, OPT_FTP_ABORT, 0, ftpFlagCheck },
{ "FTP Reselect", "On transfer failure, ask for another host",
- DMENU_SET_VARIABLE, "ftpRetryType=reselect", 0, 0 },
- { "FTP Abort", "On transfer failure, abort installation",
- DMENU_SET_VARIABLE, "ftpRetryType=abort", 0, 0 },
+ DMENU_SET_FLAG, &OptFlags, OPT_FTP_RESELECT, 0, ftpFlagCheck },
+ { "FTP active", "Use \"active mode\" for standard FTP",
+ DMENU_SET_FLAG, &OptFlags, OPT_FTP_ACTIVE, 0, ftpFlagCheck },
{ "FTP passive", "Use \"passive mode\" for firewalled FTP",
- DMENU_SET_VARIABLE, "ftpPassive=yes", 0, 0 },
+ DMENU_SET_FLAG, &OptFlags, OPT_FTP_PASSIVE, 0, ftpFlagCheck },
+ { "Debugging", "Turn on the extra debugging flag",
+ DMENU_SET_FLAG, &OptFlags, OPT_DEBUG, 0, dmenuFlagCheck },
+ { "Yes To All", "Assume \"Yes\" answers to all non-critical dialogs",
+ DMENU_SET_FLAG, &OptFlags, OPT_NO_CONFIRM, 0, dmenuFlagCheck },
+ { "FTP userpass", "Specify username and password instead of anonymous",
+ DMENU_CALL, mediaSetFtpUserPass, 0, 0, userPassCheck },
+ { "Clear", "Clear All Option Flags",
+ DMENU_CALL, clearFlags, 0, 0 },
+ { "Exit", "Exit this menu (returning to previous)",
+ DMENU_CANCEL, NULL, 0, 0 },
{ NULL } },
};
@@ -591,7 +680,7 @@ details on the type of distribution you wish to have, where you wish\n\
to install it from and how you wish to allocate disk storage to FreeBSD.\n\n\
None of the items in this menu will actually modify the contents of\n\
your disk until you select the \"Install\" menu item (and even then, only\n\
-after a final confirmation). Select Cancel to leave this menu.",
+after a final confirmation).",
"Press F1 to read the installation guide",
"install.hlp",
{ { "Partition", "Allocate disk space for FreeBSD", /* P */
@@ -602,10 +691,14 @@ after a final confirmation). Select Cancel to leave this menu.",
DMENU_SUBMENU, &MenuInstallType, 0, 0 },
{ "Media", "Choose the installation media type", /* M */
DMENU_SUBMENU, &MenuMedia, 0, 0 },
- { "Install", "Install FreeBSD onto your hard disk(s)", /* I */
+ { "Options", "Go to Options submenu", /* O */
+ DMENU_SUBMENU, &MenuOptions, 0, 0 },
+ { "Commit", "Install FreeBSD onto your hard disk(s)", /* C */
DMENU_CALL, installCommit, 0, 0 },
{ "Configure", "Do post-install configuration of FreeBSD", /* C */
DMENU_SUBMENU, &MenuConfigure, 0, 0 },
+ { "Exit", "Exit this menu (returning to previous)",
+ DMENU_CANCEL, NULL, 0, 0 },
{ NULL } },
};
@@ -623,12 +716,12 @@ one, select \"standard\". If you would prefer your Master Boot\n\
Record to remain untouched, then select \"none\".",
"Press F1 to read the installation guide",
"install.hlp",
- { { "*BootMgr", "Install the FreeBSD Boot Manager (\"Booteasy\")", /* B */
- DMENU_SET_VARIABLE, "bootManager=bteasy", 0, 0 },
+ { { "BootMgr", "Install the FreeBSD Boot Manager (\"Booteasy\")", /* B */
+ DMENU_SET_VALUE, &BootMgr, 0, 0, dmenuRadioCheck },
{ "Standard", "Use a standard MBR (no boot manager)", /* S */
- DMENU_SET_VARIABLE, "bootManager=mbr", 0, 0 },
+ DMENU_SET_VALUE, &BootMgr, 1, 0, dmenuRadioCheck },
{ "None", "Leave the Master Boot Record untouched", /* N */
- DMENU_SET_VARIABLE, "bootManager=none", 0, 0 },
+ DMENU_SET_VALUE, &BootMgr, 2, 0, dmenuRadioCheck },
{ NULL } },
};
@@ -639,8 +732,7 @@ DMenu MenuConfigure = {
"If you've already installed FreeBSD, you may use this menu to\n\
customize it somewhat to suit your particular configuration. Most\n\
importantly, you can use the Packages utility to load extra \"3rd party\"\n\
-software not provided in the base distributions.\n\n\
-When you're done, select Cancel",
+software not provided in the base distributions.",
"Press F1 for more information on these options",
"configure.hlp",
{ { "Add User", "Add users to the system",
@@ -650,7 +742,7 @@ When you're done, select Cancel",
{ "Networking", "Configure additional network services",
DMENU_SUBMENU, &MenuNetworking, 0, 0 },
{ "Time Zone", "Set which time zone you're in",
- DMENU_SYSTEM_COMMAND, "tzsetup", 0, 0 },
+ DMENU_SYSTEM_COMMAND, "rm -f /etc/wall_cmos_clock /etc/localtime; tzsetup", 0, 0 },
{ "Packages", "Install extra FreeBSD packaged software",
DMENU_CALL, configPackages, 0, 0 },
{ "Ports", "Enable the FreeBSD Ports Collection from CD",
@@ -658,32 +750,47 @@ When you're done, select Cancel",
{ "Root Password", "Set the system manager's password",
DMENU_SYSTEM_COMMAND, "passwd root", 0, 0 },
{ "XFree86", "Configure XFree86 (if installed)",
- DMENU_SYSTEM_COMMAND, "PATH=/usr/bin:/bin:/usr/X11R6/bin xf86config", 0, 0 },
+ DMENU_SYSTEM_COMMAND, "/usr/X11R6/bin/xf86config", 0, 0 },
+ { "Exit", "Exit this menu (returning to previous)",
+ DMENU_CANCEL, NULL, 0, 0 },
{ NULL } },
};
+static char *
+menuCheckNTP(DMenuItem *item)
+{
+ return getenv("ntpdate") ? "ON" : "OFF";
+}
+
+static char *
+menuCheckRouted(DMenuItem *item)
+{
+ return getenv("routedflags") ? "ON" : "OFF";
+}
+
DMenu MenuNetworking = {
- DMENU_NORMAL_TYPE,
+ DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS,
"Network Services Menu",
"You may have already configured one network device (and the\n\
other various hostname/gateway/name server parameters) in the process\n\
of installing FreeBSD. This menu allows you to configure other\n\
-aspects of your system's network configuration.\n\n\
-When you are done, select Cancel.",
+aspects of your system's network configuration.",
NULL,
NULL,
{ { "NFS client", "This machine will be an NFS client",
- DMENU_SET_VARIABLE, "nfs_client=YES", 0, 0 },
+ DMENU_SET_VARIABLE, "nfs_client=YES", 0, 0, dmenuVarCheck },
{ "NFS server", "This machine will be an NFS server",
- DMENU_SET_VARIABLE, "nfs_server=YES", 0, 0 },
- { "interfaces", "Configure additional interfaces",
- DMENU_CALL, tcpDeviceSelect, 0, 0 },
+ DMENU_SET_VARIABLE, "nfs_server=YES", 0, 0, dmenuVarCheck },
+ { "Interfaces", "Configure network interfaces",
+ DMENU_CALL, tcpMenuSelect, 0, 0 },
{ "ntpdate", "Select a clock-syncronization server",
- DMENU_SUBMENU, &MenuNTP, 0, 0 },
+ DMENU_SUBMENU, &MenuNTP, 0, 0, menuCheckNTP },
{ "routed", "Set flags for routed (default: -q)",
- DMENU_CALL, configRoutedFlags, 0, 0 },
+ DMENU_CALL, configRoutedFlags, 0, 0, menuCheckRouted },
{ "rwhod", "This machine wants to run the rwho daemon",
- DMENU_SET_VARIABLE, "rwhod=YES", 0, 0 },
+ DMENU_SET_VARIABLE, "rwhod=YES", 0, 0, dmenuVarCheck },
+ { "Exit", "Exit this menu (returning to previous)",
+ DMENU_CANCEL, NULL, 0, 0 },
{ NULL } },
};
@@ -695,7 +802,9 @@ for public use around the Internet. Please select one reasonably\n\
close to you to have your system time syncronized accordingly.",
"These are the primary open-access NTP servers",
NULL,
- { { "Australia", "ntp.syd.dms.csiro.au (HP 5061 Cesium Beam)",
+ { { "Other", "Select a site not on this list",
+ DMENU_CALL, configNTP, 0, 0 },
+ { "Australia", "ntp.syd.dms.csiro.au (HP 5061 Cesium Beam)",
DMENU_SET_VARIABLE, "ntpdate=ntp.syd.dms.csiro.au", 0, 0 },
{ "Canada", "tick.usask.ca (GOES clock)",
DMENU_SET_VARIABLE, "ntpdate=tick.usask.ca", 0, 0 },
@@ -751,11 +860,13 @@ When you are done setting configuration options, select Cancel.",
DMENU_SUBMENU, &MenuSysconsKeyrate, 0, 0 },
{ "Saver", "Configure the screen saver",
DMENU_SUBMENU, &MenuSysconsSaver, 0, 0 },
+ { "Exit", "Exit this menu (returning to previous)",
+ DMENU_CANCEL, NULL, 0, 0 },
{ NULL } },
};
DMenu MenuSysconsKeymap = {
- DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
+ DMENU_RADIO_TYPE | DMENU_SELECTION_RETURNS,
"System Console Keymap",
"The default system console driver for FreeBSD (syscons) defaults\n\
to a standard \"American\" keyboard map. Users in other countries\n\
@@ -764,54 +875,60 @@ the other keymaps below.",
"Choose a keyboard map",
NULL,
{ { "Danish CP865", "Danish Code Page 865 keymap",
- DMENU_SET_VARIABLE, "keymap=danish.cp865", 0, 0 },
+ DMENU_SET_VARIABLE, "keymap=danish.cp865", 0, 0, dmenuVarCheck },
{ "Danish ISO", "Danish ISO keymap",
- DMENU_SET_VARIABLE, "keymap=danish.iso", 0, 0 },
+ DMENU_SET_VARIABLE, "keymap=danish.iso", 0, 0, dmenuVarCheck },
{ "French ISO", "French ISO keymap",
- DMENU_SET_VARIABLE, "keymap=fr.iso", 0, 0 },
+ DMENU_SET_VARIABLE, "keymap=fr.iso", 0, 0, dmenuVarCheck },
{ "German CP850", "German Code Page 850 keymap",
- DMENU_SET_VARIABLE, "keymap=german.cp850", 0, 0 },
+ DMENU_SET_VARIABLE, "keymap=german.cp850", 0, 0, dmenuVarCheck },
{ "German ISO", "German ISO keymap",
- DMENU_SET_VARIABLE, "keymap=german.iso", 0, 0 },
+ DMENU_SET_VARIABLE, "keymap=german.iso", 0, 0, dmenuVarCheck },
{ "Russian CP866", "Russian Code Page 866 keymap",
- DMENU_SET_VARIABLE, "keymap=ru.cp866", 0, 0 },
+ DMENU_SET_VARIABLE, "keymap=ru.cp866", 0, 0, dmenuVarCheck },
{ "Russian KOI8", "Russian koi8 keymap",
- DMENU_SET_VARIABLE, "keymap=ru.koi8-r", 0, 0 },
+ DMENU_SET_VARIABLE, "keymap=ru.koi8-r", 0, 0, dmenuVarCheck },
{ "Russian s-KOI8", "Russian shifted koi8 keymap",
- DMENU_SET_VARIABLE, "keymap=ru.koi8-r.shift", 0, 0 },
+ DMENU_SET_VARIABLE, "keymap=ru.koi8-r.shift", 0, 0, dmenuVarCheck},
{ "Swedish CP850", "Swedish Code Page 850 keymap",
- DMENU_SET_VARIABLE, "keymap=swedish.cp850", 0, 0 },
+ DMENU_SET_VARIABLE, "keymap=swedish.cp850", 0, 0, dmenuVarCheck },
{ "Swedish ISO", "Swedish ISO keymap",
- DMENU_SET_VARIABLE, "keymap=swedish.iso", 0, 0 },
+ DMENU_SET_VARIABLE, "keymap=swedish.iso", 0, 0, dmenuVarCheck },
{ "U.K. CP850", "United Kingdom Code Page 850 keymap",
- DMENU_SET_VARIABLE, "keymap=uk.cp850.iso", 0, 0 },
+ DMENU_SET_VARIABLE, "keymap=uk.cp850", 0, 0, dmenuVarCheck },
{ "U.K. ISO", "United Kingdom ISO keymap",
- DMENU_SET_VARIABLE, "keymap=uk.iso", 0, 0 },
+ DMENU_SET_VARIABLE, "keymap=uk.iso", 0, 0, dmenuVarCheck },
{ "U.S. ISO", "United States ISO keymap",
- DMENU_SET_VARIABLE, "keymap=us.iso", 0, 0 },
+ DMENU_SET_VARIABLE, "keymap=us.iso", 0, 0, dmenuVarCheck },
{ NULL } },
};
DMenu MenuSysconsKeyrate = {
- DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
+ DMENU_RADIO_TYPE | DMENU_SELECTION_RETURNS,
"System Console Keyboard Repeat Rate",
"This menu allows you to set the speed at which keys repeat\n\
when held down.",
"Choose a keyboard repeat rate",
NULL,
{ { "Slow", "Slow keyboard repeat rate",
- DMENU_SET_VARIABLE, "keyrate=slow", 0, 0 },
+ DMENU_SET_VARIABLE, "keyrate=slow", 0, 0, dmenuVarCheck },
{ "Normal", "\"Normal\" keyboard repeat rate",
- DMENU_SET_VARIABLE, "keyrate=normal", 0, 0 },
+ DMENU_SET_VARIABLE, "keyrate=normal", 0, 0, dmenuVarCheck },
{ "Fast", "Fast keyboard repeat rate",
- DMENU_SET_VARIABLE, "keyrate=fast", 0, 0 },
+ DMENU_SET_VARIABLE, "keyrate=fast", 0, 0, dmenuVarCheck },
{ "Default", "Use default keyboard repeat rate",
- DMENU_SET_VARIABLE, "keyrate=NO", 0, 0 },
+ DMENU_SET_VARIABLE, "keyrate=NO", 0, 0, dmenuVarCheck },
{ NULL } },
};
+static char *
+menuSaverTimeoutCheck(DMenuItem *item)
+{
+ return getenv("blanktime") ? "ON" : "OFF";
+}
+
DMenu MenuSysconsSaver = {
- DMENU_NORMAL_TYPE,
+ DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS,
"System Console Screen Saver",
"By default, the console driver will not attempt to do anything\n\
special with your screen when it's idle. If you expect to leave your\n\
@@ -820,14 +937,16 @@ probably enable one of these screen savers to prevent phosphor burn-in.",
"Choose a nifty-looking screen saver",
NULL,
{ { "blank", "Simply blank the screen",
- DMENU_SET_VARIABLE, "saver=star", 0, 0 },
+ DMENU_SET_VARIABLE, "saver=blank", 0, 0, dmenuVarCheck },
{ "Green", "\"Green\" power saving mode (if supported by monitor)",
- DMENU_SET_VARIABLE, "saver=snake", 0, 0 },
+ DMENU_SET_VARIABLE, "saver=green", 0, 0, dmenuVarCheck },
{ "Snake", "Draw a FreeBSD \"snake\" on your screen",
- DMENU_SET_VARIABLE, "saver=snake", 0, 0 },
+ DMENU_SET_VARIABLE, "saver=snake", 0, 0, dmenuVarCheck },
{ "Star", "A \"twinkling stars\" effect",
- DMENU_SET_VARIABLE, "saver=star", 0, 0 },
+ DMENU_SET_VARIABLE, "saver=star", 0, 0, dmenuVarCheck },
{ "Timeout", "Set the screen saver timeout interval",
- DMENU_CALL, configSaverTimeout, 0, 0 },
+ DMENU_CALL, configSaverTimeout, 0, 0, menuSaverTimeoutCheck },
+ { "Exit", "Exit this menu (returning to previous)",
+ DMENU_CANCEL, NULL, 0, 0 },
{ NULL } },
};
diff --git a/usr.sbin/sade/misc.c b/usr.sbin/sade/misc.c
index 49d68f9..4a93b9e 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.10 1995/05/29 11:01:31 jkh Exp $
+ * $Id: misc.c,v 1.11.2.2 1995/06/01 22:32:06 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -243,34 +243,3 @@ Mount(char *mountp, void *dev)
}
return 0;
}
-
-int
-Mount_DOS(char *mountp, void *dev)
-{
- struct ufs_args ufsargs;
- char device[80];
- char mountpoint[FILENAME_MAX];
-
- if (*((char *)dev) != '/') {
- sprintf(device, "/mnt/dev/%s", (char *)dev);
- sprintf(mountpoint, "/mnt%s", mountp);
- }
- else {
- strcpy(device, dev);
- strcpy(mountpoint, mountp);
- }
- memset(&ufsargs,0,sizeof ufsargs);
-
- if (Mkdir(mountpoint, NULL)) {
- msgConfirm("Unable to make directory mountpoint for %s!", mountpoint);
- return 1;
- }
- msgDebug("mount %s %s\n", device, mountpoint);
- ufsargs.fspec = device;
- if (mount(MOUNT_MSDOS, mountpoint, 0, (caddr_t)&ufsargs) == -1) {
- msgConfirm("Error mounting %s on %s : %s\n", device, mountpoint, strerror(errno));
- return 1;
- }
- return 0;
-}
-
diff --git a/usr.sbin/sade/msg.c b/usr.sbin/sade/msg.c
index 0d3791c..088da89 100644
--- a/usr.sbin/sade/msg.c
+++ b/usr.sbin/sade/msg.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: msg.c,v 1.27 1995/05/29 11:01:32 jkh Exp $
+ * $Id: msg.c,v 1.28.2.2 1995/06/02 15:31:31 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -52,10 +52,7 @@
Boolean
isDebug(void)
{
- char *cp;
-
- cp = getenv("debug");
- if (cp && !strcmp(cp, "yes"))
+ if (OptFlags & OPT_DEBUG)
return TRUE;
return FALSE;
}
@@ -220,7 +217,7 @@ msgConfirm(char *fmt, ...)
w = dupwin(newscr);
if (OnVTY) {
msgDebug("Switching back to VTY 0\n");
- ioctl(0, VT_RELDISP, 1);
+ ioctl(0, VT_ACTIVATE, 1);
msgInfo(NULL);
}
dialog_notify(errstr);
@@ -268,7 +265,7 @@ msgYesNo(char *fmt, ...)
w = dupwin(newscr);
if (OnVTY) {
msgDebug("Switching back to VTY 0\n");
- ioctl(0, VT_RELDISP, 1); /* Switch back */
+ ioctl(0, VT_ACTIVATE, 1); /* Switch back */
msgInfo(NULL);
}
ret = dialog_yesno("User Confirmation Requested", errstr, -1, -1);
@@ -302,7 +299,7 @@ msgGetInput(char *buf, char *fmt, ...)
w = dupwin(newscr);
if (OnVTY) {
msgDebug("Switching back to VTY 0\n");
- ioctl(0, VT_RELDISP, 1); /* Switch back */
+ ioctl(0, VT_ACTIVATE, 1); /* Switch back */
msgInfo(NULL);
}
rval = dialog_inputbox("Value Required", errstr, -1, -1, input_buffer);
diff --git a/usr.sbin/sade/sade.h b/usr.sbin/sade/sade.h
index e18bcf8..c845941 100644
--- a/usr.sbin/sade/sade.h
+++ b/usr.sbin/sade/sade.h
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: sysinstall.h,v 1.40 1995/05/29 11:01:37 jkh Exp $
+ * $Id: sysinstall.h,v 1.41.2.20 1995/06/10 09:14:53 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -69,6 +69,7 @@
#define DEV_NAME_MAX 128 /* The maximum length of a device name */
#define DEV_MAX 200 /* The maximum number of devices we'll deal with */
#define INTERFACE_MAX 50 /* Maximum number of network interfaces we'll deal with */
+#define MAX_FTP_RETRIES 3 /* How many times to beat our heads against the wall */
/*
* I make some pretty gross assumptions about having a max of 50 chunks
@@ -85,7 +86,20 @@
#define DISK_LABELLED "_diskLabelled"
#define RUNNING_ON_ROOT "_runningOnRoot"
#define TCP_CONFIGURED "_tcpConfigured"
-#define NO_CONFIRMATION "noConfirmation"
+
+#define FTP_USER "_ftpUser"
+#define FTP_PASS "_ftpPass"
+
+#define OPT_NO_CONFIRM 0x0001
+#define OPT_NFS_SECURE 0x0002
+#define OPT_DEBUG 0x0004
+#define OPT_FTP_ACTIVE 0x0008
+#define OPT_FTP_PASSIVE 0x0010
+#define OPT_FTP_RESELECT 0x0020
+#define OPT_FTP_ABORT 0x0040
+#define OPT_SLOW_ETHER 0x0080
+#define OPT_EXPLORATORY_GET 0x0100
+#define OPT_LEAVE_NETWORK_UP 0x0200
#define VAR_HOSTNAME "hostname"
#define VAR_DOMAINNAME "domainname"
@@ -105,13 +119,13 @@ typedef struct disk Disk;
typedef struct chunk Chunk;
typedef enum {
- DMENU_SHELL_ESCAPE, /* Fork a shell */
DMENU_DISPLAY_FILE, /* Display a file's contents */
DMENU_SUBMENU, /* Recurse into another menu */
DMENU_SYSTEM_COMMAND, /* Run shell commmand */
DMENU_SYSTEM_COMMAND_BOX, /* Same as above, but in prgbox */
DMENU_SET_VARIABLE, /* Set an environment/system var */
DMENU_SET_FLAG, /* Set flag in an unsigned int */
+ DMENU_SET_VALUE, /* Set unsigned int to value */
DMENU_CALL, /* Call back a C function */
DMENU_CANCEL, /* Cancel out of this menu */
DMENU_NOP, /* Do nothing special for item */
@@ -124,6 +138,7 @@ typedef struct _dmenuItem {
void *ptr; /* Generic data ptr */
u_long parm; /* Parameter for above */
Boolean disabled; /* Are we temporarily disabled? */
+ char * (*check)(struct _dmenuItem *); /* Our state */
} DMenuItem;
typedef struct _dmenu {
@@ -172,11 +187,12 @@ typedef struct _device {
char *devname;
DeviceType type;
Boolean enabled;
- Boolean (*init)(struct _device *);
- int (*get)(char *file);
- Boolean (*close)(struct _device *, int fd);
- void (*shutdown)(struct _device *);
+ Boolean (*init)(struct _device *dev);
+ int (*get)(struct _device *dev, char *file, Attribs *dist_attrs);
+ Boolean (*close)(struct _device *dev, int fd);
+ void (*shutdown)(struct _device *dev);
void *private;
+ unsigned int flags;
} Device;
/* Some internal representations of partitions */
@@ -213,8 +229,6 @@ typedef struct _devPriv {
/*** Externs ***/
extern int DebugFD; /* Where diagnostic output goes */
-extern Boolean OnCDROM; /* Are we running off of a CDROM? */
-extern Boolean OnSerial; /* Are we on a serial console? */
extern Boolean SystemWasInstalled; /* Did we install it? */
extern Boolean RunningAsInit; /* Are we running stand-alone? */
extern Boolean DialogActive; /* Is the dialog() stuff up? */
@@ -223,10 +237,15 @@ extern Boolean OnVTY; /* On a syscons VTY? */
extern Variable *VarHead; /* The head of the variable chain */
extern Device *mediaDevice; /* Where we're getting our distribution from */
extern unsigned int Dists; /* Which distributions we want */
+extern unsigned int DESDists; /* Which naughty distributions we want */
extern unsigned int SrcDists; /* Which src distributions we want */
extern unsigned int XF86Dists; /* Which XFree86 dists we want */
extern unsigned int XF86ServerDists; /* The XFree86 servers we want */
extern unsigned int XF86FontDists; /* The XFree86 fonts we want */
+extern unsigned int OptFlags; /* Global options */
+extern int BootMgr; /* Which boot manager to use */
+extern char *InstallPrefix; /* A location bias */
+
extern DMenu MenuInitial; /* Initial installation menu */
extern DMenu MenuMBRType; /* Type of MBR to write on the disk */
@@ -234,7 +253,6 @@ extern DMenu MenuConfigure; /* Final configuration menu */
extern DMenu MenuDocumentation; /* Documentation menu */
extern DMenu MenuOptions; /* Installation options */
extern DMenu MenuOptionsLanguage; /* Language options menu */
-extern DMenu MenuOptionsFTP; /* FTP options menu */
extern DMenu MenuMedia; /* Media type menu */
extern DMenu MenuMediaCDROM; /* CDROM media menu */
extern DMenu MenuMediaDOS; /* DOS media menu */
@@ -251,6 +269,7 @@ extern DMenu MenuNetworking; /* Network configuration menu */
extern DMenu MenuInstall; /* Installation menu */
extern DMenu MenuInstallType; /* Installation type menu */
extern DMenu MenuDistributions; /* Distribution menu */
+extern DMenu MenuDESDistributions; /* DES distribution menu */
extern DMenu MenuSrcDistributions; /* Source distribution menu */
extern DMenu MenuXF86; /* XFree86 main menu */
extern DMenu MenuXF86Select; /* XFree86 distribution selection menu */
@@ -268,7 +287,7 @@ extern int attr_parse(Attribs **attr, char *file);
/* cdrom.c */
extern Boolean mediaInitCDROM(Device *dev);
-extern int mediaGetCDROM(char *file);
+extern int mediaGetCDROM(Device *dev, char *file, Attribs *dist_attrs);
extern void mediaShutdownCDROM(Device *dev);
/* command.c */
@@ -285,6 +304,11 @@ extern void configResolv(void);
extern int configPorts(char *str);
extern int configPackages(char *str);
extern int configSaverTimeout(char *str);
+extern int configNTP(char *str);
+extern int configRoutedFlags(char *str);
+
+/* crc.c */
+extern int crc(int, unsigned long *, unsigned long *);
/* decode.c */
extern DMenuItem *decode(DMenu *menu, char *name);
@@ -298,9 +322,13 @@ extern Device **deviceFind(char *name, DeviceType type);
extern int deviceCount(Device **devs);
extern Device *new_device(char *name);
extern Device *deviceRegister(char *name, char *desc, char *devname, DeviceType type, Boolean enabled,
- Boolean (*init)(Device *mediadev), int (*get)(char *file),
+ Boolean (*init)(Device *mediadev), int (*get)(Device *dev, char *file, Attribs *dist_attrs),
Boolean (*close)(Device *mediadev, int fd), void (*shutDown)(Device *mediadev),
void *private);
+extern Boolean dummyInit(Device *dev);
+extern int dummyGet(Device *dev, char *dist, Attribs *dist_attrs);
+extern Boolean dummyClose(Device *dev, int fd);
+extern void dummyShutdown(Device *dev);
/* disks.c */
extern int diskPartitionEditor(char *unused);
@@ -309,34 +337,40 @@ extern int diskPartitionEditor(char *unused);
extern int distReset(char *str);
extern int distSetDeveloper(char *str);
extern int distSetXDeveloper(char *str);
+extern int distSetKernDeveloper(char *str);
extern int distSetUser(char *str);
extern int distSetXUser(char *str);
extern int distSetMinimum(char *str);
extern int distSetEverything(char *str);
+extern int distSetDES(char *str);
extern int distSetSrc(char *str);
+extern int distSetXF86(char *str);
extern void distExtractAll(void);
/* dmenu.c */
-extern void dmenuOpen(DMenu *menu, int *choice, int *scroll,
- int *curr, int *max);
-extern void dmenuOpenSimple(DMenu *menu);
+extern Boolean dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max);
+extern Boolean dmenuOpenSimple(DMenu *menu);
+extern char *dmenuVarCheck(DMenuItem *item);
+extern char *dmenuFlagCheck(DMenuItem *item);
+extern char *dmenuRadioCheck(DMenuItem *item);
/* dos.c */
extern Boolean mediaInitDOS(Device *dev);
-extern int mediaGetDOS(char *file);
+extern int mediaGetDOS(Device *dev, char *file, Attribs *dist_attrs);
extern void mediaShutdownDOS(Device *dev);
/* floppy.c */
extern int getRootFloppy(void);
extern Boolean mediaInitFloppy(Device *dev);
-extern int mediaGetFloppy(char *file);
+extern int mediaGetFloppy(Device *dev, char *file, Attribs *dist_attrs);
extern void mediaShutdownFloppy(Device *dev);
/* ftp_strat.c */
extern Boolean mediaCloseFTP(Device *dev, int fd);
extern Boolean mediaInitFTP(Device *dev);
-extern int mediaGetFTP(char *file);
+extern int mediaGetFTP(Device *dev, char *file, Attribs *dist_attrs);
extern void mediaShutdownFTP(Device *dev);
+extern int mediaSetFtpUserPass(char *str);
/* globals.c */
extern void globalsInit(void);
@@ -403,7 +437,6 @@ extern char **item_add_pair(char **list, char *item1, char *item2,
extern void items_free(char **list, int *curr, int *max);
extern int Mkdir(char *, void *data);
extern int Mount(char *, void *data);
-extern int Mount_DOS(char *, void *data);
/* msg.c */
extern Boolean isDebug(void);
@@ -422,19 +455,16 @@ extern char *msgGetInput(char *buf, char *fmt, ...);
/* network.c */
extern Boolean mediaInitNetwork(Device *dev);
extern void mediaShutdownNetwork(Device *dev);
-extern int configRoutedFlags(char *str);
/* nfs.c */
extern Boolean mediaInitNFS(Device *dev);
-extern int mediaGetNFS(char *file);
+extern int mediaGetNFS(Device *dev, char *file, Attribs *dist_attrs);
extern void mediaShutdownNFS(Device *dev);
/* system.c */
extern void systemInitialize(int argc, char **argv);
extern void systemShutdown(void);
-extern void systemWelcome(void);
extern int systemExecute(char *cmd);
-extern int systemShellEscape(void);
extern int systemDisplayFile(char *file);
extern char *systemHelpFile(char *file, char *buf);
extern void systemChangeFont(const u_char font[]);
@@ -446,12 +476,13 @@ extern int vsystem(char *fmt, ...);
/* tape.c */
extern Boolean mediaInitTape(Device *dev);
-extern int mediaGetTape(char *file);
+extern int mediaGetTape(Device *dev, char *file, Attribs *dist_attrs);
extern void mediaShutdownTape(Device *dev);
/* tcpip.c */
extern int tcpOpenDialog(Device *dev);
-extern int tcpDeviceSelect(char *str);
+extern int tcpMenuSelect(char *str);
+extern Boolean tcpDeviceSelect(void);
/* termcap.c */
extern int set_termcap(void);
@@ -459,7 +490,7 @@ extern int set_termcap(void);
/* ufs.c */
extern void mediaShutdownUFS(Device *dev);
extern Boolean mediaInitUFS(Device *dev);
-extern int mediaGetUFS(char *file);
+extern int mediaGetUFS(Device *dev, char *file, Attribs *dist_attrs);
/* variables.c */
extern void variable_set(char *var);
diff --git a/usr.sbin/sade/system.c b/usr.sbin/sade/system.c
index 8f68a42..066558b 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.42 1995/05/29 11:01:39 jkh Exp $
+ * $Id: system.c,v 1.43.2.14 1995/06/09 14:33:36 jkh Exp $
*
* Jordan Hubbard
*
@@ -36,13 +36,6 @@ handle_intr(int sig)
systemShutdown();
}
-/* Welcome the user to the system */
-void
-systemWelcome(void)
-{
- printf("Installation system initializing..\n");
-}
-
/* Initialize system defaults */
void
systemInitialize(int argc, char **argv)
@@ -55,23 +48,14 @@ systemInitialize(int argc, char **argv)
/* Are we running as init? */
if (getpid() == 1) {
setsid();
- if (argc > 1 && strchr(argv[1],'C')) {
- /* Kernel told us that we are on a CDROM root */
- close(0); open("/bootcd/dev/console", O_RDWR);
- close(1); dup(0);
- close(2); dup(0);
- OnCDROM = TRUE;
- chroot("/bootcd");
- } else {
- close(0); open("/dev/ttyv0", O_RDWR);
- close(1); dup(0);
- close(2); dup(0);
- }
+ close(0); open("/dev/ttyv0", O_RDWR);
+ close(1); dup(0);
+ close(2); dup(0);
printf("%s running as init\n", argv[0]);
i = ioctl(0, TIOCSCTTY, (char *)NULL);
setlogin("root");
- setenv("PATH", "/stand:/bin:/sbin:/usr/sbin:/usr/bin:/mnt/bin:/mnt/sbin:/mnt/usr/sbin:/mnt/usr/bin", 1);
+ setenv("PATH", "/stand:/bin:/sbin:/usr/sbin:/usr/bin:/mnt/bin:/mnt/sbin:/mnt/usr/sbin:/mnt/usr/bin:/usr/X11R6/bin", 1);
setbuf(stdin, 0);
setbuf(stderr, 0);
}
@@ -103,7 +87,7 @@ systemShutdown(void)
/* REALLY exit! */
if (RunningAsInit) {
/* Put the console back */
- ioctl(DebugFD, VT_RELDISP, 1);
+ ioctl(0, VT_ACTIVATE, 2);
reboot(RB_HALT);
}
else
@@ -127,39 +111,6 @@ systemExecute(char *command)
return status;
}
-/* Find and execute a shell */
-int
-systemShellEscape(void)
-{
- char *sh = NULL;
-
- if (file_executable("/bin/sh"))
- sh = "/bin/sh";
- else if (file_executable("/stand/sh"))
- sh = "/stand/sh";
- else {
- msgWarn("No shell available, sorry!");
- return 1;
- }
- setenv("PS1", "freebsd% ", 1);
- dialog_clear();
- dialog_update();
- move(0, 0);
- standout();
- addstr("Type `exit' to leave this shell and continue installation");
- standend();
- refresh();
- end_dialog();
- DialogActive = FALSE;
- if (fork() == 0)
- execlp(sh, "-sh", 0);
- else
- wait(NULL);
- dialog_clear();
- DialogActive = TRUE;
- return 0;
-}
-
/* Display a file in a filebox */
int
systemDisplayFile(char *file)
@@ -197,43 +148,41 @@ systemHelpFile(char *file, char *buf)
{
char *cp;
static char oldfile[64]; /* Should be FILENAME_MAX but I don't feel like wasting that much space */
+ static char oldlang[64];
+ char extract[64], *default_lang = "en_US.ISO8859-1";
+ int i;
if (!file)
return NULL;
- if ((cp = getenv("LANG")) != NULL) {
- snprintf(buf, FILENAME_MAX, "%s/%s", cp, file);
- if (oldfile[0]) {
- if (!strcmp(buf, oldfile))
- return oldfile;
- else {
- unlink(oldfile);
- oldfile[0] = '\0';
- }
- }
- vsystem("cd /stand && zcat help.tgz | cpio --format=tar -idv %s > /dev/null 2>&1",buf);
+ if ((cp = getenv("LANG")) == NULL)
+ cp = default_lang;
+
+ for (i = 0; i < 2; i++) {
snprintf(buf, FILENAME_MAX, "/stand/%s/%s", cp, file);
+ if (file_readable(buf))
+ return buf;
+ if (*oldfile) {
+ int i;
+
+ i = unlink(oldfile);
+ if (isDebug())
+ msgDebug("Unlink(%s) = %d\n", oldfile, i);
+ i = rmdir(oldlang);
+ if (isDebug())
+ msgDebug("rmdir(%s) = %d\n", oldlang, i);
+ oldfile[0] = '\0';
+ }
+ snprintf(extract, 64, "%s/%s", cp, file);
+ vsystem("cd /stand && zcat help.tgz | cpio --format=tar -idv %s > /dev/null 2>&1", extract);
if (file_readable(buf)) {
strcpy(oldfile, buf);
+ sprintf(oldlang, "/stand/%s", cp);
return buf;
}
- }
- /* Fall back to normal imperialistic mode :-) */
- cp = "en_US.ISO8859-1";
- snprintf(buf, FILENAME_MAX, "%s/%s", cp, file);
- if (oldfile[0]) {
- if (!strcmp(buf, oldfile))
- return oldfile;
- else {
- unlink(oldfile);
- oldfile[0] = '\0';
- }
- }
- vsystem("cd /stand && zcat help.tgz | cpio --format=tar -idv %s > /dev/null 2>&1",buf);
- snprintf(buf, FILENAME_MAX, "/stand/%s/%s", cp, file);
- if (file_readable(buf)) {
- strcpy(oldfile, buf);
- return buf;
+ if (cp == default_lang)
+ break;
+ cp = default_lang;
}
return NULL;
}
@@ -245,7 +194,6 @@ systemChangeFont(const u_char font[])
if (ioctl(0, PIO_FONT8x16, font) < 0)
msgConfirm("Sorry! Unable to load font for %s", getenv("LANG"));
}
- dialog_clear();
}
void
@@ -277,8 +225,10 @@ systemChangeTerminal(char *color, const u_char c_term[],
init_acs();
cbreak(); noecho();
}
- dialog_clear();
}
+ clear();
+ refresh();
+ dialog_clear();
}
void
@@ -289,7 +239,6 @@ systemChangeScreenmap(const u_char newmap[])
msgConfirm("Sorry! Unable to load the screenmap for %s",
getenv("LANG"));
}
- dialog_clear();
}
int
diff --git a/usr.sbin/sade/termcap.c b/usr.sbin/sade/termcap.c
index 384e532..3ab2088 100644
--- a/usr.sbin/sade/termcap.c
+++ b/usr.sbin/sade/termcap.c
@@ -29,21 +29,16 @@ set_termcap(void)
char *term;
int stat;
- OnVTY = OnSerial = FALSE;
- if (getpid() != 1)
- DebugFD = open("sysinstall.debug", O_WRONLY|O_CREAT|O_TRUNC, 0644);
- else {
- int i, on;
+ OnVTY = RunningAsInit = FALSE;
- DebugFD = open("/dev/ttyv1", O_WRONLY);
- on = 1;
- i = ioctl(DebugFD, TIOCCONS, (char *)&on);
- msgDebug("ioctl(%d, TIOCCONS, NULL) = %d (%s)\n", DebugFD, i, !i ? "success" : strerror(errno));
- RunningAsInit = TRUE;
- OnVTY = TRUE;
- }
term = getenv("TERM");
stat = ioctl(STDERR_FILENO, GIO_COLOR, &ColorDisplay);
+
+ if (getpid() != 1)
+ DebugFD = open("sysinstall.debug", O_WRONLY|O_CREAT|O_TRUNC, 0644);
+ else
+ RunningAsInit = TRUE;
+
if (stat < 0) {
if (!term) {
if (setenv("TERM", "vt100", 1) < 0)
@@ -53,9 +48,15 @@ set_termcap(void)
}
if (DebugFD == -1)
DebugFD = dup(1);
- OnSerial = TRUE;
}
else {
+ int i, on;
+
+ DebugFD = open("/dev/ttyv1", O_WRONLY);
+ on = 1;
+ i = ioctl(DebugFD, TIOCCONS, (char *)&on);
+ msgDebug("ioctl(%d, TIOCCONS, NULL) = %d (%s)\n", DebugFD, i, !i ? "success" : strerror(errno));
+ OnVTY = TRUE;
if (ColorDisplay) {
if (!term) {
if (setenv("TERM", "cons25", 1) < 0)
@@ -72,7 +73,6 @@ set_termcap(void)
return -1;
}
}
- OnVTY = TRUE;
}
return 0;
}
diff --git a/usr.sbin/sade/variable.c b/usr.sbin/sade/variable.c
index d2b9799..9cf6742 100644
--- a/usr.sbin/sade/variable.c
+++ b/usr.sbin/sade/variable.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: variable.c,v 1.4 1995/05/27 10:47:44 jkh Exp $
+ * $Id: variable.c,v 1.5.2.2 1995/06/01 21:04:03 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -50,6 +50,14 @@ make_variable(char *var, char *value)
{
Variable *newvar;
+ /* First search to see if it's already there */
+ for (newvar = VarHead; newvar; newvar = newvar->next) {
+ if (!strcmp(newvar->name, var)) {
+ strncpy(newvar->value, value, VAR_VALUE_MAX);
+ setenv(var, value, 1);
+ return;
+ }
+ }
setenv(var, value, 1);
newvar = (Variable *)safe_malloc(sizeof(Variable));
strncpy(newvar->name, var, VAR_NAME_MAX);
@@ -57,7 +65,8 @@ make_variable(char *var, char *value)
newvar->next = VarHead;
VarHead = newvar;
setenv(newvar->name, newvar->value, 1);
- msgInfo("Set %s to %s", newvar->name, newvar->value);
+ if (isDebug())
+ msgDebug("Setting variable %s to %s\n", newvar->name, newvar->value);
}
void
diff --git a/usr.sbin/sade/wizard.c b/usr.sbin/sade/wizard.c
index 81c2b0f..be6f9ee 100644
--- a/usr.sbin/sade/wizard.c
+++ b/usr.sbin/sade/wizard.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: wizard.c,v 1.4 1995/05/20 10:33:14 jkh Exp $
+ * $Id: wizard.c,v 1.5.2.1 1995/06/05 02:25:27 jkh Exp $
*
*/
@@ -165,22 +165,6 @@ slice_wizard(Disk *d)
strtol(cmds[3],0,0));
continue;
}
- if (!strcasecmp(*cmds,"phys") && ncmd == 4) {
- d = Set_Phys_Geom(d,
- strtol(cmds[1],0,0),
- strtol(cmds[2],0,0),
- strtol(cmds[3],0,0));
- continue;
- }
- if (!strcasecmp(*cmds,"collapse")) {
- if (cmds[1])
- while (Collapse_Chunk(d,
- (struct chunk *)strtol(cmds[1],0,0)))
- ;
- else
- Collapse_Disk(d);
- continue;
- }
if (!strcasecmp(*cmds,"list")) {
cp = Disk_Names();
printf("Disks:");
@@ -218,19 +202,6 @@ slice_wizard(Disk *d)
Scan_Disk(d);
continue;
}
- if (!strcasecmp(*cmds,"bteasy")) {
- Set_Boot_Mgr(d,bteasy17);
- continue;
- }
- if (!strcasecmp(*cmds,"mbr")) {
- Set_Boot_Mgr(d,mbr);
- continue;
- }
- if (!strcasecmp(*cmds,"boot")) {
- extern u_char boot1[],boot2[];
- Set_Boot_Blocks(d,boot1,boot2);
- continue;
- }
if (!strcasecmp(*cmds,"write")) {
printf("Write=%d\n",
Write_Disk(d));
@@ -243,15 +214,11 @@ slice_wizard(Disk *d)
printf("CMDS:\n");
printf("allfreebsd\t\t");
printf("bios cyl hd sect\n");
- printf("boot\t\t");
- printf("bteasy17\n");
printf("collapse [pointer]\t\t");
printf("create offset size enum subtype flags\n");
printf("subtype(part): swap=1, ffs=7\t\t");
printf("delete pointer\n");
printf("list\t\t");
- printf("mbr\n");
- printf("phys cyl hd sect\t\t");
printf("quit\n");
printf("read [disk]\t\t");
printf("scan\n");
diff --git a/usr.sbin/sysctl/sysctl.c b/usr.sbin/sysctl/sysctl.c
index 4666cf6..25f404a 100644
--- a/usr.sbin/sysctl/sysctl.c
+++ b/usr.sbin/sysctl/sysctl.c
@@ -40,7 +40,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "From: @(#)sysctl.c 8.1 (Berkeley) 6/6/93"; */
static const char rcsid[] =
- "$Id: sysctl.c,v 1.5 1995/05/12 19:10:56 wollman Exp $";
+ "$Id: sysctl.c,v 1.6.2.1 1995/06/02 10:50:54 davidg Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -336,7 +336,7 @@ parse(string, flags)
}
if (bufp) {
- fprintf(stderr, "name %s in %s is unknown\n", *bufp, string);
+ fprintf(stderr, "name %s in %s is unknown\n", bufp, string);
return;
}
if (newsize > 0) {
diff --git a/usr.sbin/sysinstall/Makefile b/usr.sbin/sysinstall/Makefile
index 481ce83..c70dfc4 100644
--- a/usr.sbin/sysinstall/Makefile
+++ b/usr.sbin/sysinstall/Makefile
@@ -4,13 +4,13 @@ CLEANFILES= makedevs.c rtermcap
.PATH: ${.CURDIR}/../disklabel ${.CURDIR}/../../usr.bin/cksum
-SRCS= attr.c cdrom.c command.c config.c crc.c decode.c devices.c disks.c dist.c \
+SRCS= attr.c cdrom.c command.c config.c decode.c devices.c disks.c dist.c \
dmenu.c dos.c floppy.c ftp.c ftp_strat.c globals.c install.c label.c lang.c \
main.c makedevs.c media.c menus.c misc.c msg.c network.c nfs.c system.c tape.c \
tcpip.c termcap.c ufs.c variable.c wizard.c
-CFLAGS+= -Wall -g -I${.CURDIR}/../libdisk \
+CFLAGS+= -Wall -I${.CURDIR}/../libdisk \
-I${.CURDIR}/../../gnu/lib/libdialog
LDADD= -ldialog -lncurses -lmytinfo -lutil
@@ -22,30 +22,15 @@ LDADD+= -L${.CURDIR}/../libdisk -ldisk
DPADD= ${LIBDIALOG} ${LIBNCURSES} ${LIBMYTINFO} ${LIBUTIL}
-.if exists(${.CURDIR}/../../sys/i386/boot/biosboot/obj)
-BOOTS=${.CURDIR}/../../sys/i386/boot/biosboot/obj
-.else
-BOOTS=${.CURDIR}/../../sys/i386/boot/biosboot
-.endif
-
.if exists(${.CURDIR}/../../share/syscons/scrnmaps/obj)
MKSCRNMAP=${.CURDIR}/../../share/syscons/scrnmaps/obj/koi8-r2cp866.mk
.else
MKSCRNMAP=${.CURDIR}/../../share/syscons/scrnmaps/koi8-r2cp866.mk
.endif
-makedevs.c: dev2c.sh Makefile rtermcap
+makedevs.c: Makefile rtermcap
rm -f makedevs.tmp
- mkdir -p dev
echo '#include <sys/types.h>' > makedevs.tmp
- cp ${.CURDIR}/../../etc/etc.i386/MAKEDEV dev
- ( cd dev; sh ./MAKEDEV all )
- sh ${.CURDIR}/dev2c.sh dev > makedevs.tmp
- rm -rf dev
- uudecode < ${.CURDIR}/bteasy17.uu
- file2c 'const unsigned char boot0[] = {' '};' \
- < bteasy17 >> makedevs.tmp
- rm -rf bteasy17
./rtermcap cons25 | \
file2c 'const char termcap_cons25[] = {' ',0};' \
>> makedevs.tmp
diff --git a/usr.sbin/sysinstall/cdrom.c b/usr.sbin/sysinstall/cdrom.c
index dbb5fb8..0a65097 100644
--- a/usr.sbin/sysinstall/cdrom.c
+++ b/usr.sbin/sysinstall/cdrom.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: cdrom.c,v 1.5 1995/05/29 11:01:03 jkh Exp $
+ * $Id: cdrom.c,v 1.6.2.3 1995/06/05 12:03:44 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -101,13 +101,13 @@ mediaInitCDROM(Device *dev)
}
int
-mediaGetCDROM(char *file)
+mediaGetCDROM(Device *dev, char *file, Attribs *dist_attrs)
{
char buf[PATH_MAX];
snprintf(buf, PATH_MAX, "/cdrom/%s", file);
if (!access(buf,R_OK))
- return open(buf, O_RDONLY);
+ return open(buf, O_RDONLY);
snprintf(buf, PATH_MAX, "/cdrom/dists/%s", file);
return open(buf, O_RDONLY);
}
@@ -118,7 +118,7 @@ mediaShutdownCDROM(Device *dev)
if (!cdromMounted)
return;
msgDebug("Unmounting /cdrom\n");
- if (unmount("/cdrom", 0) != 0)
+ if (unmount("/cdrom", MNT_FORCE) != 0)
msgConfirm("Could not unmount the CDROM: %s\n", strerror(errno));
msgDebug("Unmount returned\n");
cdromMounted = FALSE;
diff --git a/usr.sbin/sysinstall/config.c b/usr.sbin/sysinstall/config.c
index 09209fd..ee82d28 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.14 1995/05/29 13:37:41 jkh Exp $
+ * $Id: config.c,v 1.15.2.28 1995/06/10 08:24:28 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -83,10 +83,10 @@ nameof(Chunk *c1)
static char *
mount_point(Chunk *c1)
{
- if (c1->type == fat || (c1->type == part && c1->subtype != FS_SWAP))
- return ((PartInfo *)c1->private)->mountpoint;
- else if (c1->type == part && c1->subtype == FS_SWAP)
+ if (c1->type == part && c1->subtype == FS_SWAP)
return "none";
+ else if (c1->type == part || c1->type == fat)
+ return ((PartInfo *)c1->private)->mountpoint;
return "/bogus";
}
@@ -101,7 +101,7 @@ fstype(Chunk *c1)
else
return "swap";
}
- return "bogfs";
+ return "bogus";
}
static char *
@@ -121,13 +121,9 @@ fstype_short(Chunk *c1)
static int
seq_num(Chunk *c1)
{
- if (c1->type == part) {
- if (c1->subtype != FS_SWAP)
- return 1;
- else
- return 0;
- }
- return -1;
+ if (c1->type == part && c1->subtype != FS_SWAP)
+ return 1;
+ return 0;
}
void
@@ -139,6 +135,12 @@ configFstab(void)
int i, cnt;
Chunk *c1, *c2;
+ if (!RunningAsInit) {
+ if (file_readable("/etc/fstab"))
+ return;
+ else
+ msgConfirm("Attempting to rebuild your /etc/fstab file.\nWarning: If you had any CD devices in use before running\nsysinstall then they may NOT be found in this run!");
+ }
devs = deviceFind(NULL, DEVICE_TYPE_DISK);
if (!devs) {
msgConfirm("No disks found!");
@@ -146,6 +148,7 @@ configFstab(void)
}
/* Record all the chunks */
+ nchunks = 0;
for (i = 0; devs[i]; i++) {
if (!devs[i]->enabled)
continue;
@@ -155,11 +158,11 @@ configFstab(void)
for (c1 = disk->chunks->part; c1; c1 = c1->next) {
if (c1->type == freebsd) {
for (c2 = c1->part; c2; c2 = c2->next) {
- if (c2->type == part && c2->private)
+ if (c2->type == part && (c2->subtype == FS_SWAP || c2->private))
chunk_list[nchunks++] = c2;
}
}
- else if (c1->type == fat)
+ else if (c1->type == fat && c1->private)
chunk_list[nchunks++] = c1;
}
}
@@ -175,14 +178,11 @@ configFstab(void)
/* Go for the burn */
msgDebug("Generating /etc/fstab file\n");
- for (i = 0; i < nchunks; i++) {
- fprintf(fstab, "/dev/%s\t\t\t%s\t\t%s %s %d %d\n", nameof(chunk_list[i]), mount_point(chunk_list[i]),
- fstype(chunk_list[i]), fstype_short(chunk_list[i]), seq_num(chunk_list[i]),
- seq_num(chunk_list[i]));
- }
-
+ for (i = 0; i < nchunks; i++)
+ fprintf(fstab, "/dev/%s\t\t\t%s\t\t%s\t%s %d %d\n", nameof(chunk_list[i]), mount_point(chunk_list[i]),
+ fstype(chunk_list[i]), fstype_short(chunk_list[i]), seq_num(chunk_list[i]), seq_num(chunk_list[i]));
Mkdir("/proc", NULL);
- fprintf(fstab, "proc\t\t\t\t/proc\t\tprocfs rw 0 0\n");
+ fprintf(fstab, "proc\t\t\t\t/proc\t\tprocfs\trw 0 0\n");
/* Now look for the CDROMs */
devs = deviceFind(NULL, DEVICE_TYPE_CDROM);
@@ -191,7 +191,7 @@ configFstab(void)
/* Write the first one out as /cdrom */
if (cnt) {
Mkdir("/cdrom", NULL);
- fprintf(fstab, "/dev/%s\t\t\t/cdrom\t\tcd9660 ro 0 0\n", devs[0]->name);
+ fprintf(fstab, "/dev/%s\t\t\t/cdrom\t\tcd9660\tro 0 0\n", devs[0]->name);
}
/* Write the others out as /cdrom<n> */
@@ -200,9 +200,11 @@ configFstab(void)
sprintf(cdname, "/cdrom%d", i);
Mkdir(cdname, NULL);
- fprintf(fstab, "/dev/%s\t\t\t%s\t\tcd9660 ro 0 0\n", devs[i]->name, cdname);
+ fprintf(fstab, "/dev/%s\t\t\t%s\t\tcd9660\tro 0 0\n", devs[i]->name, cdname);
}
fclose(fstab);
+ if (isDebug())
+ msgDebug("Wrote out /etc/fstab file\n");
}
/*
@@ -266,7 +268,7 @@ configSysconfig(void)
devp = deviceFind(NULL, DEVICE_TYPE_NETWORK);
cnt = deviceCount(devp);
for (j = 0; j < cnt; j++) {
- if (devp[j]->private) {
+ if (devp[j]->private && strncmp(devp[j]->name, "cuaa", 4)) {
char iname[64];
snprintf(iname, 64, "%s%s", VAR_IFCONFIG, devp[j]->name);
@@ -277,6 +279,12 @@ configSysconfig(void)
}
}
fclose(fp);
+
+ /* If we're an NFS server, we need an exports file */
+ if (getenv("nfs_server") && !file_readable("/etc/exports")) {
+ msgConfirm("You have chosen to be an NFS server but have not yet configured\nthe /etc/exports file. The format for an exports entry is:\n <mountpoint> <opts> <host [..host]>\nWhere <mounpoint> is the name of a filesystem as specified\nin the Label editor, <opts> is a list of special options we\nwon't concern ourselves with here (``man exports'' when the\nsystem is fully installed) and <host> is one or more host\nnames who are allowed to mount this file system. Press\n[ENTER] now to invoke the editor on /etc/exports");
+ systemExecute("vi /etc/exports");
+ }
}
int
@@ -290,14 +298,30 @@ configSaverTimeout(char *str)
return 0;
}
+int
+configNTP(char *str)
+{
+ char *val;
+
+ val = msgGetInput(NULL, "Enter the name of an NTP server");
+ if (val)
+ variable_set2("ntpdate", val);
+ return 0;
+}
+
void
configResolv(void)
{
FILE *fp;
+ char *cp;
- if (!getenv(VAR_DOMAINNAME) || !getenv(VAR_NAMESERVER)) {
- msgConfirm("Warning: You haven't set a domain name or nameserver. You will need\nto configure your /etc/resolv.conf file manually to fully use network services.");
+ if (!RunningAsInit && file_readable("/etc/resolv.conf"))
return;
+
+ if (!getenv(VAR_NAMESERVER)) {
+ if (mediaDevice && (mediaDevice->type == DEVICE_TYPE_NFS || mediaDevice->type == DEVICE_TYPE_FTP))
+ msgConfirm("Warning: Missing name server value - network operations\nmay fail as a result!");
+ goto skip;
}
Mkdir("/etc", NULL);
fp = fopen("/etc/resolv.conf", "w");
@@ -305,9 +329,34 @@ configResolv(void)
msgConfirm("Unable to open /etc/resolv.conf! You will need to do this manually.");
return;
}
- fprintf(fp, "domain\t%s\n", getenv(VAR_DOMAINNAME));
+ if (getenv(VAR_DOMAINNAME))
+ fprintf(fp, "domain\t%s\n", getenv(VAR_DOMAINNAME));
fprintf(fp, "nameserver\t%s\n", getenv(VAR_NAMESERVER));
fclose(fp);
+ if (isDebug())
+ msgDebug("Wrote out /etc/resolv.conf\n");
+
+skip:
+ /* Tack ourselves at the end of /etc/hosts */
+ cp = getenv(VAR_IPADDR);
+ if (cp && *cp != '0' && getenv(VAR_HOSTNAME)) {
+ fp = fopen("/etc/hosts", "a");
+ fprintf(fp, "%s\t\t%s\n", cp, getenv(VAR_HOSTNAME));
+ fclose(fp);
+ if (isDebug())
+ msgDebug("Appended entry for %s to /etc/hosts\n", cp);
+ }
+}
+
+int
+configRoutedFlags(char *str)
+{
+ char *val;
+
+ val = msgGetInput("-q", "Specify the flags for routed; -q is the default, -s is\na good choice for gateway machines.");
+ if (val)
+ variable_set2("routedflags", val);
+ return 0;
}
int
@@ -317,39 +366,26 @@ configPackages(char *str)
pid_t pid;
Boolean onCD;
- onCD = FALSE;
+ msgConfirm("Warning: This utility (pkg_manage) is still somewhat experimental\nand may not function for all packages. If it fails to load the\npackages you want, try running it directly once the system is up or use the\npkg_add, pkg_info and pkg_delete utilities directly.");
i = -1;
- if (!mediaDevice || mediaDevice->type != DEVICE_TYPE_CDROM) {
- if (getpid() == 1) {
- if (!mediaSetCDROM(NULL))
- onCD = FALSE;
- else
+ /* If we're running as init, we know that a CD in the drive is probably ours */
+ onCD = file_readable("/cdrom/packages");
+ if (!onCD && RunningAsInit) {
+ if (mediaSetCDROM(NULL)) {
+ if ((*mediaDevice->init)(mediaDevice))
onCD = TRUE;
}
- else
- onCD = FALSE;
}
- else if (mediaDevice && mediaDevice->type == DEVICE_TYPE_CDROM)
- onCD = TRUE;
- if (onCD) {
- if (!(pid = fork())) {
- execl("/stand/sh", "sh", "-c", "pkg_manage /cdrom", (char *)NULL);
+
+ if (!(pid = fork())) {
+ if (onCD && chdir("/cdrom/packages/All"))
exit(1);
- }
- else {
- pid = waitpid(pid, (int *)&pstat, 0);
- i = (pid == -1) ? -1 : WEXITSTATUS(pstat);
- }
+ execl("/usr/sbin/pkg_manage", "/usr/sbin/pkg_manage", (char *)NULL);
+ exit(1);
}
else {
- if (!(pid = fork())) {
- execl("/stand/sh", "sh", "-c", "pkg_manage", (char *)NULL);
- exit(1);
- }
- else {
- pid = waitpid(pid, (int *)&pstat, 0);
- i = (pid == -1) ? -1 : WEXITSTATUS(pstat);
- }
+ pid = waitpid(pid, (int *)&pstat, 0);
+ i = (pid == -1) ? -1 : WEXITSTATUS(pstat);
}
if (i != 0 && isDebug())
msgDebug("pkg_manage returns status of %d\n", i);
diff --git a/usr.sbin/sysinstall/devices.c b/usr.sbin/sysinstall/devices.c
index 14225fb..b1b91d7 100644
--- a/usr.sbin/sysinstall/devices.c
+++ b/usr.sbin/sysinstall/devices.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: devices.c,v 1.34 1995/05/29 11:01:08 jkh Exp $
+ * $Id: devices.c,v 1.35.2.9 1995/06/05 12:03:46 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -88,14 +88,15 @@ static struct {
{ DEVICE_TYPE_TAPE, "wt0", "Wangtek tape drive" },
{ DEVICE_TYPE_DISK, "sd", "SCSI disk device" },
{ DEVICE_TYPE_DISK, "wd", "IDE/ESDI/MFM/ST506 disk device" },
- { DEVICE_TYPE_FLOPPY, "rfd0", "floppy drive unit A" },
- { DEVICE_TYPE_FLOPPY, "rfd1", "floppy drive unit B" },
+ { DEVICE_TYPE_FLOPPY, "fd0", "floppy drive unit A" },
+ { DEVICE_TYPE_FLOPPY, "fd1", "floppy drive unit B" },
{ DEVICE_TYPE_NETWORK, "cuaa0", "Serial port (COM1) - possible PPP/SLIP device" },
{ DEVICE_TYPE_NETWORK, "cuaa1", "Serial port (COM2) - possible PPP/SLIP device" },
{ DEVICE_TYPE_NETWORK, "lp0", "Parallel Port IP (PLIP) using laplink cable" },
{ DEVICE_TYPE_NETWORK, "lo", "Loop-back (local) network interface" },
{ DEVICE_TYPE_NETWORK, "sl", "Serial-line IP (SLIP) interface" },
{ DEVICE_TYPE_NETWORK, "ppp", "Point-to-Point Protocol (PPP) interface" },
+ { DEVICE_TYPE_NETWORK, "de", "DEC DE435 PCI NIC or other DC21040-AA based card" },
{ DEVICE_TYPE_NETWORK, "ed", "WD/SMC 80xx; Novell NE1000/2000; 3Com 3C503 cards" },
{ DEVICE_TYPE_NETWORK, "ep", "3Com 3C509 ethernet card" },
{ DEVICE_TYPE_NETWORK, "el", "3Com 3C501 ethernet card" },
@@ -115,13 +116,39 @@ new_device(char *name)
Device *dev;
dev = safe_malloc(sizeof(Device));
+ bzero(dev, sizeof(Device));
if (name)
strcpy(dev->name, name);
- else
- dev->name[0] = '\0';
return dev;
}
+/* Stubs for unimplemented strategy routines */
+Boolean
+dummyInit(Device *dev)
+{
+ return TRUE;
+}
+
+int
+dummyGet(Device *dev, char *dist, Attribs *dist_attrs)
+{
+ return -1;
+}
+
+Boolean
+dummyClose(Device *dev, int fd)
+{
+ if (!close(fd))
+ return TRUE;
+ return FALSE;
+}
+
+void
+dummyShutdown(Device *dev)
+{
+ return;
+}
+
static int
deviceTry(char *name, char *try)
{
@@ -136,17 +163,11 @@ deviceTry(char *name, char *try)
return fd;
}
-static void
-deviceDiskFree(Device *dev)
-{
- Free_Disk(dev->private);
-}
-
/* Register a new device in the devices array */
Device *
deviceRegister(char *name, char *desc, char *devname, DeviceType type, Boolean enabled,
- Boolean (*init)(Device *), int (*get)(char *), Boolean (*close)(Device *, int),
- void (*shutdown)(Device *), void *private)
+ Boolean (*init)(Device *), int (*get)(Device *, char *, Attribs *),
+ Boolean (*close)(Device *, int), void (*shutdown)(Device *), void *private)
{
Device *newdev;
@@ -157,10 +178,10 @@ deviceRegister(char *name, char *desc, char *devname, DeviceType type, Boolean e
newdev->devname = devname;
newdev->type = type;
newdev->enabled = enabled;
- newdev->init = init;
- newdev->get = get;
- newdev->close = close;
- newdev->shutdown = shutdown;
+ newdev->init = init ? init : dummyInit;
+ newdev->get = get ? get : dummyGet;
+ newdev->close = close ? close : dummyClose;
+ newdev->shutdown = shutdown ? shutdown : dummyShutdown;
newdev->private = private;
Devices[numDevs] = newdev;
Devices[++numDevs] = NULL;
@@ -197,9 +218,11 @@ deviceGetAll(void)
for (c1 = d->chunks->part; c1; c1 = c1->next) {
if (c1->type == fat) {
Device *dev;
+ char devname[80];
/* Got one! */
- dev = deviceRegister(c1->name, c1->name, c1->name, DEVICE_TYPE_DOS, TRUE,
+ sprintf(devname, "/dev/%s", c1->name);
+ dev = deviceRegister(c1->name, c1->name, strdup(devname), DEVICE_TYPE_DOS, TRUE,
mediaInitDOS, mediaGetDOS, NULL, mediaShutdownDOS, NULL);
dev->private = c1;
msgDebug("Found a DOS partition %s on drive %s\n", c1->name, d->name);
@@ -355,8 +378,7 @@ deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)())
for (i = 0; devs[i]; i++) {
tmp->items[i].title = devs[i]->name;
for (j = 0; device_names[j].name; j++) {
- if (!strncmp(devs[i]->name, device_names[j].name,
- strlen(device_names[j].name))) {
+ if (!strncmp(devs[i]->name, device_names[j].name, strlen(device_names[j].name))) {
tmp->items[i].prompt = device_names[j].description;
break;
}
@@ -366,6 +388,7 @@ deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)())
tmp->items[i].type = DMENU_CALL;
tmp->items[i].ptr = hook;
tmp->items[i].disabled = FALSE;
+ tmp->items[i].check = NULL;
}
tmp->items[i].type = DMENU_NOP;
tmp->items[i].title = NULL;
diff --git a/usr.sbin/sysinstall/disks.c b/usr.sbin/sysinstall/disks.c
index 3aeb539..da5c62e 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.29 1995/05/28 20:28:09 jkh Exp $
+ * $Id: disks.c,v 1.30.2.7 1995/06/08 09:48:31 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -79,11 +79,14 @@ print_chunks(Disk *d)
int row;
int i;
+ if ((!d->bios_cyl || d->bios_cyl > 65536) || (!d->bios_hd || d->bios_hd > 256) || (!d->bios_sect || d->bios_sect >= 64))
+ msgConfirm("WARNING: The detected geometry is incorrect! Please adjust it to\nthe correct values manually with the (G)eometry command. If you are\nunsure about the correct geometry (which may be \"translated\"), please\nconsult the Hardware Guide in the Documentation submenu.");
+
attrset(A_NORMAL);
mvaddstr(0, 0, "Disk name:\t");
clrtobot();
attrset(A_REVERSE); addstr(d->name); attrset(A_NORMAL);
- attrset(A_REVERSE); mvaddstr(0, 55, "Master Partition Editor"); attrset(A_NORMAL);
+ attrset(A_REVERSE); mvaddstr(0, 55, "FDISK Partition Editor"); attrset(A_NORMAL);
mvprintw(1, 0,
"BIOS Geometry:\t%lu cyls/%lu heads/%lu sectors",
d->bios_cyl, d->bios_hd, d->bios_sect);
@@ -93,11 +96,11 @@ print_chunks(Disk *d)
for (i = 0, row = CHUNK_START_ROW; chunk_info[i]; i++, row++) {
if (i == current_chunk)
attrset(A_REVERSE);
- mvprintw(row, 2, "%10ld %10lu %10lu %8s %8d %8s %8d %6lx",
+ mvprintw(row, 2, "%10ld %10lu %10lu %8s %8d %8s %8d\t%-6s",
chunk_info[i]->offset, chunk_info[i]->size,
chunk_info[i]->end, chunk_info[i]->name,
chunk_info[i]->type, chunk_n[chunk_info[i]->type],
- chunk_info[i]->subtype, chunk_info[i]->flags);
+ chunk_info[i]->subtype, ShowChunkFlags(chunk_info[i]));
if (i == current_chunk)
attrset(A_NORMAL);
}
@@ -109,7 +112,7 @@ print_command_summary()
mvprintw(14, 0, "The following commands are supported (in upper or lower case):");
mvprintw(16, 0, "A = Use Entire Disk B = Bad Block Scan C = Create Partition");
mvprintw(17, 0, "D = Delete Partition G = Set BIOS Geometry S = Set Bootable");
- mvprintw(18, 0, "U = Undo All Changes ESC = Exit this screen");
+ mvprintw(18, 0, "U = Undo All Changes Q = Finish");
mvprintw(20, 0, "The currently selected partition is displayed in ");
attrset(A_REVERSE); addstr("reverse"); attrset(A_NORMAL); addstr(" video.");
mvprintw(21, 0, "Use F1 or ? to get more help, arrow keys to move.");
@@ -265,7 +268,7 @@ diskPartition(Disk *d)
msg = "Wise choice!";
break;
- case 27: /* ESC */
+ case 'Q':
chunking = FALSE;
break;
@@ -322,14 +325,27 @@ int
diskPartitionEditor(char *str)
{
DMenu *menu;
-
- menu = deviceCreateMenu(&MenuDiskDevices, DEVICE_TYPE_DISK, partitionHook);
- if (!menu) {
- msgConfirm("No devices suitable for installation found!\n\nPlease verify that your disk controller (and attached drives) were detected properly. This can be done by selecting the ``Bootmsg'' option on the main menu and reviewing the boot messages carefully.");
+ Device **devs;
+ int cnt;
+
+ devs = deviceFind(NULL, DEVICE_TYPE_DISK);
+ cnt = deviceCount(devs);
+ if (!cnt) {
+ msgConfirm("No disks found! Please verify that your disk controller is being\nproperly probed at boot time. See the Hardware Guide on the Documentation menu\nfor clues on diagnosing this type of problem.");
+ return 0;
+ }
+ else if (cnt == 1) {
+ devs[0]->private = diskPartition((Disk *)devs[0]->private);
+ devs[0]->enabled = TRUE;
}
else {
- dmenuOpenSimple(menu);
- free(menu);
+ menu = deviceCreateMenu(&MenuDiskDevices, DEVICE_TYPE_DISK, partitionHook);
+ if (!menu)
+ msgConfirm("No devices suitable for installation found!\n\nPlease verify that your disk controller (and attached drives) were detected properly. This can be done by selecting the ``Bootmsg'' option on the main menu and reviewing the boot messages carefully.");
+ else {
+ dmenuOpenSimple(menu);
+ free(menu);
+ }
}
return 0;
}
diff --git a/usr.sbin/sysinstall/dist.c b/usr.sbin/sysinstall/dist.c
index f01c5b5..3db283d 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.34 1995/05/29 14:38:31 jkh Exp $
+ * $Id: dist.c,v 1.35.2.35 1995/06/10 14:20:10 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -44,88 +44,12 @@
#include "sysinstall.h"
unsigned int Dists;
+unsigned int DESDists;
unsigned int SrcDists;
unsigned int XF86Dists;
unsigned int XF86ServerDists;
unsigned int XF86FontDists;
-static int distSetXF86(char *str);
-
-int
-distReset(char *str)
-{
- Dists = 0;
- SrcDists = 0;
- XF86Dists = 0;
- XF86ServerDists = 0;
- XF86FontDists = 0;
- return 0;
-}
-
-int
-distSetDeveloper(char *str)
-{
- Dists = _DIST_DEVELOPER;
- SrcDists = DIST_SRC_ALL;
- return 0;
-}
-
-int
-distSetXDeveloper(char *str)
-{
- Dists = _DIST_XDEVELOPER;
- SrcDists = DIST_SRC_ALL;
- distSetXF86(NULL);
- return 0;
-}
-
-int
-distSetUser(char *str)
-{
- Dists = _DIST_USER;
- return 0;
-}
-
-int
-distSetXUser(char *str)
-{
- Dists = _DIST_XUSER;
- distSetXF86(NULL);
- return 0;
-}
-
-int
-distSetMinimum(char *str)
-{
- Dists = DIST_BIN;
- return 0;
-}
-
-int
-distSetEverything(char *str)
-{
- Dists = DIST_ALL;
- SrcDists = DIST_SRC_ALL;
- distSetXF86(NULL);
- return 0;
-}
-
-int
-distSetSrc(char *str)
-{
- dmenuOpenSimple(&MenuSrcDistributions);
- if (SrcDists)
- Dists |= DIST_SRC;
- return 0;
-}
-
-static int
-distSetXF86(char *str)
-{
- dmenuOpenSimple(&MenuXF86Select);
- return 0;
-}
-
typedef struct _dist {
char *my_name;
char *my_dir;
@@ -134,27 +58,41 @@ typedef struct _dist {
struct _dist *my_dist;
} Distribution;
+extern Distribution DistTable[];
+extern Distribution DESDistTable[];
extern Distribution SrcDistTable[];
extern Distribution XF86DistTable[];
extern Distribution XF86FontDistTable[];
extern Distribution XF86ServerDistTable[];
-
/* The top-level distribution categories */
static Distribution DistTable[] = {
{ "bin", "/", &Dists, DIST_BIN, NULL },
{ "games", "/", &Dists, DIST_GAMES, NULL },
+{ "help", NULL, &Dists, DIST_HELP, NULL },
{ "manpages", "/", &Dists, DIST_MANPAGES, NULL },
{ "proflibs", "/", &Dists, DIST_PROFLIBS, NULL },
{ "dict", "/", &Dists, DIST_DICT, NULL },
+{ "info", "/", &Dists, DIST_INFO, NULL },
{ "src", "/", &Dists, DIST_SRC, SrcDistTable },
-{ "des", "/", &Dists, DIST_DES, NULL },
+{ "des", "/", &Dists, DIST_DES, DESDistTable },
{ "compat1x", "/", &Dists, DIST_COMPAT1X, NULL },
{ "compat20", "/", &Dists, DIST_COMPAT20, NULL },
+{ "commerce", "/usr/local", &Dists, DIST_COMMERCIAL, NULL },
+{ "xperimnt", "/usr/local", &Dists, DIST_EXPERIMENTAL, NULL },
{ "XF86311", "/usr", &Dists, DIST_XF86, XF86DistTable },
{ NULL },
};
+/* The DES distribution (not for export!) */
+static Distribution DESDistTable[] = {
+{ "des", "/", &DESDists, DIST_DES_DES, NULL },
+{ "krb", "/", &DESDists, DIST_DES_KERBEROS, NULL },
+{ "ssecure", "/usr/src", &DESDists, DIST_DES_SSECURE, NULL },
+{ "sebones", "/usr/src", &DESDists, DIST_DES_SEBONES, NULL },
+{ NULL },
+};
+
/* The /usr/src distribution */
static Distribution SrcDistTable[] = {
{ "sbase", "/usr/src", &SrcDists, DIST_SRC_BASE, NULL },
@@ -171,8 +109,6 @@ static Distribution SrcDistTable[] = {
{ "ssys", "/usr/src", &SrcDists, DIST_SRC_SYS, NULL },
{ "subin", "/usr/src", &SrcDists, DIST_SRC_UBIN, NULL },
{ "susbin", "/usr/src", &SrcDists, DIST_SRC_USBIN, NULL },
-{ "XF86-xc", "/usr/X11R6/src", &SrcDists, DIST_SRC_XF86, NULL },
-{ "XF86-co", "/usr/X11R6/src", &SrcDists, DIST_SRC_XF86, NULL },
{ NULL },
};
@@ -181,15 +117,17 @@ static Distribution XF86DistTable[] = {
{ "X311bin", "/usr", &XF86Dists, DIST_XF86_BIN, NULL },
{ "X311lib", "/usr", &XF86Dists, DIST_XF86_LIB, NULL },
{ "X311doc", "/usr", &XF86Dists, DIST_XF86_DOC, NULL },
-{ "Xf86311", "/usr", &XF86Dists, DIST_XF86_FONTS, XF86FontDistTable },
+{ "XF86311", "/usr", &XF86Dists, DIST_XF86_FONTS, XF86FontDistTable },
{ "X311man", "/usr", &XF86Dists, DIST_XF86_MAN, NULL },
{ "X311prog", "/usr", &XF86Dists, DIST_XF86_PROG, NULL },
{ "X311link", "/usr", &XF86Dists, DIST_XF86_LINK, NULL },
{ "X311pex", "/usr", &XF86Dists, DIST_XF86_PEX, NULL },
{ "X311lbx", "/usr", &XF86Dists, DIST_XF86_LBX, NULL },
{ "X311xicf", "/usr", &XF86Dists, DIST_XF86_XINIT, NULL },
-{ "X311xdmcf", "/usr", &XF86Dists, DIST_XF86_XDMCF, NULL },
-{ "Xf86311", "/usr", &XF86Dists, DIST_XF86_SERVER, XF86ServerDistTable },
+{ "X311xdcf", "/usr", &XF86Dists, DIST_XF86_XDMCF, NULL },
+{ "XF86311", "/usr", &XF86Dists, DIST_XF86_SERVER, XF86ServerDistTable },
+{ "XF86-xc", "/usr/X11R6/src", &XF86Dists, DIST_XF86_SRC, NULL },
+{ "XF86-co", "/usr/X11R6/src", &XF86Dists, DIST_XF86_SRC, NULL },
{ NULL },
};
@@ -197,8 +135,9 @@ static Distribution XF86DistTable[] = {
static Distribution XF86ServerDistTable[] = {
{ "X3118514", "/usr", &XF86ServerDists, DIST_XF86_SERVER_8514, NULL },
{ "X311AGX", "/usr", &XF86ServerDists, DIST_XF86_SERVER_AGX, NULL },
-{ "X311Mch3", "/usr", &XF86ServerDists, DIST_XF86_SERVER_MACH32,NULL },
-{ "X311Mch8", "/usr", &XF86ServerDists, DIST_XF86_SERVER_MACH8, NULL },
+{ "X311Ma8", "/usr", &XF86ServerDists, DIST_XF86_SERVER_MACH8, NULL },
+{ "X311Ma32", "/usr", &XF86ServerDists, DIST_XF86_SERVER_MACH32,NULL },
+{ "X311Ma64", "/usr", &XF86ServerDists, DIST_XF86_SERVER_MACH64,NULL },
{ "X311Mono", "/usr", &XF86ServerDists, DIST_XF86_SERVER_MONO, NULL },
{ "X311P9K", "/usr", &XF86ServerDists, DIST_XF86_SERVER_P9000, NULL },
{ "X311S3", "/usr", &XF86ServerDists, DIST_XF86_SERVER_S3, NULL },
@@ -219,6 +158,121 @@ static Distribution XF86FontDistTable[] = {
{ NULL },
};
+int
+distReset(char *str)
+{
+ Dists = 0;
+ SrcDists = 0;
+ XF86Dists = 0;
+ XF86ServerDists = 0;
+ XF86FontDists = 0;
+ return 0;
+}
+
+int
+distSetDeveloper(char *str)
+{
+ distReset(NULL);
+ Dists = _DIST_DEVELOPER;
+ SrcDists = DIST_SRC_ALL;
+ return 0;
+}
+
+int
+distSetXDeveloper(char *str)
+{
+ distReset(NULL);
+ Dists = _DIST_DEVELOPER | DIST_XF86;
+ SrcDists = DIST_SRC_ALL;
+ XF86Dists = DIST_XF86_BIN | DIST_XF86_LIB | DIST_XF86_PROG | DIST_XF86_MAN | DIST_XF86_SERVER | DIST_XF86_FONTS;
+ XF86ServerDists = DIST_XF86_SERVER_SVGA;
+ XF86FontDists = DIST_XF86_FONTS_MISC;
+ distSetXF86(NULL);
+ return 0;
+}
+
+int
+distSetKernDeveloper(char *str)
+{
+ distReset(NULL);
+ Dists = _DIST_DEVELOPER;
+ SrcDists = DIST_SRC_SYS;
+ return 0;
+}
+
+int
+distSetUser(char *str)
+{
+ distReset(NULL);
+ Dists = _DIST_USER;
+ return 0;
+}
+
+int
+distSetXUser(char *str)
+{
+ distReset(NULL);
+ Dists = _DIST_USER;
+ XF86Dists = DIST_XF86_BIN | DIST_XF86_LIB | DIST_XF86_MAN | DIST_XF86_SERVER | DIST_XF86_FONTS;
+ XF86ServerDists = DIST_XF86_SERVER_SVGA;
+ XF86FontDists = DIST_XF86_FONTS_MISC;
+ distSetXF86(NULL);
+ return 0;
+}
+
+int
+distSetMinimum(char *str)
+{
+ distReset(NULL);
+ Dists = DIST_BIN;
+ return 0;
+}
+
+int
+distSetEverything(char *str)
+{
+ Dists = DIST_ALL;
+ SrcDists = DIST_SRC_ALL;
+ XF86Dists = DIST_XF86_ALL;
+ XF86ServerDists = DIST_XF86_SERVER_ALL;
+ XF86FontDists = DIST_XF86_FONTS_ALL;
+ return 0;
+}
+
+int
+distSetDES(char *str)
+{
+ dmenuOpenSimple(&MenuDESDistributions);
+ if (DESDists)
+ Dists |= DIST_DES;
+ return 0;
+}
+
+int
+distSetSrc(char *str)
+{
+ dmenuOpenSimple(&MenuSrcDistributions);
+ if (SrcDists)
+ Dists |= DIST_SRC;
+ return 0;
+}
+
+int
+distSetXF86(char *str)
+{
+ dmenuOpenSimple(&MenuXF86Select);
+ if (XF86ServerDists)
+ XF86Dists |= DIST_XF86_SERVER;
+ if (XF86FontDists)
+ XF86Dists |= DIST_XF86_FONTS;
+ if (XF86Dists)
+ Dists |= DIST_XF86;
+ if (isDebug())
+ msgDebug("SetXF86 Masks: Server: %0x, Fonts: %0x, XDists: %0x, Dists: %0x\n",
+ XF86ServerDists, XF86FontDists, XF86Dists, Dists);
+ return 0;
+}
+
static Boolean
distExtract(char *parent, Distribution *me)
{
@@ -228,37 +282,49 @@ distExtract(char *parent, Distribution *me)
const char *tmp;
Attribs *dist_attr;
- status = FALSE;
- if (mediaDevice->init)
- if (!(*mediaDevice->init)(mediaDevice))
- return FALSE;
+ status = TRUE;
+ if (isDebug())
+ msgDebug("distExtract: parent: %s, me: %s\n", parent ? parent : "(none)", me->my_name);
+ /* Loop through to see if we're in our parent's plans */
for (i = 0; me[i].my_name; i++) {
- /* If we're not doing it, we're not doing it */
+ dist = me[i].my_name;
+ path = parent ? parent : dist;
+
+ /* If our bit isn't set, go to the next */
if (!(me[i].my_bit & *(me[i].my_mask)))
continue;
+ /* This is shorthand for "dist currently disabled" */
+ if (!me[i].my_dir) {
+ *(me[i].my_mask) &= ~(me[i].my_bit);
+ continue;
+ }
+
/* Recurse if actually have a sub-distribution */
if (me[i].my_dist) {
- status = distExtract(me[i].my_name, me[i].my_dist);
+ status = distExtract(dist, me[i].my_dist);
goto done;
}
- dist = me[i].my_name;
- path = parent ? parent : me[i].my_name;
-
+ /* First try to get the distribution as a single file */
snprintf(buf, 512, "%s/%s.tgz", path, dist);
- fd = (*mediaDevice->get)(buf);
- if (fd != -1) {
+ if (isDebug())
+ msgDebug("Trying to get large piece: %s\n", buf);
+ /* Set it as an "exploratory get" so that we don't loop unnecessarily on it */
+ mediaDevice->flags |= OPT_EXPLORATORY_GET;
+ fd = (*mediaDevice->get)(mediaDevice, buf, NULL);
+ mediaDevice->flags &= ~OPT_EXPLORATORY_GET;
+ if (fd >= 0) {
msgNotify("Extracting %s into %s directory...", me[i].my_name, me[i].my_dir);
status = mediaExtractDist(me[i].my_dir, fd);
- if (mediaDevice->close)
- (*mediaDevice->close)(mediaDevice, fd);
- else
- close(fd);
+ (*mediaDevice->close)(mediaDevice, fd);
goto done;
}
+ else if (fd == -2) /* Hard error, can't continue */
+ return FALSE;
+ /* If we couldn't get it as one file then we need to get multiple pieces; get info file telling us how many */
snprintf(buf, sizeof buf, "/stand/info/%s/%s.inf", path, dist);
if (!access(buf, R_OK)) {
if (isDebug())
@@ -273,56 +339,42 @@ distExtract(char *parent, Distribution *me)
msgDebug("Looking for attribute `pieces'\n");
tmp = attr_match(dist_attr, "pieces");
if (tmp)
- numchunks = atoi(tmp);
+ numchunks = strtol(tmp, 0, 0);
else
numchunks = 0;
}
- else
+ else {
+ if (isDebug())
+ msgDebug("Couldn't open attributes file: %s\n", buf);
numchunks = 0;
+ }
+ if (!numchunks)
+ continue;
if (isDebug())
msgDebug("Attempting to extract distribution from %u chunks.\n", numchunks);
- if (numchunks < 2 ) {
- snprintf(buf, 512, "%s/%s", path, dist);
- if (numchunks)
- strcat(buf,".aa");
- fd = (*mediaDevice->get)(buf);
- if (fd == -1) {
- status = FALSE;
- } else {
- msgNotify("Extracting %s into %s directory...", me[i].my_name, me[i].my_dir);
- status = mediaExtractDist(me[i].my_dir, fd);
- if (mediaDevice->close)
- (*mediaDevice->close)(mediaDevice, fd);
- else
- close(fd);
- }
- goto done;
- }
-
+ /* We have one or more chunks, go pick them up */
mediaExtractDistBegin(me[i].my_dir, &fd2, &zpid, &cpid);
dialog_clear();
for (chunk = 0; chunk < numchunks; chunk++) {
int n, retval;
char prompt[80];
- int retries = 0;
- snprintf(buf, 512, "%s/%s.%c%c", path, dist, (chunk / 26) + 'a', (chunk % 26) + 'a');
-retry:
- fd = (*mediaDevice->get)(buf);
+ snprintf(buf, 512, "%s/%s.%c%c", path, dist, (chunk / 26) + 'a', (chunk % 26) + 'a');
+ if (isDebug())
+ msgDebug("trying for piece %d of %d: %s\n", chunk, numchunks, buf);
+ fd = (*mediaDevice->get)(mediaDevice, buf, dist_attr);
if (fd < 0) {
- if (++retries < 5)
- goto retry;
- msgConfirm("failed to retreive piece file %s after 5 retries!\nAborting the transfer", buf);
+ dialog_clear();
+ msgConfirm("failed to retreive piece file %s!\nAborting the transfer", buf);
goto punt;
}
snprintf(prompt, 80, "Extracting %s into %s directory...", me[i].my_name, me[i].my_dir);
- dialog_gauge(" Progress ", prompt, 8, 15, 6, 50, (int) ((float) (chunk + 1) / numchunks * 100));
+ dialog_gauge("Progress", prompt, 8, 15, 6, 50, (int)((float)(chunk + 1) / numchunks * 100));
while ((n = read(fd, buf, sizeof buf)) > 0) {
retval = write(fd2, buf, n);
- if (retval != n)
- {
+ if (retval != n) {
if (mediaDevice->close)
(*mediaDevice->close)(mediaDevice, fd);
else
@@ -331,10 +383,7 @@ retry:
goto punt;
}
}
- if (mediaDevice->close)
- (*mediaDevice->close)(mediaDevice, fd);
- else
- close(fd);
+ (*mediaDevice->close)(mediaDevice, fd);
}
close(fd2);
status = mediaExtractDistEnd(zpid, cpid);
@@ -347,19 +396,20 @@ retry:
done:
if (!status) {
- if (getenv(NO_CONFIRMATION))
+ if (OptFlags & OPT_NO_CONFIRM)
status = TRUE;
- else
- status = msgYesNo("Unable to transfer the %s distribution from %s.\nDo you want to retry this distribution later?", me[i].my_name, mediaDevice->name);
+ else {
+ if (me[i].my_dist) {
+ msgConfirm("Unable to transfer all components of the %s distribution.\nIf this is a CDROM install, it may be because export restrictions prohibit\nDES code from being shipped from the U.S. Try to get this code from a\nlocal FTP site instead!");
+ status = TRUE;
+ }
+ else
+ status = msgYesNo("Unable to transfer the %s distribution from %s.\nDo you want to try to retrieve it again?", me[i].my_name, mediaDevice->name);
+ }
}
- if (status) {
- /* Extract was successful, remove ourselves from further consideration */
+ /* Extract was successful, remove ourselves from further consideration */
+ if (status)
*(me[i].my_mask) &= ~(me[i].my_bit);
- }
- }
- if (mediaDevice->shutdown && parent == NULL) {
- (*mediaDevice->shutdown)(mediaDevice);
- mediaDevice = NULL;
}
return status;
}
@@ -369,9 +419,18 @@ distExtractAll(void)
{
int retries = 0;
+ /* First try to initialize the state of things */
+ if (!(*mediaDevice->init)(mediaDevice))
+ return;
+
/* Try for 3 times around the loop, then give up. */
while (Dists && ++retries < 3)
distExtract(NULL, DistTable);
+
+ /* Anything left? */
if (Dists)
- msgConfirm("Couldn't extract all of the dists. Residue: %0x", Dists);
+ msgConfirm("Couldn't extract all of the distributions. This may\nbe because the specified distributions are not available from the\ninstallation media you've chosen (residue: %0x)", Dists);
+
+ /* Close up shop and go home */
+ (*mediaDevice->shutdown)(mediaDevice);
}
diff --git a/usr.sbin/sysinstall/dist.h b/usr.sbin/sysinstall/dist.h
index 79f78af..9b4d338 100644
--- a/usr.sbin/sysinstall/dist.h
+++ b/usr.sbin/sysinstall/dist.h
@@ -8,27 +8,28 @@
#define DIST_PROFLIBS 0x0008
#define DIST_DICT 0x0010
#define DIST_SRC 0x0020
-#define DIST_DES 0x0040
+#define DIST_HELP 0x0040 /* Not yet used; reserved */
#define DIST_INFO 0x0080
#define DIST_COMPAT1X 0x0100
#define DIST_COMPAT20 0x0200
#define DIST_XF86 0x0400
#define DIST_COMMERCIAL 0x0800
+#define DIST_DES 0x1000
+#define DIST_EXPERIMENTAL 0x2000
#define DIST_ALL 0x0FFF
/* Canned distribution sets */
#define _DIST_DEVELOPER \
- (DIST_BIN | DIST_MANPAGES | DIST_DICT | DIST_PROFLIBS | DIST_SRC)
-
-#define _DIST_XDEVELOPER \
- (_DIST_DEVELOPER | DIST_XF86)
+ (DIST_BIN | DIST_MANPAGES | DIST_DICT | DIST_PROFLIBS | DIST_INFO | DIST_SRC)
#define _DIST_USER \
(DIST_BIN | DIST_MANPAGES | DIST_DICT | DIST_COMPAT1X | DIST_COMPAT20)
-#define _DIST_XUSER \
- (_DIST_USER | DIST_XF86)
-
+/* Subtypes for DES distribution */
+#define DIST_DES_DES 0x0001
+#define DIST_DES_SEBONES 0x0002
+#define DIST_DES_SSECURE 0x0004
+#define DIST_DES_KERBEROS 0x0008
/* Subtypes for SRC distribution */
#define DIST_SRC_BASE 0x0001
@@ -45,38 +46,41 @@
#define DIST_SRC_SYS 0x0800
#define DIST_SRC_UBIN 0x1000
#define DIST_SRC_USBIN 0x2000
-#define DIST_SRC_XF86 0x4000
-#define DIST_SRC_ALL 0x3FFF /* Don't include XFree86 source by default */
+#define DIST_SRC_ALL 0xFFFF
/* Subtypes for XFree86 distribution */
#define DIST_XF86_BIN 0x0001
-#define DIST_XF86_LIB 0x0004
-#define DIST_XF86_DOC 0x0008
-#define DIST_XF86_MAN 0x0010
-#define DIST_XF86_PROG 0x0020
-#define DIST_XF86_LINK 0x0040
-#define DIST_XF86_PEX 0x0080
-#define DIST_XF86_LBX 0x0100
-#define DIST_XF86_SERVER 0x0200
+#define DIST_XF86_LIB 0x0002
+#define DIST_XF86_DOC 0x0004
+#define DIST_XF86_MAN 0x0008
+#define DIST_XF86_PROG 0x0010
+#define DIST_XF86_LINK 0x0020
+#define DIST_XF86_PEX 0x0040
+#define DIST_XF86_LBX 0x0080
+#define DIST_XF86_XINIT 0x0100
+#define DIST_XF86_XDMCF 0x0200
+#define DIST_XF86_SRC 0x0400
+#define DIST_XF86_SERVER 0x0800
#define DIST_XF86_SERVER_8514 0x0001
#define DIST_XF86_SERVER_AGX 0x0002
-#define DIST_XF86_SERVER_MACH32 0x0004
-#define DIST_XF86_SERVER_MACH8 0x0008
-#define DIST_XF86_SERVER_MONO 0x0010
-#define DIST_XF86_SERVER_P9000 0x0020
-#define DIST_XF86_SERVER_S3 0x0040
-#define DIST_XF86_SERVER_SVGA 0x0080
-#define DIST_XF86_SERVER_VGA16 0x0100
-#define DIST_XF86_SERVER_W32 0x0200
-#define DIST_XF86_SERVER_NEST 0x0400
-#define DIST_XF86_XINIT 0x0400
-#define DIST_XF86_XDMCF 0x0800
+#define DIST_XF86_SERVER_MACH8 0x0004
+#define DIST_XF86_SERVER_MACH32 0x0008
+#define DIST_XF86_SERVER_MACH64 0x0010
+#define DIST_XF86_SERVER_MONO 0x0020
+#define DIST_XF86_SERVER_P9000 0x0040
+#define DIST_XF86_SERVER_S3 0x0080
+#define DIST_XF86_SERVER_SVGA 0x0100
+#define DIST_XF86_SERVER_VGA16 0x0200
+#define DIST_XF86_SERVER_W32 0x0400
+#define DIST_XF86_SERVER_NEST 0x0800
+#define DIST_XF86_SERVER_ALL 0x0FFF
#define DIST_XF86_FONTS 0x1000
#define DIST_XF86_FONTS_MISC 0x0001
#define DIST_XF86_FONTS_100 0x0002
#define DIST_XF86_FONTS_SCALE 0x0004
#define DIST_XF86_FONTS_NON 0x0008
#define DIST_XF86_FONTS_SERVER 0x0010
+#define DIST_XF86_FONTS_ALL 0x00FF
#define DIST_XF86_ALL 0xFFFF
#endif
diff --git a/usr.sbin/sysinstall/dmenu.c b/usr.sbin/sysinstall/dmenu.c
index 636408a..ff059c7 100644
--- a/usr.sbin/sysinstall/dmenu.c
+++ b/usr.sbin/sysinstall/dmenu.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated for what's essentially a complete rewrite.
*
- * $Id: dmenu.c,v 1.10 1995/05/24 17:49:13 jkh Exp $
+ * $Id: dmenu.c,v 1.11.2.11 1995/06/10 19:44:54 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -42,23 +42,66 @@
*/
#include "sysinstall.h"
+#include <sys/types.h>
-#define MAX_MENU 10
-
-static DMenuItem shellAction = { NULL, NULL, DMENU_SHELL_ESCAPE, NULL, 0 };
+#define MAX_MENU 8
/* Traverse menu but give user no control over positioning */
-void
+Boolean
dmenuOpenSimple(DMenu *menu)
{
int choice, scroll, curr, max;
choice = scroll = curr = max = 0;
- dmenuOpen(menu, &choice, &scroll, &curr, &max);
+ return dmenuOpen(menu, &choice, &scroll, &curr, &max);
+}
+
+/* Work functions for the state hook */
+char *
+dmenuFlagCheck(DMenuItem *item)
+{
+ if (*((unsigned int *)item->ptr) & item->parm)
+ return "ON";
+ return "OFF";
+}
+
+char *
+dmenuVarCheck(DMenuItem *item)
+{
+ char *cp, *cp2, tmp[256];
+
+ strncpy(tmp, (char *)item->ptr, 256);
+ if ((cp = index(tmp, '=')) != NULL) {
+ *(cp++) = '\0';
+ cp2 = getenv(tmp);
+ if (cp2)
+ return !strcmp(cp, cp2) ? "ON" : "OFF";
+ else
+ return "OFF";
+ }
+ else
+ return getenv(tmp) ? "ON" : "OFF";
+}
+
+char *
+dmenuRadioCheck(DMenuItem *item)
+{
+ if (*((unsigned int *)item->ptr) == item->parm)
+ return "ON";
+ return "OFF";
+}
+
+static char *
+checkHookVal(DMenuItem *item)
+{
+
+ if (!item->check)
+ return "OFF";
+ return (*item->check)(item);
}
/* Traverse over an internal menu */
-void
+Boolean
dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max)
{
char result[FILENAME_MAX];
@@ -69,21 +112,9 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max)
/* First, construct the menu */
for (tmp = menu->items; tmp->title; tmp++) {
if (!tmp->disabled) {
- char *addme = NULL;
- char *title = tmp->title;
- char *prompt = tmp->prompt;
-
- if (menu->options & (DMENU_RADIO_TYPE | DMENU_MULTIPLE_TYPE)) {
- if (*title == '*') {
- addme = "ON";
- ++title;
- }
- else
- addme = "OFF";
- }
- nitems = item_add_pair(nitems, title, prompt, curr, max);
- if (addme)
- nitems = item_add(nitems, addme, curr, max);
+ nitems = item_add_pair(nitems, tmp->title, tmp->prompt, curr, max);
+ if (menu->options & (DMENU_RADIO_TYPE | DMENU_MULTIPLE_TYPE))
+ nitems = item_add(nitems, checkHookVal(tmp), curr, max);
++n;
}
}
@@ -98,32 +129,16 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max)
/* Pop up that dialog! */
if (menu->options & DMENU_NORMAL_TYPE) {
- rval = dialog_menu((unsigned char *)menu->title,
- (unsigned char *)menu->prompt,
- -1, -1,
- n > MAX_MENU ? MAX_MENU : n,
- n,
- (unsigned char **)nitems,
- (unsigned char *)result,
- choice, scroll);
+ rval = dialog_menu((u_char *)menu->title, (u_char *)menu->prompt, -1, -1,
+ n > MAX_MENU ? MAX_MENU : n, n, (u_char **)nitems, (u_char *)result, choice, scroll);
}
else if (menu->options & DMENU_RADIO_TYPE) {
- rval = dialog_radiolist((unsigned char *)menu->title,
- (unsigned char *)menu->prompt,
- -1, -1,
- n > MAX_MENU ? MAX_MENU : n,
- n,
- (unsigned char **)nitems,
- (unsigned char *)result);
+ rval = dialog_radiolist((u_char *)menu->title, (u_char *)menu->prompt, -1, -1,
+ n > MAX_MENU ? MAX_MENU : n, n, (u_char **)nitems, (u_char *)result);
}
else if (menu->options & DMENU_MULTIPLE_TYPE) {
- rval = dialog_checklist((unsigned char *)menu->title,
- (unsigned char *)menu->prompt,
- -1, -1,
- n > MAX_MENU ? MAX_MENU : n,
- n,
- (unsigned char **)nitems,
- (unsigned char *)result);
+ rval = dialog_checklist((u_char *)menu->title, (u_char *)menu->prompt, -1, -1,
+ n > MAX_MENU ? MAX_MENU : n, n, (u_char **)nitems, (u_char *)result);
}
/* This seems to be the only technique that works for getting the display to look right */
@@ -137,25 +152,22 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max)
if (decode_and_dispatch_multiple(menu, result) ||
menu->options & DMENU_SELECTION_RETURNS) {
items_free(nitems, curr, max);
- return;
+ return TRUE;
}
}
}
else {
if ((tmp = decode(menu, result)) == NULL)
- msgFatal("Menu item `%s' not found??", result);
+ return FALSE;
+ }
+ if (dispatch(tmp, result) || (menu->options & DMENU_SELECTION_RETURNS)) {
+ items_free(nitems, curr, max);
+ return TRUE;
}
}
- else if (rval == -1)
- tmp = &shellAction;
else {
items_free(nitems, curr, max);
- return;
- }
- if (dispatch(tmp, result) ||
- menu->options & DMENU_SELECTION_RETURNS) {
- items_free(nitems, curr, max);
- return;
+ return FALSE;
}
}
}
diff --git a/usr.sbin/sysinstall/dos.c b/usr.sbin/sysinstall/dos.c
index 5bd31f0..52ba28e 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.4 1995/05/29 11:01:11 jkh Exp $
+ * $Id: dos.c,v 1.5.2.4 1995/06/05 16:59:03 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -69,12 +69,13 @@ mediaInitDOS(Device *dev)
if (Mkdir("/dos", NULL))
return FALSE;
- bzero(&args, sizeof(args));
+ memset(&args, 0, sizeof(args));
args.fspec = dev->devname;
args.uid = args.gid = 0;
+ args.mask = 0777;
if (mount(MOUNT_MSDOS, "/dos", MNT_RDONLY, (caddr_t)&args) == -1) {
- msgConfirm("Error mounting %s on /dos: %s (%u)\n", dev, strerror(errno), errno);
+ msgConfirm("Error mounting %s on /dos: %s (%u)\n", args.fspec, strerror(errno), errno);
return FALSE;
}
DOSMounted = TRUE;
@@ -82,13 +83,13 @@ mediaInitDOS(Device *dev)
}
int
-mediaGetDOS(char *file)
+mediaGetDOS(Device *dev, char *file, Attribs *dist_attrs)
{
char buf[PATH_MAX];
snprintf(buf, PATH_MAX, "/dos/freebsd/%s", file);
if (!access(buf, R_OK))
- return open(buf, O_RDONLY);
+ return open(buf, O_RDONLY);
snprintf(buf, PATH_MAX, "/dos/freebsd/dists/%s", file);
return open(buf, O_RDONLY);
}
@@ -99,7 +100,7 @@ mediaShutdownDOS(Device *dev)
if (!DOSMounted)
return;
msgDebug("Unmounting /dos\n");
- if (unmount("/dos", 0) != 0)
+ if (unmount("/dos", MNT_FORCE) != 0)
msgConfirm("Could not unmount the DOS partition: %s\n", strerror(errno));
if (isDebug())
msgDebug("Unmount returned\n");
diff --git a/usr.sbin/sysinstall/floppy.c b/usr.sbin/sysinstall/floppy.c
index bf9265a..cf847de 100644
--- a/usr.sbin/sysinstall/floppy.c
+++ b/usr.sbin/sysinstall/floppy.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: floppy.c,v 1.5 1995/05/29 11:01:13 jkh Exp $
+ * $Id: floppy.c,v 1.6.2.17 1995/06/10 09:14:51 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -61,6 +61,8 @@
static Device *floppyDev;
static Boolean floppyMounted;
+static char *distWanted;
+
/* For finding floppies */
static int
floppyChoiceHook(char *str)
@@ -90,22 +92,27 @@ getRootFloppy(void)
devs = deviceFind(NULL, DEVICE_TYPE_FLOPPY);
cnt = deviceCount(devs);
- if (cnt == 1)
+ if (!cnt) {
+ msgConfirm("No floppy devices found! Something is seriously wrong!");
+ return -1;
+ }
+ else if (cnt == 1) {
floppyDev = devs[0];
- else if (cnt > 1) {
+ msgConfirm("Please insert the ROOT floppy in %s and press [ENTER]", floppyDev->description);
+ }
+ else {
DMenu *menu;
menu = deviceCreateMenu(&MenuMediaFloppy, DEVICE_TYPE_FLOPPY, floppyChoiceHook);
menu->title = "Please insert the ROOT floppy";
- dmenuOpenSimple(menu);
- }
- else {
- msgConfirm("No floppy devices found! Something is seriously wrong!");
- return -1;
+ if (!dmenuOpenSimple(menu))
+ return -1;
}
if (!floppyDev)
continue;
fd = open(floppyDev->devname, O_RDONLY);
+ if (isDebug())
+ msgDebug("getRootFloppy on %s yields fd of %d\n", floppyDev->devname, fd);
}
return fd;
}
@@ -114,42 +121,104 @@ Boolean
mediaInitFloppy(Device *dev)
{
struct msdosfs_args dosargs;
- char mountpoint[FILENAME_MAX];
if (floppyMounted)
return TRUE;
- memset(&dosargs, 0, sizeof dosargs);
if (Mkdir("/mnt", NULL)) {
- msgConfirm("Unable to make directory mountpoint for %s!", mountpoint);
+ msgConfirm("Unable to make directory mountpoint for %s!", dev->devname);
return FALSE;
}
- msgConfirm("Please insert media into %s and press return", dev->description);
- msgDebug("initFloppy: mount floppy %s on /mnt\n", dev->devname);
+ if (!distWanted)
+ msgConfirm("Please insert next floppy into %s", dev->description);
+ else {
+ msgConfirm("Please insert floppy containing %s into %s", distWanted, dev->description);
+ distWanted = NULL;
+ }
+ memset(&dosargs, 0, sizeof dosargs);
dosargs.fspec = dev->devname;
+ dosargs.uid = dosargs.gid = 0;
+ dosargs.mask = 0777;
if (mount(MOUNT_MSDOS, "/mnt", 0, (caddr_t)&dosargs) == -1) {
- msgConfirm("Error mounting floppy %s (%s) on /mnt : %s\n", dev->name,
- dev->devname, mountpoint, strerror(errno));
+ msgConfirm("Error mounting floppy %s (%s) on /mnt : %s", dev->name, dev->devname, strerror(errno));
return FALSE;
}
+ if (isDebug())
+ msgDebug("initFloppy: mounted floppy %s successfully on /mnt\n", dev->devname);
floppyMounted = TRUE;
return TRUE;
}
int
-mediaGetFloppy(char *file)
+mediaGetFloppy(Device *dev, char *file, Attribs *dist_attrs)
{
char buf[PATH_MAX];
+#ifdef DO_CRC_CHECK
+ char *extn, *var;
+ const char *val;
+ char attrib[10];
+ u_long cval1, clen1, cval2, clen2;
+#endif
+ int fd;
+ int nretries = 5;
snprintf(buf, PATH_MAX, "/mnt/%s", file);
- return open(buf, O_RDONLY);
+
+ if (access(buf, R_OK)) {
+ if (dev->flags & OPT_EXPLORATORY_GET)
+ return -1;
+ else {
+ while (access(buf, R_OK) != 0) {
+ if (!--nretries) {
+ msgConfirm("GetFloppy: Failed to get %s after retries;\ngiving up.", file);
+ return -1;
+ }
+ distWanted = buf;
+ (*dev->shutdown)(dev);
+ if (!(dev->init)(dev))
+ return -1;
+ }
+ }
+ }
+
+ fd = open(buf, O_RDONLY);
+#ifdef DO_CRC_CHECK
+ if (dist_attrs != NULL && fd != -1) {
+ extn = rindex(buf, '.');
+ snprintf(attrib, 10, "cksum%s", extn);
+ val = attr_match(dist_attrs, attrib);
+ if (val != NULL) {
+ if (isDebug())
+ msgDebug("attr_match(%s,%s) returned `%s'\n", dist_attrs, attrib, val);
+ var = strdup(val);
+
+ cval1 = strtol(var, &extn, 10);
+ clen1 = strtol(extn, NULL, 10);
+
+ if (crc(fd, &cval2, &clen2) != 0) {
+ msgConfirm("crc() of file `%s' failed!", file);
+ close(fd);
+ return -1;
+ }
+ if ((cval1 != cval2) || (clen1 != clen2)) {
+ msgConfirm("Invalid file `%s' (checksum `%u %u' should be %s)", file, cval2, clen2, var);
+ close(fd);
+ return -1;
+ }
+ lseek(fd, 0, 0);
+ }
+ else
+ msgNotify("No checksum information for file %s..", file);
+ }
+#endif
+ return fd;
}
void
mediaShutdownFloppy(Device *dev)
{
if (floppyMounted) {
- if (unmount("/mnt", 0) != 0)
+ if (unmount("/mnt", MNT_FORCE) != 0)
msgDebug("Umount of floppy on /mnt failed: %s (%d)\n", strerror(errno), errno);
else {
floppyMounted = FALSE;
diff --git a/usr.sbin/sysinstall/ftp.c b/usr.sbin/sysinstall/ftp.c
index 99e064f..59ffb6f 100644
--- a/usr.sbin/sysinstall/ftp.c
+++ b/usr.sbin/sysinstall/ftp.c
@@ -6,8 +6,12 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: ftp.c,v 1.12 1995/05/29 11:01:16 jkh Exp $
+ * $Id: ftp.c,v 1.13.2.9 1995/06/05 18:34:15 jkh Exp $
*
+ * Return values have been sanitized:
+ * -1 error, but you (still) have a session.
+ * -2 error, your session is dead.
+ *
*/
#include <stdlib.h>
@@ -27,6 +31,9 @@
#include <netinet/in.h>
#include <arpa/inet.h>
+/* Handy global for us to stick the port # */
+int FtpPort;
+
#ifndef STANDALONE_FTP
#include "sysinstall.h"
#endif /*STANDALONE_FTP*/
@@ -39,17 +46,14 @@ debug(FTP_t ftp, const char *fmt, ...)
va_start(ap, fmt);
#ifdef STANDALONE_FTP
strcpy(p,"LIBFTP: ");
-#else
- *p = '\0';
-#endif
(void) vsnprintf(p+strlen(p), sizeof p - strlen(p), fmt, ap);
va_end(ap);
-
-#ifdef STANDALONE_FTP
write(ftp->fd_debug,p,strlen(p));
#else
- if (isDebug())
+ if (isDebug()) {
+ (void) vsnprintf(p, sizeof p - strlen(p), fmt, ap);
msgDebug(p);
+ }
#endif
}
@@ -58,11 +62,11 @@ writes(int fd, char *s)
{
int i = strlen(s);
if (i != write(fd,s,i))
- return errno ? errno : -1;
+ return -2;
return 0;
}
-static char*
+static __inline char*
get_a_line(FTP_t ftp)
{
static char buf[BUFSIZ];
@@ -92,15 +96,17 @@ get_a_number(FTP_t ftp, char **q)
while(1) {
p = get_a_line(ftp);
+ if (!p)
+ return -2;
if (!(isdigit(p[0]) && isdigit(p[1]) && isdigit(p[2])))
continue;
if (i == -1 && p[3] == '-') {
- i = atoi(p);
+ i = strtol(p, 0, 0);
continue;
}
if (p[3] != ' ' && p[3] != '\t')
continue;
- j = atoi(p);
+ j = strtol(p, 0, 0);
if (i == -1) {
if (q) *q = p+4;
return j;
@@ -112,14 +118,24 @@ get_a_number(FTP_t ftp, char **q)
}
static int
-botch(FTP_t ftp, char *func, char *state)
+zap(FTP_t ftp)
{
- debug(ftp, "Botch: %s called outside state %s\n",func,state);
- writes(ftp->fd_ctrl,"QUIT\r\n");
+ int i;
+
+ i = writes(ftp->fd_ctrl,"QUIT\r\n");
+ if (isDebug())
+ msgDebug("Zapping ftp connection on %d returns %d\n", ftp->fd_ctrl, i);
close(ftp->fd_ctrl); ftp->fd_ctrl = -1;
close(ftp->fd_xfer); ftp->fd_xfer = -1;
ftp->state = init;
- return -1;
+ return -2;
+}
+
+static int
+botch(FTP_t ftp, char *func, char *state)
+{
+ debug(ftp, "Botch: %s called outside state %s\n",func,state);
+ return -2;
}
static int
@@ -136,7 +152,7 @@ cmd(FTP_t ftp, const char *fmt, ...)
debug(ftp, "send <%s>\n",p);
strcat(p,"\r\n");
if (writes(ftp->fd_ctrl,p))
- return -1;
+ return -2;
i = get_a_number(ftp,0);
return i;
}
@@ -170,9 +186,9 @@ FtpOpen(FTP_t ftp, char *host, char *user, char *passwd)
{
struct hostent *he = NULL;
struct sockaddr_in sin;
- int s;
- unsigned long temp;
- int i;
+ int s;
+ unsigned long temp;
+ int i;
if (ftp->state != init)
return botch(ftp,"FtpOpen","init");
@@ -186,35 +202,34 @@ FtpOpen(FTP_t ftp, char *host, char *user, char *passwd)
debug(ftp, "FtpOpen(ftp, %s, %s, %s)\n", host, user, passwd);
temp = inet_addr(host);
- if (temp != INADDR_NONE)
- {
+ if (temp != INADDR_NONE) {
debug(ftp, "Using dotted IP address `%s'\n", host);
ftp->addrtype = sin.sin_family = AF_INET;
sin.sin_addr.s_addr = temp;
- } else {
+ }
+ else {
debug(ftp, "Trying to resolve `%s'\n", host);
he = gethostbyname(host);
- if (!he)
- {
+ if (!he) {
debug(ftp, "Lookup of `%s' failed!\n", host);
- return ENOENT;
+ return zap(ftp);
}
ftp->addrtype = sin.sin_family = he->h_addrtype;
bcopy(he->h_addr, (char *)&sin.sin_addr, he->h_length);
}
- sin.sin_port = htons(21);
+ sin.sin_port = htons(FtpPort ? FtpPort : 21);
if ((s = socket(ftp->addrtype, SOCK_STREAM, 0)) < 0)
{
debug(ftp, "Socket open failed: %s (%i)\n", strerror(errno), errno);
- return s;
+ return zap(ftp);
}
if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
debug(ftp,"Connection failed: %s (%i)\n", strerror(errno), errno);
(void)close(s);
- return -1;
+ return zap(ftp);
}
ftp->fd_ctrl = s;
@@ -224,30 +239,25 @@ FtpOpen(FTP_t ftp, char *host, char *user, char *passwd)
i = cmd(ftp,"USER %s",user);
if (i >= 300 && i < 400)
i = cmd(ftp,"PASS %s",passwd);
- if (i >= 299)
- return -1;
+ if (i >= 299 || i < 0) {
+ close(ftp->fd_ctrl); ftp->fd_ctrl = -1;
+ return zap(ftp);
+ }
ftp->state = isopen;
return 0;
-
-#if 0
-fail:
- close(ftp->fd_ctrl);
- ftp->fd_ctrl = -1;
- return -1;
-#endif
}
void
FtpClose(FTP_t ftp)
{
+ if (ftp->state != init)
+ return;
+
if (ftp->state != isopen)
- botch(ftp,"FtpClose","open");
+ botch(ftp,"FtpClose","open or init");
debug(ftp, "FtpClose(ftp)\n");
- writes(ftp->fd_ctrl,"QUIT\r\n");
- close(ftp->fd_ctrl); ftp->fd_ctrl = -1;
- close(ftp->fd_xfer); ftp->fd_xfer = -1;
- ftp->state = init;
+ zap(ftp);
}
int
@@ -257,6 +267,10 @@ FtpChdir(FTP_t ftp, char *dir)
if (ftp->state != isopen)
return botch(ftp,"FtpChdir","open");
i = cmd(ftp,"CWD %s",dir);
+ if (i < 0)
+ return i;
+ else if (i != 250)
+ return -1;
return 0;
}
@@ -265,30 +279,39 @@ FtpGet(FTP_t ftp, char *file)
{
int i,s;
char *q;
- unsigned char addr[6];
+ unsigned char addr[64];
struct sockaddr_in sin;
+ u_long a;
debug(ftp, "FtpGet(ftp,%s)\n",file);
if (ftp->state != isopen)
return botch(ftp,"FtpGet","open");
if(ftp->binary) {
i = cmd(ftp,"TYPE I");
+ if (i < 0)
+ return zap(ftp);
if (i > 299)
return -1;
} else {
return -1;
}
+
+ if ((s = socket(ftp->addrtype, SOCK_STREAM, 0)) < 0)
+ return zap(ftp);
+
if (ftp->passive) {
debug(ftp, "send <%s>\n","PASV");
if (writes(ftp->fd_ctrl,"PASV\r\n"))
- return -1;
+ return zap(ftp);
i = get_a_number(ftp,&q);
+ if (i < 0)
+ return zap(ftp);
if (i != 227)
- return -1;
+ return zap(ftp);
while (*q && !isdigit(*q))
q++;
if (!*q)
- return -1;
+ return zap(ftp);
q--;
for(i=0;i<6;i++) {
q++;
@@ -300,42 +323,96 @@ FtpGet(FTP_t ftp, char *file)
bcopy(addr+4, (char *)&sin.sin_port, 2);
debug(ftp, "Opening active socket to %s : %u\n", inet_ntoa(sin.sin_addr), htons(sin.sin_port));
- if ((s = socket(ftp->addrtype, SOCK_STREAM, 0)) < 0)
- return -1;
-
debug(ftp, "Connecting to %s:%u\n", inet_ntoa(sin.sin_addr), htons(sin.sin_port));
if (connect(s, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
(void)close(s);
debug(ftp, "connect: %s (%d)\n", strerror(errno), errno);
return -1;
}
-
+ ftp->fd_xfer = s;
i = cmd(ftp,"RETR %s",file);
- if (i > 299)
+ if (i < 0) {
+ close(s);
+ return zap(ftp);
+ }
+ else if (i > 299) {
+ if (isDebug())
+ msgDebug("FTP: No such file %s, moving on.\n", file);
+ close(s);
return -1;
+ }
ftp->state = xfer;
- ftp->fd_xfer = s;
return s;
} else {
- return -1;
+ i = sizeof sin;
+ getsockname(ftp->fd_ctrl,(struct sockaddr *)&sin,&i);
+ sin.sin_port = 0;
+ i = sizeof sin;
+ if (bind(s,(struct sockaddr *)&sin, i) < 0) {
+ close (s);
+ debug(ftp,"bind failed %d\n",errno);
+ return zap(ftp);
+ }
+ getsockname(s,(struct sockaddr *)&sin,&i);
+ if (listen(s,1) < 0) {
+ close (s);
+ debug(ftp,"listen failed %d\n",errno);
+ return zap(ftp);
+ }
+ a = ntohl(sin.sin_addr.s_addr);
+ i = cmd(ftp,"PORT %d,%d,%d,%d,%d,%d",
+ (a >> 24) & 0xff,
+ (a >> 16) & 0xff,
+ (a >> 8) & 0xff,
+ a & 0xff,
+ (ntohs(sin.sin_port) >> 8) & 0xff,
+ ntohs(sin.sin_port) & 0xff);
+ if (i != 200)
+ return -1;
+ i = cmd(ftp,"RETR %s",file);
+ if (i < 0) {
+ close(s);
+ return zap(ftp);
+ }
+ else if (i > 299) {
+ if (isDebug())
+ msgDebug("FTP: No such file %s, moving on.\n", file);
+ close(s);
+ return -1;
+ }
+ ftp->fd_xfer = accept(s, 0, 0);
+ if (ftp->fd_xfer < 0) {
+ close(s);
+ return zap(ftp);
+ }
+ ftp->state = xfer;
+ close(s);
+ return(ftp->fd_xfer);
}
}
int
FtpEOF(FTP_t ftp)
{
+ int i;
+
if (ftp->state != xfer)
return botch(ftp,"FtpEOF","xfer");
debug(ftp, "FtpEOF(ftp)\n");
close(ftp->fd_xfer); ftp->fd_xfer = -1;
ftp->state = isopen;
- return get_a_number(ftp,0);
+ i = get_a_number(ftp,0);
+ if (i < 0)
+ return zap(ftp);
+ else if (i != 250 && i != 226)
+ return -1;
+ else
+ return 0;
}
#ifdef STANDALONE_FTP
/* main.c */
-
int
main(int argc, char **argv)
{
@@ -344,27 +421,17 @@ main(int argc, char **argv)
char c;
ftp = FtpInit();
- if (!ftp) err(1,"FtpInit()");
-
- FtpDebug(ftp,1);
- i = FtpOpen(ftp, "ref.tfs.com", "ftp", "phk-libftp@");
- if (i) err(1,"FtpOpen(%d)",i);
- FtpBinary(ftp,1);
- FtpPassive(ftp,1);
- FtpChdir(ftp,"/");
- FtpChdir(ftp,"CTM");
- i = FtpGet(ftp,"README");
- while(1 == read(i,&c,1))
- putchar(c);
- FtpEOF(ftp);
- FtpClose(ftp);
+ if (!ftp)
+ err(1, "FtpInit()");
+
+ FtpDebug(ftp, 1);
i = FtpOpen(ftp, "freefall.cdrom.com", "ftp", "phk-libftp@");
- FtpBinary(ftp,1);
- FtpPassive(ftp,1);
- FtpChdir(ftp,"/pub");
- FtpChdir(ftp,"FreeBSD");
- i = FtpGet(ftp,"README");
- while(1 == read(i,&c,1))
+ FtpBinary(ftp, 1);
+ FtpPassive(ftp, 0);
+ FtpChdir(ftp, "/pub");
+ FtpChdir(ftp, "FreeBSD");
+ i = FtpGet(ftp, "README");
+ while (1 == read(i, &c, 1))
putchar(c);
FtpEOF(ftp);
return 0;
diff --git a/usr.sbin/sysinstall/globals.c b/usr.sbin/sysinstall/globals.c
index a2ccbce..2041024 100644
--- a/usr.sbin/sysinstall/globals.c
+++ b/usr.sbin/sysinstall/globals.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: globals.c,v 1.8 1995/05/25 18:48:25 jkh Exp $
+ * $Id: globals.c,v 1.9.2.2 1995/06/05 03:15:38 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -48,16 +48,16 @@
* whatever values we feel are appropriate.
*/
-int RootFD; /* The file descriptor for our ROOT floppy */
int DebugFD; /* Where diagnostic output goes */
-Boolean OnCDROM; /* Are we running off of a CDROM? */
-Boolean OnSerial; /* Are we on a serial console? */
Boolean RunningAsInit; /* Are we running as init? */
Boolean DialogActive;
Boolean ColorDisplay;
Boolean OnVTY;
Variable *VarHead; /* The head of the variable chain */
Device *mediaDevice; /* Where we're installing from */
+unsigned int OptFlags; /* Option flags */
+int BootMgr;
+char *InstallPrefix; /* Always install under here */
/*
* Yes, I know some of these are already automatically initialized as
@@ -66,14 +66,13 @@ Device *mediaDevice; /* Where we're installing from */
void
globalsInit(void)
{
- RootFD = -1;
DebugFD = -1;
- OnCDROM = FALSE;
- OnSerial = FALSE;
ColorDisplay = FALSE;
OnVTY = FALSE;
DialogActive = FALSE;
VarHead = NULL;
mediaDevice = NULL;
RunningAsInit = FALSE;
+ OptFlags = 0;
+ InstallPrefix = NULL;
}
diff --git a/usr.sbin/sysinstall/install.c b/usr.sbin/sysinstall/install.c
index 48f75f1..d69984d 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.69 1995/05/30 05:50:53 jkh Exp $
+ * $Id: install.c,v 1.70.2.41 1995/06/10 07:58:37 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -49,11 +49,11 @@
#include <sys/wait.h>
#include <unistd.h>
-Boolean SystemWasInstalled;
+Boolean SystemWasInstalled = FALSE;
-static void make_filesystems(void);
-static void copy_self(void);
-static void root_extract(void);
+static Boolean make_filesystems(void);
+static Boolean copy_self(void);
+static Boolean root_extract(void);
static Chunk *rootdev;
@@ -62,9 +62,10 @@ checkLabels(void)
{
Device **devs;
Disk *disk;
- Chunk *c1, *c2, *swapdev = NULL;
+ Chunk *c1, *c2, *swapdev, *usrdev;
int i;
+ rootdev = swapdev = usrdev = NULL;
devs = deviceFind(NULL, DEVICE_TYPE_DISK);
/* First verify that we have a root device */
for (i = 0; devs[i]; i++) {
@@ -77,9 +78,21 @@ checkLabels(void)
for (c1 = disk->chunks->part; c1; c1 = c1->next) {
if (c1->type == freebsd) {
for (c2 = c1->part; c2; c2 = c2->next) {
- if (c2->type == part && c2->subtype != FS_SWAP && c2->private && c2->flags & CHUNK_IS_ROOT) {
- rootdev = c2;
- break;
+ if (c2->type == part && c2->subtype != FS_SWAP && c2->private) {
+ if (c2->flags & CHUNK_IS_ROOT) {
+ if (rootdev) {
+ msgConfirm("WARNING: You have more than one root device set?!\nUsing the first one found.");
+ continue;
+ }
+ rootdev = c2;
+ }
+ else if (!strcmp(((PartInfo *)c2->private)->mountpoint, "/usr")) {
+ if (usrdev) {
+ msgConfirm("WARNING: You have more than one /usr filesystem.\nUsing the first one found.");
+ continue;
+ }
+ usrdev = c2;
+ }
}
}
}
@@ -116,6 +129,8 @@ checkLabels(void)
msgConfirm("No swap devices found - you must create at least one\nswap partition.");
return FALSE;
}
+ if (!usrdev)
+ msgConfirm("WARNING: No /usr filesystem found. This is not technically\nan error if your root filesystem is big enough (or you later\nintend to get your /usr filesystem over NFS), but it may otherwise\ncause you trouble and is not recommended procedure!");
return TRUE;
}
@@ -128,7 +143,6 @@ installInitial(void)
Device **devs;
int i;
static Boolean alreadyDone = FALSE;
- char *cp;
if (alreadyDone)
return TRUE;
@@ -145,14 +159,21 @@ installInitial(void)
return FALSE;
/* Figure out what kind of MBR the user wants */
- dmenuOpenSimple(&MenuMBRType);
- mbrContents = NULL;
- cp = getenv("bootManager");
- if (cp) {
- if (!strcmp(cp, "bteasy"))
- mbrContents = bteasy17;
- else if (!strcmp(cp, "mbr"))
- mbrContents = mbr;
+ if (!dmenuOpenSimple(&MenuMBRType))
+ return FALSE;
+
+ switch (BootMgr) {
+ case 0:
+ mbrContents = bteasy17;
+ break;
+
+ case 1:
+ mbrContents = mbr;
+ break;
+
+ case 2:
+ default:
+ mbrContents = NULL;
}
/* If we refuse to proceed, bail. */
@@ -190,32 +211,38 @@ installInitial(void)
}
}
}
- make_filesystems();
- copy_self();
+ if (!make_filesystems()) {
+ msgConfirm("Couldn't make filesystems properly. Aborting.");
+ return 0;
+ }
+ if (!copy_self()) {
+ msgConfirm("Couldn't clone the boot floppy onto the root file system.\nAborting.");
+ return 0;
+ }
dialog_clear();
chroot("/mnt");
chdir("/");
variable_set2(RUNNING_ON_ROOT, "yes");
/* stick a helpful shell over on the 4th VTY */
- msgDebug("Sticking a potentially helpful shell over on the 4th screen\n");
- if (!fork()) {
+ if (OnVTY && !fork()) {
int i, fd;
extern int login_tty(int);
+ msgDebug("Starting an emergency holographic shell over on the 4th screen\n");
for (i = 0; i < 64; i++)
close(i);
fd = open("/dev/ttyv3", O_RDWR);
ioctl(0, TIOCSCTTY, &fd);
dup2(0, 1);
dup2(0, 2);
- if (login_tty(fd)==-1) {
- msgConfirm("Can't set controlling terminal");
+ if (login_tty(fd) == -1) {
+ msgNotify("Can't set controlling terminal");
exit(1);
}
+ printf("Warning: This shell is chroot()'d to /mnt\n");
execlp("sh", "-sh", 0);
exit(1);
}
- root_extract();
alreadyDone = TRUE;
return TRUE;
}
@@ -229,8 +256,8 @@ installInitial(void)
int
installCommit(char *str)
{
- FILE *fp;
- static Boolean hostsModified = FALSE;
+ Device **devs;
+ int i;
if (!Dists) {
msgConfirm("You haven't told me what distributions to load yet!\nPlease select a distribution from the Distributions menu.");
@@ -239,32 +266,75 @@ installCommit(char *str)
if (!mediaVerify())
return 0;
- if (RunningAsInit) {
+ if (RunningAsInit && !SystemWasInstalled) {
if (!installInitial())
return 0;
configFstab();
- configResolv();
}
+ if (!SystemWasInstalled && !root_extract()) {
+ msgConfirm("Failed to load the ROOT distribution. Please correct\nthis problem and try again.");
+ return 0;
+ }
+
+ /* If we're about to extract the bin dist again, reset the installed state */
+ if (Dists & DIST_BIN)
+ SystemWasInstalled = FALSE;
+
distExtractAll();
- /* Tack ourselves at the end of /etc/hosts */
- if (RunningAsInit && getenv(VAR_IPADDR) && !hostsModified) {
- fp = fopen("/etc/hosts", "a");
- fprintf(fp, "%s\t\t%s\n", getenv(VAR_IPADDR), getenv(VAR_HOSTNAME));
- fclose(fp);
- hostsModified = TRUE;
+ if (!SystemWasInstalled && access("/kernel", R_OK)) {
+ if (vsystem("ln -f /kernel.GENERIC /kernel")) {
+ msgConfirm("Unable to link /kernel into place!");
+ return 0;
+ }
}
- /* If there's no kernel but there is a kernel.GENERIC, link it over */
- if (access("/kernel", R_OK))
- vsystem("ln -f /kernel.GENERIC /kernel");
- msgConfirm("Installation completed successfully.\nHit return now to go back to the main menu.");
+ /* Resurrect /dev after bin distribution screws it up */
+ if (!SystemWasInstalled) {
+ msgNotify("Remaking all devices.. Please wait!");
+ if (vsystem("cd /dev; sh MAKEDEV all"))
+ msgConfirm("MAKEDEV returned non-zero status");
+
+ msgNotify("Resurrecting /dev entries for slices..");
+ devs = deviceFind(NULL, DEVICE_TYPE_DISK);
+ if (!devs)
+ msgFatal("Couldn't get a disk device list!");
+ /* Resurrect the slices that the former clobbered */
+ for (i = 0; devs[i]; i++) {
+ Disk *disk = (Disk *)devs[i]->private;
+ Chunk *c1;
+
+ if (!disk->chunks)
+ msgFatal("No chunk list found for %s!", disk->name);
+ for (c1 = disk->chunks->part; c1; c1 = c1->next) {
+ if (c1->type == freebsd) {
+ msgNotify("Making slice entries for %s", c1->name);
+ if (vsystem("cd /dev; sh MAKEDEV %sh", c1->name))
+ msgConfirm("Unable to make slice entries for %s!", c1->name);
+ }
+ }
+ }
+ }
+
+ /* XXX Do all the last ugly work-arounds here which we'll try and excise someday right?? XXX */
+ /* BOGON #1: XFree86 extracting /usr/X11R6 with root-only perms */
+ if (file_readable("/usr/X11R6"))
+ (void)system("chmod 755 /usr/X11R6");
+
+ /* BOGON #2: We leave /etc in a bad state */
+ (void)system("chmod 755 /etc");
+
+ dialog_clear();
+ if (Dists)
+ msgConfirm("Installation completed with some errors. You may wish\nto scroll through the debugging messages on ALT-F2 with the scroll-lock\nfeature. Press [ENTER] to return to the installation menu.");
+ else
+ msgConfirm("Installation completed successfully, now press [ENTER] to return\nto the main menu. If you have any network devices you have not yet\nconfigured, see the Interface configuration item on the\nConfiguration menu.");
SystemWasInstalled = TRUE;
return 0;
}
/* Go newfs and/or mount all the filesystems we've been asked to */
-static void
+static Boolean
make_filesystems(void)
{
int i;
@@ -273,6 +343,7 @@ make_filesystems(void)
Device **devs;
char dname[40];
PartInfo *p = (PartInfo *)rootdev->private;
+ Boolean RootReadOnly;
command_clear();
devs = deviceFind(NULL, DEVICE_TYPE_DISK);
@@ -289,10 +360,12 @@ make_filesystems(void)
i = vsystem("%s %s", p->newfs_cmd, dname);
if (i) {
msgConfirm("Unable to make new root filesystem! Command returned status %d", i);
- return;
+ return FALSE;
}
+ RootReadOnly = FALSE;
}
else {
+ RootReadOnly = TRUE;
msgConfirm("Warning: You have selected a Read-Only root device\nand may be unable to find the appropriate device entries on it\nif it is from an older pre-slice version of FreeBSD.");
sprintf(dname, "/dev/r%sa", rootdev->disk->name);
msgNotify("Checking integrity of existing %s filesystem", dname);
@@ -303,19 +376,7 @@ make_filesystems(void)
sprintf(dname, "/dev/%sa", rootdev->disk->name);
if (Mount("/mnt", dname)) {
msgConfirm("Unable to mount the root file system! Giving up.");
- return;
- }
- else {
- extern int makedevs(void);
-
- msgNotify("Making device files");
- if (Mkdir("/mnt/dev", NULL) || chdir("/mnt/dev") || makedevs())
- msgConfirm("Failed to make some of the devices in /mnt!");
- if (Mkdir("/mnt/stand", NULL)) {
- msgConfirm("Unable to make /mnt/stand directory!");
- return;
- }
- chdir("/");
+ return FALSE;
}
/* Now buzz through the rest of the partitions and mount them too */
@@ -324,12 +385,16 @@ make_filesystems(void)
continue;
disk = (Disk *)devs[i]->private;
- if (!disk->chunks)
- msgFatal("No chunk list found for %s!", disk->name);
+ if (!disk->chunks) {
+ msgConfirm("No chunk list found for %s!", disk->name);
+ return FALSE;
+ }
/* Make the proper device mount points in /mnt/dev */
- MakeDevDisk(disk, "/mnt/dev");
-
+ if (!(RootReadOnly && disk == rootdev->disk)) {
+ Mkdir("/mnt/dev", NULL);
+ MakeDevDisk(disk, "/mnt/dev");
+ }
for (c1 = disk->chunks->part; c1; c1 = c1->next) {
if (c1->type == freebsd) {
for (c2 = c1->part; c2; c2 = c2->next) {
@@ -358,90 +423,103 @@ make_filesystems(void)
}
}
}
- else if (c1->type == fat) {
- PartInfo *tmp = (PartInfo *)c1->private;
+ else if (c1->type == fat && c1->private && !RootReadOnly) {
+ char name[FILENAME_MAX];
- if (!tmp)
- continue;
- command_func_add(tmp->mountpoint, Mount_DOS, c1->name);
+ sprintf(name, "/mnt%s", ((PartInfo *)c1->private)->mountpoint);
+ Mkdir(name, NULL);
}
}
}
+
+ /* Copy the boot floppy's dev files */
+ if (vsystem("find -x /dev | cpio -pdmV /mnt")) {
+ msgConfirm("Couldn't clone the /dev files!");
+ return FALSE;
+ }
+
command_sort();
command_execute();
+ return TRUE;
}
/* Copy the boot floppy contents into /stand */
-static void
+static Boolean
copy_self(void)
{
int i;
msgWeHaveOutput("Copying the boot floppy to /stand on root filesystem");
i = vsystem("find -x /stand | cpio -pdmV /mnt");
- if (i)
+ if (i) {
msgConfirm("Copy returned error status of %d!", i);
+ return FALSE;
+ }
/* Copy the /etc files into their rightful place */
- (void)vsystem("cd /mnt/stand; find etc | cpio -pdmv /mnt");
+ if (vsystem("cd /mnt/stand; find etc | cpio -pdmV /mnt")) {
+ msgConfirm("Couldn't copy up the /etc files!");
+ return TRUE;
+ }
+ return TRUE;
}
-static void loop_on_root_floppy();
+static Boolean loop_on_root_floppy(void);
-static void
+static Boolean
root_extract(void)
{
int fd;
+ static Boolean alreadyExtracted = FALSE;
+
+ if (alreadyExtracted)
+ return TRUE;
- if (OnCDROM) {
- fd = open("/floppies/root.flp", O_RDONLY);
- (void)mediaExtractDist("/", fd);
- return;
- }
if (mediaDevice) {
+ if (isDebug())
+ msgDebug("Attempting to extract root image from %s device\n", mediaDevice->description);
switch(mediaDevice->type) {
- case DEVICE_TYPE_TAPE:
case DEVICE_TYPE_FLOPPY:
- loop_on_root_floppy();
+ alreadyExtracted = loop_on_root_floppy();
break;
default:
- if (mediaDevice->init)
- if (!(*mediaDevice->init)(mediaDevice))
- break;
- fd = (*mediaDevice->get)("floppies/root.flp");
- if (fd != -1) {
- msgNotify("Loading root floppy from %s", mediaDevice->name);
- (void)mediaExtractDist("/", fd);
- if (mediaDevice->close)
- (*mediaDevice->close)(mediaDevice, fd);
- else
- close(fd);
+ if (!(*mediaDevice->init)(mediaDevice))
+ break;
+ fd = (*mediaDevice->get)(mediaDevice, "floppies/root.flp", NULL);
+ if (fd < 0) {
+ msgConfirm("Couldn't get root image from %s!\nWill try to get it from floppy.", mediaDevice->name);
+ (*mediaDevice->shutdown)(mediaDevice);
+ alreadyExtracted = loop_on_root_floppy();
}
else {
- msgConfirm("Couldn't get root floppy image from %s\n, falling back to floppy.", mediaDevice->name);
- if (mediaDevice->shutdown)
- (*mediaDevice->shutdown)(mediaDevice);
- loop_on_root_floppy();
+ msgNotify("Loading root image from %s", mediaDevice->name);
+ alreadyExtracted = mediaExtractDist("/", fd);
+ (*mediaDevice->close)(mediaDevice, fd);
}
break;
}
}
else
- loop_on_root_floppy();
+ alreadyExtracted = loop_on_root_floppy();
+ return alreadyExtracted;
}
-static void
+static Boolean
loop_on_root_floppy(void)
{
int fd;
+ int status = FALSE;
while (1) {
fd = getRootFloppy();
if (fd != -1) {
- mediaExtractDist("/", fd);
+ msgNotify("Extracting root floppy..");
+ status = mediaExtractDist("/", fd);
+ close(fd);
break;
}
}
+ return status;
}
diff --git a/usr.sbin/sysinstall/label.c b/usr.sbin/sysinstall/label.c
index e4533734..20d7a3a 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.30 1995/05/29 00:50:03 jkh Exp $
+ * $Id: label.c,v 1.31.2.4 1995/06/07 06:38:11 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -171,7 +171,10 @@ static PartInfo *
new_part(char *mpoint, Boolean newfs, u_long size)
{
PartInfo *ret;
- u_long target,divisor;
+ u_long target, divisor;
+
+ if (!mpoint)
+ mpoint = "/change_me";
ret = (PartInfo *)safe_malloc(sizeof(PartInfo));
strncpy(ret->mountpoint, mpoint, FILENAME_MAX);
@@ -382,8 +385,8 @@ static void
print_command_summary()
{
mvprintw(17, 0, "The following commands are valid here (upper or lower case):");
- mvprintw(19, 0, "C = Create New D = Delete M = Set Mountpoint");
- mvprintw(20, 0, "N = Newfs Options T = Toggle Newfs U = Undo ESC = Exit");
+ mvprintw(19, 0, "C = Create New D = Delete M = Set Mountpoint");
+ mvprintw(20, 0, "N = Newfs Options T = Toggle Newfs U = Undo Q = Finish");
mvprintw(21, 0, "The default target will be displayed in ");
attrset(A_REVERSE);
@@ -400,7 +403,7 @@ diskLabelEditor(char *str)
int sz, i, key = 0;
Boolean labeling;
char *msg = NULL;
- PartInfo *p;
+ PartInfo *p, *oldp;
PartType type;
Device **devs;
@@ -459,7 +462,7 @@ diskLabelEditor(char *str)
case KEY_F(1):
case '?':
- systemDisplayFile("disklabel.hlp");
+ systemDisplayFile("partition.hlp");
break;
case 'C':
@@ -580,9 +583,11 @@ diskLabelEditor(char *str)
case PART_FAT:
case PART_FILESYSTEM:
+ oldp = label_chunk_info[here].c->private;
p = get_mountpoint(label_chunk_info[here].c);
if (p) {
- p->newfs = FALSE;
+ if (!oldp)
+ p->newfs = FALSE;
if (label_chunk_info[here].type == PART_FAT
&& (!strcmp(p->mountpoint, "/") || !strcmp(p->mountpoint, "/usr")
|| !strcmp(p->mountpoint, "/var"))) {
@@ -608,10 +613,9 @@ diskLabelEditor(char *str)
break;
case 'T': /* Toggle newfs state */
- if (label_chunk_info[here].type == PART_FILESYSTEM &&
- label_chunk_info[here].c->private) {
+ if (label_chunk_info[here].type == PART_FILESYSTEM) {
PartInfo *pi = ((PartInfo *)label_chunk_info[here].c->private);
- label_chunk_info[here].c->private = new_part(pi->mountpoint, !pi->newfs, label_chunk_info[here].c->size);
+ label_chunk_info[here].c->private = new_part(pi ? pi->mountpoint : NULL, pi ? !pi->newfs : TRUE, label_chunk_info[here].c->size);
safe_free(pi);
label_chunk_info[here].c->private_free = safe_free;
}
@@ -659,7 +663,7 @@ diskLabelEditor(char *str)
msg = "A most prudent choice!";
break;
- case 27: /* ESC */
+ case 'Q':
labeling = FALSE;
break;
diff --git a/usr.sbin/sysinstall/main.c b/usr.sbin/sysinstall/main.c
index 649f1ad..9b648fc 100644
--- a/usr.sbin/sysinstall/main.c
+++ b/usr.sbin/sysinstall/main.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: main.c,v 1.11 1995/05/28 09:31:35 jkh Exp $
+ * $Id: main.c,v 1.12.2.4 1995/06/05 15:17:12 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -42,6 +42,7 @@
*/
#include "sysinstall.h"
+#include <stdio.h>
int
main(int argc, char **argv)
@@ -55,17 +56,19 @@ main(int argc, char **argv)
/* Set up whatever things need setting up */
systemInitialize(argc, argv);
+ /* Try to preserve our scroll-back buffer */
+ if (OnVTY)
+ for (curr = 0; curr < 25; curr++)
+ putchar('\n');
+
/* Probe for all relevant devices on the system */
deviceGetAll();
- /* Welcome user to FreeBSD */
- systemWelcome();
-
/* Default to English */
lang_set_English(NULL);
/* Default to passive mode ftp since it's the only thing we currently support :-( */
- variable_set2("ftpPassive", "yes");
+ OptFlags |= OPT_FTP_PASSIVE;
/* Begin user dialog at outer menu */
while (1) {
@@ -76,7 +79,8 @@ main(int argc, char **argv)
}
/* Write out any changes to /etc/sysconfig */
- configSysconfig();
+ if (SystemWasInstalled)
+ configSysconfig();
/* Say goodnight, Gracie */
systemShutdown();
diff --git a/usr.sbin/sysinstall/media.c b/usr.sbin/sysinstall/media.c
index 03ec86b..a701fcd 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.23 1995/05/30 05:13:21 jkh Exp $
+ * $Id: media.c,v 1.24.2.11 1995/06/10 01:42:19 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -82,35 +82,26 @@ mediaSetCDROM(char *str)
Device **devs;
int cnt;
- if (OnCDROM == TRUE) {
- static Device bootCD;
-
- /* This may need to be extended a little, but the basic idea is sound */
- strcpy(bootCD.name, "bootCD");
- bootCD.type = DEVICE_TYPE_CDROM;
- bootCD.get = mediaGetCDROM;
- mediaDevice = &bootCD;
- return 1;
+ devs = deviceFind(NULL, DEVICE_TYPE_CDROM);
+ cnt = deviceCount(devs);
+ if (!cnt) {
+ msgConfirm("No CDROM devices found! Please check that your system's\nconfiguration is correct and that the CDROM drive is of a supported\ntype. For more information, consult the hardware guide\nin the Doc menu.");
+ return 0;
}
- else {
- devs = deviceFind(NULL, DEVICE_TYPE_CDROM);
- cnt = deviceCount(devs);
- if (!cnt) {
- msgConfirm("No CDROM devices found! Please check that your system's\nconfiguration is correct and that the CDROM drive is of a supported\ntype. For more information, consult the hardware guide\nin the Doc menu.");
+ else if (cnt > 1) {
+ DMenu *menu;
+ int status;
+
+ menu = deviceCreateMenu(&MenuMediaCDROM, DEVICE_TYPE_CDROM, cdromHook);
+ if (!menu)
+ msgFatal("Unable to create CDROM menu! Something is seriously wrong.");
+ status = dmenuOpenSimple(menu);
+ free(menu);
+ if (!status)
return 0;
- }
- else if (cnt > 1) {
- DMenu *menu;
-
- menu = deviceCreateMenu(&MenuMediaCDROM, DEVICE_TYPE_CDROM, cdromHook);
- if (!menu)
- msgFatal("Unable to create CDROM menu! Something is seriously wrong.");
- dmenuOpenSimple(menu);
- free(menu);
- }
- else
- mediaDevice = devs[0];
}
+ else
+ mediaDevice = devs[0];
return mediaDevice ? 1 : 0;
}
@@ -138,12 +129,15 @@ mediaSetFloppy(char *str)
}
else if (cnt > 1) {
DMenu *menu;
+ int status;
menu = deviceCreateMenu(&MenuMediaFloppy, DEVICE_TYPE_FLOPPY, floppyHook);
if (!menu)
msgFatal("Unable to create Floppy menu! Something is seriously wrong.");
- dmenuOpenSimple(menu);
+ status = dmenuOpenSimple(menu);
free(menu);
+ if (!status)
+ return 0;
}
else
mediaDevice = devs[0];
@@ -174,12 +168,15 @@ mediaSetDOS(char *str)
}
else if (cnt > 1) {
DMenu *menu;
+ int status;
menu = deviceCreateMenu(&MenuMediaDOS, DEVICE_TYPE_DOS, DOSHook);
if (!menu)
msgFatal("Unable to create DOS menu! Something is seriously wrong.");
- dmenuOpenSimple(menu);
+ status = dmenuOpenSimple(menu);
free(menu);
+ if (!status)
+ return 0;
}
else
mediaDevice = devs[0];
@@ -210,15 +207,27 @@ mediaSetTape(char *str)
}
else if (cnt > 1) {
DMenu *menu;
+ int status;
menu = deviceCreateMenu(&MenuMediaTape, DEVICE_TYPE_TAPE, tapeHook);
if (!menu)
msgFatal("Unable to create tape drive menu! Something is seriously wrong.");
- dmenuOpenSimple(menu);
+ status = dmenuOpenSimple(menu);
free(menu);
+ if (!status)
+ return 0;
}
else
mediaDevice = devs[0];
+ if (mediaDevice) {
+ char *val;
+
+ val = msgGetInput("/usr/tmp", "Please enter the name of a temporary directory containing\nsufficient space for holding the contents of this tape (or\ntapes). The contents of this directory will be removed\nafter installation, so be sure to specify a directory that\ncan be erased afterward!");
+ if (!val)
+ mediaDevice = NULL;
+ else
+ mediaDevice->private = strdup(val);
+ }
return mediaDevice ? 1 : 0;
}
@@ -232,25 +241,30 @@ mediaSetFTP(char *str)
static Device ftpDevice;
char *cp;
- dmenuOpenSimple(&MenuMediaFTP);
+ if (!dmenuOpenSimple(&MenuMediaFTP))
+ return 0;
cp = getenv("ftp");
if (!cp)
return 0;
if (!strcmp(cp, "other")) {
- cp = msgGetInput("ftp://", "Please specify the URL of a FreeBSD distribution on a\nremote ftp site. This site must accept anonymous ftp!\nA URL looks like this: ftp://<hostname>/<path>");
+ cp = msgGetInput("ftp://", "Please specify the URL of a FreeBSD distribution on a\nremote ftp site. This site must accept either anonymous\nftp or you should have set an ftp username and password\nin the Options Menu.\nA URL looks like this: ftp://<hostname>/<path>\nWhere <path> is relative to the anonymous ftp directory or the\nhome directory of the user being logged in as.");
if (!cp || strncmp("ftp://", cp, 6))
return 0;
else
variable_set2("ftp", cp);
}
- tcpDeviceSelect(NULL);
strcpy(ftpDevice.name, cp);
+ /* XXX hack: if str == NULL, we were called by an ftp strategy routine and don't need to reinit all */
+ if (!str)
+ return 1;
+ if (!tcpDeviceSelect())
+ return 0;
ftpDevice.type = DEVICE_TYPE_FTP;
ftpDevice.init = mediaInitFTP;
ftpDevice.get = mediaGetFTP;
ftpDevice.close = mediaCloseFTP;
ftpDevice.shutdown = mediaShutdownFTP;
- ftpDevice.private = mediaDevice;
+ ftpDevice.private = mediaDevice; /* Set to network device by tcpDeviceSelect() */
mediaDevice = &ftpDevice;
return 1;
}
@@ -261,12 +275,15 @@ mediaSetUFS(char *str)
static Device ufsDevice;
char *val;
- val = msgGetInput(NULL, "Enter a fully qualified pathname for the directory\ncontaining the FreeBSD distribtion files:");
+ val = msgGetInput(NULL, "Enter a fully qualified pathname for the directory\ncontaining the FreeBSD distribution files:");
if (!val)
return 0;
strcpy(ufsDevice.name, "ufs");
ufsDevice.type = DEVICE_TYPE_UFS;
+ ufsDevice.init = dummyInit;
ufsDevice.get = mediaGetUFS;
+ ufsDevice.close = dummyClose;
+ ufsDevice.shutdown = dummyShutdown;
ufsDevice.private = strdup(val);
mediaDevice = &ufsDevice;
return 1;
@@ -281,11 +298,13 @@ mediaSetNFS(char *str)
val = msgGetInput(NULL, "Please enter the full NFS file specification for the remote\nhost and directory containing the FreeBSD distribution files.\nThis should be in the format: hostname:/some/freebsd/dir");
if (!val)
return 0;
- tcpDeviceSelect(NULL);
strncpy(nfsDevice.name, val, DEV_NAME_MAX);
+ if (!tcpDeviceSelect())
+ return 0;
nfsDevice.type = DEVICE_TYPE_NFS;
nfsDevice.init = mediaInitNFS;
nfsDevice.get = mediaGetNFS;
+ nfsDevice.close = dummyClose;
nfsDevice.shutdown = mediaShutdownNFS;
nfsDevice.private = mediaDevice;
mediaDevice = &nfsDevice;
@@ -436,7 +455,8 @@ mediaExtractDist(char *dir, int fd)
Boolean
mediaGetType(void)
{
- dmenuOpenSimple(&MenuMedia);
+ if (!dmenuOpenSimple(&MenuMedia))
+ return FALSE;
return TRUE;
}
diff --git a/usr.sbin/sysinstall/menus.c b/usr.sbin/sysinstall/menus.c
index 6811a91..3cbafe0 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.40 1995/05/30 05:13:23 jkh Exp $
+ * $Id: menus.c,v 1.41.2.39 1995/06/10 19:38:27 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -57,7 +57,7 @@ DMenu MenuInitial = {
"This is the main menu of the FreeBSD installation system. Please\n\
select one of the options below by using the arrow keys or typing the\n\
first character of the option name you're interested in. Invoke an\n\
-option by pressing enter. If you'd like a shell, press ESC", /* prompt */
+option by pressing [ENTER].", /* prompt */
"Press F1 for usage instructions", /* help line */
"usage.hlp", /* help file */
{ { "Usage", "Quick start - How to use this menu system.", /* U */
@@ -70,7 +70,7 @@ option by pressing enter. If you'd like a shell, press ESC", /* prompt */
DMENU_SUBMENU, &MenuOptions, 0, 0 },
{ "Proceed", "Go to the installation menu", /* P */
DMENU_SUBMENU, &MenuInstall, 0, 0 },
- { "Quit", "Exit this installation utility", /* Q */
+ { "Quit", "Exit this menu (and the installation)", /* Q */
DMENU_CANCEL, NULL, 0, 0 },
{ NULL } },
};
@@ -83,8 +83,7 @@ DMenu MenuDocumentation = {
or are looking to build a system specifically for FreeBSD, read the\n\
Hardware guide! New users should also read the Install document for\n\
a step-by-step tutorial on installing FreeBSD. For general information,\n\
-consult the README file. If you're having other problems, you may find\n\
-answers in the FAQ.",
+consult the README file.",
"Confused? Press F1 for help.",
"usage.hlp", /* help file */
{ { "README", "Read this for a general description of FreeBSD", /* R */
@@ -97,22 +96,18 @@ answers in the FAQ.",
DMENU_DISPLAY_FILE, "COPYRIGHT", 0, 0 },
{ "Release", "The release notes for this version of FreeBSD.", /* R */
DMENU_DISPLAY_FILE, "RELNOTES", 0, 0 },
- { "FAQ", "Frequently Asked Questions about FreeBSD.", /* F */
- DMENU_DISPLAY_FILE, "faq.hlp", 0, 0 },
+ { "Exit", "Exit this menu (returning to previous)", /* E */
+ DMENU_CANCEL, NULL, 0, 0 },
{ NULL } },
};
/*
* The language selection menu.
- *
- * Note: The RADIO menus use a slightly different syntax. If an item
- * name starts with `*', it's considered to be "ON" by default,
- * otherwise off.
*/
DMenu MenuOptionsLanguage = {
DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"Natural language selection", /* title */
- "Please specify the language you'd like to use by default.\n\n\
+ "Please specify the language you would like to use by default.\n\n\
While almost all of the system's documentation is still written\n\
in english (and may never be translated), there are a few guides\n\
and types of system documentation that may be written in your\n\
@@ -150,8 +145,8 @@ DMenu MenuMediaCDROM = {
DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"Choose a CDROM type",
"FreeBSD can be installed directly from a CDROM containing a valid\n\
-FreeBSD 2.0.5 distribution. If you are seeing this menu it's because\n\
-more than one CDROM drive on your system was found. Please select one\n\
+FreeBSD 2.0.5 distribution. If you are seeing this menu it is because\n\
+more than one CDROM drive was found on your system. Please select one\n\
of the following CDROM drives as your installation drive.",
"Press F1 to read the installation guide",
"install.hlp",
@@ -161,8 +156,8 @@ of the following CDROM drives as your installation drive.",
DMenu MenuMediaFloppy = {
DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"Choose a Floppy drive",
-"You have more than one floppy drive. Please chose the floppy\n\
-drive you'd like to use for this operation",
+"You have more than one floppy drive. Please chose the drive\n\
+you would like to use for this operation",
NULL,
NULL,
{ { NULL } },
@@ -171,13 +166,14 @@ drive you'd like to use for this operation",
DMenu MenuMediaDOS = {
DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"Choose a DOS partition",
-"FreeBSD can be installed directly from a DOS partition,\n\
-assuming of course that you've copied the relevant distributions\n\
-into your DOS partition before starting this installation. If\n\
-such is not the case, then you should reboot DOS at this time\n\
-and copy the distributions you want to install into a subdirectory\n\
-on one of your DOS partitions. Otherwise, please select the\n\
-DOS partition containing the FreeBSD distribution files.",
+"FreeBSD can be installed directly from a DOS partition\n\
+assuming, of course, that you have copied the relevant\n\
+distributions into your DOS partition before starting this\n\
+installation. If this is not the case then you should reboot\n\
+DOS at this time and copy the distributions you wish to install\n\
+into a \"FREEBSD\" subdirectory on one of your DOS partitions.\n\
+Otherwise, please select the DOS partition containing the FreeBSD\n\
+distribution files.",
"Press F1 to read the installation guide",
"install.hlp",
{ { NULL } },
@@ -192,66 +188,74 @@ choice. Also note that not all sites carry every possible distribution!\n\
Distributions other than the basic user set are only guaranteed to be\n\
available from the Primary site.\n\n\
If the first site selected doesn't respond, try one of the alternates.\n\
-You may also wish to investigate the Ftp options menu in case of trouble.\n\
+You may also wish to investigate the options menu in case of trouble.\n\
To specify a URL not in this list, chose \"other\".",
"Select a site that's close!",
"install.hlp",
{ { "Primary Site", "ftp.freebsd.org",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.freebsd.org/pub/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.freebsd.org/pub/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "Secondary Site", "freefall.cdrom.com",
- DMENU_SET_VARIABLE, "ftp=ftp://freefall.cdrom.com/pub/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://freefall.cdrom.com/pub/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "Other", "Specify some other ftp site by URL",
DMENU_SET_VARIABLE, "ftp=other", 0, 0 },
{ "Australia", "ftp.physics.usyd.edu.au",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.physics.usyd.edu.au/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.physics.usyd.edu.au/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "Finland", "nic.funet.fi",
- DMENU_SET_VARIABLE, "ftp=ftp://nic.funet.fi/pub/unix/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://nic.funet.fi/pub/unix/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "France", "ftp.ibp.fr",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.ibp.fr/pub/FreeBSD/2.0.5-ALPHA", 0, 0 },
- { "Germany", "ftp.uni-duisburg.de",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.uni-duisburg.de/pub/unix/FreeBSD/2.0.5-ALPHA", 0, },
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.ibp.fr/pub/FreeBSD/2.0.5-RELEASE", 0, 0 },
+ { "Germany", "ftp.fb9dv.uni-duisburg.de",
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.fb9dv.uni-duisburg.de/pub/unix/FreeBSD/2.0.5-RELEASE", 0, 0 },
+ { "Germany #2", "gil.physik.rwth-aachen.de",
+ DMENU_SET_VARIABLE, "ftp=ftp://gil.physik.rwth-aachen.de/pub/FreeBSD/2.0.5-RELEASE", 0, 0 },
+ { "Germany #3", "ftp.uni-paderborn.de",
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.uni-paderborn.de/freebsd/2.0.5-RELEASE", 0, 0 },
+ { "Hong Kong", "ftp.hk.super.net",
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.hk.super.net/pub/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "Israel", "orgchem.weizmann.ac.il",
- DMENU_SET_VARIABLE, "ftp=ftp://orgchem.weizmann.ac.il/pub/FreeBSD-2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://orgchem.weizmann.ac.il/pub/FreeBSD-2.0.5-RELEASE", 0, 0 },
{ "Japan", "ftp.sra.co.jp",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.sra.co.jp/pub/os/FreeBSD/distribution/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.sra.co.jp/pub/os/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "Japan #2", "ftp.mei.co.jp",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.mei.co.jp/free/PC-UNIX/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.mei.co.jp/free/PC-UNIX/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "Japan #3", "ftp.waseda.ac.jp",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.waseda.ac.jp/pub/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.waseda.ac.jp/pub/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "Japan #4", "ftp.pu-toyama.ac.jp",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.pu-toyama.ac.jp/pub/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.pu-toyama.ac.jp/pub/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "Japan #5", "ftpsv1.u-aizu.ac.jp",
- DMENU_SET_VARIABLE, "ftp=ftp://ftpsv1.u-aizu.ac.jp/pub/os/FreeBSD/2.0.5-ALPHA", 0, 0 },
- { "Japan #6", "tutserver.tutcc.tut.ac.jp",
- DMENU_SET_VARIABLE, "ftp=ftp://tutserver.tutcc.tut.ac.jp/FreeBSD/FreeBSD-2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://ftpsv1.u-aizu.ac.jp/pub/os/FreeBSD/2.0.5-RELEASE", 0, 0 },
+ { "Japan #6", "ftp.tut.ac.jp",
+ DMENU_SET_VARIABLE, "ftp://ftp.tut.ac.jp/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "Japan #7", "ftp.ee.uec.ac.jp",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.ee.uec.ac.jp/pub/os/FreeBSD.other/FreeBSD-2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.ee.uec.ac.jp/pub/os/mirror/ftp.freebsd.org/2.0.5-RELEASE", 0, 0 },
+ { "Japan #8", "ftp.tokyonet.ad.jp",
+ DMENU_SET_VARIABLE, "ftp://ftp.tokyonet.ad.jp/pub/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "Korea", "ftp.cau.ac.kr",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.cau.ac.kr/pub/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.cau.ac.kr/pub/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "Netherlands", "ftp.nl.net",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.nl.net/pub/os/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.nl.net/pub/os/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "Russia", "ftp.kiae.su",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.kiae.su/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.kiae.su/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "Sweden", "ftp.luth.se",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.luth.se/pub/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.luth.se/pub/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "Taiwan", "netbsd.csie.nctu.edu.tw",
- DMENU_SET_VARIABLE, "ftp=ftp://netbsd.csie.nctu.edu.tw/pub/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://netbsd.csie.nctu.edu.tw/pub/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "Thailand", "ftp.nectec.or.th",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.nectec.or.th/pub/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.nectec.or.th/pub/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "UK", "ftp.demon.co.uk",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.demon.co.uk/pub/BSD/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.demon.co.uk/pub/BSD/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "UK #2", "src.doc.ic.ac.uk",
- DMENU_SET_VARIABLE, "ftp=ftp://src.doc.ic.ac.uk/packages/unix/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://src.doc.ic.ac.uk/packages/unix/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "UK #3", "unix.hensa.ac.uk",
- DMENU_SET_VARIABLE, "ftp=ftp://unix.hensa.ac.uk/pub/walnut.creek/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://unix.hensa.ac.uk/mirrors/walnut.creek/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "USA", "ref.tfs.com",
- DMENU_SET_VARIABLE, "ftp=ftp://ref.tfs.com/pub/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://ref.tfs.com/pub/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "USA #2", "ftp.dataplex.net",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.dataplex.net/pub/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.dataplex.net/pub/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "USA #3", "kryten.atinc.com",
- DMENU_SET_VARIABLE, "ftp=ftp://kryten.atinc.com/pub/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://kryten.atinc.com/pub/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ "USA #4", "ftp.neosoft.com",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.neosoft.com/systems/FreeBSD/2.0.5-ALPHA", 0, 0 },
+ DMENU_SET_VARIABLE, "ftp=ftp://ftp.neosoft.com/systems/FreeBSD/2.0.5-RELEASE", 0, 0 },
{ NULL } }
};
@@ -274,8 +278,8 @@ DMenu MenuNetworkDevice = {
"Choose a network interface type",
"FreeBSD can be installed directly over a network, using NFS or FTP.\n
If you are using PPP over a serial device (cuaa0 or cuaa1) as opposed\n\
-to a direct ethernet connection, then you may need to first dial your\n\
-service provider using a special utility we provide for that purpose.\n\
+to a direct ethernet connection, then you may first need to dial your\n\
+service provider using the ppp utility we provide for that purpose.\n\
You can also install over a parallel port using a special \"laplink\"\n\
cable, though this only works if you have another FreeBSD machine running\n\
a fairly recent (2.0R or later) release to talk to.\n\n\
@@ -323,12 +327,14 @@ DMenu MenuInstallType = {
These select what we consider to be the most reasonable defaults for the\n\
type of system in question. If you would prefer to pick and choose\n\
the list of distributions yourself, simply select \"custom\".",
- NULL,
- NULL,
+ "Press F1 for more information on these options.",
+ "distributions.hlp",
{ { "Developer", "Full sources, binaries and doc but no games [171MB]",
DMENU_CALL, distSetDeveloper, 0, 0 },
{ "X-Developer", "Same as above, but includes XFree86 [196MB]",
DMENU_CALL, distSetXDeveloper, 0, 0 },
+ { "Kern-Developer", "Full binaries and doc, kernel sources only [35MB]",
+ DMENU_CALL, distSetKernDeveloper, 0, 0 },
{ "User", "Average user - binaries and doc but no sources [19MB]",
DMENU_CALL, distSetUser, 0, 0 },
{ "X-User", "Same as above, but includes XFree86 [45MB]",
@@ -339,46 +345,93 @@ the list of distributions yourself, simply select \"custom\".",
DMENU_CALL, distSetEverything, 0, 0 },
{ "Custom", "Specify your own distribution set [?]",
DMENU_SUBMENU, &MenuDistributions, 0, 0 },
- { "Reset", "Reset selected distribution list to None",
+ { "Clear", "Reset selected distribution list to None",
DMENU_CALL, distReset, 0, 0 },
{ NULL } },
};
+static char *
+DESFlagCheck(DMenuItem *item)
+{
+ if (isDebug())
+ msgDebug("Dists & DIST_DES = %d\n", Dists & DIST_DES);
+ return (Dists & DIST_DES) ? "ON" : "OFF";
+}
+
+static char *
+srcFlagCheck(DMenuItem *item)
+{
+ if (isDebug())
+ msgDebug("Dists & DIST_SRC = %d\n", Dists & DIST_SRC);
+ return (Dists & DIST_SRC) ? "ON" : "OFF";
+}
+
+static char *
+x11FlagCheck(DMenuItem *item)
+{
+ if (isDebug())
+ msgDebug("Dists & DIST_XF86 = %d\n", Dists & DIST_XF86);
+ return (Dists & DIST_XF86) ? "ON" : "OFF";
+}
+
DMenu MenuDistributions = {
DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS,
"Select the distributions you wish to install.",
- "Please check off the distributions you wish to install. Some\n
-of the most generally useful distributions are already checked, and\n\
-selecting OK at this stage will chose them as defaults.",
+ "Please check off the distributions you wish to install. At the\n\
+very minimum, this should be \"bin\". WARNING: Do not export the\n\
+DES distribution out of the U.S.! It is for U.S. customers only.",
NULL,
NULL,
- { { "*bin", "Binary base distribution (required) [36MB]",
- DMENU_SET_FLAG, &Dists, DIST_BIN, 0 },
+ { { "bin", "Binary base distribution (required) [36MB]",
+ DMENU_SET_FLAG, &Dists, DIST_BIN, 0, dmenuFlagCheck },
{ "commercial", "Commercial demos and shareware [10MB]",
- DMENU_SET_FLAG, &Dists, DIST_COMMERCIAL, 0 },
- { "compat1x", "FreeBSD 1.x binary compatability package [2MB]",
- DMENU_SET_FLAG, &Dists, DIST_COMPAT1X, 0 },
- { "compat20", "FreeBSD 2.0 binary compatability package [2MB]",
- DMENU_SET_FLAG, &Dists, DIST_COMPAT20, 0 },
- { "DES", "DES encryption code and sources [.3MB]",
- DMENU_SET_FLAG, &Dists, DIST_DES, 0 },
- { "dict", "Spelling checker disctionary files [4.2MB]",
- DMENU_SET_FLAG, &Dists, DIST_DICT, 0 },
+ DMENU_SET_FLAG, &Dists, DIST_COMMERCIAL, 0, dmenuFlagCheck },
+ { "compat1x", "FreeBSD 1.x binary compatibility package [2MB]",
+ DMENU_SET_FLAG, &Dists, DIST_COMPAT1X, 0, dmenuFlagCheck },
+ { "compat20", "FreeBSD 2.0 binary compatibility package [2MB]",
+ DMENU_SET_FLAG, &Dists, DIST_COMPAT20, 0, dmenuFlagCheck },
+ { "DES", "NOT FOR EXPORT! DES encryption code [.3MB]",
+ DMENU_CALL, distSetDES, 0, 0, DESFlagCheck },
+ { "dict", "Spelling checker dictionary files [4.2MB]",
+ DMENU_SET_FLAG, &Dists, DIST_DICT, 0, dmenuFlagCheck },
{ "games", "Games and other amusements (non-commercial) [6.4MB]",
- DMENU_SET_FLAG, &Dists, DIST_GAMES, 0 },
+ DMENU_SET_FLAG, &Dists, DIST_GAMES, 0, dmenuFlagCheck },
{ "info", "GNU info files [4.1MB]",
- DMENU_SET_FLAG, &Dists, DIST_INFO, 0 },
- { "*man", "System manual pages - strongly recommended [3.3MB]",
- DMENU_SET_FLAG, &Dists, DIST_MANPAGES, 0 },
+ DMENU_SET_FLAG, &Dists, DIST_INFO, 0, dmenuFlagCheck },
+ { "man", "System manual pages - strongly recommended [3.3MB]",
+ DMENU_SET_FLAG, &Dists, DIST_MANPAGES, 0, dmenuFlagCheck },
{ "proflibs", "Profiled versions of the libraries [3.3MB]",
- DMENU_SET_FLAG, &Dists, DIST_PROFLIBS, 0 },
+ DMENU_SET_FLAG, &Dists, DIST_PROFLIBS, 0, dmenuFlagCheck },
{ "src", "Sources for everything but DES [120MB]",
- DMENU_CALL, distSetSrc, 0 },
- { "XFree86", "The XFree86 3.1.1L distribution [?]",
- DMENU_SUBMENU, &MenuXF86Select, 0 },
+ DMENU_CALL, distSetSrc, 0, 0, srcFlagCheck },
+ { "XFree86", "The XFree86 3.1.1u1 distribution [?]",
+ DMENU_CALL, distSetXF86, 0, 0, x11FlagCheck },
+ { "Experimental", "Work in progress!",
+ DMENU_SET_FLAG, &Dists, DIST_EXPERIMENTAL, 0, dmenuFlagCheck },
{ NULL } },
};
+DMenu MenuDESDistributions = {
+ DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS,
+ "Select the encryption facilities you wish to install.",
+ "Please check off any special DES-based encryption distributions\n\
+you would like to install. Please note that these services are NOT FOR\n\
+EXPORT from the United States, nor are they available on CDROM (for the\n\
+same reason). For information on non-U.S. FTP distributions of this\n\
+software, please consult the release notes.",
+ NULL,
+ NULL,
+ { { "des", "Basic DES services (rlogin, init, etc) [1MB]",
+ DMENU_SET_FLAG, &DESDists, DIST_DES_DES, 0, dmenuFlagCheck },
+ { "krb", "Kerberos encryption services [2MB]",
+ DMENU_SET_FLAG, &DESDists, DIST_DES_KERBEROS, 0, dmenuFlagCheck },
+ { "sebones", "Sources for eBones (Kerberos) [1MB]",
+ DMENU_SET_FLAG, &DESDists, DIST_DES_SEBONES, 0, dmenuFlagCheck },
+ { "ssecure", "Sources for DES libs and utilities [1MB]",
+ DMENU_SET_FLAG, &DESDists, DIST_DES_SSECURE, 0, dmenuFlagCheck },
+ { NULL } },
+};
+
DMenu MenuSrcDistributions = {
DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS,
"Select the sub-components of src you wish to install.",
@@ -387,81 +440,93 @@ you wish to install.",
NULL,
NULL,
{ { "base", "top-level files in /usr/src [300K]",
- DMENU_SET_FLAG, &SrcDists, DIST_SRC_BASE, 0 },
+ DMENU_SET_FLAG, &SrcDists, DIST_SRC_BASE, 0, dmenuFlagCheck },
{ "gnu", "/usr/src/gnu (software from the GNU Project) [42MB]]",
- DMENU_SET_FLAG, &SrcDists, DIST_SRC_GNU, 0 },
+ DMENU_SET_FLAG, &SrcDists, DIST_SRC_GNU, 0, dmenuFlagCheck },
{ "etc", "/usr/src/etc (miscellaneous system files) [460K]",
- DMENU_SET_FLAG, &SrcDists, DIST_SRC_ETC, 0 },
+ DMENU_SET_FLAG, &SrcDists, DIST_SRC_ETC, 0, dmenuFlagCheck },
{ "games", "/usr/src/games (diversions) [7.8MB]",
- DMENU_SET_FLAG, &SrcDists, DIST_SRC_GAMES, 0 },
+ DMENU_SET_FLAG, &SrcDists, DIST_SRC_GAMES, 0, dmenuFlagCheck },
{ "include", "/usr/src/include (header files) [467K]",
- DMENU_SET_FLAG, &SrcDists, DIST_SRC_INCLUDE, 0 },
+ DMENU_SET_FLAG, &SrcDists, DIST_SRC_INCLUDE, 0, dmenuFlagCheck },
{ "lib", "/usr/src/lib (system libraries) [9.2MB]",
- DMENU_SET_FLAG, &SrcDists, DIST_SRC_LIB, 0 },
+ DMENU_SET_FLAG, &SrcDists, DIST_SRC_LIB, 0, dmenuFlagCheck },
{ "libexec", "/usr/src/libexec (system programs) [1.2MB]",
- DMENU_SET_FLAG, &SrcDists, DIST_SRC_LIBEXEC, 0 },
+ DMENU_SET_FLAG, &SrcDists, DIST_SRC_LIBEXEC, 0, dmenuFlagCheck },
{ "lkm", "/usr/src/lkm (Loadable Kernel Modules) [193K]",
- DMENU_SET_FLAG, &SrcDists, DIST_SRC_LKM, 0 },
+ DMENU_SET_FLAG, &SrcDists, DIST_SRC_LKM, 0, dmenuFlagCheck },
{ "release", "/usr/src/release (release-generation tools) [533K]",
- DMENU_SET_FLAG, &SrcDists, DIST_SRC_RELEASE, 0 },
+ DMENU_SET_FLAG, &SrcDists, DIST_SRC_RELEASE, 0, dmenuFlagCheck },
{ "sbin", "/usr/src/sbin (system binaries) [1.3MB]",
- DMENU_SET_FLAG, &SrcDists, DIST_SRC_SBIN, 0 },
+ DMENU_SET_FLAG, &SrcDists, DIST_SRC_SBIN, 0, dmenuFlagCheck },
{ "share", "/usr/src/share (documents and shared files) [10MB]",
- DMENU_SET_FLAG, &SrcDists, DIST_SRC_SHARE, 0 },
+ DMENU_SET_FLAG, &SrcDists, DIST_SRC_SHARE, 0, dmenuFlagCheck },
{ "sys", "/usr/src/sys (FreeBSD kernel) [13MB]",
- DMENU_SET_FLAG, &SrcDists, DIST_SRC_SYS, 0 },
+ DMENU_SET_FLAG, &SrcDists, DIST_SRC_SYS, 0, dmenuFlagCheck },
{ "ubin", "/usr/src/usr.bin (user binaries) [13MB]",
- DMENU_SET_FLAG, &SrcDists, DIST_SRC_UBIN, 0 },
+ DMENU_SET_FLAG, &SrcDists, DIST_SRC_UBIN, 0, dmenuFlagCheck },
{ "usbin", "/usr/src/usr.sbin (aux system binaries) [14MB]",
- DMENU_SET_FLAG, &SrcDists, DIST_SRC_USBIN, 0 },
- { "XFree86", "XFree86 3.1.1L source + contrib distribution [200MB]",
- DMENU_SET_FLAG, &SrcDists, DIST_SRC_XF86, 0 },
+ DMENU_SET_FLAG, &SrcDists, DIST_SRC_USBIN, 0, dmenuFlagCheck },
{ NULL } },
};
+static int
+clearx11(char *str)
+{
+ XF86Dists = 0;
+ XF86ServerDists = 0;
+ XF86FontDists = 0;
+ Dists &= ~DIST_XF86;
+ return 0;
+}
+
DMenu MenuXF86Select = {
DMENU_NORMAL_TYPE,
"XFree86 3.1.1u1 Distribution",
"Please select the components you need from the XFree86 3.1.1u1\n\
distribution. We recommend that you select what you need from the basic\n\
-components set and at least one entry from the Server and Font set menus.\n\n\
-When you're finished, select Cancel.",
+components set and at least one entry from the Server and Font set menus.",
"Press F1 to read the XFree86 release notes for FreeBSD",
"XF86.hlp",
- { { "Basic", "Basic component menu (required)",
+ { { "Basic", "Basic component menu (required)", /* B */
DMENU_SUBMENU, &MenuXF86SelectCore, 0, 0 },
- { "Server", "X server menu",
+ { "Server", "X server menu", /* S */
DMENU_SUBMENU, &MenuXF86SelectServer, 0, 0 },
- { "Fonts", "Font set menu",
+ { "Fonts", "Font set menu", /* F */
DMENU_SUBMENU, &MenuXF86SelectFonts, 0, 0 },
+ { "Clear", "Reset XFree86 distribution list",
+ DMENU_CALL, clearx11, 0, 0, 0 },
+ { "Exit", "Exit this menu (returning to previous)", /* E */
+ DMENU_CANCEL, NULL, 0, 0 },
{ NULL } },
};
DMenu MenuXF86SelectCore = {
DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS,
"XFree86 3.1.1 base distribution types",
- "Please check off the basic XFree86 components you wish to install.\n\
-Those deemed most generally useful are already checked off for you.",
+ "Please check off the basic XFree86 components you wish to install.",
"Press F1 to read the XFree86 release notes for FreeBSD",
"XF86.hlp",
- { { "*bin", "X client applications and shared libs [4MB].",
- DMENU_SET_FLAG, &XF86Dists, DIST_XF86_BIN, 0 },
- { "*lib", "Data files needed at runtime [600K]",
- DMENU_SET_FLAG, &XF86Dists, DIST_XF86_LIB, 0 },
+ { { "bin", "X client applications and shared libs [4MB].",
+ DMENU_SET_FLAG, &XF86Dists, DIST_XF86_BIN, 0, dmenuFlagCheck },
+ { "lib", "Data files needed at runtime [600K]",
+ DMENU_SET_FLAG, &XF86Dists, DIST_XF86_LIB, 0, dmenuFlagCheck },
{ "xicf", "Customizable xinit runtime configuration file [100K]",
- DMENU_SET_FLAG, &XF86Dists, DIST_XF86_XINIT, 0 },
+ DMENU_SET_FLAG, &XF86Dists, DIST_XF86_XINIT, 0, dmenuFlagCheck },
{ "xdcf", "Customizable xdm runtime configuration file [100K]",
- DMENU_SET_FLAG, &XF86Dists, DIST_XF86_XDMCF, 0 },
+ DMENU_SET_FLAG, &XF86Dists, DIST_XF86_XDMCF, 0, dmenuFlagCheck },
{ "doc", "READMEs and XFree86 specific man pages [500K]",
- DMENU_SET_FLAG, &XF86Dists, DIST_XF86_DOC, 0 },
- { "*man", "Man pages (except XFree86 specific ones) [1.2MB]",
- DMENU_SET_FLAG, &XF86Dists, DIST_XF86_MAN, 0 },
+ DMENU_SET_FLAG, &XF86Dists, DIST_XF86_DOC, 0, dmenuFlagCheck },
+ { "man", "Man pages (except XFree86 specific ones) [1.2MB]",
+ DMENU_SET_FLAG, &XF86Dists, DIST_XF86_MAN, 0, dmenuFlagCheck },
{ "prog", "Programmer's header and library files [4MB]",
- DMENU_SET_FLAG, &XF86Dists, DIST_XF86_PROG, 0 },
+ DMENU_SET_FLAG, &XF86Dists, DIST_XF86_PROG, 0, dmenuFlagCheck },
{ "link", "X Server reconfiguration kit [7.8MB]",
- DMENU_SET_FLAG, &XF86Dists, DIST_XF86_LINK, 0 },
+ DMENU_SET_FLAG, &XF86Dists, DIST_XF86_LINK, 0, dmenuFlagCheck },
{ "pex", "PEX fonts and libs needed by PEX apps [500K]",
- DMENU_SET_FLAG, &XF86Dists, DIST_XF86_PEX, 0 },
+ DMENU_SET_FLAG, &XF86Dists, DIST_XF86_PEX, 0, dmenuFlagCheck },
+ { "sources", "XFree86 3.1.1u1 source + contrib distribution [200MB]",
+ DMENU_SET_FLAG, &XF86Dists, DIST_XF86_SRC, 0, dmenuFlagCheck },
{ NULL } },
};
@@ -474,16 +539,16 @@ install. At the minimum, you should install the standard\n\
(these are selected by default).",
"Press F1 to read the XFree86 release notes for FreeBSD",
"XF86.hlp",
- { { "*fnts", "Standard 75 DPI and miscellaneous fonts [3.6MB]",
- DMENU_SET_FLAG, &XF86FontDists, DIST_XF86_FONTS_MISC, 0 },
+ { { "fnts", "Standard 75 DPI and miscellaneous fonts [3.6MB]",
+ DMENU_SET_FLAG, &XF86FontDists, DIST_XF86_FONTS_MISC, 0, dmenuFlagCheck },
{ "f100", "100 DPI fonts [1.8MB]",
- DMENU_SET_FLAG, &XF86FontDists, DIST_XF86_FONTS_100, 0 },
+ DMENU_SET_FLAG, &XF86FontDists, DIST_XF86_FONTS_100, 0, dmenuFlagCheck },
{ "fscl", "Speedo and Type scalable fonts [1.6MB]",
- DMENU_SET_FLAG, &XF86FontDists, DIST_XF86_FONTS_SCALE, 0 },
+ DMENU_SET_FLAG, &XF86FontDists, DIST_XF86_FONTS_SCALE, 0, dmenuFlagCheck },
{ "non", "Japanese, Chinese and other non-english fonts [3.3MB]",
- DMENU_SET_FLAG, &XF86FontDists, DIST_XF86_FONTS_NON, 0 },
+ DMENU_SET_FLAG, &XF86FontDists, DIST_XF86_FONTS_NON, 0, dmenuFlagCheck },
{ "server", "Font server [0.3MB]",
- DMENU_SET_FLAG, &XF86FontDists, DIST_XF86_FONTS_SERVER, 0 },
+ DMENU_SET_FLAG, &XF86FontDists, DIST_XF86_FONTS_SERVER, 0, dmenuFlagCheck },
{ NULL } },
};
@@ -496,28 +561,30 @@ it is recommended that try the SVGA or VGA16 servers (the VGA16 and\n\
Mono servers are particularly well-suited to most LCD displays).",
"Press F1 to read the XFree86 release notes for FreeBSD",
"XF86.hlp",
- { { "*SVGA", "Standard VGA or Super VGA display [1MB]",
- DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_SVGA, 0 },
+ { { "SVGA", "Standard VGA or Super VGA display [1MB]",
+ DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_SVGA, 0, dmenuFlagCheck },
{ "VGA16", "Standard 16 color VGA display [1MB]",
- DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_VGA16, 0 },
+ DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_VGA16, 0, dmenuFlagCheck },
{ "Mono", "Standard Monochrome display [1MB]",
- DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_MONO, 0 },
+ DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_MONO, 0, dmenuFlagCheck },
{ "8514", "8-bit (256 color) IBM 8514 or compatible card [1MB]",
- DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_8514, 0 },
+ DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_8514, 0, dmenuFlagCheck },
{ "AGX", "8-bit AGX card [1MB]",
- DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_AGX, 0 },
- { "Mch3", "8 and 16-bit (65K color) for ATI Mach32 card [1MB]",
- DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_MACH32, 0 },
- { "Mch8", "8-bit ATI Mach8 card [1MB]",
- DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_MACH8, 0 },
+ DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_AGX, 0, dmenuFlagCheck },
+ { "Ma8", "8-bit ATI Mach8 card [1MB]",
+ DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_MACH8, 0, dmenuFlagCheck },
+ { "Ma32", "8 and 16-bit (65K color) for ATI Mach32 card [1MB]",
+ DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_MACH32, 0, dmenuFlagCheck },
+ { "Ma64", "8 and 16-bit (65K color) for ATI Mach64 card [1MB]",
+ DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_MACH64, 0, dmenuFlagCheck },
{ "P9K", "8, 16, and 24-bit color for Weitek P9000 based boards [1MB]",
- DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_P9000, 0 },
+ DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_P9000, 0, dmenuFlagCheck },
{ "S3", "8, 16 and 24-bit color for S3 based boards [1MB]",
- DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_S3, 0 },
+ DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_S3, 0, dmenuFlagCheck },
{ "W32", "8-bit Color for ET4000/W32, /W32i and /W32p cards [1MB]",
- DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_W32, 0 },
+ DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_W32, 0, dmenuFlagCheck },
{ "nest", "A nested server for testing purposes [1MB]",
- DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_NEST, 0 },
+ DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_NEST, 0, dmenuFlagCheck },
{ NULL } },
};
@@ -530,55 +597,77 @@ space, though FreeBSD can be installed across several drives if you do\n\
not have the required space on a single drive. If you wish to boot\n\
off a drive that's not a `zero drive', or have multiple operating\n\
systems on your machine, you will have the option to install a boot\n\
-manager later.",
+manager later. To select a drive, use the arrow keys to move to it\n\
+and press [SPACE].",
"Press F1 for important information regarding geometry!",
"drives.hlp",
{ { NULL } },
};
+/* Local work func for MenuOptions */
+static int
+clearFlags(char *str)
+{
+ OptFlags = 0;
+ return 1; /* Gross, but forces menu rebuild */
+}
+
+static char *
+userPassCheck(DMenuItem *item)
+{
+ char *cp = getenv(FTP_USER);
+
+ return (cp && *cp) ? "ON" : "OFF";
+}
+
+static char *
+ftpFlagCheck(DMenuItem *item)
+{
+ /* Verify that everything's sane */
+ if ((OptFlags & (OPT_FTP_ABORT + OPT_FTP_RESELECT)) == (OPT_FTP_ABORT + OPT_FTP_RESELECT))
+ OptFlags &= ~OPT_FTP_RESELECT;
+ if (!(OptFlags & (OPT_FTP_ABORT + OPT_FTP_RESELECT)))
+ OptFlags |= OPT_FTP_ABORT;
+ if ((OptFlags & (OPT_FTP_ACTIVE + OPT_FTP_PASSIVE)) == (OPT_FTP_ACTIVE + OPT_FTP_PASSIVE))
+ OptFlags &= ~OPT_FTP_ACTIVE;
+ if (!(OptFlags & (OPT_FTP_ACTIVE + OPT_FTP_PASSIVE)))
+ OptFlags |= OPT_FTP_PASSIVE;
+ if (*((unsigned int *)item->ptr) & item->parm)
+ return "ON";
+ return "OFF";
+}
+
/* The installation options menu */
DMenu MenuOptions = {
- DMENU_NORMAL_TYPE,
+ DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS,
"Choose Installation Options",
"The following options control how this utility will deal\n\
with various possible error conditions and how verbose it will\n\
-be at various stages.\n\n\
-When you're done setting options, select Cancel",
- NULL,
- NULL,
- { { "Ftp Options", "Ftp options menu",
- DMENU_SUBMENU, &MenuOptionsFTP, 0, 0 },
- { "NFS Secure", "NFS server talks only on a secure port",
- DMENU_SET_VARIABLE, "nfsServerSecure=yes", 0, 0 },
+be at various stages.",
+ "Press F1 for more help on these options",
+ "options.hlp",
+ { { "NFS Secure", "NFS server talks only on a secure port",
+ DMENU_SET_FLAG, &OptFlags, OPT_NFS_SECURE, 0, dmenuFlagCheck },
{ "NFS Slow", "User is using a slow PC or ethernet card",
- DMENU_SET_VARIABLE, "nfsSlowPC=yes", 0, 0 },
- { "Extra Debugging", "Toggle the extra debugging flag",
- DMENU_SET_VARIABLE, "debug=yes", 0, 0 },
- { "No Debugging", "Turn the extra debugging flag off",
- DMENU_SET_VARIABLE, "debug=no", 0, 0 },
- { "Yes To All", "Assume \"Yes\" answers to all non-critical dialogs",
- DMENU_SET_VARIABLE, "noConfirmation=Yes", 0, 0 },
- { NULL } },
-};
-
-DMenu MenuOptionsFTP = {
- DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
- "Choose FTP Options",
- "Please indicate how you would like FTP to deal with potential error\n\
-conditions, the default behavior being to Abort on transfer errors. If you\n\
-are behind an IP firewall, you will also probably wish to select passive\n\
-mode transfers (it's generally OK to set this in any case as almost all\n\
-servers support it, firewall or no).",
- NULL,
- NULL,
- { { "FTP Retry", "On transfer failure, retry same host",
- DMENU_SET_VARIABLE, "ftpRetryType=loop", 0, 0 },
+ DMENU_SET_FLAG, &OptFlags, OPT_SLOW_ETHER, 0, dmenuFlagCheck },
+ { "FTP Abort", "On transfer failure, abort",
+ DMENU_SET_FLAG, &OptFlags, OPT_FTP_ABORT, 0, ftpFlagCheck },
{ "FTP Reselect", "On transfer failure, ask for another host",
- DMENU_SET_VARIABLE, "ftpRetryType=reselect", 0, 0 },
- { "FTP Abort", "On transfer failure, abort installation",
- DMENU_SET_VARIABLE, "ftpRetryType=abort", 0, 0 },
+ DMENU_SET_FLAG, &OptFlags, OPT_FTP_RESELECT, 0, ftpFlagCheck },
+ { "FTP active", "Use \"active mode\" for standard FTP",
+ DMENU_SET_FLAG, &OptFlags, OPT_FTP_ACTIVE, 0, ftpFlagCheck },
{ "FTP passive", "Use \"passive mode\" for firewalled FTP",
- DMENU_SET_VARIABLE, "ftpPassive=yes", 0, 0 },
+ DMENU_SET_FLAG, &OptFlags, OPT_FTP_PASSIVE, 0, ftpFlagCheck },
+ { "Debugging", "Turn on the extra debugging flag",
+ DMENU_SET_FLAG, &OptFlags, OPT_DEBUG, 0, dmenuFlagCheck },
+ { "Yes To All", "Assume \"Yes\" answers to all non-critical dialogs",
+ DMENU_SET_FLAG, &OptFlags, OPT_NO_CONFIRM, 0, dmenuFlagCheck },
+ { "FTP userpass", "Specify username and password instead of anonymous",
+ DMENU_CALL, mediaSetFtpUserPass, 0, 0, userPassCheck },
+ { "Clear", "Clear All Option Flags",
+ DMENU_CALL, clearFlags, 0, 0 },
+ { "Exit", "Exit this menu (returning to previous)",
+ DMENU_CANCEL, NULL, 0, 0 },
{ NULL } },
};
@@ -591,7 +680,7 @@ details on the type of distribution you wish to have, where you wish\n\
to install it from and how you wish to allocate disk storage to FreeBSD.\n\n\
None of the items in this menu will actually modify the contents of\n\
your disk until you select the \"Install\" menu item (and even then, only\n\
-after a final confirmation). Select Cancel to leave this menu.",
+after a final confirmation).",
"Press F1 to read the installation guide",
"install.hlp",
{ { "Partition", "Allocate disk space for FreeBSD", /* P */
@@ -602,10 +691,14 @@ after a final confirmation). Select Cancel to leave this menu.",
DMENU_SUBMENU, &MenuInstallType, 0, 0 },
{ "Media", "Choose the installation media type", /* M */
DMENU_SUBMENU, &MenuMedia, 0, 0 },
- { "Install", "Install FreeBSD onto your hard disk(s)", /* I */
+ { "Options", "Go to Options submenu", /* O */
+ DMENU_SUBMENU, &MenuOptions, 0, 0 },
+ { "Commit", "Install FreeBSD onto your hard disk(s)", /* C */
DMENU_CALL, installCommit, 0, 0 },
{ "Configure", "Do post-install configuration of FreeBSD", /* C */
DMENU_SUBMENU, &MenuConfigure, 0, 0 },
+ { "Exit", "Exit this menu (returning to previous)",
+ DMENU_CANCEL, NULL, 0, 0 },
{ NULL } },
};
@@ -623,12 +716,12 @@ one, select \"standard\". If you would prefer your Master Boot\n\
Record to remain untouched, then select \"none\".",
"Press F1 to read the installation guide",
"install.hlp",
- { { "*BootMgr", "Install the FreeBSD Boot Manager (\"Booteasy\")", /* B */
- DMENU_SET_VARIABLE, "bootManager=bteasy", 0, 0 },
+ { { "BootMgr", "Install the FreeBSD Boot Manager (\"Booteasy\")", /* B */
+ DMENU_SET_VALUE, &BootMgr, 0, 0, dmenuRadioCheck },
{ "Standard", "Use a standard MBR (no boot manager)", /* S */
- DMENU_SET_VARIABLE, "bootManager=mbr", 0, 0 },
+ DMENU_SET_VALUE, &BootMgr, 1, 0, dmenuRadioCheck },
{ "None", "Leave the Master Boot Record untouched", /* N */
- DMENU_SET_VARIABLE, "bootManager=none", 0, 0 },
+ DMENU_SET_VALUE, &BootMgr, 2, 0, dmenuRadioCheck },
{ NULL } },
};
@@ -639,8 +732,7 @@ DMenu MenuConfigure = {
"If you've already installed FreeBSD, you may use this menu to\n\
customize it somewhat to suit your particular configuration. Most\n\
importantly, you can use the Packages utility to load extra \"3rd party\"\n\
-software not provided in the base distributions.\n\n\
-When you're done, select Cancel",
+software not provided in the base distributions.",
"Press F1 for more information on these options",
"configure.hlp",
{ { "Add User", "Add users to the system",
@@ -650,7 +742,7 @@ When you're done, select Cancel",
{ "Networking", "Configure additional network services",
DMENU_SUBMENU, &MenuNetworking, 0, 0 },
{ "Time Zone", "Set which time zone you're in",
- DMENU_SYSTEM_COMMAND, "tzsetup", 0, 0 },
+ DMENU_SYSTEM_COMMAND, "rm -f /etc/wall_cmos_clock /etc/localtime; tzsetup", 0, 0 },
{ "Packages", "Install extra FreeBSD packaged software",
DMENU_CALL, configPackages, 0, 0 },
{ "Ports", "Enable the FreeBSD Ports Collection from CD",
@@ -658,32 +750,47 @@ When you're done, select Cancel",
{ "Root Password", "Set the system manager's password",
DMENU_SYSTEM_COMMAND, "passwd root", 0, 0 },
{ "XFree86", "Configure XFree86 (if installed)",
- DMENU_SYSTEM_COMMAND, "PATH=/usr/bin:/bin:/usr/X11R6/bin xf86config", 0, 0 },
+ DMENU_SYSTEM_COMMAND, "/usr/X11R6/bin/xf86config", 0, 0 },
+ { "Exit", "Exit this menu (returning to previous)",
+ DMENU_CANCEL, NULL, 0, 0 },
{ NULL } },
};
+static char *
+menuCheckNTP(DMenuItem *item)
+{
+ return getenv("ntpdate") ? "ON" : "OFF";
+}
+
+static char *
+menuCheckRouted(DMenuItem *item)
+{
+ return getenv("routedflags") ? "ON" : "OFF";
+}
+
DMenu MenuNetworking = {
- DMENU_NORMAL_TYPE,
+ DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS,
"Network Services Menu",
"You may have already configured one network device (and the\n\
other various hostname/gateway/name server parameters) in the process\n\
of installing FreeBSD. This menu allows you to configure other\n\
-aspects of your system's network configuration.\n\n\
-When you are done, select Cancel.",
+aspects of your system's network configuration.",
NULL,
NULL,
{ { "NFS client", "This machine will be an NFS client",
- DMENU_SET_VARIABLE, "nfs_client=YES", 0, 0 },
+ DMENU_SET_VARIABLE, "nfs_client=YES", 0, 0, dmenuVarCheck },
{ "NFS server", "This machine will be an NFS server",
- DMENU_SET_VARIABLE, "nfs_server=YES", 0, 0 },
- { "interfaces", "Configure additional interfaces",
- DMENU_CALL, tcpDeviceSelect, 0, 0 },
+ DMENU_SET_VARIABLE, "nfs_server=YES", 0, 0, dmenuVarCheck },
+ { "Interfaces", "Configure network interfaces",
+ DMENU_CALL, tcpMenuSelect, 0, 0 },
{ "ntpdate", "Select a clock-syncronization server",
- DMENU_SUBMENU, &MenuNTP, 0, 0 },
+ DMENU_SUBMENU, &MenuNTP, 0, 0, menuCheckNTP },
{ "routed", "Set flags for routed (default: -q)",
- DMENU_CALL, configRoutedFlags, 0, 0 },
+ DMENU_CALL, configRoutedFlags, 0, 0, menuCheckRouted },
{ "rwhod", "This machine wants to run the rwho daemon",
- DMENU_SET_VARIABLE, "rwhod=YES", 0, 0 },
+ DMENU_SET_VARIABLE, "rwhod=YES", 0, 0, dmenuVarCheck },
+ { "Exit", "Exit this menu (returning to previous)",
+ DMENU_CANCEL, NULL, 0, 0 },
{ NULL } },
};
@@ -695,7 +802,9 @@ for public use around the Internet. Please select one reasonably\n\
close to you to have your system time syncronized accordingly.",
"These are the primary open-access NTP servers",
NULL,
- { { "Australia", "ntp.syd.dms.csiro.au (HP 5061 Cesium Beam)",
+ { { "Other", "Select a site not on this list",
+ DMENU_CALL, configNTP, 0, 0 },
+ { "Australia", "ntp.syd.dms.csiro.au (HP 5061 Cesium Beam)",
DMENU_SET_VARIABLE, "ntpdate=ntp.syd.dms.csiro.au", 0, 0 },
{ "Canada", "tick.usask.ca (GOES clock)",
DMENU_SET_VARIABLE, "ntpdate=tick.usask.ca", 0, 0 },
@@ -751,11 +860,13 @@ When you are done setting configuration options, select Cancel.",
DMENU_SUBMENU, &MenuSysconsKeyrate, 0, 0 },
{ "Saver", "Configure the screen saver",
DMENU_SUBMENU, &MenuSysconsSaver, 0, 0 },
+ { "Exit", "Exit this menu (returning to previous)",
+ DMENU_CANCEL, NULL, 0, 0 },
{ NULL } },
};
DMenu MenuSysconsKeymap = {
- DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
+ DMENU_RADIO_TYPE | DMENU_SELECTION_RETURNS,
"System Console Keymap",
"The default system console driver for FreeBSD (syscons) defaults\n\
to a standard \"American\" keyboard map. Users in other countries\n\
@@ -764,54 +875,60 @@ the other keymaps below.",
"Choose a keyboard map",
NULL,
{ { "Danish CP865", "Danish Code Page 865 keymap",
- DMENU_SET_VARIABLE, "keymap=danish.cp865", 0, 0 },
+ DMENU_SET_VARIABLE, "keymap=danish.cp865", 0, 0, dmenuVarCheck },
{ "Danish ISO", "Danish ISO keymap",
- DMENU_SET_VARIABLE, "keymap=danish.iso", 0, 0 },
+ DMENU_SET_VARIABLE, "keymap=danish.iso", 0, 0, dmenuVarCheck },
{ "French ISO", "French ISO keymap",
- DMENU_SET_VARIABLE, "keymap=fr.iso", 0, 0 },
+ DMENU_SET_VARIABLE, "keymap=fr.iso", 0, 0, dmenuVarCheck },
{ "German CP850", "German Code Page 850 keymap",
- DMENU_SET_VARIABLE, "keymap=german.cp850", 0, 0 },
+ DMENU_SET_VARIABLE, "keymap=german.cp850", 0, 0, dmenuVarCheck },
{ "German ISO", "German ISO keymap",
- DMENU_SET_VARIABLE, "keymap=german.iso", 0, 0 },
+ DMENU_SET_VARIABLE, "keymap=german.iso", 0, 0, dmenuVarCheck },
{ "Russian CP866", "Russian Code Page 866 keymap",
- DMENU_SET_VARIABLE, "keymap=ru.cp866", 0, 0 },
+ DMENU_SET_VARIABLE, "keymap=ru.cp866", 0, 0, dmenuVarCheck },
{ "Russian KOI8", "Russian koi8 keymap",
- DMENU_SET_VARIABLE, "keymap=ru.koi8-r", 0, 0 },
+ DMENU_SET_VARIABLE, "keymap=ru.koi8-r", 0, 0, dmenuVarCheck },
{ "Russian s-KOI8", "Russian shifted koi8 keymap",
- DMENU_SET_VARIABLE, "keymap=ru.koi8-r.shift", 0, 0 },
+ DMENU_SET_VARIABLE, "keymap=ru.koi8-r.shift", 0, 0, dmenuVarCheck},
{ "Swedish CP850", "Swedish Code Page 850 keymap",
- DMENU_SET_VARIABLE, "keymap=swedish.cp850", 0, 0 },
+ DMENU_SET_VARIABLE, "keymap=swedish.cp850", 0, 0, dmenuVarCheck },
{ "Swedish ISO", "Swedish ISO keymap",
- DMENU_SET_VARIABLE, "keymap=swedish.iso", 0, 0 },
+ DMENU_SET_VARIABLE, "keymap=swedish.iso", 0, 0, dmenuVarCheck },
{ "U.K. CP850", "United Kingdom Code Page 850 keymap",
- DMENU_SET_VARIABLE, "keymap=uk.cp850.iso", 0, 0 },
+ DMENU_SET_VARIABLE, "keymap=uk.cp850", 0, 0, dmenuVarCheck },
{ "U.K. ISO", "United Kingdom ISO keymap",
- DMENU_SET_VARIABLE, "keymap=uk.iso", 0, 0 },
+ DMENU_SET_VARIABLE, "keymap=uk.iso", 0, 0, dmenuVarCheck },
{ "U.S. ISO", "United States ISO keymap",
- DMENU_SET_VARIABLE, "keymap=us.iso", 0, 0 },
+ DMENU_SET_VARIABLE, "keymap=us.iso", 0, 0, dmenuVarCheck },
{ NULL } },
};
DMenu MenuSysconsKeyrate = {
- DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
+ DMENU_RADIO_TYPE | DMENU_SELECTION_RETURNS,
"System Console Keyboard Repeat Rate",
"This menu allows you to set the speed at which keys repeat\n\
when held down.",
"Choose a keyboard repeat rate",
NULL,
{ { "Slow", "Slow keyboard repeat rate",
- DMENU_SET_VARIABLE, "keyrate=slow", 0, 0 },
+ DMENU_SET_VARIABLE, "keyrate=slow", 0, 0, dmenuVarCheck },
{ "Normal", "\"Normal\" keyboard repeat rate",
- DMENU_SET_VARIABLE, "keyrate=normal", 0, 0 },
+ DMENU_SET_VARIABLE, "keyrate=normal", 0, 0, dmenuVarCheck },
{ "Fast", "Fast keyboard repeat rate",
- DMENU_SET_VARIABLE, "keyrate=fast", 0, 0 },
+ DMENU_SET_VARIABLE, "keyrate=fast", 0, 0, dmenuVarCheck },
{ "Default", "Use default keyboard repeat rate",
- DMENU_SET_VARIABLE, "keyrate=NO", 0, 0 },
+ DMENU_SET_VARIABLE, "keyrate=NO", 0, 0, dmenuVarCheck },
{ NULL } },
};
+static char *
+menuSaverTimeoutCheck(DMenuItem *item)
+{
+ return getenv("blanktime") ? "ON" : "OFF";
+}
+
DMenu MenuSysconsSaver = {
- DMENU_NORMAL_TYPE,
+ DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS,
"System Console Screen Saver",
"By default, the console driver will not attempt to do anything\n\
special with your screen when it's idle. If you expect to leave your\n\
@@ -820,14 +937,16 @@ probably enable one of these screen savers to prevent phosphor burn-in.",
"Choose a nifty-looking screen saver",
NULL,
{ { "blank", "Simply blank the screen",
- DMENU_SET_VARIABLE, "saver=star", 0, 0 },
+ DMENU_SET_VARIABLE, "saver=blank", 0, 0, dmenuVarCheck },
{ "Green", "\"Green\" power saving mode (if supported by monitor)",
- DMENU_SET_VARIABLE, "saver=snake", 0, 0 },
+ DMENU_SET_VARIABLE, "saver=green", 0, 0, dmenuVarCheck },
{ "Snake", "Draw a FreeBSD \"snake\" on your screen",
- DMENU_SET_VARIABLE, "saver=snake", 0, 0 },
+ DMENU_SET_VARIABLE, "saver=snake", 0, 0, dmenuVarCheck },
{ "Star", "A \"twinkling stars\" effect",
- DMENU_SET_VARIABLE, "saver=star", 0, 0 },
+ DMENU_SET_VARIABLE, "saver=star", 0, 0, dmenuVarCheck },
{ "Timeout", "Set the screen saver timeout interval",
- DMENU_CALL, configSaverTimeout, 0, 0 },
+ DMENU_CALL, configSaverTimeout, 0, 0, menuSaverTimeoutCheck },
+ { "Exit", "Exit this menu (returning to previous)",
+ DMENU_CANCEL, NULL, 0, 0 },
{ NULL } },
};
diff --git a/usr.sbin/sysinstall/misc.c b/usr.sbin/sysinstall/misc.c
index 49d68f9..4a93b9e 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.10 1995/05/29 11:01:31 jkh Exp $
+ * $Id: misc.c,v 1.11.2.2 1995/06/01 22:32:06 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -243,34 +243,3 @@ Mount(char *mountp, void *dev)
}
return 0;
}
-
-int
-Mount_DOS(char *mountp, void *dev)
-{
- struct ufs_args ufsargs;
- char device[80];
- char mountpoint[FILENAME_MAX];
-
- if (*((char *)dev) != '/') {
- sprintf(device, "/mnt/dev/%s", (char *)dev);
- sprintf(mountpoint, "/mnt%s", mountp);
- }
- else {
- strcpy(device, dev);
- strcpy(mountpoint, mountp);
- }
- memset(&ufsargs,0,sizeof ufsargs);
-
- if (Mkdir(mountpoint, NULL)) {
- msgConfirm("Unable to make directory mountpoint for %s!", mountpoint);
- return 1;
- }
- msgDebug("mount %s %s\n", device, mountpoint);
- ufsargs.fspec = device;
- if (mount(MOUNT_MSDOS, mountpoint, 0, (caddr_t)&ufsargs) == -1) {
- msgConfirm("Error mounting %s on %s : %s\n", device, mountpoint, strerror(errno));
- return 1;
- }
- return 0;
-}
-
diff --git a/usr.sbin/sysinstall/msg.c b/usr.sbin/sysinstall/msg.c
index 0d3791c..088da89 100644
--- a/usr.sbin/sysinstall/msg.c
+++ b/usr.sbin/sysinstall/msg.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: msg.c,v 1.27 1995/05/29 11:01:32 jkh Exp $
+ * $Id: msg.c,v 1.28.2.2 1995/06/02 15:31:31 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -52,10 +52,7 @@
Boolean
isDebug(void)
{
- char *cp;
-
- cp = getenv("debug");
- if (cp && !strcmp(cp, "yes"))
+ if (OptFlags & OPT_DEBUG)
return TRUE;
return FALSE;
}
@@ -220,7 +217,7 @@ msgConfirm(char *fmt, ...)
w = dupwin(newscr);
if (OnVTY) {
msgDebug("Switching back to VTY 0\n");
- ioctl(0, VT_RELDISP, 1);
+ ioctl(0, VT_ACTIVATE, 1);
msgInfo(NULL);
}
dialog_notify(errstr);
@@ -268,7 +265,7 @@ msgYesNo(char *fmt, ...)
w = dupwin(newscr);
if (OnVTY) {
msgDebug("Switching back to VTY 0\n");
- ioctl(0, VT_RELDISP, 1); /* Switch back */
+ ioctl(0, VT_ACTIVATE, 1); /* Switch back */
msgInfo(NULL);
}
ret = dialog_yesno("User Confirmation Requested", errstr, -1, -1);
@@ -302,7 +299,7 @@ msgGetInput(char *buf, char *fmt, ...)
w = dupwin(newscr);
if (OnVTY) {
msgDebug("Switching back to VTY 0\n");
- ioctl(0, VT_RELDISP, 1); /* Switch back */
+ ioctl(0, VT_ACTIVATE, 1); /* Switch back */
msgInfo(NULL);
}
rval = dialog_inputbox("Value Required", errstr, -1, -1, input_buffer);
diff --git a/usr.sbin/sysinstall/network.c b/usr.sbin/sysinstall/network.c
index 950896e..526f3de 100644
--- a/usr.sbin/sysinstall/network.c
+++ b/usr.sbin/sysinstall/network.c
@@ -4,12 +4,10 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: network.c,v 1.5 1995/05/29 11:01:34 jkh Exp $
+ * $Id: network.c,v 1.6.2.14 1995/06/07 09:26:29 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
- * Copyright (c) 1995
- * Gary J Palmer. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -47,10 +45,12 @@
#include "sysinstall.h"
#include <sys/fcntl.h>
+#include <signal.h>
#include <sys/stat.h>
-static Boolean networkInitialized;
-static Boolean startPPP(Device *devp);
+static Boolean networkInitialized;
+static pid_t pppPid;
+static pid_t startPPP(Device *devp);
Boolean
mediaInitNetwork(Device *dev)
@@ -58,16 +58,18 @@ mediaInitNetwork(Device *dev)
int i;
char *rp;
- if (networkInitialized)
+ if (networkInitialized || (dev->flags & OPT_LEAVE_NETWORK_UP))
return TRUE;
configResolv();
if (!strncmp("cuaa", dev->name, 4)) {
if (!msgYesNo("You have selected a serial-line network interface.\nDo you want to use PPP with it?")) {
- if (!startPPP(dev)) {
+ if (!(dev->private = (void *)startPPP(dev))) {
msgConfirm("Unable to start PPP! This installation method\ncannot be used.");
return FALSE;
}
+ networkInitialized = TRUE;
+ return TRUE;
}
else {
char *val;
@@ -78,8 +80,12 @@ mediaInitNetwork(Device *dev)
val = msgGetInput(attach, "Warning: SLIP is rather poorly supported in this revision\nof the installation due to the lack of a dialing utility.\nIf you can use PPP for this instead then you're much better\noff doing so, otherwise SLIP works fairly well for *hardwired*\nlinks. Please edit the following slattach command for\ncorrectness (default here is VJ compression, Hardware flow-control,\nignore carrier and 9600 baud data rate) and hit return to execute it.");
if (!val)
return FALSE;
- else if (!vsystem(attach))
+ else
+ strcpy(attach, val);
+ if (!vsystem(attach)) {
+ dev->private = NULL;
return TRUE;
+ }
else {
msgConfirm("slattach returned a bad status! Please verify that\nthe command is correct and try again.");
return FALSE;
@@ -103,9 +109,8 @@ mediaInitNetwork(Device *dev)
}
rp = getenv(VAR_GATEWAY);
- if (!rp)
- msgConfirm("No gateway has been set. You will not be able to access hosts\n
-not on the local network\n");
+ if (!rp || *rp == '0')
+ msgConfirm("No gateway has been set. You may be unable to access hosts\nnot on your local network\n");
else
vsystem("route add default %s", rp);
networkInitialized = TRUE;
@@ -117,10 +122,9 @@ mediaShutdownNetwork(Device *dev)
{
char *cp;
- if (!networkInitialized)
+ if (!networkInitialized || (dev->flags & OPT_LEAVE_NETWORK_UP))
return;
- /* If we're running PPP or SLIP, it's too much trouble to shut down so forget it */
if (strncmp("cuaa", dev->name, 4)) {
int i;
char ifconfig[64];
@@ -137,38 +141,53 @@ mediaShutdownNetwork(Device *dev)
vsystem("route delete default");
networkInitialized = FALSE;
}
-}
-
-int
-configRoutedFlags(char *str)
-{
- char *val;
-
- val = msgGetInput("-q", "Specify the flags for routed; -q is the default, -s is\na good choice for gateway machines.");
- if (val)
- variable_set2("routedflags", val);
- return 0;
+ else if (pppPid != 0) {
+ kill(pppPid, SIGTERM);
+ pppPid = 0;
+ }
}
/* Start PPP on the 3rd screen */
-static Boolean
+static pid_t
startPPP(Device *devp)
{
- int fd, fd2;
+ int vfd, fd2;
FILE *fp;
char *val;
- char myaddr[16], provider[16];
+ pid_t pid;
+ char myaddr[16], provider[16], speed[16];
+
+ /* We're going over to VTY2 */
+ vfd = open("/dev/ttyv2", O_RDWR);
+ if (vfd == -1)
+ return 0;
- fd = open("/dev/ttyv2", O_RDWR);
- if (fd == -1)
- return FALSE;
+ /* These are needed to make ppp work */
Mkdir("/var/log", NULL);
Mkdir("/var/spool/lock", NULL);
Mkdir("/etc/ppp", NULL);
- fd2 = open("/etc/ppp/ppp.linkup", O_CREAT);
- if (fd2 != -1) {
- fchmod(fd2, 0755);
- close(fd2);
+
+ /* Get any important user values */
+ val = msgGetInput("115200",
+"Enter the baud rate for your modem - this can be higher than the actual\nmaximum data rate since most modems can talk at one speed to the\ncomputer and at another speed to the remote end.\n\nIf you're not sure what to put here, just select the default.");
+ strcpy(speed, val ? val : "115200");
+
+ strcpy(provider, getenv(VAR_GATEWAY) ? getenv(VAR_GATEWAY) : "0");
+ val = msgGetInput(provider, "Enter the IP address of your service provider or 0 if you\ndon't know it and would prefer to negotiate it dynamically.");
+ strcpy(provider, val ? val : "0");
+
+ if (devp->private && ((DevInfo *)devp->private)->ipaddr[0])
+ strcpy(myaddr, ((DevInfo *)devp->private)->ipaddr);
+ else
+ strcpy(myaddr, "0");
+
+ fp = fopen("/etc/ppp/ppp.linkup", "w");
+ if (fp != NULL) {
+ fprintf(fp, "MYADDR:\n");
+ fprintf(fp, " delete ALL\n");
+ fprintf(fp, " add 0 0 HISADDR\n");
+ fchmod(fileno(fp), 0755);
+ fclose(fp);
}
fd2 = open("/etc/ppp/ppp.secret", O_CREAT);
if (fd2 != -1) {
@@ -178,35 +197,27 @@ startPPP(Device *devp)
fp = fopen("/etc/ppp/ppp.conf", "w");
if (!fp) {
msgConfirm("Couldn't open /etc/ppp/ppp.conf file! This isn't going to work");
- return FALSE;
+ return 0;
}
fprintf(fp, "default:\n");
+ fprintf(fp, " set speed %s\n", speed);
fprintf(fp, " set device %s\n", devp->devname);
- val = msgGetInput("115200",
-"Enter the baud rate for your modem - this can be higher than the actual\nmaximum data rate since most modems can talk at one speed to the\ncomputer and at another speed to the remote end.\n\nIf you're not sure what to put here, just select the default.");
- if (!val)
- val = "115200";
- fprintf(fp, " set speed %s\n", val);
- if (getenv(VAR_GATEWAY))
- strcpy(provider, getenv(VAR_GATEWAY));
- else
- strcpy(provider, "0");
- val = msgGetInput(provider, "Enter the IP address of your service provider or 0 if you\ndon't know it and would prefer to negotiate it dynamically.");
- if (!val)
- val = "0";
- if (devp->private && ((DevInfo *)devp->private)->ipaddr[0])
- strcpy(myaddr, ((DevInfo *)devp->private)->ipaddr);
- else
- strcpy(myaddr, "0");
- fprintf(fp, " set ifaddr %s %s\n", myaddr, val);
+ fprintf(fp, " set ifaddr %s %s\n", myaddr, provider);
fclose(fp);
- if (!fork()) {
- dup2(fd, 0);
- dup2(fd, 1);
- dup2(fd, 2);
+
+ if (isDebug())
+ msgDebug("Creating /dev/tun0 device.\n");
+ if (!file_readable("/dev/tun0") && mknod("/dev/tun0", 0600 | S_IFCHR, makedev(52, 0))) {
+ msgConfirm("Warning: No /dev/tun0 device. PPP will not work!");
+ return 0;
+ }
+ if (!(pid = fork())) {
+ dup2(vfd, 0);
+ dup2(vfd, 1);
+ dup2(vfd, 2);
execl("/stand/ppp", "/stand/ppp", (char *)NULL);
exit(1);
}
msgConfirm("The PPP command is now started on screen 3 (type ALT-F3 to\ninteract with it, ALT-F1 to switch back here). The only command\nyou'll probably want or need to use is the \"term\" command\nwhich starts a terminal emulator you can use to talk to your\nmodem and dial the service provider. Once you're connected,\ncome back to this screen and press return. DO NOT PRESS RETURN\nHERE UNTIL THE CONNECTION IS FULLY ESTABLISHED!");
- return TRUE;
+ return pid;
}
diff --git a/usr.sbin/sysinstall/nfs.c b/usr.sbin/sysinstall/nfs.c
index f752aca..cf04e5e 100644
--- a/usr.sbin/sysinstall/nfs.c
+++ b/usr.sbin/sysinstall/nfs.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: nfs.c,v 1.3 1995/05/30 05:13:24 jkh Exp $
+ * $Id: nfs.c,v 1.4.2.6 1995/06/10 02:21:40 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -58,17 +58,14 @@ mediaInitNFS(Device *dev)
if (NFSMounted)
return TRUE;
- if (netDevice->init)
- if (!(*netDevice->init)(netDevice))
- return FALSE;
+ if (!(*netDevice->init)(netDevice))
+ return FALSE;
if (Mkdir("/nfs", NULL))
return FALSE;
- if (!vsystem("mount_nfs %s %s %s /nfs", getenv("nfsSlowPC") ? "-r 1024 -w 1024" : "",
- getenv("nfsServerSecure") ? "-P" : "", dev->name))
- return TRUE;
- else {
+ if (vsystem("mount_nfs %s %s %s /nfs", (OptFlags & OPT_SLOW_ETHER) ? "-r 1024 -w 1024" : "",
+ (OptFlags & OPT_NFS_SECURE) ? "-P" : "", dev->name)) {
msgConfirm("Error mounting %s on /nfs: %s (%u)\n", dev->name, strerror(errno), errno);
return FALSE;
}
@@ -77,13 +74,13 @@ mediaInitNFS(Device *dev)
}
int
-mediaGetNFS(char *file)
+mediaGetNFS(Device *dev, char *file, Attribs *dist_attrs)
{
char buf[PATH_MAX];
snprintf(buf, PATH_MAX, "/nfs/%s", file);
if (!access(buf, R_OK))
- return open(buf, O_RDONLY);
+ return open(buf, O_RDONLY);
snprintf(buf, PATH_MAX, "/nfs/dists/%s", file);
return open(buf, O_RDONLY);
}
@@ -96,12 +93,11 @@ mediaShutdownNFS(Device *dev)
if (!NFSMounted)
return;
msgDebug("Unmounting /nfs\n");
- if (unmount("/nfs", 0) != 0)
+ if (unmount("/nfs", MNT_FORCE) != 0)
msgConfirm("Could not unmount the NFS partition: %s\n", strerror(errno));
if (isDebug())
msgDebug("Unmount returned\n");
- if (netdev->shutdown)
- (*netdev->shutdown)(netdev);
+ (*netdev->shutdown)(netdev);
NFSMounted = FALSE;
return;
}
diff --git a/usr.sbin/sysinstall/sysinstall.h b/usr.sbin/sysinstall/sysinstall.h
index e18bcf8..c845941 100644
--- a/usr.sbin/sysinstall/sysinstall.h
+++ b/usr.sbin/sysinstall/sysinstall.h
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: sysinstall.h,v 1.40 1995/05/29 11:01:37 jkh Exp $
+ * $Id: sysinstall.h,v 1.41.2.20 1995/06/10 09:14:53 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -69,6 +69,7 @@
#define DEV_NAME_MAX 128 /* The maximum length of a device name */
#define DEV_MAX 200 /* The maximum number of devices we'll deal with */
#define INTERFACE_MAX 50 /* Maximum number of network interfaces we'll deal with */
+#define MAX_FTP_RETRIES 3 /* How many times to beat our heads against the wall */
/*
* I make some pretty gross assumptions about having a max of 50 chunks
@@ -85,7 +86,20 @@
#define DISK_LABELLED "_diskLabelled"
#define RUNNING_ON_ROOT "_runningOnRoot"
#define TCP_CONFIGURED "_tcpConfigured"
-#define NO_CONFIRMATION "noConfirmation"
+
+#define FTP_USER "_ftpUser"
+#define FTP_PASS "_ftpPass"
+
+#define OPT_NO_CONFIRM 0x0001
+#define OPT_NFS_SECURE 0x0002
+#define OPT_DEBUG 0x0004
+#define OPT_FTP_ACTIVE 0x0008
+#define OPT_FTP_PASSIVE 0x0010
+#define OPT_FTP_RESELECT 0x0020
+#define OPT_FTP_ABORT 0x0040
+#define OPT_SLOW_ETHER 0x0080
+#define OPT_EXPLORATORY_GET 0x0100
+#define OPT_LEAVE_NETWORK_UP 0x0200
#define VAR_HOSTNAME "hostname"
#define VAR_DOMAINNAME "domainname"
@@ -105,13 +119,13 @@ typedef struct disk Disk;
typedef struct chunk Chunk;
typedef enum {
- DMENU_SHELL_ESCAPE, /* Fork a shell */
DMENU_DISPLAY_FILE, /* Display a file's contents */
DMENU_SUBMENU, /* Recurse into another menu */
DMENU_SYSTEM_COMMAND, /* Run shell commmand */
DMENU_SYSTEM_COMMAND_BOX, /* Same as above, but in prgbox */
DMENU_SET_VARIABLE, /* Set an environment/system var */
DMENU_SET_FLAG, /* Set flag in an unsigned int */
+ DMENU_SET_VALUE, /* Set unsigned int to value */
DMENU_CALL, /* Call back a C function */
DMENU_CANCEL, /* Cancel out of this menu */
DMENU_NOP, /* Do nothing special for item */
@@ -124,6 +138,7 @@ typedef struct _dmenuItem {
void *ptr; /* Generic data ptr */
u_long parm; /* Parameter for above */
Boolean disabled; /* Are we temporarily disabled? */
+ char * (*check)(struct _dmenuItem *); /* Our state */
} DMenuItem;
typedef struct _dmenu {
@@ -172,11 +187,12 @@ typedef struct _device {
char *devname;
DeviceType type;
Boolean enabled;
- Boolean (*init)(struct _device *);
- int (*get)(char *file);
- Boolean (*close)(struct _device *, int fd);
- void (*shutdown)(struct _device *);
+ Boolean (*init)(struct _device *dev);
+ int (*get)(struct _device *dev, char *file, Attribs *dist_attrs);
+ Boolean (*close)(struct _device *dev, int fd);
+ void (*shutdown)(struct _device *dev);
void *private;
+ unsigned int flags;
} Device;
/* Some internal representations of partitions */
@@ -213,8 +229,6 @@ typedef struct _devPriv {
/*** Externs ***/
extern int DebugFD; /* Where diagnostic output goes */
-extern Boolean OnCDROM; /* Are we running off of a CDROM? */
-extern Boolean OnSerial; /* Are we on a serial console? */
extern Boolean SystemWasInstalled; /* Did we install it? */
extern Boolean RunningAsInit; /* Are we running stand-alone? */
extern Boolean DialogActive; /* Is the dialog() stuff up? */
@@ -223,10 +237,15 @@ extern Boolean OnVTY; /* On a syscons VTY? */
extern Variable *VarHead; /* The head of the variable chain */
extern Device *mediaDevice; /* Where we're getting our distribution from */
extern unsigned int Dists; /* Which distributions we want */
+extern unsigned int DESDists; /* Which naughty distributions we want */
extern unsigned int SrcDists; /* Which src distributions we want */
extern unsigned int XF86Dists; /* Which XFree86 dists we want */
extern unsigned int XF86ServerDists; /* The XFree86 servers we want */
extern unsigned int XF86FontDists; /* The XFree86 fonts we want */
+extern unsigned int OptFlags; /* Global options */
+extern int BootMgr; /* Which boot manager to use */
+extern char *InstallPrefix; /* A location bias */
+
extern DMenu MenuInitial; /* Initial installation menu */
extern DMenu MenuMBRType; /* Type of MBR to write on the disk */
@@ -234,7 +253,6 @@ extern DMenu MenuConfigure; /* Final configuration menu */
extern DMenu MenuDocumentation; /* Documentation menu */
extern DMenu MenuOptions; /* Installation options */
extern DMenu MenuOptionsLanguage; /* Language options menu */
-extern DMenu MenuOptionsFTP; /* FTP options menu */
extern DMenu MenuMedia; /* Media type menu */
extern DMenu MenuMediaCDROM; /* CDROM media menu */
extern DMenu MenuMediaDOS; /* DOS media menu */
@@ -251,6 +269,7 @@ extern DMenu MenuNetworking; /* Network configuration menu */
extern DMenu MenuInstall; /* Installation menu */
extern DMenu MenuInstallType; /* Installation type menu */
extern DMenu MenuDistributions; /* Distribution menu */
+extern DMenu MenuDESDistributions; /* DES distribution menu */
extern DMenu MenuSrcDistributions; /* Source distribution menu */
extern DMenu MenuXF86; /* XFree86 main menu */
extern DMenu MenuXF86Select; /* XFree86 distribution selection menu */
@@ -268,7 +287,7 @@ extern int attr_parse(Attribs **attr, char *file);
/* cdrom.c */
extern Boolean mediaInitCDROM(Device *dev);
-extern int mediaGetCDROM(char *file);
+extern int mediaGetCDROM(Device *dev, char *file, Attribs *dist_attrs);
extern void mediaShutdownCDROM(Device *dev);
/* command.c */
@@ -285,6 +304,11 @@ extern void configResolv(void);
extern int configPorts(char *str);
extern int configPackages(char *str);
extern int configSaverTimeout(char *str);
+extern int configNTP(char *str);
+extern int configRoutedFlags(char *str);
+
+/* crc.c */
+extern int crc(int, unsigned long *, unsigned long *);
/* decode.c */
extern DMenuItem *decode(DMenu *menu, char *name);
@@ -298,9 +322,13 @@ extern Device **deviceFind(char *name, DeviceType type);
extern int deviceCount(Device **devs);
extern Device *new_device(char *name);
extern Device *deviceRegister(char *name, char *desc, char *devname, DeviceType type, Boolean enabled,
- Boolean (*init)(Device *mediadev), int (*get)(char *file),
+ Boolean (*init)(Device *mediadev), int (*get)(Device *dev, char *file, Attribs *dist_attrs),
Boolean (*close)(Device *mediadev, int fd), void (*shutDown)(Device *mediadev),
void *private);
+extern Boolean dummyInit(Device *dev);
+extern int dummyGet(Device *dev, char *dist, Attribs *dist_attrs);
+extern Boolean dummyClose(Device *dev, int fd);
+extern void dummyShutdown(Device *dev);
/* disks.c */
extern int diskPartitionEditor(char *unused);
@@ -309,34 +337,40 @@ extern int diskPartitionEditor(char *unused);
extern int distReset(char *str);
extern int distSetDeveloper(char *str);
extern int distSetXDeveloper(char *str);
+extern int distSetKernDeveloper(char *str);
extern int distSetUser(char *str);
extern int distSetXUser(char *str);
extern int distSetMinimum(char *str);
extern int distSetEverything(char *str);
+extern int distSetDES(char *str);
extern int distSetSrc(char *str);
+extern int distSetXF86(char *str);
extern void distExtractAll(void);
/* dmenu.c */
-extern void dmenuOpen(DMenu *menu, int *choice, int *scroll,
- int *curr, int *max);
-extern void dmenuOpenSimple(DMenu *menu);
+extern Boolean dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max);
+extern Boolean dmenuOpenSimple(DMenu *menu);
+extern char *dmenuVarCheck(DMenuItem *item);
+extern char *dmenuFlagCheck(DMenuItem *item);
+extern char *dmenuRadioCheck(DMenuItem *item);
/* dos.c */
extern Boolean mediaInitDOS(Device *dev);
-extern int mediaGetDOS(char *file);
+extern int mediaGetDOS(Device *dev, char *file, Attribs *dist_attrs);
extern void mediaShutdownDOS(Device *dev);
/* floppy.c */
extern int getRootFloppy(void);
extern Boolean mediaInitFloppy(Device *dev);
-extern int mediaGetFloppy(char *file);
+extern int mediaGetFloppy(Device *dev, char *file, Attribs *dist_attrs);
extern void mediaShutdownFloppy(Device *dev);
/* ftp_strat.c */
extern Boolean mediaCloseFTP(Device *dev, int fd);
extern Boolean mediaInitFTP(Device *dev);
-extern int mediaGetFTP(char *file);
+extern int mediaGetFTP(Device *dev, char *file, Attribs *dist_attrs);
extern void mediaShutdownFTP(Device *dev);
+extern int mediaSetFtpUserPass(char *str);
/* globals.c */
extern void globalsInit(void);
@@ -403,7 +437,6 @@ extern char **item_add_pair(char **list, char *item1, char *item2,
extern void items_free(char **list, int *curr, int *max);
extern int Mkdir(char *, void *data);
extern int Mount(char *, void *data);
-extern int Mount_DOS(char *, void *data);
/* msg.c */
extern Boolean isDebug(void);
@@ -422,19 +455,16 @@ extern char *msgGetInput(char *buf, char *fmt, ...);
/* network.c */
extern Boolean mediaInitNetwork(Device *dev);
extern void mediaShutdownNetwork(Device *dev);
-extern int configRoutedFlags(char *str);
/* nfs.c */
extern Boolean mediaInitNFS(Device *dev);
-extern int mediaGetNFS(char *file);
+extern int mediaGetNFS(Device *dev, char *file, Attribs *dist_attrs);
extern void mediaShutdownNFS(Device *dev);
/* system.c */
extern void systemInitialize(int argc, char **argv);
extern void systemShutdown(void);
-extern void systemWelcome(void);
extern int systemExecute(char *cmd);
-extern int systemShellEscape(void);
extern int systemDisplayFile(char *file);
extern char *systemHelpFile(char *file, char *buf);
extern void systemChangeFont(const u_char font[]);
@@ -446,12 +476,13 @@ extern int vsystem(char *fmt, ...);
/* tape.c */
extern Boolean mediaInitTape(Device *dev);
-extern int mediaGetTape(char *file);
+extern int mediaGetTape(Device *dev, char *file, Attribs *dist_attrs);
extern void mediaShutdownTape(Device *dev);
/* tcpip.c */
extern int tcpOpenDialog(Device *dev);
-extern int tcpDeviceSelect(char *str);
+extern int tcpMenuSelect(char *str);
+extern Boolean tcpDeviceSelect(void);
/* termcap.c */
extern int set_termcap(void);
@@ -459,7 +490,7 @@ extern int set_termcap(void);
/* ufs.c */
extern void mediaShutdownUFS(Device *dev);
extern Boolean mediaInitUFS(Device *dev);
-extern int mediaGetUFS(char *file);
+extern int mediaGetUFS(Device *dev, char *file, Attribs *dist_attrs);
/* variables.c */
extern void variable_set(char *var);
diff --git a/usr.sbin/sysinstall/system.c b/usr.sbin/sysinstall/system.c
index 8f68a42..066558b 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.42 1995/05/29 11:01:39 jkh Exp $
+ * $Id: system.c,v 1.43.2.14 1995/06/09 14:33:36 jkh Exp $
*
* Jordan Hubbard
*
@@ -36,13 +36,6 @@ handle_intr(int sig)
systemShutdown();
}
-/* Welcome the user to the system */
-void
-systemWelcome(void)
-{
- printf("Installation system initializing..\n");
-}
-
/* Initialize system defaults */
void
systemInitialize(int argc, char **argv)
@@ -55,23 +48,14 @@ systemInitialize(int argc, char **argv)
/* Are we running as init? */
if (getpid() == 1) {
setsid();
- if (argc > 1 && strchr(argv[1],'C')) {
- /* Kernel told us that we are on a CDROM root */
- close(0); open("/bootcd/dev/console", O_RDWR);
- close(1); dup(0);
- close(2); dup(0);
- OnCDROM = TRUE;
- chroot("/bootcd");
- } else {
- close(0); open("/dev/ttyv0", O_RDWR);
- close(1); dup(0);
- close(2); dup(0);
- }
+ close(0); open("/dev/ttyv0", O_RDWR);
+ close(1); dup(0);
+ close(2); dup(0);
printf("%s running as init\n", argv[0]);
i = ioctl(0, TIOCSCTTY, (char *)NULL);
setlogin("root");
- setenv("PATH", "/stand:/bin:/sbin:/usr/sbin:/usr/bin:/mnt/bin:/mnt/sbin:/mnt/usr/sbin:/mnt/usr/bin", 1);
+ setenv("PATH", "/stand:/bin:/sbin:/usr/sbin:/usr/bin:/mnt/bin:/mnt/sbin:/mnt/usr/sbin:/mnt/usr/bin:/usr/X11R6/bin", 1);
setbuf(stdin, 0);
setbuf(stderr, 0);
}
@@ -103,7 +87,7 @@ systemShutdown(void)
/* REALLY exit! */
if (RunningAsInit) {
/* Put the console back */
- ioctl(DebugFD, VT_RELDISP, 1);
+ ioctl(0, VT_ACTIVATE, 2);
reboot(RB_HALT);
}
else
@@ -127,39 +111,6 @@ systemExecute(char *command)
return status;
}
-/* Find and execute a shell */
-int
-systemShellEscape(void)
-{
- char *sh = NULL;
-
- if (file_executable("/bin/sh"))
- sh = "/bin/sh";
- else if (file_executable("/stand/sh"))
- sh = "/stand/sh";
- else {
- msgWarn("No shell available, sorry!");
- return 1;
- }
- setenv("PS1", "freebsd% ", 1);
- dialog_clear();
- dialog_update();
- move(0, 0);
- standout();
- addstr("Type `exit' to leave this shell and continue installation");
- standend();
- refresh();
- end_dialog();
- DialogActive = FALSE;
- if (fork() == 0)
- execlp(sh, "-sh", 0);
- else
- wait(NULL);
- dialog_clear();
- DialogActive = TRUE;
- return 0;
-}
-
/* Display a file in a filebox */
int
systemDisplayFile(char *file)
@@ -197,43 +148,41 @@ systemHelpFile(char *file, char *buf)
{
char *cp;
static char oldfile[64]; /* Should be FILENAME_MAX but I don't feel like wasting that much space */
+ static char oldlang[64];
+ char extract[64], *default_lang = "en_US.ISO8859-1";
+ int i;
if (!file)
return NULL;
- if ((cp = getenv("LANG")) != NULL) {
- snprintf(buf, FILENAME_MAX, "%s/%s", cp, file);
- if (oldfile[0]) {
- if (!strcmp(buf, oldfile))
- return oldfile;
- else {
- unlink(oldfile);
- oldfile[0] = '\0';
- }
- }
- vsystem("cd /stand && zcat help.tgz | cpio --format=tar -idv %s > /dev/null 2>&1",buf);
+ if ((cp = getenv("LANG")) == NULL)
+ cp = default_lang;
+
+ for (i = 0; i < 2; i++) {
snprintf(buf, FILENAME_MAX, "/stand/%s/%s", cp, file);
+ if (file_readable(buf))
+ return buf;
+ if (*oldfile) {
+ int i;
+
+ i = unlink(oldfile);
+ if (isDebug())
+ msgDebug("Unlink(%s) = %d\n", oldfile, i);
+ i = rmdir(oldlang);
+ if (isDebug())
+ msgDebug("rmdir(%s) = %d\n", oldlang, i);
+ oldfile[0] = '\0';
+ }
+ snprintf(extract, 64, "%s/%s", cp, file);
+ vsystem("cd /stand && zcat help.tgz | cpio --format=tar -idv %s > /dev/null 2>&1", extract);
if (file_readable(buf)) {
strcpy(oldfile, buf);
+ sprintf(oldlang, "/stand/%s", cp);
return buf;
}
- }
- /* Fall back to normal imperialistic mode :-) */
- cp = "en_US.ISO8859-1";
- snprintf(buf, FILENAME_MAX, "%s/%s", cp, file);
- if (oldfile[0]) {
- if (!strcmp(buf, oldfile))
- return oldfile;
- else {
- unlink(oldfile);
- oldfile[0] = '\0';
- }
- }
- vsystem("cd /stand && zcat help.tgz | cpio --format=tar -idv %s > /dev/null 2>&1",buf);
- snprintf(buf, FILENAME_MAX, "/stand/%s/%s", cp, file);
- if (file_readable(buf)) {
- strcpy(oldfile, buf);
- return buf;
+ if (cp == default_lang)
+ break;
+ cp = default_lang;
}
return NULL;
}
@@ -245,7 +194,6 @@ systemChangeFont(const u_char font[])
if (ioctl(0, PIO_FONT8x16, font) < 0)
msgConfirm("Sorry! Unable to load font for %s", getenv("LANG"));
}
- dialog_clear();
}
void
@@ -277,8 +225,10 @@ systemChangeTerminal(char *color, const u_char c_term[],
init_acs();
cbreak(); noecho();
}
- dialog_clear();
}
+ clear();
+ refresh();
+ dialog_clear();
}
void
@@ -289,7 +239,6 @@ systemChangeScreenmap(const u_char newmap[])
msgConfirm("Sorry! Unable to load the screenmap for %s",
getenv("LANG"));
}
- dialog_clear();
}
int
diff --git a/usr.sbin/sysinstall/tape.c b/usr.sbin/sysinstall/tape.c
index a60f48f..1b9d93c 100644
--- a/usr.sbin/sysinstall/tape.c
+++ b/usr.sbin/sysinstall/tape.c
@@ -4,12 +4,10 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: tape.c,v 1.4 1995/05/29 11:01:40 jkh Exp $
+ * $Id: tape.c,v 1.5.2.6 1995/06/05 15:33:09 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
- * Copyright (c) 1995
- * Gary J Palmer. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -59,17 +57,15 @@ mediaInitTape(Device *dev)
if (tapeInitted)
return TRUE;
- Mkdir("/usr/tmp/tape", NULL);
- if (chdir("/usr/tmp/tape")) {
- Mkdir("/var/tmp/tape", NULL);
- if (chdir("/var/tmp/tape"))
+ Mkdir(dev->private, NULL);
+ if (chdir(dev->private))
return FALSE;
- }
msgConfirm("Insert tape into %s and press return", dev->description);
+ msgNotify("Attempting to extract from %s...", dev->description);
if (!strcmp(dev->name, "ft0"))
- i = vsystem("ft | tar xvf -");
+ i = vsystem("ft | cpio -iduVm -H tar");
else
- i = vsystem("tar xvf %s", dev->devname);
+ i = vsystem("cpio -iBduVm -H tar -I %s", dev->devname);
if (!i) {
tapeInitted = TRUE;
return TRUE;
@@ -80,14 +76,14 @@ mediaInitTape(Device *dev)
}
int
-mediaGetTape(char *file)
+mediaGetTape(Device *dev, char *file, Attribs *dist_attrs)
{
char buf[PATH_MAX];
- sprintf(buf, "/usr/tmp/tape/%s", file);
- if (!access(buf, R_OK))
- return open(buf, O_RDONLY);
- sprintf(buf, "/var/tmp/tape/%s", file);
+ sprintf(buf, "%s/%s", (char *)dev->private, file);
+ if (file_readable(buf))
+ return open(buf, O_RDONLY);
+ sprintf(buf, "%s/dists/%s", (char *)dev->private, file);
return open(buf, O_RDONLY);
}
@@ -96,9 +92,9 @@ mediaShutdownTape(Device *dev)
{
if (!tapeInitted)
return;
- if (!access("/usr/tmp/tape", X_OK))
- (void)vsystem("rm -rf /usr/tmp/tape");
- else if (!access("/var/tmp/tape", X_OK))
- (void)vsystem("rm -rf /var/tmp/tape");
+ if (!access(dev->private, X_OK)) {
+ msgNotify("Cleaning up results of tape extract..");
+ (void)vsystem("rm -rf %s", (char *)dev->private);
+ }
tapeInitted = FALSE;
}
diff --git a/usr.sbin/sysinstall/tcpip.c b/usr.sbin/sysinstall/tcpip.c
index ea2cf3e..40a6af8 100644
--- a/usr.sbin/sysinstall/tcpip.c
+++ b/usr.sbin/sysinstall/tcpip.c
@@ -1,5 +1,5 @@
/*
- * $Id: tcpip.c,v 1.28 1995/05/29 12:32:41 jkh Exp $
+ * $Id: tcpip.c,v 1.29.2.8 1995/06/06 06:08:29 jkh Exp $
*
* Copyright (c) 1995
* Gary J Palmer. All rights reserved.
@@ -83,7 +83,7 @@ typedef struct _layout {
static Layout layout[] = {
{ 1, 2, 25, HOSTNAME_FIELD_LEN - 1,
- "Host name:", "The name of your machine on a network, e.g. foo.bar.com",
+ "Host name:", "Your fully-qualified hostname, e.g. foo.bar.com",
hostname, STRINGOBJ, NULL },
#define LAYOUT_HOSTNAME 0
{ 1, 35, 20, HOSTNAME_FIELD_LEN - 1,
@@ -392,9 +392,11 @@ tcpOpenDialog(Device *devp)
if (!cancel) {
DevInfo *di;
char temp[512], ifn[64];
+ char *ifaces;
variable_set2(VAR_HOSTNAME, hostname);
- variable_set2(VAR_DOMAINNAME, domainname);
+ if (domainname[0])
+ variable_set2(VAR_DOMAINNAME, domainname);
if (gateway[0])
variable_set2(VAR_GATEWAY, gateway);
if (nameserver[0])
@@ -410,8 +412,14 @@ tcpOpenDialog(Device *devp)
sprintf(temp, "inet %s %s netmask %s", ipaddr, extras, netmask);
sprintf(ifn, "%s%s", VAR_IFCONFIG, devp->name);
variable_set2(ifn, temp);
- sprintf(ifn, "%s %s", devp->name, getenv(VAR_INTERFACES) ? getenv(VAR_INTERFACES) : "");
- variable_set2(VAR_INTERFACES, ifn);
+ ifaces = getenv(VAR_INTERFACES);
+ if (!ifaces)
+ variable_set2(VAR_INTERFACES, ifaces = "lo0");
+ /* Only add it if it's not there already */
+ if (!strstr(ifaces, devp->name)) {
+ sprintf(ifn, "%s %s", devp->name, ifaces);
+ variable_set2(VAR_INTERFACES, ifn);
+ }
if (ipaddr[0])
variable_set2(VAR_IPADDR, ipaddr);
return 0;
@@ -438,15 +446,41 @@ netHook(char *str)
}
/* Get a network device */
-int
-tcpDeviceSelect(char *str)
+Boolean
+tcpDeviceSelect(void)
{
DMenu *menu;
+ Device **devs;
+ int cnt;
+ int status;
+
+ devs = deviceFind(NULL, DEVICE_TYPE_NETWORK);
+ cnt = deviceCount(devs);
+ if (!cnt) {
+ msgConfirm("No network devices available!");
+ status = FALSE;
+ }
+ else if (cnt == 1) {
+ tcpOpenDialog(devs[0]);
+ mediaDevice = devs[0];
+ status = TRUE;
+ }
+ else {
+
+ menu = deviceCreateMenu(&MenuNetworkDevice, DEVICE_TYPE_NETWORK, netHook);
+ if (!menu)
+ msgFatal("Unable to create network device menu! Argh!");
+ status = dmenuOpenSimple(menu);
+ free(menu);
+ }
+ return status;
+}
- menu = deviceCreateMenu(&MenuNetworkDevice, DEVICE_TYPE_NETWORK, netHook);
- if (!menu)
- msgFatal("Unable to create network device menu! Argh!");
- dmenuOpenSimple(menu);
- free(menu);
+/* Do it from a menu that doesn't care about status */
+int
+tcpMenuSelect(char *str)
+{
+ (void)tcpDeviceSelect();
+ configResolv();
return 0;
}
diff --git a/usr.sbin/sysinstall/termcap.c b/usr.sbin/sysinstall/termcap.c
index 384e532..3ab2088 100644
--- a/usr.sbin/sysinstall/termcap.c
+++ b/usr.sbin/sysinstall/termcap.c
@@ -29,21 +29,16 @@ set_termcap(void)
char *term;
int stat;
- OnVTY = OnSerial = FALSE;
- if (getpid() != 1)
- DebugFD = open("sysinstall.debug", O_WRONLY|O_CREAT|O_TRUNC, 0644);
- else {
- int i, on;
+ OnVTY = RunningAsInit = FALSE;
- DebugFD = open("/dev/ttyv1", O_WRONLY);
- on = 1;
- i = ioctl(DebugFD, TIOCCONS, (char *)&on);
- msgDebug("ioctl(%d, TIOCCONS, NULL) = %d (%s)\n", DebugFD, i, !i ? "success" : strerror(errno));
- RunningAsInit = TRUE;
- OnVTY = TRUE;
- }
term = getenv("TERM");
stat = ioctl(STDERR_FILENO, GIO_COLOR, &ColorDisplay);
+
+ if (getpid() != 1)
+ DebugFD = open("sysinstall.debug", O_WRONLY|O_CREAT|O_TRUNC, 0644);
+ else
+ RunningAsInit = TRUE;
+
if (stat < 0) {
if (!term) {
if (setenv("TERM", "vt100", 1) < 0)
@@ -53,9 +48,15 @@ set_termcap(void)
}
if (DebugFD == -1)
DebugFD = dup(1);
- OnSerial = TRUE;
}
else {
+ int i, on;
+
+ DebugFD = open("/dev/ttyv1", O_WRONLY);
+ on = 1;
+ i = ioctl(DebugFD, TIOCCONS, (char *)&on);
+ msgDebug("ioctl(%d, TIOCCONS, NULL) = %d (%s)\n", DebugFD, i, !i ? "success" : strerror(errno));
+ OnVTY = TRUE;
if (ColorDisplay) {
if (!term) {
if (setenv("TERM", "cons25", 1) < 0)
@@ -72,7 +73,6 @@ set_termcap(void)
return -1;
}
}
- OnVTY = TRUE;
}
return 0;
}
diff --git a/usr.sbin/sysinstall/ufs.c b/usr.sbin/sysinstall/ufs.c
index 9ad4a81..5f68366 100644
--- a/usr.sbin/sysinstall/ufs.c
+++ b/usr.sbin/sysinstall/ufs.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: ufs.c,v 1.3 1995/05/29 11:01:42 jkh Exp $
+ * $Id: ufs.c,v 1.4.2.2 1995/06/05 12:04:09 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -50,13 +50,13 @@
/* No init or shutdown routines necessary - all done in mediaSetUFS() */
int
-mediaGetUFS(char *file)
+mediaGetUFS(Device *dev, char *file, Attribs *dist_attrs)
{
char buf[PATH_MAX];
- snprintf(buf, PATH_MAX, "%s/%s", (char *)mediaDevice->private, file);
+ snprintf(buf, PATH_MAX, "%s/%s", dev->private, file);
if (!access(buf, R_OK))
return open(buf, O_RDONLY);
- snprintf(buf, PATH_MAX, "%s/dists/%s", (char *)mediaDevice->private, file);
+ snprintf(buf, PATH_MAX, "%s/dists/%s", dev->private, file);
return open(buf, O_RDONLY);
}
diff --git a/usr.sbin/sysinstall/variable.c b/usr.sbin/sysinstall/variable.c
index d2b9799..9cf6742 100644
--- a/usr.sbin/sysinstall/variable.c
+++ b/usr.sbin/sysinstall/variable.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: variable.c,v 1.4 1995/05/27 10:47:44 jkh Exp $
+ * $Id: variable.c,v 1.5.2.2 1995/06/01 21:04:03 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -50,6 +50,14 @@ make_variable(char *var, char *value)
{
Variable *newvar;
+ /* First search to see if it's already there */
+ for (newvar = VarHead; newvar; newvar = newvar->next) {
+ if (!strcmp(newvar->name, var)) {
+ strncpy(newvar->value, value, VAR_VALUE_MAX);
+ setenv(var, value, 1);
+ return;
+ }
+ }
setenv(var, value, 1);
newvar = (Variable *)safe_malloc(sizeof(Variable));
strncpy(newvar->name, var, VAR_NAME_MAX);
@@ -57,7 +65,8 @@ make_variable(char *var, char *value)
newvar->next = VarHead;
VarHead = newvar;
setenv(newvar->name, newvar->value, 1);
- msgInfo("Set %s to %s", newvar->name, newvar->value);
+ if (isDebug())
+ msgDebug("Setting variable %s to %s\n", newvar->name, newvar->value);
}
void
diff --git a/usr.sbin/sysinstall/wizard.c b/usr.sbin/sysinstall/wizard.c
index 81c2b0f..be6f9ee 100644
--- a/usr.sbin/sysinstall/wizard.c
+++ b/usr.sbin/sysinstall/wizard.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: wizard.c,v 1.4 1995/05/20 10:33:14 jkh Exp $
+ * $Id: wizard.c,v 1.5.2.1 1995/06/05 02:25:27 jkh Exp $
*
*/
@@ -165,22 +165,6 @@ slice_wizard(Disk *d)
strtol(cmds[3],0,0));
continue;
}
- if (!strcasecmp(*cmds,"phys") && ncmd == 4) {
- d = Set_Phys_Geom(d,
- strtol(cmds[1],0,0),
- strtol(cmds[2],0,0),
- strtol(cmds[3],0,0));
- continue;
- }
- if (!strcasecmp(*cmds,"collapse")) {
- if (cmds[1])
- while (Collapse_Chunk(d,
- (struct chunk *)strtol(cmds[1],0,0)))
- ;
- else
- Collapse_Disk(d);
- continue;
- }
if (!strcasecmp(*cmds,"list")) {
cp = Disk_Names();
printf("Disks:");
@@ -218,19 +202,6 @@ slice_wizard(Disk *d)
Scan_Disk(d);
continue;
}
- if (!strcasecmp(*cmds,"bteasy")) {
- Set_Boot_Mgr(d,bteasy17);
- continue;
- }
- if (!strcasecmp(*cmds,"mbr")) {
- Set_Boot_Mgr(d,mbr);
- continue;
- }
- if (!strcasecmp(*cmds,"boot")) {
- extern u_char boot1[],boot2[];
- Set_Boot_Blocks(d,boot1,boot2);
- continue;
- }
if (!strcasecmp(*cmds,"write")) {
printf("Write=%d\n",
Write_Disk(d));
@@ -243,15 +214,11 @@ slice_wizard(Disk *d)
printf("CMDS:\n");
printf("allfreebsd\t\t");
printf("bios cyl hd sect\n");
- printf("boot\t\t");
- printf("bteasy17\n");
printf("collapse [pointer]\t\t");
printf("create offset size enum subtype flags\n");
printf("subtype(part): swap=1, ffs=7\t\t");
printf("delete pointer\n");
printf("list\t\t");
- printf("mbr\n");
- printf("phys cyl hd sect\t\t");
printf("quit\n");
printf("read [disk]\t\t");
printf("scan\n");
diff --git a/usr.sbin/tzsetup/main.c b/usr.sbin/tzsetup/main.c
index 4b64810..f7d0e21 100644
--- a/usr.sbin/tzsetup/main.c
+++ b/usr.sbin/tzsetup/main.c
@@ -28,7 +28,7 @@
*/
static const char rcsid[] =
- "$Id: main.c,v 1.1 1995/04/24 21:04:33 wollman Exp $";
+ "$Id: main.c,v 1.2.2.1 1995/06/06 04:51:22 jkh Exp $";
#include <stdio.h>
#include <ncurses.h>
@@ -150,8 +150,8 @@ set_time(void)
}
static unsigned char *cmos_list[] = {
- "1", "CMOS clock is set to local time",
- "2", "CMOS clock is set to Universal time (UTC)",
+ "1", "CMOS clock is set to Universal time (UTC)",
+ "2", "CMOS clock is set to local time",
"3", "I'm not sure, leave it alone"
};
OpenPOWER on IntegriCloud