summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sade
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/sade
parentb1a97daa1e06ab0de3071f979965878fd056292b (diff)
downloadFreeBSD-src-1b1ee5553889e207087539ddafa5dfd4e28bd585.zip
FreeBSD-src-1b1ee5553889e207087539ddafa5dfd4e28bd585.tar.gz
Merge RELENG_2_0_5 into HEAD
Diffstat (limited to 'usr.sbin/sade')
-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
17 files changed, 891 insertions, 693 deletions
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");
OpenPOWER on IntegriCloud