summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sysinstall
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1995-12-07 10:34:59 +0000
committerpeter <peter@FreeBSD.org>1995-12-07 10:34:59 +0000
commit03382d7ccd5ed3c8bf17b6719df445c2d9c5dea6 (patch)
tree3d31cd880ab6a9af9ad3ab3c6313d70e1c542d60 /usr.sbin/sysinstall
parent53a232b78efd4ef6c84ff8047a3a43c3d8cf0a25 (diff)
downloadFreeBSD-src-03382d7ccd5ed3c8bf17b6719df445c2d9c5dea6.zip
FreeBSD-src-03382d7ccd5ed3c8bf17b6719df445c2d9c5dea6.tar.gz
Update the -current sources from the 2.1 branch.
Approved (in spirit) by: jkh
Diffstat (limited to 'usr.sbin/sysinstall')
-rw-r--r--usr.sbin/sysinstall/Makefile15
-rw-r--r--usr.sbin/sysinstall/cdrom.c48
-rw-r--r--usr.sbin/sysinstall/command.c41
-rw-r--r--usr.sbin/sysinstall/config.c361
-rw-r--r--usr.sbin/sysinstall/devices.c21
-rw-r--r--usr.sbin/sysinstall/disks.c395
-rw-r--r--usr.sbin/sysinstall/dist.c248
-rw-r--r--usr.sbin/sysinstall/dist.h35
-rw-r--r--usr.sbin/sysinstall/dmenu.c62
-rw-r--r--usr.sbin/sysinstall/dos.c30
-rw-r--r--usr.sbin/sysinstall/floppy.c97
-rw-r--r--usr.sbin/sysinstall/ftp.c16
-rw-r--r--usr.sbin/sysinstall/globals.c6
-rw-r--r--usr.sbin/sysinstall/help/configure.hlp8
-rw-r--r--usr.sbin/sysinstall/help/distributions.hlp41
-rw-r--r--usr.sbin/sysinstall/help/drives.hlp4
-rw-r--r--usr.sbin/sysinstall/help/media.hlp58
-rw-r--r--usr.sbin/sysinstall/help/network_device.hlp72
-rw-r--r--usr.sbin/sysinstall/help/options.hlp114
-rw-r--r--usr.sbin/sysinstall/help/partition.hlp196
-rw-r--r--usr.sbin/sysinstall/help/slice.hlp61
-rw-r--r--usr.sbin/sysinstall/help/usage.hlp56
-rw-r--r--usr.sbin/sysinstall/install.c766
-rw-r--r--usr.sbin/sysinstall/label.c447
-rw-r--r--usr.sbin/sysinstall/main.c25
-rw-r--r--usr.sbin/sysinstall/media.c229
-rw-r--r--usr.sbin/sysinstall/menus.c915
-rw-r--r--usr.sbin/sysinstall/misc.c87
-rw-r--r--usr.sbin/sysinstall/msg.c31
-rw-r--r--usr.sbin/sysinstall/network.c172
-rw-r--r--usr.sbin/sysinstall/nfs.c49
-rw-r--r--usr.sbin/sysinstall/sysinstall.h271
-rw-r--r--usr.sbin/sysinstall/system.c121
-rw-r--r--usr.sbin/sysinstall/tape.c46
-rw-r--r--usr.sbin/sysinstall/tcpip.c158
-rw-r--r--usr.sbin/sysinstall/ufs.c13
-rw-r--r--usr.sbin/sysinstall/variable.c66
-rw-r--r--usr.sbin/sysinstall/wizard.c9
38 files changed, 3645 insertions, 1745 deletions
diff --git a/usr.sbin/sysinstall/Makefile b/usr.sbin/sysinstall/Makefile
index 0f0b8fd..c2c3fee 100644
--- a/usr.sbin/sysinstall/Makefile
+++ b/usr.sbin/sysinstall/Makefile
@@ -4,14 +4,14 @@ CLEANFILES= makedevs.c rtermcap
.PATH: ${.CURDIR}/../disklabel ${.CURDIR}/../../usr.bin/cksum
-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 \
- 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
+SRCS= anonFTP.c apache.c attr.c cdrom.c command.c config.c decode.c \
+ devices.c disks.c dist.c dmenu.c doc.c dos.c floppy.c ftp.c \
+ ftp_strat.c globals.c index.c install.c installFinal.c \
+ installPreconfig.c installUpgrade.c label.c lndir.c main.c \
+ makedevs.c media.c menus.c misc.c msg.c network.c nfs.c options.c \
+ package.c system.c tape.c tcpip.c termcap.c ufs.c variable.c wizard.c
-
-CFLAGS+= -Wall -I${.CURDIR}/../libdisk \
- -I${.CURDIR}/../../gnu/lib/libdialog
+CFLAGS+= -Wall -I${.CURDIR}/../libdisk -I${.CURDIR}/../../gnu/lib/libdialog
LDADD= -ldialog -lncurses -lmytinfo -lutil
.if exists(${.CURDIR}/../libdisk/obj)
@@ -55,4 +55,3 @@ testftp: ftp.c
cc -o testftp -I../libdisk -DSTANDALONE_FTP ftp.c
.include <bsd.prog.mk>
-
diff --git a/usr.sbin/sysinstall/cdrom.c b/usr.sbin/sysinstall/cdrom.c
index 03cef9f..843c2e2 100644
--- a/usr.sbin/sysinstall/cdrom.c
+++ b/usr.sbin/sysinstall/cdrom.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: cdrom.c,v 1.7.2.2 1995/07/21 11:45:32 rgrimes Exp $
+ * $Id: cdrom.c,v 1.8 1995/09/18 16:52:20 peter Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -58,13 +58,16 @@
#include <sys/mount.h>
#undef CD9660
-static Boolean cdromMounted;
+/* This isn't static, like the others, since it's often useful to know whether or not we have a CDROM
+ available in some of the other installation screens. */
+Boolean cdromMounted;
Boolean
mediaInitCDROM(Device *dev)
{
struct iso_args args;
struct stat sb;
+ char specialrel[80];
if (!RunningAsInit || cdromMounted)
return TRUE;
@@ -77,38 +80,51 @@ mediaInitCDROM(Device *dev)
args.flags = 0;
if (mount(MOUNT_CD9660, "/cdrom", MNT_RDONLY, (caddr_t) &args) == -1) {
- msgConfirm("Error mounting %s on /cdrom: %s (%u)\n", dev, strerror(errno), errno);
+ dialog_clear();
+ msgConfirm("Error mounting %s on /cdrom: %s (%u)", dev->devname, strerror(errno), errno);
return FALSE;
}
-
/*
- * Do a very simple check to see if this looks roughly like a 2.0.5 CDROM
+ * Do a very simple check to see if this looks roughly like a FreeBSD CDROM
* Unfortunately FreeBSD won't let us read the ``label'' AFAIK, which is one
* sure way of telling the disc version :-(
*/
- if (stat("/cdrom/dists", &sb)) {
+ snprintf(specialrel, 80, "/cdrom/%s/dists", variable_get(VAR_RELNAME));
+ if (stat("/cdrom/dists", &sb) && stat(specialrel, &sb)) {
if (errno == ENOENT) {
- msgConfirm("Couldn't locate the directory `dists' on the CD.\nIs this a FreeBSD CDROM?\n");
+ dialog_clear();
+ msgConfirm("Couldn't locate the directory `dists' anywhere on the CD.\n"
+ "Is this a FreeBSD CDROM? Is the release version set properly\n"
+ "in the Options editor?");
return FALSE;
}
else {
- msgConfirm("Couldn't stat directory %s: %s", "/cdrom/dists", strerror(errno));
+ dialog_clear();
+ msgConfirm("Error trying to stat the CDROM's dists directory: %s", strerror(errno));
return FALSE;
}
}
cdromMounted = TRUE;
+ msgDebug("Mounted CDROM device %s on /cdrom\n", dev->devname);
return TRUE;
}
int
-mediaGetCDROM(Device *dev, char *file, Attribs *dist_attrs)
+mediaGetCDROM(Device *dev, char *file, Boolean tentative)
{
- char buf[PATH_MAX];
+ char buf[PATH_MAX];
+ msgDebug("Request for %s from CDROM\n", file);
snprintf(buf, PATH_MAX, "/cdrom/%s", file);
- if (!access(buf,R_OK))
+ if (file_readable(buf))
return open(buf, O_RDONLY);
snprintf(buf, PATH_MAX, "/cdrom/dists/%s", file);
+ if (file_readable(buf))
+ return open(buf, O_RDONLY);
+ snprintf(buf, PATH_MAX, "/cdrom/%s/%s", variable_get(VAR_RELNAME), file);
+ if (file_readable(buf))
+ return open(buf, O_RDONLY);
+ snprintf(buf, PATH_MAX, "/cdrom/%s/dists/%s", variable_get(VAR_RELNAME), file);
return open(buf, O_RDONLY);
}
@@ -117,10 +133,12 @@ mediaShutdownCDROM(Device *dev)
{
if (!RunningAsInit || !cdromMounted)
return;
- msgDebug("Unmounting /cdrom\n");
- if (unmount("/cdrom", MNT_FORCE) != 0)
- msgConfirm("Could not unmount the CDROM: %s\n", strerror(errno));
- msgDebug("Unmount returned\n");
+ msgDebug("Unmounting %s from /cdrom\n", dev->devname);
+ if (unmount("/cdrom", MNT_FORCE) != 0) {
+ dialog_clear();
+ msgConfirm("Could not unmount the CDROM from /cdrom: %s", strerror(errno));
+ }
+ msgDebug("Unmount successful\n");
cdromMounted = FALSE;
return;
}
diff --git a/usr.sbin/sysinstall/command.c b/usr.sbin/sysinstall/command.c
index 1fad8d2..225d4ec 100644
--- a/usr.sbin/sysinstall/command.c
+++ b/usr.sbin/sysinstall/command.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: command.c,v 1.11.4.1 1995/07/21 11:45:35 rgrimes Exp $
+ * $Id: command.c,v 1.12 1995/09/18 16:52:21 peter Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -77,7 +77,7 @@ addit(char *key, int type, void *cmd, void *data)
{
int i;
- /* First, look for the key already present and add a command to it */
+ /* First, look for the key already present and add a command to it if found */
for (i = 0; i < numCommands; i++) {
if (!strcmp(commandStack[i]->key, key)) {
if (commandStack[i]->ncmds == MAX_NUM_COMMANDS)
@@ -98,7 +98,8 @@ addit(char *key, int type, void *cmd, void *data)
commandStack[numCommands]->ncmds = 1;
commandStack[numCommands]->cmds[0].type = type;
commandStack[numCommands]->cmds[0].ptr = cmd;
- commandStack[numCommands++]->cmds[0].data = data;
+ commandStack[numCommands]->cmds[0].data = data;
+ ++numCommands;
}
/* Add a shell command under a given key */
@@ -108,9 +109,9 @@ command_shell_add(char *key, char *fmt, ...)
va_list args;
char *cmd;
- cmd = (char *)safe_malloc(1024);
+ cmd = (char *)safe_malloc(256);
va_start(args, fmt);
- vsnprintf(cmd, 1024, fmt, args);
+ vsnprintf(cmd, 256, fmt, args);
va_end(args);
addit(key, CMD_SHELL, cmd, NULL);
@@ -123,17 +124,36 @@ command_func_add(char *key, commandFunc func, void *data)
addit(key, CMD_FUNCTION, func, data);
}
-/* arg to sort */
static int
-sort_compare(const void *p1, const void *p2)
+sort_compare(Command *p1, Command *p2)
{
- return strcmp(((Command *)p1)->key, ((Command *)p2)->key);
+ if (!p1 && !p2)
+ return 0;
+ else if (!p1 && p2) /* NULL has a "greater" value for commands */
+ return 1;
+ else if (p1 && !p2)
+ return -1;
+ else
+ return strcmp(p1->key, p2->key);
}
void
command_sort(void)
{
- qsort(commandStack, numCommands, sizeof(Command *), sort_compare);
+ int i, j;
+
+ commandStack[numCommands] = NULL;
+ /* Just do a crude bubble sort since the list is small */
+ for (i = 0; i < numCommands; i++) {
+ for (j = 0; j < numCommands; j++) {
+ if (sort_compare(commandStack[j], commandStack[j + 1]) > 0) {
+ Command *tmp = commandStack[j];
+
+ commandStack[j] = commandStack[j + 1];
+ commandStack[j + 1] = tmp;
+ }
+ }
+ }
}
/* Run all accumulated commands in sorted order */
@@ -155,7 +175,8 @@ command_execute(void)
else {
/* It's a function pointer - call it with the key and the data */
func = (commandFunc)commandStack[i]->cmds[j].ptr;
- msgNotify("%x: Execute(%s, %s)", func, commandStack[i]->key, commandStack[i]->cmds[j].data);
+ if (isDebug())
+ msgDebug("%x: Execute(%s, %s)", func, commandStack[i]->key, commandStack[i]->cmds[j].data);
ret = (*func)(commandStack[i]->key, commandStack[i]->cmds[j].data);
if (isDebug())
msgDebug("Function @ %x returns status %d\n", commandStack[i]->cmds[j].ptr, ret);
diff --git a/usr.sbin/sysinstall/config.c b/usr.sbin/sysinstall/config.c
index 75f0f9c..e49b574 100644
--- a/usr.sbin/sysinstall/config.c
+++ b/usr.sbin/sysinstall/config.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: config.c,v 1.16.2.2 1995/07/21 11:45:36 rgrimes Exp $
+ * $Id: config.c,v 1.17 1995/09/18 16:52:22 peter Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -50,34 +50,53 @@ static int nchunks;
/* arg to sort */
static int
-chunk_compare(const void *p1, const void *p2)
+chunk_compare(Chunk *c1, Chunk *c2)
{
- Chunk *c1, *c2;
-
- c1 = (Chunk *)p1;
- c2 = (Chunk *)p2;
- if (!c1->private && !c2->private)
+ if (!c1 && !c2)
return 0;
- else if (c1->private && !c2->private)
+ else if (!c1 && c2)
+ return 1;
+ else if (c1 && !c2)
return -1;
- else if (!c1->private && c2->private)
+ else if (!c1->private && !c2->private)
+ return 0;
+ else if (c1->private && !c2->private)
return 1;
+ else if (!c1->private && c2->private)
+ return -1;
else
- return strcmp(((PartInfo *)c1->private)->mountpoint, ((PartInfo *)c2->private)->mountpoint);
+ return strcmp(((PartInfo *)(c1->private))->mountpoint, ((PartInfo *)(c2->private))->mountpoint);
+}
+
+static void
+chunk_sort(void)
+{
+ int i, j;
+
+ for (i = 0; i < nchunks; i++) {
+ for (j = 0; j < nchunks; j++) {
+ if (chunk_compare(chunk_list[j], chunk_list[j + 1]) > 0) {
+ Chunk *tmp = chunk_list[j];
+
+ chunk_list[j] = chunk_list[j + 1];
+ chunk_list[j + 1] = tmp;
+ }
+ }
+ }
}
static char *
-nameof(Chunk *c1)
+name_of(Chunk *c1)
{
- static char rootname[64];
+ static char rootname[32];
/* Our boot blocks can't deal with root partitions on slices - need the compatbility name */
if (c1->type == part && c1->flags & CHUNK_IS_ROOT) {
- sprintf(rootname, "%sa", c1->disk->name);
- return rootname;
+ sprintf(rootname, "%sa", c1->disk->name);
+ return rootname;
}
else
- return c1->name;
+ return c1->name;
}
static char *
@@ -126,7 +145,7 @@ seq_num(Chunk *c1)
return 0;
}
-void
+int
configFstab(void)
{
Device **devs;
@@ -137,14 +156,20 @@ configFstab(void)
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!");
+ return RET_SUCCESS;
+ else {
+ dialog_clear();
+ msgConfirm("Attempting to rebuild your /etc/fstab file. Warning: If you had\n"
+ "any CD devices in use before running sysinstall then they may NOT\n"
+ "be found by this run!");
+ }
}
+
devs = deviceFind(NULL, DEVICE_TYPE_DISK);
if (!devs) {
+ dialog_clear();
msgConfirm("No disks found!");
- return;
+ return RET_FAIL;
}
/* Record all the chunks */
@@ -166,20 +191,21 @@ configFstab(void)
chunk_list[nchunks++] = c1;
}
}
-
- /* Sort them puppies! */
- qsort(chunk_list, nchunks, sizeof(Chunk *), chunk_compare);
+ chunk_list[nchunks] = 0;
+ chunk_sort();
fstab = fopen("/etc/fstab", "w");
if (!fstab) {
- msgConfirm("Unable to create a new /etc/fstab file!\nManual intervention will be required.");
- return;
+ dialog_clear();
+ msgConfirm("Unable to create a new /etc/fstab file! Manual intervention\n"
+ "will be required.");
+ return RET_FAIL;
}
/* 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\t%s %d %d\n", nameof(chunk_list[i]), mount_point(chunk_list[i]),
+ fprintf(fstab, "/dev/%s\t\t\t%s\t\t%s\t%s %d %d\n", name_of(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\trw 0 0\n");
@@ -190,8 +216,12 @@ configFstab(void)
/* Write the first one out as /cdrom */
if (cnt) {
- Mkdir("/cdrom", NULL);
- fprintf(fstab, "/dev/%s\t\t\t/cdrom\t\tcd9660\tro 0 0\n", devs[0]->name);
+ if (Mkdir("/cdrom", NULL)) {
+ dialog_clear();
+ msgConfirm("Unable to make mount point for: /cdrom");
+ }
+ else
+ fprintf(fstab, "/dev/%s\t\t\t/cdrom\t\tcd9660\tro,noauto 0 0\n", devs[0]->name);
}
/* Write the others out as /cdrom<n> */
@@ -199,185 +229,308 @@ configFstab(void)
char cdname[10];
sprintf(cdname, "/cdrom%d", i);
- Mkdir(cdname, NULL);
- fprintf(fstab, "/dev/%s\t\t\t%s\t\tcd9660\tro 0 0\n", devs[i]->name, cdname);
+ if (Mkdir(cdname, NULL)) {
+ dialog_clear();
+ msgConfirm("Unable to make mount point for: %s", cdname);
+ }
+ else
+ fprintf(fstab, "/dev/%s\t\t\t%s\t\tcd9660\tro,noauto 0 0\n", devs[i]->name, cdname);
}
fclose(fstab);
if (isDebug())
msgDebug("Wrote out /etc/fstab file\n");
+ return RET_SUCCESS;
}
/*
* This sucks in /etc/sysconfig, substitutes anything needing substitution, then
* writes it all back out. It's pretty gross and needs re-writing at some point.
*/
+
+#define MAX_LINES 2000 /* Some big number we're not likely to ever reach - I'm being really lazy here, I know */
void
configSysconfig(void)
{
FILE *fp;
- char *lines[5001]; /* Some big number we're not likely to ever reach - I'm being really lazy here, I know */
+ char *lines[MAX_LINES], *cp;
char line[256];
Variable *v;
- int i, nlines = 0;
+ int i, nlines;
fp = fopen("/etc/sysconfig", "r");
if (!fp) {
- msgConfirm("Unable to open /etc/sysconfig file! Things may work\nrather strangely as a result of this.");
+ dialog_clear();
+ msgConfirm("Unable to open /etc/sysconfig file! Things may work\n"
+ "rather strangely as a result of this.");
return;
}
- for (i = 0; i < 5000; i++) {
+ msgNotify("Writing configuration changes to /etc/sysconfig file..");
+
+ nlines = 0;
+ /* Read in the entire file */
+ for (i = 0; i < MAX_LINES; i++) {
if (!fgets(line, 255, fp))
break;
lines[nlines++] = strdup(line);
}
- lines[nlines] = NULL;
- fclose(fp);
+ msgDebug("Read %d lines from sysconfig.\n", nlines);
+ /* Now do variable substitutions */
for (v = VarHead; v; v = v->next) {
for (i = 0; i < nlines; i++) {
- char modify[256], *cp;
+ char tmp[256];
- if (lines[i][0] == '#' || lines[i][0] == ';')
+ /* Skip the comments */
+ if (lines[i][0] == '#')
continue;
- strncpy(modify, lines[i], 255);
- cp = index(modify, '=');
+ strcpy(tmp, lines[i]);
+ cp = index(tmp, '=');
if (!cp)
continue;
*(cp++) = '\0';
- if (!strcmp(modify, v->name)) {
+ if (!strcmp(tmp, v->name)) {
free(lines[i]);
- lines[i] = (char *)malloc(strlen(v->name) + strlen(v->value) + 3);
+ lines[i] = (char *)malloc(strlen(v->name) + strlen(v->value) + 5);
sprintf(lines[i], "%s=\"%s\"\n", v->name, v->value);
+ msgDebug("Variable substitution on: %s\n", lines[i]);
}
-
}
}
+
+ /* Now write it all back out again */
+ fclose(fp);
fp = fopen("/etc/sysconfig", "w");
- if (!fp) {
- msgConfirm("Unable to re-write /etc/sysconfig file! Things may work\nrather strangely as a result of this.");
- return;
- }
for (i = 0; i < nlines; i++) {
- fprintf(fp, lines[i]);
- free(lines[i]);
+ static Boolean firstTime = TRUE;
+ fprintf(fp, lines[i]);
/* Stand by for bogus special case handling - we try to dump the interface specs here */
- if (!strncmp(lines[i], VAR_INTERFACES, strlen(VAR_INTERFACES))) {
+ if (firstTime && !strncmp(lines[i], VAR_INTERFACES, strlen(VAR_INTERFACES))) {
Device **devp;
int j, cnt;
devp = deviceFind(NULL, DEVICE_TYPE_NETWORK);
cnt = deviceCount(devp);
for (j = 0; j < cnt; j++) {
- if (devp[j]->private && strncmp(devp[j]->name, "cuaa", 4)) {
- char iname[64];
+ char iname[255];
- snprintf(iname, 64, "%s%s", VAR_IFCONFIG, devp[j]->name);
- if (getenv(iname))
- fprintf(fp, "%s=\"%s\"\n", iname, getenv(iname));
+ snprintf(iname, 255, "%s%s", VAR_IFCONFIG, devp[j]->name);
+ if ((cp = variable_get(iname))) {
+ fprintf(fp, "%s=\"%s\"\n", iname, cp);
}
}
+ firstTime = FALSE;
}
+ free(lines[i]);
}
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
configSaverTimeout(char *str)
{
- char *val;
-
- val = msgGetInput("60", "Enter time-out period in seconds for screen saver");
- if (val)
- variable_set2("blanktime", val);
- return 0;
+ return variable_get_value(VAR_BLANKTIME, "Enter time-out period in seconds for screen saver")
+ ? RET_SUCCESS : RET_FAIL;
}
int
configNTP(char *str)
{
- char *val;
-
- val = msgGetInput(NULL, "Enter the name of an NTP server");
- if (val)
- variable_set2("ntpdate", val);
- return 0;
+ return variable_get_value(VAR_NTPDATE, "Enter the name of an NTP server") ? RET_SUCCESS : RET_FAIL;
}
void
configResolv(void)
{
FILE *fp;
- char *cp;
+ char *cp, *dp, *hp;
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!");
+ if (!variable_get(VAR_NAMESERVER)) {
+ if (mediaDevice && (mediaDevice->type == DEVICE_TYPE_NFS || mediaDevice->type == DEVICE_TYPE_FTP)) {
+ dialog_clear();
+ msgConfirm("Warning: Missing name server value - network operations\n"
+ "may fail as a result!");
+ }
goto skip;
}
- Mkdir("/etc", NULL);
+ if (Mkdir("/etc", NULL)) {
+ dialog_clear();
+ msgConfirm("Unable to create /etc directory. Network configuration\n"
+ "files will therefore not be written!");
+ return;
+ }
fp = fopen("/etc/resolv.conf", "w");
if (!fp) {
+ dialog_clear();
msgConfirm("Unable to open /etc/resolv.conf! You will need to do this manually.");
return;
}
- if (getenv(VAR_DOMAINNAME))
- fprintf(fp, "domain\t%s\n", getenv(VAR_DOMAINNAME));
- fprintf(fp, "nameserver\t%s\n", getenv(VAR_NAMESERVER));
+ if (variable_get(VAR_DOMAINNAME))
+ fprintf(fp, "domain\t%s\n", variable_get(VAR_DOMAINNAME));
+ fprintf(fp, "nameserver\t%s\n", variable_get(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));
+ /* Tack ourselves into /etc/hosts */
+ cp = variable_get(VAR_IPADDR);
+ dp = variable_get(VAR_DOMAINNAME);
+ if (cp && *cp != '0' && (hp = variable_get(VAR_HOSTNAME))) {
+ char cp2[255];
+
+ (void)vsystem("hostname %s", hp);
+ fp = fopen("/etc/hosts", "w");
+ if (!index(hp, '.'))
+ cp2[0] = '\0';
+ else {
+ strcpy(cp2, hp);
+ *(index(cp2, '.')) = '\0';
+ }
+ fprintf(fp, "127.0.0.1\t\tlocalhost.%s localhost\n", dp ? dp : "my.domain");
+ fprintf(fp, "%s\t\t%s %s\n", cp, hp, cp2);
fclose(fp);
if (isDebug())
- msgDebug("Appended entry for %s to /etc/hosts\n", cp);
+ msgDebug("Wrote 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;
+ return variable_get_value(VAR_ROUTEDFLAGS,
+ "Specify the flags for routed; -q is the default, -s is\n"
+ "a good choice for gateway machines.") ? RET_SUCCESS : RET_FAIL;
}
int
configPackages(char *str)
{
- Boolean onCD;
-
- /* 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;
+ PkgNode top, plist;
+ int fd;
+
+ if (!mediaVerify())
+ return RET_FAIL;
+
+ if (!mediaDevice->init(mediaDevice))
+ return RET_FAIL;
+
+ msgNotify("Attempting to fetch packages/INDEX file from selected media.");
+ fd = mediaDevice->get(mediaDevice, "packages/INDEX", TRUE);
+ if (fd < 0) {
+ dialog_clear();
+ msgConfirm("Unable to get packages/INDEX file from selected media.\n"
+ "This may be because the packages collection is not available at\n"
+ "on the distribution media you've chosen (most likely an FTP site\n"
+ "without the packages collection mirrored). Please verify media\n"
+ "(or path to media) and try again. If your local site does not\n"
+ "carry the packages collection, then we recommend either a CD\n"
+ "distribution or the master distribution on ftp.freebsd.org.");
+ return RET_FAIL;
+ }
+ msgNotify("Got INDEX successfully, now building packages menu..");
+ index_init(&top, &plist);
+ if (index_read(fd, &top)) {
+ dialog_clear();
+ msgConfirm("I/O or format error on packages/INDEX file.\n"
+ "Please verify media (or path to media) and try again.");
+ mediaDevice->close(mediaDevice, fd);
+ return RET_FAIL;
+ }
+ mediaDevice->close(mediaDevice, fd);
+ index_sort(&top);
+ while (1) {
+ int ret, pos, scroll;
+
+ /* Bring up the packages menu */
+ pos = scroll = 0;
+ index_menu(&top, &plist, &pos, &scroll);
+
+ if (plist.kids) {
+ /* Now show the packing list menu */
+ pos = scroll = 0;
+ ret = index_menu(&plist, NULL, &pos, &scroll);
+ if (ret == RET_DONE)
+ break;
+ else if (ret != RET_FAIL) {
+ index_extract(mediaDevice, &plist);
+ break;
+ }
+ }
+ else {
+ dialog_clear();
+ msgConfirm("No packages were selected for extraction.");
+ break;
}
}
- /* XXX Construct some sort of menu here using an INDEX file from /cdrom/packages XXX */
- return 0;
+ index_node_free(&top, &plist);
+ mediaDevice->shutdown(mediaDevice);
+ return RET_SUCCESS;
}
int
configPorts(char *str)
{
- return 0;
+ char *cp, *dist = NULL; /* Shut up compiler */
+
+ if (!variable_get(VAR_PORTS_PATH))
+ variable_set2(VAR_PORTS_PATH, dist = "/cdrom/ports");
+ while (!directoryExists(dist)) {
+ dist = variable_get_value(VAR_PORTS_PATH,
+ "Unable to locate a ports tree on CDROM. Please specify the\n"
+ "location of the master ports directory you wish to create the\n"
+ "link tree to.");
+ if (!dist)
+ break;
+ }
+ if (dist) {
+ cp = msgGetInput("/usr/ports",
+ "Where would you like to create the link tree?\n"
+ "(press [ENTER] for default location). The link tree should\n"
+ "reside in a directory with as much free space as possible,\n"
+ "as you'll need space to compile any ports.");
+ if (!cp || !*cp)
+ return RET_FAIL;
+ if (Mkdir(cp, NULL)) {
+ dialog_clear();
+ msgConfirm("Unable to make the %s directory!", cp);
+ return RET_FAIL;
+ }
+ else {
+ if (strcmp(cp, "/usr/ports")) {
+ unlink("/usr/ports");
+ if (symlink(cp, "/usr/ports") == -1) {
+ msgConfirm("Unable to create a symlink from /usr/ports to %s!\n"
+ "I can't continue, sorry!", cp);
+ return RET_FAIL;
+ }
+ else {
+ msgConfirm("NOTE: This directory is also now symlinked to /usr/ports\n"
+ "which, for a variety of reasons, is the directory the ports\n"
+ "framework expects to find its files in. You should refer to\n"
+ "/usr/ports instead of %s directly when you're working in the\n"
+ "ports collection.", cp);
+ }
+ }
+ msgNotify("Making a link tree from %s to %s.", dist, cp);
+ if (lndir(dist, cp) != RET_SUCCESS) {
+ dialog_clear();
+ msgConfirm("The lndir function returned an error status and may not have.\n"
+ "successfully generated the link tree. You may wish to inspect\n"
+ "the /usr/ports directory carefully for any missing link files.");
+ }
+ else {
+ msgConfirm("The /usr/ports directory is now ready to use. When the system comes\n"
+ "up fully, you can cd to this directory and type `make' in any sub-\n"
+ "directory for which you'd like to compile a port. You can also\n"
+ "cd to /usr/ports and type `make print-index' for a complete list of all\n"
+ "ports in the hierarchy.");
+ }
+ }
+ }
+ else
+ return RET_FAIL;
+ return RET_SUCCESS;
}
diff --git a/usr.sbin/sysinstall/devices.c b/usr.sbin/sysinstall/devices.c
index b1b91d7..7951422 100644
--- a/usr.sbin/sysinstall/devices.c
+++ b/usr.sbin/sysinstall/devices.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: devices.c,v 1.35.2.9 1995/06/05 12:03:46 jkh Exp $
+ * $Id: devices.c,v 1.36.2.11 1995/11/15 06:57:02 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -82,16 +82,20 @@ static struct {
{ DEVICE_TYPE_CDROM, "scd1a", "Sony CDROM drive - CDU31/33A type (2nd unit)" },
{ DEVICE_TYPE_CDROM, "matcd0a", "Matsushita CDROM ('sound blaster' type)" },
{ DEVICE_TYPE_CDROM, "matcd1a", "Matsushita CDROM (2nd unit)" },
+ { DEVICE_TYPE_CDROM, "wcd0c", "ATAPI IDE CDROM" },
+ { DEVICE_TYPE_CDROM, "wcd1c", "ATAPI IDE CDROM (2nd unit)" },
{ DEVICE_TYPE_TAPE, "rst0", "SCSI tape drive" },
{ DEVICE_TYPE_TAPE, "rst1", "SCSI tape drive (2nd unit)" },
- { DEVICE_TYPE_TAPE, "ft0", "Floppy tape drive (QIC-02)" },
- { DEVICE_TYPE_TAPE, "wt0", "Wangtek tape drive" },
+ { DEVICE_TYPE_TAPE, "rft0", "Floppy tape drive (QIC-02)" },
+ { DEVICE_TYPE_TAPE, "rwt0", "Wangtek tape drive" },
{ DEVICE_TYPE_DISK, "sd", "SCSI disk device" },
{ DEVICE_TYPE_DISK, "wd", "IDE/ESDI/MFM/ST506 disk device" },
{ 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, "cuaa2", "Serial port (COM3) - possible PPP/SLIP device" },
+ { DEVICE_TYPE_NETWORK, "cuaa3", "Serial port (COM4) - 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" },
@@ -126,18 +130,21 @@ new_device(char *name)
Boolean
dummyInit(Device *dev)
{
+ msgDebug("Dummy init called for %s\n", dev->name);
return TRUE;
}
int
-dummyGet(Device *dev, char *dist, Attribs *dist_attrs)
+dummyGet(Device *dev, char *dist, Boolean tentative)
{
+ msgDebug("Dummy get called for %s\n", dev->name);
return -1;
}
Boolean
dummyClose(Device *dev, int fd)
{
+ msgDebug("Dummy [default] close called for %s with fd of %d.\n", dev->name, fd);
if (!close(fd))
return TRUE;
return FALSE;
@@ -146,6 +153,7 @@ dummyClose(Device *dev, int fd)
void
dummyShutdown(Device *dev)
{
+ msgDebug("Dummy shutdown called for %s\n", dev->name);
return;
}
@@ -166,7 +174,7 @@ deviceTry(char *name, char *try)
/* 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)(Device *, char *, Attribs *),
+ Boolean (*init)(Device *), int (*get)(Device *, char *, Boolean),
Boolean (*close)(Device *, int), void (*shutdown)(Device *), void *private)
{
Device *newdev;
@@ -294,10 +302,12 @@ deviceGetAll(void)
s = socket(AF_INET, SOCK_DGRAM, 0);
if (s < 0) {
+ dialog_clear();
msgConfirm("ifconfig: socket");
return;
}
if (ioctl(s, SIOCGIFCONF, (char *) &ifc) < 0) {
+ dialog_clear();
msgConfirm("ifconfig (SIOCGIFCONF)");
return;
}
@@ -316,6 +326,7 @@ deviceGetAll(void)
msgDebug("Found a device of type network named: %s\n", ifptr->ifr_name);
close(s);
if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
+ dialog_clear();
msgConfirm("ifconfig: socket");
continue;
}
diff --git a/usr.sbin/sysinstall/disks.c b/usr.sbin/sysinstall/disks.c
index c5ec295..fb29202 100644
--- a/usr.sbin/sysinstall/disks.c
+++ b/usr.sbin/sysinstall/disks.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: disks.c,v 1.31.2.2 1995/07/21 11:45:38 rgrimes Exp $
+ * $Id: disks.c,v 1.32 1995/09/18 16:52:23 peter Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -49,7 +49,7 @@
#define CHUNK_START_ROW 5
/* Where we keep track of MBR chunks */
-static struct chunk *chunk_info[10];
+static struct chunk *chunk_info[16];
static int current_chunk;
static void
@@ -60,15 +60,13 @@ record_chunks(Disk *d)
int last_free = 0;
if (!d->chunks)
msgFatal("No chunk list found for %s!", d->name);
- c1 = d->chunks->part;
current_chunk = 0;
- while (c1) {
+ for (c1 = d->chunks->part; c1; c1 = c1->next) {
if (c1->type == unused && c1->size > last_free) {
last_free = c1->size;
current_chunk = i;
}
chunk_info[i++] = c1;
- c1 = c1->next;
}
chunk_info[i] = NULL;
}
@@ -79,16 +77,32 @@ 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.");
-
+ if ((!d->bios_cyl || d->bios_cyl > 65536) || (!d->bios_hd || d->bios_hd > 256) || (!d->bios_sect || d->bios_sect >= 64)) {
+ int sz;
+
+ dialog_clear();
+ msgConfirm("WARNING: The current geometry for %s is incorrect. Using\n"
+ "a default geometry of 64 heads and 32 sectors. If this geometry\n"
+ "is incorrect or you are unsure as to whether or not it's correct,\n"
+ "please consult the Hardware Guide in the Documentation submenu\n"
+ "or use the (G)eometry command to change it now.", d->name);
+ d->bios_hd = 64;
+ d->bios_sect = 32;
+ sz = 0;
+ for (i = 0; chunk_info[i]; i++)
+ sz += chunk_info[i]->size;
+ if (sz)
+ d->bios_cyl = sz / ONE_MEG;
+ else
+ msgConfirm("Couldn't set geometry! You'll have to do it by hand.");
+ }
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, "FDISK Partition Editor"); attrset(A_NORMAL);
mvprintw(1, 0,
- "BIOS Geometry:\t%lu cyls/%lu heads/%lu sectors",
+ "DISK Geometry:\t%lu cyls/%lu heads/%lu sectors",
d->bios_cyl, d->bios_hd, d->bios_sect);
mvprintw(3, 1, "%10s %10s %10s %8s %8s %8s %8s %8s",
"Offset", "Size", "End", "Name", "PType", "Desc",
@@ -111,7 +125,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(17, 0, "D = Delete Partition G = Set Drive Geometry S = Set Bootable");
mvprintw(18, 0, "U = Undo All Changes Q = Finish W = Write Changes");
mvprintw(20, 0, "The currently selected partition is displayed in ");
attrset(A_REVERSE); addstr("reverse"); attrset(A_NORMAL); addstr(" video.");
@@ -119,17 +133,142 @@ print_command_summary()
move(0, 0);
}
-static Disk *
-diskPartition(Disk *d)
+/* Partition a disk based wholly on which variables are set */
+static void
+scriptPartition(Device *dev, Disk *d)
+{
+ char *cp;
+ int i, sz;
+
+ record_chunks(d);
+ cp = variable_get(VAR_GEOMETRY);
+ if (cp) {
+ msgDebug("Setting geometry from script to: %s\n", cp);
+ d->bios_cyl = strtol(cp, &cp, 0);
+ d->bios_hd = strtol(cp + 1, &cp, 0);
+ d->bios_sect = strtol(cp + 1, 0, 0);
+ }
+
+ cp = variable_get(VAR_DISKSPACE);
+ if (cp) {
+ if (!strcmp(cp, "free")) {
+ /* Do free disk space case */
+ for (i = 0; chunk_info[i]; i++) {
+ /* If a chunk is at least 10MB in size, use it. */
+ if (chunk_info[i]->type == unused && chunk_info[i]->size > (10 * ONE_MEG)) {
+ Create_Chunk(d, chunk_info[i]->offset, chunk_info[i]->size, freebsd, 3,
+ (chunk_info[i]->flags & CHUNK_ALIGN));
+ variable_set2(DISK_PARTITIONED, "yes");
+ break;
+ }
+ }
+ if (!chunk_info[i]) {
+ dialog_clear();
+ msgConfirm("Unable to find any free space on this disk!");
+ return;
+ }
+ }
+ else if (!strcmp(cp, "all")) {
+ /* Do all disk space case */
+ msgDebug("Warning: Devoting all of disk %s to FreeBSD.\n", d->name);
+
+ All_FreeBSD(d, FALSE);
+ }
+ else if (!strcmp(cp, "exclusive")) {
+ /* Do really-all-the-disk-space case */
+ msgDebug("Warning: Devoting all of disk %s to FreeBSD.\n", d->name);
+
+ All_FreeBSD(d, TRUE);
+ }
+ else if ((sz = strtol(cp, &cp, 0))) {
+ /* Look for sz bytes free */
+ if (*cp && toupper(*cp) == 'M')
+ sz *= ONE_MEG;
+ for (i = 0; chunk_info[i]; i++) {
+ /* If a chunk is at least sz MB, use it. */
+ if (chunk_info[i]->type == unused && chunk_info[i]->size >= sz) {
+ Create_Chunk(d, chunk_info[i]->offset, sz, freebsd, 3, (chunk_info[i]->flags & CHUNK_ALIGN));
+ variable_set2(DISK_PARTITIONED, "yes");
+ break;
+ }
+ }
+ if (!chunk_info[i]) {
+ dialog_clear();
+ msgConfirm("Unable to find %d free blocks on this disk!", sz);
+ return;
+ }
+ }
+ else if (!strcmp(cp, "existing")) {
+ /* Do existing FreeBSD case */
+ for (i = 0; chunk_info[i]; i++) {
+ if (chunk_info[i]->type == freebsd)
+ break;
+ }
+ if (!chunk_info[i]) {
+ dialog_clear();
+ msgConfirm("Unable to find any existing FreeBSD partitions on this disk!");
+ return;
+ }
+ }
+ else {
+ dialog_clear();
+ msgConfirm("`%s' is an invalid value for %s - is config file valid?", cp, VAR_DISKSPACE);
+ return;
+ }
+ variable_set2(DISK_PARTITIONED, "yes");
+ }
+}
+
+static u_char *
+getBootMgr(char *dname)
+{
+ extern u_char mbr[], bteasy17[];
+ char str[80];
+ char *cp;
+ int i = 0;
+
+ cp = variable_get(VAR_BOOTMGR);
+ if (!cp) {
+ /* Figure out what kind of MBR the user wants */
+ sprintf(str, "Install Boot Manager for drive %s?", dname);
+ MenuMBRType.title = str;
+ dialog_clear();
+ i = dmenuOpenSimple(&MenuMBRType);
+ }
+ else {
+ if (!strncmp(cp, "boot", 4))
+ BootMgr = 0;
+ else if (!strcmp(cp, "standard"))
+ BootMgr = 1;
+ else
+ BootMgr = 2;
+ }
+ if (cp || i) {
+ switch (BootMgr) {
+ case 0:
+ return bteasy17;
+
+ case 1:
+ return mbr;
+
+ case 2:
+ default:
+ break;
+ }
+ }
+ return NULL;
+}
+
+void
+diskPartition(Device *dev, Disk *d)
{
char *p;
int key = 0;
Boolean chunking;
char *msg = NULL;
- char name[40];
+ u_char *mbrContents;
chunking = TRUE;
- strncpy(name, d->name, 40);
keypad(stdscr, TRUE);
clear();
@@ -148,6 +287,7 @@ diskPartition(Disk *d)
case '\014': /* ^L */
clear();
+ print_command_summary();
continue;
case KEY_UP:
@@ -175,23 +315,46 @@ diskPartition(Disk *d)
case KEY_F(1):
case '?':
- systemDisplayFile("slice.hlp");
+ systemDisplayHelp("slice");
break;
- case 'A':
- All_FreeBSD(d);
+ case 'A': {
+ int rv;
+
+ rv = msgYesNo("Do you want to do this with a true partition entry\n"
+ "so as to remain cooperative with any future possible\n"
+ "operating systems on the drive(s)?");
+ if (rv) {
+ rv = !msgYesNo("This is dangerous in that it will make the drive totally\n"
+ "uncooperative with other potential operating systems on the\n"
+ "same disk. It will lead instead to a totally dedicated disk,\n"
+ "starting at the very first sector, bypassing all BIOS geometry\n"
+ "considerations.\n"
+ "You will run into serious trouble with ST-506 and ESDI drives\n"
+ "and possibly some IDE drives (e.g. drives running under the\n"
+ "control of sort of disk manager). SCSI drives are considerably\n"
+ "less at risk.\n\n"
+ "Do you insist on dedicating the entire disk this way?");
+ }
+ All_FreeBSD(d, rv);
+ if (rv)
+ d->bios_hd = d->bios_sect = d->bios_cyl = 1;
+ variable_set2(DISK_PARTITIONED, "yes");
record_chunks(d);
+ }
break;
case 'B':
if (chunk_info[current_chunk]->type != freebsd)
msg = "Can only scan for bad blocks in FreeBSD partition.";
- else if (strncmp(name, "sd", 2) ||
- !msgYesNo("This typically makes sense only for ESDI, IDE or MFM drives.\nAre you sure you want to do this on a SCSI disk?"))
+ else if (strncmp(d->name, "sd", 2) ||
+ !msgYesNo("This typically makes sense only for ESDI, IDE or MFM drives.\n"
+ "Are you sure you want to do this on a SCSI disk?")) {
if (chunk_info[current_chunk]->flags & CHUNK_BAD144)
chunk_info[current_chunk]->flags &= ~CHUNK_BAD144;
else
chunk_info[current_chunk]->flags |= CHUNK_BAD144;
+ }
break;
case 'C':
@@ -202,12 +365,14 @@ diskPartition(Disk *d)
int size;
snprintf(tmp, 20, "%d", chunk_info[current_chunk]->size);
- val = msgGetInput(tmp, "Please specify the size for new FreeBSD partition in blocks, or append\na trailing `M' for megabytes (e.g. 20M).");
+ val = msgGetInput(tmp, "Please specify the size for new FreeBSD partition in blocks, or append\n"
+ "a trailing `M' for megabytes (e.g. 20M).");
if (val && (size = strtol(val, &cp, 0)) > 0) {
if (*cp && toupper(*cp) == 'M')
- size *= 2048;
+ size *= ONE_MEG;
Create_Chunk(d, chunk_info[current_chunk]->offset, size, freebsd, 3,
(chunk_info[current_chunk]->flags & CHUNK_ALIGN));
+ variable_set2(DISK_PARTITIONED, "yes");
record_chunks(d);
}
}
@@ -218,6 +383,7 @@ diskPartition(Disk *d)
msg = "Partition is already unused!";
else {
Delete_Chunk(d, chunk_info[current_chunk]);
+ variable_set2(DISK_PARTITIONED, "yes");
record_chunks(d);
}
break;
@@ -226,40 +392,74 @@ diskPartition(Disk *d)
char *val, geometry[80];
snprintf(geometry, 80, "%lu/%lu/%lu", d->bios_cyl, d->bios_hd, d->bios_sect);
- val = msgGetInput(geometry,
-"Please specify the new geometry in cyl/hd/sect format.\nDon't forget to use the two slash (/) separator characters!\nIt's not possible to parse the field without them.");
+ val = msgGetInput(geometry, "Please specify the new geometry in cyl/hd/sect format.\n"
+ "Don't forget to use the two slash (/) separator characters!\n"
+ "It's not possible to parse the field without them.");
if (val) {
d->bios_cyl = strtol(val, &val, 0);
d->bios_hd = strtol(val + 1, &val, 0);
d->bios_sect = strtol(val + 1, 0, 0);
}
}
- break;
-
- case 'S':
- /* Set Bootable */
- chunk_info[current_chunk]->flags |= CHUNK_ACTIVE;
- break;
-
- case 'U':
- Free_Disk(d);
- d = Open_Disk(name);
- if (!d)
- msgFatal("Can't reopen disk %s!", name);
+ break;
+
+ case 'S':
+ /* Set Bootable */
+ chunk_info[current_chunk]->flags |= CHUNK_ACTIVE;
+ break;
+
+ case 'U':
+ clear();
+ if (msgYesNo("Are you SURE you want to Undo everything?"))
+ break;
+ d = Open_Disk(d->name);
+ if (!d) {
+ dialog_clear();
+ msgConfirm("Can't reopen disk %s! Internal state is probably corrupted", d->name);
+ return;
+ }
+ Free_Disk(dev->private);
+ dev->private = d;
+ variable_unset(DISK_PARTITIONED);
record_chunks(d);
break;
case 'W':
- if (!msgYesNo("Are you sure you want to write this now? You do also\nhave the option of not modifying the disk until *all*\nconfiguration information has been entered, at which\npoint you can do it all at once. If you're unsure, then\nchoose No at this dialog."))
- diskPartitionWrite(NULL);
+ if (!msgYesNo("Are you SURE you want to write this now? You do also\n"
+ "have the option of not modifying the disk until *all*\n"
+ "configuration information has been entered, at which\n"
+ "point you can do it all at once. If you're unsure, then\n"
+ "PLEASE CHOOSE NO at this dialog! This option is DANGEROUS\n"
+ "if you do not know EXACTLY what you are doing!")) {
+ variable_set2(DISK_PARTITIONED, "yes");
+ clear();
+
+ /* Don't trash the MBR if the first (and therefore only) chunk is marked for a truly dedicated
+ * disk (i.e., the disklabel starts at sector 0), even in cases where the user has requested
+ * booteasy or a "standard" MBR -- both would be fatal in this case.
+ */
+ if ((d->chunks->part->flags & CHUNK_FORCE_ALL) != CHUNK_FORCE_ALL
+ && (mbrContents = getBootMgr(d->name)) != NULL)
+ Set_Boot_Mgr(d, mbrContents);
+
+ if (diskPartitionWrite(NULL) != RET_SUCCESS) {
+ dialog_clear();
+ msgConfirm("Disk partition write returned an error status!");
+ }
+ else {
+ msgConfirm("Wrote FDISK partition information out successfully.");
+ }
+ }
break;
case '|':
- if (!msgYesNo("Are you sure you want to go into Wizard mode?\nNo seat belts whatsoever are provided!")) {
+ if (!msgYesNo("Are you SURE you want to go into Wizard mode?\n"
+ "No seat belts whatsoever are provided!")) {
dialog_clear();
end_dialog();
DialogActive = FALSE;
slice_wizard(d);
+ variable_set2(DISK_PARTITIONED, "yes");
dialog_clear();
DialogActive = TRUE;
record_chunks(d);
@@ -270,6 +470,14 @@ diskPartition(Disk *d)
case 'Q':
chunking = FALSE;
+ clear();
+ /* Don't trash the MBR if the first (and therefore only) chunk is marked for a truly dedicated
+ * disk (i.e., the disklabel starts at sector 0), even in cases where the user has requested
+ * booteasy or a "standard" MBR -- both would be fatal in this case.
+ */
+ if ((d->chunks->part->flags & CHUNK_FORCE_ALL) != CHUNK_FORCE_ALL
+ && (mbrContents = getBootMgr(d->name)) != NULL)
+ Set_Boot_Mgr(d, mbrContents);
break;
default:
@@ -280,12 +488,11 @@ diskPartition(Disk *d)
}
p = CheckRules(d);
if (p) {
+ dialog_clear();
msgConfirm(p);
free(p);
}
dialog_clear();
- variable_set2(DISK_PARTITIONED, "yes");
- return d;
}
static int
@@ -309,13 +516,16 @@ partitionHook(char *str)
}
devs = deviceFind(str, DEVICE_TYPE_DISK);
if (!devs) {
+ dialog_clear();
msgConfirm("Unable to find disk %s!", str);
return 0;
}
- else if (devs[1])
+ else if (devs[1]) {
+ dialog_clear();
msgConfirm("Bizarre multiple match for %s!", str);
- devs[0]->private = diskPartition((Disk *)devs[0]->private);
+ }
devs[0]->enabled = TRUE;
+ diskPartition(devs[0], (Disk *)devs[0]->private);
str = cp;
}
return devs ? 1 : 0;
@@ -326,65 +536,73 @@ diskPartitionEditor(char *str)
{
DMenu *menu;
Device **devs;
- int cnt;
+ int i, cnt;
+ char *cp;
- devs = deviceFind(NULL, DEVICE_TYPE_DISK);
+ cp = variable_get(VAR_DISK);
+ devs = deviceFind(cp, 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;
+ dialog_clear();
+ msgConfirm("No disks found! Please verify that your disk controller is being\n"
+ "properly probed at boot time. See the Hardware Guide on the\n"
+ "Documentation menu for clues on diagnosing this type of problem.");
+ i = RET_FAIL;
}
else if (cnt == 1) {
- devs[0]->private = diskPartition((Disk *)devs[0]->private);
devs[0]->enabled = TRUE;
+ if (str && !strcmp(str, "script"))
+ scriptPartition(devs[0], (Disk *)devs[0]->private);
+ else
+ diskPartition(devs[0], (Disk *)devs[0]->private);
+ i = RET_SUCCESS;
+ variable_set2(DISK_SELECTED, "yes");
}
else {
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.");
+ if (!menu) {
+ dialog_clear();
+ msgConfirm("No devices suitable for installation found!\n\n"
+ "Please verify that your disk controller (and attached drives)\n"
+ "were detected properly. This can be done by pressing the\n"
+ "[Scroll Lock] key and using the Arrow keys to move back to\n"
+ "the boot messages. Press [Scroll Lock] again to return.");
+ i = RET_FAIL;
+ }
else {
- dmenuOpenSimple(menu);
+ if (!dmenuOpenSimple(menu))
+ i = RET_FAIL;
+ else {
+ i = RET_SUCCESS;
+ variable_set2(DISK_SELECTED, "yes");
+ }
free(menu);
}
}
- return 0;
-}
-
-static u_char *
-getBootMgr(void)
-{
- extern u_char mbr[], bteasy17[];
-
- /* Figure out what kind of MBR the user wants */
- if (dmenuOpenSimple(&MenuMBRType)) {
- switch (BootMgr) {
- case 0:
- return bteasy17;
-
- case 1:
- return mbr;
-
- case 2:
- default:
- break;
- }
- }
- return NULL;
+ return i;
}
int
diskPartitionWrite(char *str)
{
extern u_char boot1[], boot2[];
- u_char *mbrContents;
Device **devs;
+ char *cp;
int i;
- mbrContents = getBootMgr();
+ if ((cp = variable_get(DISK_PARTITIONED)) && strcmp(cp, "yes"))
+ return RET_SUCCESS;
+ else if (!cp) {
+ dialog_clear();
+ msgConfirm("You must partition the disk(s) before this option can be used.");
+ return RET_FAIL;
+ }
+
devs = deviceFind(NULL, DEVICE_TYPE_DISK);
if (!devs) {
+ dialog_clear();
msgConfirm("Unable to find any disks to write to??");
- return 0;
+ return RET_FAIL;
}
for (i = 0; devs[i]; i++) {
@@ -394,16 +612,13 @@ diskPartitionWrite(char *str)
if (!devs[i]->enabled)
continue;
- /* Do it once so that it only goes on the first drive */
- if (mbrContents) {
- Set_Boot_Mgr(d, mbrContents);
- mbrContents = NULL;
- }
-
Set_Boot_Blocks(d, boot1, boot2);
msgNotify("Writing partition information to drive %s", d->name);
- Write_Disk(d);
-
+ if (Write_Disk(d)) {
+ dialog_clear();
+ msgConfirm("ERROR: Unable to write data to disk %s!", d->name);
+ return RET_FAIL;
+ }
/* Now scan for bad blocks, if necessary */
for (c1 = d->chunks->part; c1; c1 = c1->next) {
if (c1->flags & CHUNK_BAD144) {
@@ -411,13 +626,19 @@ diskPartitionWrite(char *str)
msgNotify("Running bad block scan on partition %s", c1->name);
ret = vsystem("bad144 -v /dev/r%s 1234", c1->name);
- if (ret)
+ if (ret) {
+ dialog_clear();
msgConfirm("Bad144 init on %s returned status of %d!", c1->name, ret);
+ }
ret = vsystem("bad144 -v -s /dev/r%s", c1->name);
- if (ret)
+ if (ret) {
+ dialog_clear();
msgConfirm("Bad144 scan on %s returned status of %d!", c1->name, ret);
+ }
}
}
}
- return 0;
+ /* Now it's not "yes", but "written" */
+ variable_set2(DISK_PARTITIONED, "written");
+ return RET_SUCCESS;
}
diff --git a/usr.sbin/sysinstall/dist.c b/usr.sbin/sysinstall/dist.c
index 539fc61..d01c84f 100644
--- a/usr.sbin/sysinstall/dist.c
+++ b/usr.sbin/sysinstall/dist.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: dist.c,v 1.36.2.1 1995/07/21 10:53:48 rgrimes Exp $
+ * $Id: dist.c,v 1.37 1995/09/18 16:52:24 peter Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -80,7 +80,7 @@ static Distribution DistTable[] = {
{ "compat20", "/", &Dists, DIST_COMPAT20, NULL },
{ "commerce", "/usr/local", &Dists, DIST_COMMERCIAL, NULL },
{ "xperimnt", "/usr/local", &Dists, DIST_EXPERIMENTAL, NULL },
-{ "XF86311", "/usr", &Dists, DIST_XF86, XF86DistTable },
+{ "XF86312", "/usr", &Dists, DIST_XF86, XF86DistTable },
{ NULL },
};
@@ -110,23 +110,27 @@ static Distribution SrcDistTable[] = {
{ "ssys", "/usr/src", &SrcDists, DIST_SRC_SYS, NULL },
{ "subin", "/usr/src", &SrcDists, DIST_SRC_UBIN, NULL },
{ "susbin", "/usr/src", &SrcDists, DIST_SRC_USBIN, NULL },
+{ "ssmailcf", "/usr/src", &SrcDists, DIST_SRC_SMAILCF, NULL },
{ NULL },
};
/* The XFree86 distribution */
static Distribution XF86DistTable[] = {
-{ "X311bin", "/usr", &XF86Dists, DIST_XF86_BIN, NULL },
-{ "X311lib", "/usr", &XF86Dists, DIST_XF86_LIB, NULL },
-{ "X311doc", "/usr", &XF86Dists, DIST_XF86_DOC, NULL },
-{ "XF86311", "/usr", &XF86Dists, DIST_XF86_FONTS, XF86FontDistTable },
-{ "X311man", "/usr", &XF86Dists, DIST_XF86_MAN, NULL },
-{ "X311prog", "/usr", &XF86Dists, DIST_XF86_PROG, NULL },
-{ "X311link", "/usr", &XF86Dists, DIST_XF86_LINK, NULL },
-{ "X311pex", "/usr", &XF86Dists, DIST_XF86_PEX, NULL },
-{ "X311lbx", "/usr", &XF86Dists, DIST_XF86_LBX, NULL },
-{ "X311xicf", "/usr", &XF86Dists, DIST_XF86_XINIT, NULL },
-{ "X311xdcf", "/usr", &XF86Dists, DIST_XF86_XDMCF, NULL },
-{ "XF86311", "/usr", &XF86Dists, DIST_XF86_SERVER, XF86ServerDistTable },
+{ "X312bin", "/usr", &XF86Dists, DIST_XF86_BIN, NULL },
+{ "X312lib", "/usr", &XF86Dists, DIST_XF86_LIB, NULL },
+{ "X312doc", "/usr", &XF86Dists, DIST_XF86_DOC, NULL },
+{ "X312etc", "/usr", &XF86Dists, DIST_XF86_ETC, NULL },
+{ "XF86312", "/usr", &XF86Dists, DIST_XF86_FONTS, XF86FontDistTable },
+{ "X312man", "/usr", &XF86Dists, DIST_XF86_MAN, NULL },
+{ "X312ctrb", "/usr", &XF86Dists, DIST_XF86_CTRB, NULL },
+{ "X312prog", "/usr", &XF86Dists, DIST_XF86_PROG, NULL },
+{ "X312link", "/usr", &XF86Dists, DIST_XF86_LINK, NULL },
+{ "X312pex", "/usr", &XF86Dists, DIST_XF86_PEX, NULL },
+{ "X312lbx", "/usr", &XF86Dists, DIST_XF86_LBX, NULL },
+{ "X312ubin", "/usr", &XF86Dists, DIST_XF86_UBIN, NULL },
+{ "X312xicf", "/usr", &XF86Dists, DIST_XF86_XINIT, NULL },
+{ "X312xdcf", "/usr", &XF86Dists, DIST_XF86_XDMCF, NULL },
+{ "XF86312", "/usr", &XF86Dists, DIST_XF86_SERVER, XF86ServerDistTable },
{ "XF86-xc", "/usr/X11R6/src", &XF86Dists, DIST_XF86_SRC, NULL },
{ "XF86-co", "/usr/X11R6/src", &XF86Dists, DIST_XF86_SRC, NULL },
{ NULL },
@@ -134,28 +138,29 @@ static Distribution XF86DistTable[] = {
/* The XFree86 server distribution */
static Distribution XF86ServerDistTable[] = {
-{ "X3118514", "/usr", &XF86ServerDists, DIST_XF86_SERVER_8514, NULL },
-{ "X311AGX", "/usr", &XF86ServerDists, DIST_XF86_SERVER_AGX, NULL },
-{ "X311Ma8", "/usr", &XF86ServerDists, DIST_XF86_SERVER_MACH8, NULL },
-{ "X311Ma32", "/usr", &XF86ServerDists, DIST_XF86_SERVER_MACH32,NULL },
-{ "X311Ma64", "/usr", &XF86ServerDists, DIST_XF86_SERVER_MACH64,NULL },
-{ "X311Mono", "/usr", &XF86ServerDists, DIST_XF86_SERVER_MONO, NULL },
-{ "X311P9K", "/usr", &XF86ServerDists, DIST_XF86_SERVER_P9000, NULL },
-{ "X311S3", "/usr", &XF86ServerDists, DIST_XF86_SERVER_S3, NULL },
-{ "X311SVGA", "/usr", &XF86ServerDists, DIST_XF86_SERVER_SVGA, NULL },
-{ "X311VG16", "/usr", &XF86ServerDists, DIST_XF86_SERVER_VGA16, NULL },
-{ "X311W32", "/usr", &XF86ServerDists, DIST_XF86_SERVER_W32, NULL },
-{ "X311nest", "/usr", &XF86ServerDists, DIST_XF86_SERVER_NEST, NULL },
+{ "X3128514", "/usr", &XF86ServerDists, DIST_XF86_SERVER_8514, NULL },
+{ "X312AGX", "/usr", &XF86ServerDists, DIST_XF86_SERVER_AGX, NULL },
+{ "X312Ma8", "/usr", &XF86ServerDists, DIST_XF86_SERVER_MACH8, NULL },
+{ "X312Ma32", "/usr", &XF86ServerDists, DIST_XF86_SERVER_MACH32,NULL },
+{ "X312Ma64", "/usr", &XF86ServerDists, DIST_XF86_SERVER_MACH64,NULL },
+{ "X312Mono", "/usr", &XF86ServerDists, DIST_XF86_SERVER_MONO, NULL },
+{ "X312P9K", "/usr", &XF86ServerDists, DIST_XF86_SERVER_P9000, NULL },
+{ "X312S3", "/usr", &XF86ServerDists, DIST_XF86_SERVER_S3, NULL },
+{ "X312SVGA", "/usr", &XF86ServerDists, DIST_XF86_SERVER_SVGA, NULL },
+{ "X312VG16", "/usr", &XF86ServerDists, DIST_XF86_SERVER_VGA16, NULL },
+{ "X312W32", "/usr", &XF86ServerDists, DIST_XF86_SERVER_W32, NULL },
+{ "X312nest", "/usr", &XF86ServerDists, DIST_XF86_SERVER_NEST, NULL },
{ NULL },
};
/* The XFree86 font distribution */
static Distribution XF86FontDistTable[] = {
-{ "X311fnts", "/usr", &XF86FontDists, DIST_XF86_FONTS_MISC, NULL },
-{ "X311f100", "/usr", &XF86FontDists, DIST_XF86_FONTS_100, NULL },
-{ "X311fscl", "/usr", &XF86FontDists, DIST_XF86_FONTS_SCALE, NULL },
-{ "X311fnon", "/usr", &XF86FontDists, DIST_XF86_FONTS_NON, NULL },
-{ "X311fsrv", "/usr", &XF86FontDists, DIST_XF86_FONTS_SERVER, NULL },
+{ "X312fnts", "/usr", &XF86FontDists, DIST_XF86_FONTS_MISC, NULL },
+{ "X312f100", "/usr", &XF86FontDists, DIST_XF86_FONTS_100, NULL },
+{ "X312fcyr", "/usr", &XF86FontDists, DIST_XF86_FONTS_CYR, NULL },
+{ "X312fscl", "/usr", &XF86FontDists, DIST_XF86_FONTS_SCALE, NULL },
+{ "X312fnon", "/usr", &XF86FontDists, DIST_XF86_FONTS_NON, NULL },
+{ "X312fsrv", "/usr", &XF86FontDists, DIST_XF86_FONTS_SERVER, NULL },
{ NULL },
};
@@ -167,7 +172,7 @@ distReset(char *str)
XF86Dists = 0;
XF86ServerDists = 0;
XF86FontDists = 0;
- return 0;
+ return RET_SUCCESS;
}
int
@@ -176,7 +181,7 @@ distSetDeveloper(char *str)
distReset(NULL);
Dists = _DIST_DEVELOPER;
SrcDists = DIST_SRC_ALL;
- return 0;
+ return RET_SUCCESS;
}
int
@@ -189,7 +194,7 @@ distSetXDeveloper(char *str)
XF86ServerDists = DIST_XF86_SERVER_SVGA;
XF86FontDists = DIST_XF86_FONTS_MISC;
distSetXF86(NULL);
- return 0;
+ return RET_SUCCESS;
}
int
@@ -198,7 +203,7 @@ distSetKernDeveloper(char *str)
distReset(NULL);
Dists = _DIST_DEVELOPER;
SrcDists = DIST_SRC_SYS;
- return 0;
+ return RET_SUCCESS;
}
int
@@ -206,7 +211,7 @@ distSetUser(char *str)
{
distReset(NULL);
Dists = _DIST_USER;
- return 0;
+ return RET_SUCCESS;
}
int
@@ -218,7 +223,7 @@ distSetXUser(char *str)
XF86ServerDists = DIST_XF86_SERVER_SVGA;
XF86FontDists = DIST_XF86_FONTS_MISC;
distSetXF86(NULL);
- return 0;
+ return RET_SUCCESS;
}
int
@@ -226,7 +231,7 @@ distSetMinimum(char *str)
{
distReset(NULL);
Dists = DIST_BIN;
- return 0;
+ return RET_SUCCESS;
}
int
@@ -237,16 +242,33 @@ distSetEverything(char *str)
XF86Dists = DIST_XF86_ALL;
XF86ServerDists = DIST_XF86_SERVER_ALL;
XF86FontDists = DIST_XF86_FONTS_ALL;
- return 0;
+ return RET_SUCCESS;
+}
+
+int
+distSetCustom(char *str)
+{
+ /* These *ALL* have to be set at once. It's for power users only! :) */
+ if (sscanf(str, "%d %d %d %d %d %d",
+ &Dists, &DESDists, &SrcDists, &XF86Dists, &XF86ServerDists, &XF86FontDists) != 6) {
+ dialog_clear();
+ msgConfirm("Warning: A `%s' set was configured which did not set all\n"
+ "distributions explicitly. Some distributions will default to\n"
+ "unselected as a result.", str);
+ }
+ return RET_SUCCESS;
}
int
distSetDES(char *str)
{
dmenuOpenSimple(&MenuDESDistributions);
- if (DESDists)
+ if (DESDists) {
+ if (DESDists & DIST_DES_KERBEROS)
+ DESDists |= DIST_DES_DES;
Dists |= DIST_DES;
- return 0;
+ }
+ return RET_SUCCESS;
}
int
@@ -255,7 +277,7 @@ distSetSrc(char *str)
dmenuOpenSimple(&MenuSrcDistributions);
if (SrcDists)
Dists |= DIST_SRC;
- return 0;
+ return RET_SUCCESS;
}
int
@@ -271,7 +293,7 @@ distSetXF86(char *str)
if (isDebug())
msgDebug("SetXF86 Masks: Server: %0x, Fonts: %0x, XDists: %0x, Dists: %0x\n",
XF86ServerDists, XF86FontDists, XF86Dists, Dists);
- return 0;
+ return RET_SUCCESS;
}
static Boolean
@@ -312,43 +334,46 @@ distExtract(char *parent, Distribution *me)
snprintf(buf, 512, "%s/%s.tgz", path, dist);
if (isDebug())
msgDebug("Trying to get large piece: %s\n", buf);
- /* Set it as an "exploratory get" so that we don't loop unnecessarily on it */
- mediaDevice->flags |= OPT_EXPLORATORY_GET;
- fd = (*mediaDevice->get)(mediaDevice, buf, NULL);
- mediaDevice->flags &= ~OPT_EXPLORATORY_GET;
+ fd = mediaDevice->get(mediaDevice, buf, TRUE);
if (fd >= 0) {
msgNotify("Extracting %s into %s directory...", me[i].my_name, me[i].my_dir);
status = mediaExtractDist(me[i].my_dir, fd);
- (*mediaDevice->close)(mediaDevice, fd);
+ mediaDevice->close(mediaDevice, fd);
goto done;
}
- else if (fd == -2) /* Hard error, can't continue */
- return FALSE;
+ else if (fd == -2) { /* Hard error, can't continue */
+ mediaDevice->shutdown(mediaDevice);
+ status = FALSE;
+ goto done;
+ }
+
+ /*
+ * If we couldn't get it as one file then we need to get multiple pieces; locate and parse an
+ * info file telling us how many we need for this distribution.
+ */
+ dist_attr = NULL;
+ numchunks = 0;
- /* If we couldn't get it as one file then we need to get multiple pieces; get info file telling us how many */
snprintf(buf, sizeof buf, "/stand/info/%s/%s.inf", path, dist);
- if (!access(buf, R_OK)) {
+ if (file_readable(buf)) {
if (isDebug())
- msgDebug("Parsing attributes file for %s\n", dist);
+ msgDebug("Parsing attributes file for distribution %s\n", dist);
dist_attr = safe_malloc(sizeof(Attribs) * MAX_ATTRIBS);
- if (attr_parse(&dist_attr, buf) == 0) {
- msgConfirm("Cannot load information file for %s distribution!\nPlease verify that your media is valid and try again.", dist);
- return FALSE;
+ if (attr_parse_file(dist_attr, buf) == RET_FAIL) {
+ dialog_clear();
+ msgConfirm("Cannot load information file for %s distribution!\n"
+ "Please verify that your media is valid and try again.", dist);
}
-
- if (isDebug())
- msgDebug("Looking for attribute `pieces'\n");
- tmp = attr_match(dist_attr, "pieces");
- if (tmp)
- numchunks = strtol(tmp, 0, 0);
- else
- numchunks = 0;
- }
- else {
- if (isDebug())
- msgDebug("Couldn't open attributes file: %s\n", buf);
- numchunks = 0;
+ else {
+ if (isDebug())
+ msgDebug("Looking for attribute `pieces'\n");
+ tmp = attr_match(dist_attr, "pieces");
+ if (tmp)
+ numchunks = strtol(tmp, 0, 0);
+ }
+ safe_free(dist_attr);
}
+
if (!numchunks)
continue;
@@ -364,8 +389,8 @@ distExtract(char *parent, Distribution *me)
snprintf(buf, 512, "%s/%s.%c%c", path, dist, (chunk / 26) + 'a', (chunk % 26) + 'a');
if (isDebug())
- msgDebug("trying for piece %d of %d: %s\n", chunk, numchunks, buf);
- fd = (*mediaDevice->get)(mediaDevice, buf, dist_attr);
+ msgDebug("trying for piece %d of %d: %s\n", chunk + 1, numchunks, buf);
+ fd = mediaDevice->get(mediaDevice, buf, FALSE);
if (fd < 0) {
dialog_clear();
msgConfirm("failed to retreive piece file %s!\nAborting the transfer", buf);
@@ -373,18 +398,17 @@ distExtract(char *parent, Distribution *me)
}
snprintf(prompt, 80, "Extracting %s into %s directory...", me[i].my_name, me[i].my_dir);
dialog_gauge("Progress", prompt, 8, 15, 6, 50, (int)((float)(chunk + 1) / numchunks * 100));
+ move(0, 0); /* Get cursor out of the way - it makes gauges look strange */
while ((n = read(fd, buf, sizeof buf)) > 0) {
retval = write(fd2, buf, n);
if (retval != n) {
- if (mediaDevice->close)
- (*mediaDevice->close)(mediaDevice, fd);
- else
- close(fd);
+ mediaDevice->close(mediaDevice, fd);
+ dialog_clear();
msgConfirm("Write failure on transfer! (wrote %d bytes of %d bytes)", retval, n);
goto punt;
}
}
- (*mediaDevice->close)(mediaDevice, fd);
+ mediaDevice->close(mediaDevice, fd);
}
close(fd2);
status = mediaExtractDistEnd(zpid, cpid);
@@ -397,15 +421,23 @@ distExtract(char *parent, Distribution *me)
done:
if (!status) {
- if (OptFlags & OPT_NO_CONFIRM)
+ if (variable_get(VAR_NO_CONFIRM))
status = TRUE;
else {
if (me[i].my_dist) {
- msgConfirm("Unable to transfer all components of the %s distribution.\nIf this is a CDROM install, it may be because export restrictions prohibit\nDES code from being shipped from the U.S. Try to get this code from a\nlocal FTP site instead!");
+ dialog_clear();
+ msgConfirm("Unable to transfer all components of the %s distribution.\n"
+ "If this is a CDROM install, it may be because export restrictions prohibit\n"
+ "DES code from being shipped from the U.S. Try to get this code from a\n"
+ "local FTP site instead!", me[i].my_name);
status = TRUE;
}
- else
- status = msgYesNo("Unable to transfer the %s distribution from %s.\nDo you want to try to retrieve it again?", me[i].my_name, mediaDevice->name);
+ else {
+ dialog_clear();
+ status = msgYesNo("Unable to transfer the %s distribution from %s.\n"
+ "Do you want to try to retrieve it again?",
+ me[i].my_name, mediaDevice->name);
+ }
}
}
/* Extract was successful, remove ourselves from further consideration */
@@ -415,24 +447,58 @@ distExtract(char *parent, Distribution *me)
return status;
}
+static void
+printSelected(char *buf, int selected, Distribution *me)
+{
+ int i;
+ static int col = 0;
+
+ /* Loop through to see if we're in our parent's plans */
+ for (i = 0; me[i].my_name; i++) {
+
+ /* If our bit isn't set, go to the next */
+ if (!(me[i].my_bit & selected))
+ continue;
+
+ /* This is shorthand for "dist currently disabled" */
+ if (!me[i].my_dir)
+ continue;
+
+ col += strlen(me[i].my_name);
+ if (col > 50) {
+ col = 0;
+ strcat(buf, "\n");
+ }
+ sprintf(&buf[strlen(buf)], " %s", me[i].my_name);
+ /* Recurse if have a sub-distribution */
+ if (me[i].my_dist)
+ printSelected(buf, *(me[i].my_mask), me[i].my_dist);
+ }
+}
+
int
-distExtractAll(char *unused)
+distExtractAll(char *ptr)
{
int retries = 0;
+ char buf[512];
/* First try to initialize the state of things */
- if (!(*mediaDevice->init)(mediaDevice))
- return 0;
-
+ if (!mediaDevice->init(mediaDevice))
+ return RET_FAIL;
+ if (!Dists && ptr) {
+ msgConfirm("You haven't selected any distributions to extract.");
+ return RET_FAIL;
+ }
/* Try for 3 times around the loop, then give up. */
while (Dists && ++retries < 3)
distExtract(NULL, DistTable);
- /* Anything left? */
- if (Dists)
- msgConfirm("Couldn't extract all of the distributions. This may\nbe because the specified distributions are not available from the\ninstallation media you've chosen (residue: %0x)", Dists);
-
- /* Close up shop and go home */
- (*mediaDevice->shutdown)(mediaDevice);
- return 0;
+ if (Dists) {
+ printSelected(buf, Dists, DistTable);
+ dialog_clear();
+ msgConfirm("Couldn't extract all of the distributions. This may\n"
+ "be because the following distributions are not available on the\n"
+ "installation media you've chosen:\n\n\t%s", buf);
+ }
+ return RET_SUCCESS;
}
diff --git a/usr.sbin/sysinstall/dist.h b/usr.sbin/sysinstall/dist.h
index eaab90b..b923d87 100644
--- a/usr.sbin/sysinstall/dist.h
+++ b/usr.sbin/sysinstall/dist.h
@@ -47,21 +47,25 @@
#define DIST_SRC_UBIN 0x1000
#define DIST_SRC_USBIN 0x2000
#define DIST_SRC_BIN 0x4000
-#define DIST_SRC_ALL 0xFFFF
+#define DIST_SRC_SMAILCF 0x8000
+#define DIST_SRC_ALL 0x7FFF /* no SMAILCF, it's part of USBIN */
/* Subtypes for XFree86 distribution */
#define DIST_XF86_BIN 0x0001
#define DIST_XF86_LIB 0x0002
#define DIST_XF86_DOC 0x0004
-#define DIST_XF86_MAN 0x0008
-#define DIST_XF86_PROG 0x0010
-#define DIST_XF86_LINK 0x0020
-#define DIST_XF86_PEX 0x0040
-#define DIST_XF86_LBX 0x0080
-#define DIST_XF86_XINIT 0x0100
-#define DIST_XF86_XDMCF 0x0200
-#define DIST_XF86_SRC 0x0400
-#define DIST_XF86_SERVER 0x0800
+#define DIST_XF86_ETC 0x0008
+#define DIST_XF86_MAN 0x0010
+#define DIST_XF86_CTRB 0x0020
+#define DIST_XF86_PROG 0x0040
+#define DIST_XF86_LINK 0x0080
+#define DIST_XF86_UBIN 0x0100
+#define DIST_XF86_PEX 0x0200
+#define DIST_XF86_LBX 0x0400
+#define DIST_XF86_XINIT 0x0800
+#define DIST_XF86_XDMCF 0x1000
+#define DIST_XF86_SRC 0x2000
+#define DIST_XF86_SERVER 0x4000
#define DIST_XF86_SERVER_8514 0x0001
#define DIST_XF86_SERVER_AGX 0x0002
#define DIST_XF86_SERVER_MACH8 0x0004
@@ -75,13 +79,14 @@
#define DIST_XF86_SERVER_W32 0x0400
#define DIST_XF86_SERVER_NEST 0x0800
#define DIST_XF86_SERVER_ALL 0x0FFF
-#define DIST_XF86_FONTS 0x1000
+#define DIST_XF86_FONTS 0x8000
#define DIST_XF86_FONTS_MISC 0x0001
#define DIST_XF86_FONTS_100 0x0002
-#define DIST_XF86_FONTS_SCALE 0x0004
-#define DIST_XF86_FONTS_NON 0x0008
-#define DIST_XF86_FONTS_SERVER 0x0010
-#define DIST_XF86_FONTS_ALL 0x00FF
+#define DIST_XF86_FONTS_CYR 0x0004
+#define DIST_XF86_FONTS_SCALE 0x0008
+#define DIST_XF86_FONTS_NON 0x0010
+#define DIST_XF86_FONTS_SERVER 0x0020
+#define DIST_XF86_FONTS_ALL 0x003F
#define DIST_XF86_ALL 0xFFFF
#endif
diff --git a/usr.sbin/sysinstall/dmenu.c b/usr.sbin/sysinstall/dmenu.c
index ff059c7..333f9b5 100644
--- a/usr.sbin/sysinstall/dmenu.c
+++ b/usr.sbin/sysinstall/dmenu.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated for what's essentially a complete rewrite.
*
- * $Id: dmenu.c,v 1.11.2.11 1995/06/10 19:44:54 jkh Exp $
+ * $Id: dmenu.c,v 1.12.2.5 1995/10/19 15:55:00 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -44,7 +44,7 @@
#include "sysinstall.h"
#include <sys/types.h>
-#define MAX_MENU 8
+#define MAX_MENU 15
/* Traverse menu but give user no control over positioning */
Boolean
@@ -68,19 +68,24 @@ dmenuFlagCheck(DMenuItem *item)
char *
dmenuVarCheck(DMenuItem *item)
{
- char *cp, *cp2, tmp[256];
+ char *w, *cp, *cp2, tmp[256];
- strncpy(tmp, (char *)item->ptr, 256);
+ w = (char *)item->parm;
+ if (!w)
+ w = (char *)item->ptr;
+ if (!w)
+ return "OFF";
+ strncpy(tmp, w, 256);
if ((cp = index(tmp, '=')) != NULL) {
- *(cp++) = '\0';
- cp2 = getenv(tmp);
- if (cp2)
- return !strcmp(cp, cp2) ? "ON" : "OFF";
- else
- return "OFF";
+ *(cp++) = '\0';
+ cp2 = getenv(tmp);
+ if (cp2)
+ return !strcmp(cp, cp2) ? "ON" : "OFF";
+ else
+ return "OFF";
}
else
- return getenv(tmp) ? "ON" : "OFF";
+ return getenv(tmp) ? "ON" : "OFF";
}
char *
@@ -100,6 +105,19 @@ checkHookVal(DMenuItem *item)
return (*item->check)(item);
}
+static int
+menu_height(DMenu *menu, int n)
+{
+ int max;
+ char *t;
+
+ for (t = menu->title, max = MAX_MENU; *t; t++) {
+ if (*t == '\n')
+ --max;
+ }
+ return n > max ? max : n;
+}
+
/* Traverse over an internal menu */
Boolean
dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max)
@@ -128,18 +146,17 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max)
use_helpfile(systemHelpFile(menu->helpfile, buf));
/* Pop up that dialog! */
- if (menu->options & DMENU_NORMAL_TYPE) {
+ if (menu->options & DMENU_NORMAL_TYPE)
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) {
+ menu_height(menu, n), n, (u_char **)nitems, (u_char *)result, choice, scroll);
+
+ else if (menu->options & DMENU_RADIO_TYPE)
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) {
+ menu_height(menu, n), n, (u_char **)nitems, (u_char *)result);
+
+ else if (menu->options & DMENU_MULTIPLE_TYPE)
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);
- }
+ menu_height(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 */
dialog_clear();
@@ -149,8 +166,7 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max)
if (menu->options & DMENU_CALL_FIRST)
tmp = &(menu->items[0]);
else {
- if (decode_and_dispatch_multiple(menu, result) ||
- menu->options & DMENU_SELECTION_RETURNS) {
+ if (decode_and_dispatch_multiple(menu, result) || menu->options & DMENU_SELECTION_RETURNS) {
items_free(nitems, curr, max);
return TRUE;
}
@@ -160,7 +176,7 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max)
if ((tmp = decode(menu, result)) == NULL)
return FALSE;
}
- if (dispatch(tmp, result) || (menu->options & DMENU_SELECTION_RETURNS)) {
+ if (dispatch(tmp, result) == RET_DONE || (menu->options & DMENU_SELECTION_RETURNS)) {
items_free(nitems, curr, max);
return TRUE;
}
diff --git a/usr.sbin/sysinstall/dos.c b/usr.sbin/sysinstall/dos.c
index d4a19a4..6e5f65d 100644
--- a/usr.sbin/sysinstall/dos.c
+++ b/usr.sbin/sysinstall/dos.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: dos.c,v 1.6.2.1 1995/07/21 10:53:52 rgrimes Exp $
+ * $Id: dos.c,v 1.7 1995/09/18 16:52:26 peter Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -66,7 +66,7 @@ mediaInitDOS(Device *dev)
if (!RunningAsInit || DOSMounted)
return TRUE;
- if (Mkdir("/dos", NULL))
+ if (Mkdir("/dos", NULL) != RET_SUCCESS)
return FALSE;
memset(&args, 0, sizeof(args));
@@ -75,22 +75,32 @@ mediaInitDOS(Device *dev)
args.mask = 0777;
if (mount(MOUNT_MSDOS, "/dos", MNT_RDONLY, (caddr_t)&args) == -1) {
- msgConfirm("Error mounting %s on /dos: %s (%u)\n", args.fspec, strerror(errno), errno);
+ dialog_clear();
+ msgConfirm("Error mounting %s on /dos: %s (%u)", args.fspec, strerror(errno), errno);
return FALSE;
}
+ else
+ msgDebug("Mounted DOS device (%s) on /dos.\n", args.fspec);
DOSMounted = TRUE;
return TRUE;
}
int
-mediaGetDOS(Device *dev, char *file, Attribs *dist_attrs)
+mediaGetDOS(Device *dev, char *file, Boolean tentative)
{
char buf[PATH_MAX];
+ msgDebug("Request for %s from DOS\n", file);
snprintf(buf, PATH_MAX, "/dos/freebsd/%s", file);
- if (!access(buf, R_OK))
+ if (file_readable(buf))
return open(buf, O_RDONLY);
snprintf(buf, PATH_MAX, "/dos/freebsd/dists/%s", file);
+ if (file_readable(buf))
+ return open(buf, O_RDONLY);
+ snprintf(buf, PATH_MAX, "/dos/%s", file);
+ if (file_readable(buf))
+ return open(buf, O_RDONLY);
+ snprintf(buf, PATH_MAX, "/dos/dists/%s", file);
return open(buf, O_RDONLY);
}
@@ -99,11 +109,13 @@ mediaShutdownDOS(Device *dev)
{
if (!RunningAsInit || !DOSMounted)
return;
- msgDebug("Unmounting /dos\n");
- if (unmount("/dos", MNT_FORCE) != 0)
- msgConfirm("Could not unmount the DOS partition: %s\n", strerror(errno));
+ msgDebug("Unmounting %s from /dos\n", dev->name);
+ if (unmount("/dos", MNT_FORCE) != 0) {
+ dialog_clear();
+ msgConfirm("Could not unmount the DOS partition: %s", strerror(errno));
+ }
if (isDebug())
- msgDebug("Unmount returned\n");
+ msgDebug("Unmount successful\n");
DOSMounted = FALSE;
return;
}
diff --git a/usr.sbin/sysinstall/floppy.c b/usr.sbin/sysinstall/floppy.c
index cf847de..f4512a2 100644
--- a/usr.sbin/sysinstall/floppy.c
+++ b/usr.sbin/sysinstall/floppy.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: floppy.c,v 1.6.2.17 1995/06/10 09:14:51 jkh Exp $
+ * $Id: floppy.c,v 1.7.2.8 1995/10/22 17:39:07 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -73,11 +73,11 @@ floppyChoiceHook(char *str)
string_prune(str);
str = string_skipwhite(str);
if (!*str)
- return 0;
+ return RET_FAIL;
devs = deviceFind(str, DEVICE_TYPE_FLOPPY);
if (devs)
floppyDev = devs[0];
- return devs ? 1 : 0;
+ return devs ? RET_DONE : RET_FAIL;
}
/* Our last-ditch routine for getting ROOT from a floppy */
@@ -93,11 +93,13 @@ getRootFloppy(void)
devs = deviceFind(NULL, DEVICE_TYPE_FLOPPY);
cnt = deviceCount(devs);
if (!cnt) {
+ dialog_clear();
msgConfirm("No floppy devices found! Something is seriously wrong!");
return -1;
}
else if (cnt == 1) {
floppyDev = devs[0];
+ dialog_clear();
msgConfirm("Please insert the ROOT floppy in %s and press [ENTER]", floppyDev->description);
}
else {
@@ -121,96 +123,75 @@ Boolean
mediaInitFloppy(Device *dev)
{
struct msdosfs_args dosargs;
+ struct ufs_args u_args;
if (floppyMounted)
return TRUE;
- if (Mkdir("/mnt", NULL)) {
+ if (Mkdir("/dist", NULL)) {
+ dialog_clear();
msgConfirm("Unable to make directory mountpoint for %s!", dev->devname);
return FALSE;
}
- if (!distWanted)
+ msgDebug("Init floppy called for %s distribution.\n", distWanted ? distWanted : "some");
+ if (!distWanted) {
+ dialog_clear();
msgConfirm("Please insert next floppy into %s", dev->description);
+ }
else {
+ dialog_clear();
msgConfirm("Please insert floppy containing %s into %s", distWanted, dev->description);
- distWanted = NULL;
}
+
memset(&dosargs, 0, sizeof dosargs);
dosargs.fspec = dev->devname;
dosargs.uid = dosargs.gid = 0;
dosargs.mask = 0777;
- if (mount(MOUNT_MSDOS, "/mnt", 0, (caddr_t)&dosargs) == -1) {
- msgConfirm("Error mounting floppy %s (%s) on /mnt : %s", dev->name, dev->devname, strerror(errno));
- return FALSE;
+
+ memset(&u_args, 0, sizeof(u_args));
+ u_args.fspec = dev->devname;
+
+ if (mount(MOUNT_MSDOS, "/dist", MNT_RDONLY, (caddr_t)&dosargs) == -1) {
+ if (mount(MOUNT_UFS, "/dist", MNT_RDONLY, (caddr_t)&u_args) == -1) {
+ dialog_clear();
+ msgConfirm("Error mounting floppy %s (%s) on /dist : %s", dev->name, dev->devname, strerror(errno));
+ return FALSE;
+ }
}
- if (isDebug())
- msgDebug("initFloppy: mounted floppy %s successfully on /mnt\n", dev->devname);
+ msgDebug("initFloppy: mounted floppy %s successfully on /dist\n", dev->devname);
floppyMounted = TRUE;
+ distWanted = NULL;
return TRUE;
}
int
-mediaGetFloppy(Device *dev, char *file, Attribs *dist_attrs)
+mediaGetFloppy(Device *dev, char *file, Boolean tentative)
{
char buf[PATH_MAX];
-#ifdef DO_CRC_CHECK
- char *extn, *var;
- const char *val;
- char attrib[10];
- u_long cval1, clen1, cval2, clen2;
-#endif
int fd;
int nretries = 5;
- snprintf(buf, PATH_MAX, "/mnt/%s", file);
+ snprintf(buf, PATH_MAX, "/dist/%s", file);
- if (access(buf, R_OK)) {
- if (dev->flags & OPT_EXPLORATORY_GET)
+ msgDebug("Request for %s from floppy on /dist, tentative is %d.\n", buf, tentative);
+ if (!file_readable(buf)) {
+ if (tentative)
return -1;
else {
- while (access(buf, R_OK) != 0) {
+ while (!file_readable(buf)) {
if (!--nretries) {
- msgConfirm("GetFloppy: Failed to get %s after retries;\ngiving up.", file);
+ dialog_clear();
+ msgConfirm("GetFloppy: Failed to get %s after retries;\ngiving up.", buf);
return -1;
}
distWanted = buf;
- (*dev->shutdown)(dev);
- if (!(dev->init)(dev))
+ mediaShutdownFloppy(dev);
+ if (!mediaInitFloppy(dev))
return -1;
}
}
}
-
fd = open(buf, O_RDONLY);
-#ifdef DO_CRC_CHECK
- if (dist_attrs != NULL && fd != -1) {
- extn = rindex(buf, '.');
- snprintf(attrib, 10, "cksum%s", extn);
- val = attr_match(dist_attrs, attrib);
- if (val != NULL) {
- if (isDebug())
- msgDebug("attr_match(%s,%s) returned `%s'\n", dist_attrs, attrib, val);
- var = strdup(val);
-
- cval1 = strtol(var, &extn, 10);
- clen1 = strtol(extn, NULL, 10);
-
- if (crc(fd, &cval2, &clen2) != 0) {
- msgConfirm("crc() of file `%s' failed!", file);
- close(fd);
- return -1;
- }
- if ((cval1 != cval2) || (clen1 != clen2)) {
- msgConfirm("Invalid file `%s' (checksum `%u %u' should be %s)", file, cval2, clen2, var);
- close(fd);
- return -1;
- }
- lseek(fd, 0, 0);
- }
- else
- msgNotify("No checksum information for file %s..", file);
- }
-#endif
return fd;
}
@@ -218,10 +199,12 @@ void
mediaShutdownFloppy(Device *dev)
{
if (floppyMounted) {
- if (unmount("/mnt", MNT_FORCE) != 0)
- msgDebug("Umount of floppy on /mnt failed: %s (%d)\n", strerror(errno), errno);
+ if (unmount("/dist", MNT_FORCE) != 0)
+ msgDebug("Umount of floppy on /dist failed: %s (%d)\n", strerror(errno), errno);
else {
floppyMounted = FALSE;
+ msgDebug("Floppy unmounted successfully.\n");
+ dialog_clear();
msgConfirm("You may remove the floppy from %s", dev->description);
}
}
diff --git a/usr.sbin/sysinstall/ftp.c b/usr.sbin/sysinstall/ftp.c
index 59ffb6f..e4b2c3e 100644
--- a/usr.sbin/sysinstall/ftp.c
+++ b/usr.sbin/sysinstall/ftp.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: ftp.c,v 1.13.2.9 1995/06/05 18:34:15 jkh Exp $
+ * $Id: ftp.c,v 1.14.2.1 1995/10/21 14:06:35 jkh Exp $
*
* Return values have been sanitized:
* -1 error, but you (still) have a session.
@@ -34,6 +34,9 @@
/* Handy global for us to stick the port # */
int FtpPort;
+/* How to see by a given code whether or not the connection has timed out */
+#define FTP_TIMEOUT(code) (code == 421)
+
#ifndef STANDALONE_FTP
#include "sysinstall.h"
#endif /*STANDALONE_FTP*/
@@ -288,7 +291,7 @@ FtpGet(FTP_t ftp, char *file)
return botch(ftp,"FtpGet","open");
if(ftp->binary) {
i = cmd(ftp,"TYPE I");
- if (i < 0)
+ if (i < 0 || FTP_TIMEOUT(i))
return zap(ftp);
if (i > 299)
return -1;
@@ -331,7 +334,7 @@ FtpGet(FTP_t ftp, char *file)
}
ftp->fd_xfer = s;
i = cmd(ftp,"RETR %s",file);
- if (i < 0) {
+ if (i < 0 || FTP_TIMEOUT(i)) {
close(s);
return zap(ftp);
}
@@ -374,11 +377,14 @@ FtpGet(FTP_t ftp, char *file)
close(s);
return zap(ftp);
}
- else if (i > 299) {
+ else if (i > 299 || FTP_TIMEOUT(i)) {
if (isDebug())
msgDebug("FTP: No such file %s, moving on.\n", file);
close(s);
- return -1;
+ if (FTP_TIMEOUT(i))
+ return zap(ftp);
+ else
+ return -1;
}
ftp->fd_xfer = accept(s, 0, 0);
if (ftp->fd_xfer < 0) {
diff --git a/usr.sbin/sysinstall/globals.c b/usr.sbin/sysinstall/globals.c
index 2041024..bc303e5 100644
--- a/usr.sbin/sysinstall/globals.c
+++ b/usr.sbin/sysinstall/globals.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: globals.c,v 1.9.2.2 1995/06/05 03:15:38 jkh Exp $
+ * $Id: globals.c,v 1.10.2.1 1995/10/21 14:06:41 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -55,9 +55,7 @@ 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
@@ -73,6 +71,4 @@ globalsInit(void)
VarHead = NULL;
mediaDevice = NULL;
RunningAsInit = FALSE;
- OptFlags = 0;
- InstallPrefix = NULL;
}
diff --git a/usr.sbin/sysinstall/help/configure.hlp b/usr.sbin/sysinstall/help/configure.hlp
index 49980d4..d7473e6 100644
--- a/usr.sbin/sysinstall/help/configure.hlp
+++ b/usr.sbin/sysinstall/help/configure.hlp
@@ -3,12 +3,8 @@ process is complete. At the minimum, you should probably set the
system manager's password and the system time zone.
For extra goodies like bash, emacs, pascal, etc., you should look at
-the Packages item in this menu. Currently, the Packages option is
-only useful if you have a CDROM or an existing packages collection
-somewhere in the file system hierarchy where the package management
-tool can locate it. The automatic transfer of packages via FTP is not
-yet supported!
+the Packages item in this menu.
For setting the timezone after the system is installed, type
-``tzsetup''. For more information on the general system
+``tzsetup''. For more information on the overall general system
configuration, see the ``/etc/sysconfig'' file.
diff --git a/usr.sbin/sysinstall/help/distributions.hlp b/usr.sbin/sysinstall/help/distributions.hlp
index b81efbf..b614937 100644
--- a/usr.sbin/sysinstall/help/distributions.hlp
+++ b/usr.sbin/sysinstall/help/distributions.hlp
@@ -1,5 +1,5 @@
An ``X-'' prefixed before a distribution set means that the XFree86
-3.1.1u1 base distribution, libraries, manual pages, SVGA server and a
+3.1.2-S base distribution, libraries, manual pages, SVGA server and a
set of default fonts will be selected in addition to the set itself.
If you select such a set, you will also be presented with a set of
@@ -9,37 +9,32 @@ setup.
N.B. All references in this document to `complete source' mean the
complete source tree minus any legally encumbered cryptography code.
-The current "canned" installations are as follows:
+The current "canned" installations are provided:
Developer: Base ("bin") distribution, man pages, dictionary
files, profiling libraries and the complete source tree.
-
Kern-Developer: As above, but with only kernel sources instead of
the complete source tree.
-
User: The base distribution, man pages, dictionary files and
the FreeBSD 1.x and 2.0 compatibility sets.
-
Minimal: Only the base distribution.
-
Everything: The base distribution, man pages, dictionary files,
profiling libraries, the FreeBSD 1.x and the FreeBSD 2.0
compatibility libraries, the complete source tree,
games and your choice of XFree86 distribution components.
- N.B. Still no cryptocraphy source code!
-
+ Note that the cryptocraphy source code is NOT included
+ in this collection. You will need to select that by
+ hand if you're inside the United States.
Custom: Allows you to modify or create your distribution set on
a piece-by-piece basis.
-
Reset: Clear all currently selected distributions.
-
---
When using Custom, most of the sub-distribution choices are fairly
@@ -51,15 +46,6 @@ obvious, though two possible exceptions may be the "commerce" and
under special arrangement, limited functionality demos, shareware
products (you like it, you buy it), etc.
- At the time of this writing, there are unfortunately not enough
- commercial offerings to justify a fully split distribution set,
- so each product is available both as a subdirectory and as part
- of one large archive file. If you select "commerce" from the
- distributions submenus then you'll get the big file containing
- the entire collection copied to your hard disk. Don't do this
- unless you've got at least 10MB to devote to it!
-
-
* The "xperimnt" directory contains, not surprisingly, experimental
offerings. Unfinished (or work-in-progress) features, special
purpose drivers and packages, strange proof-of-concept stuff,
@@ -74,15 +60,18 @@ obvious, though two possible exceptions may be the "commerce" and
You may also notice that certain distributions, like "des" and "krb",
-are marked "NOT FOR EXPORT!" This is because it's illegal to
-export them from the United States (or any other country which
-considers encryption technology to be on its restricted export
-list). Since breaking this law only gets the _originating_ site
-(US!) in trouble, please do not load these distributions from U.S.
-servers!
+are marked "NOT FOR EXPORT!" This is because it's illegal to export
+them from the United States (or any other country which considers
+encryption technology to be on its restricted export list). Since
+breaking this law only gets the _originating_ site (US!) in trouble,
+please do not load these distributions from U.S. servers! We don't
+like these restrictions any more than you do, but can't do much about
+it (write your U.S. congressperson!).
A number of "foreign" servers do exist for the benefit of
-non-U.S. sites, one of which is "skeleton.mikom.csir.co.za".
+non-U.S. sites, the official site being:
+
+ ftp://ftp.internat.freebsd.org/pub/FreeBSD
Please get all such export restricted software from there
if you are outside the U.S., thanks!
diff --git a/usr.sbin/sysinstall/help/drives.hlp b/usr.sbin/sysinstall/help/drives.hlp
index ef1c4fe..27e2e75 100644
--- a/usr.sbin/sysinstall/help/drives.hlp
+++ b/usr.sbin/sysinstall/help/drives.hlp
@@ -1,7 +1,7 @@
If you are going to actually install some portion of FreeBSD on a
drive then PLEASE BE VERY CERTAIN that the Geometry reported in the
-Partition Editor (see Installation Menu) is the correct one for your
-drive and controller combination!
+Partition Editor is the correct one for your drive and controller
+combination!
IDE drives often have a certain geometry set during the PC BIOS setup,
or (in the case of larger IDE drives) have their geometry "remapped"
diff --git a/usr.sbin/sysinstall/help/media.hlp b/usr.sbin/sysinstall/help/media.hlp
index 8b081bc..dbf7d9b 100644
--- a/usr.sbin/sysinstall/help/media.hlp
+++ b/usr.sbin/sysinstall/help/media.hlp
@@ -1,29 +1,49 @@
You can install from the following types of media:
- CDROM - requires one of the following supported CDROM drives:
+ CDROM requires one of the following supported CDROM drives:
+ Sony CDU 31/33A
+ Matushita/Panasonic "Sound Blaster" CDROM.
+ Mitsumi FX-001{A-D} (older non-IDE drives).
+ SCSI - Any standard SCSI CDROM drive hooked to
+ a supported controller (see Hardware Guide).
- Sony CDU 31/33A
- Matushita/Panasonic "Sound Blaster" CDROM.
- Mitsumi FX-001{A-D} (older non-IDE drives).
- SCSI - Any standard SCSI CDROM drive hooked to
- a supported controller (see Hardware Guide).
- DOS - A DOS primary partition with the required FreeBSD
- distribution files copied onto it (e.g. C:\FREEBSD\)
+ DOS A DOS primary partition with the required FreeBSD
+ distribution files copied onto it (e.g. C:\FREEBSD\)
- FS - Assuming a disk or partition with an existing
- FreeBSD file system and distribution set on it,
- get the distribution files from there.
- Floppy - Get distribution files from one or more DOS formatted
- floppies.
+ FS Assuming a disk or partition with an existing
+ FreeBSD file system and distribution set on it,
+ get the distribution files from there.
- FTP - Get the distribution files from an anonymous ftp server
- (you will be presented with a list).
- NFS - Get the distribution files from an NFS server somewhere
- (make sure that permissions on the server allow this!)
+ Floppy Get distribution files from one or more DOS or UFS
+ formatted floppies.
- Tape - Extract distribution files from tape into a temporary
- directory and install from there.
+ FTP Get the distribution files from an anonymous ftp server
+ (you will be presented with a list). Please note that
+ there are also two ways of invoking FTP in either
+ "Active" and "Passive" mode.
+
+ Active mode is the standard way of fetching files and
+ Passive mode is for use when you're behind a firewall or
+ some other security mechanism that blocks active FTP
+ connections. If you chose "other" in the FTP menu, please
+ also note that all paths are *relative* to the home
+ directory of the user being logged in as. By default, this
+ is the user "ftp" (anonymous ftp) but you may change this
+ in the Options screen.
+
+
+ NFS Get the distribution files from an NFS server somewhere
+ (make sure that permissions on the server allow this!).
+ If this install method hangs on you or refuses to work
+ properly, you may need to set some special options for
+ your NFS server. See the Options screen for more details.
+
+
+ Tape Extract distribution files from tape into a temporary
+ directory and install from there. If the tape was created
+ with blocksize other than 20, you may wish to change this
+ in the Options screen.
diff --git a/usr.sbin/sysinstall/help/network_device.hlp b/usr.sbin/sysinstall/help/network_device.hlp
index 95c42ae..81bf6f2 100644
--- a/usr.sbin/sysinstall/help/network_device.hlp
+++ b/usr.sbin/sysinstall/help/network_device.hlp
@@ -2,53 +2,55 @@ You can do network installations over 3 types of communications links:
Serial port: SLIP / PPP
Parallel port: PLIP (laplink cable)
- Ethernet: A standard ethernet controller (includes some PCMCIA).
+ Ethernet: A standard ethernet controller (includes some
+ PCMCIA networking cards).
-SLIP support is rather primitive and limited primarily to hard-wired
-links, such as a serial cable running between a laptop computer and
-another PC. The link must be hard-wired as the SLIP installation
-doesn't currently offer a dialing capability; that facility is provided
-with the PPP utility, which should be used in preference to SLIP
-whenever possible. When you choose a serial port device, you'll
-be given the option later to edit the slattach command before it's
-run on the serial line. It is expected that you'll run slattach
-(or some equivalent) on the other end of the link at this time and
-bring up the line. FreeBSD will then install itself over the link
-at speeds of up to 115.2K/baud (the recommended speed for a hardwired
-cable).
+SLIP support is rather primitive and limited primarily to directly
+connected links, such as a serial cable running between a laptop
+computer and another PC. The link must be hard-wired as the SLIP
+installation doesn't currently offer a dialing capability (that
+facility is offered by the PPP utility, which should be used in
+preference to SLIP whenever possible). When you choose the SLIP
+option, you'll be given the option of later editing the slattach
+command before it's run on the serial line. It is expected that
+you'll run slattach (or some equivalent command) on the other end of
+the link at that time and bring up the line. FreeBSD will then
+install itself at serial speeds of up to 115.2K/baud (the recommended
+speed for a hardwired cable).
-If you're using a modem then PPP is almost certainly your only
-choice. Make sure that you have your service provider's information
-handy as you'll need to know it fairly early in the installation
-process. You will need to know, at the minimum, your service
-provider's IP address and possibly your own (though you can also leave
-it blank and allow PPP to negotiate it with your ISP). You will also
-need to know how to use the various "AT commands" to dial the ISP with
-your particular brand of modem as the PPP dialer provides only a very
-simple terminal emulator and has no "modem capabilities database".
+If you're using a modem then PPP is almost certainly your only choice.
+Make sure that you have your service provider's information handy as
+you'll need to know it fairly early in the installation process. You
+will need to know, at the minimum, your service provider's IP address
+and possibly your own (though you can also leave it blank and allow
+PPP to negotiate it with your ISP if your ISP supports such dynamic
+negotiation). You will also need to know how to use the various "AT
+commands" to dial the ISP with your particular brand of modem as the
+PPP dialer provides only a very simple terminal emulator and has no
+"modem capabilities database".
If a hard-wired connection to another FreeBSD (2.0R or later) machine
is available, you might also consider installing over a "laplink"
parallel port cable. The data rate over the parallel port is much
-higher than what is typically possible over a serial line with
-speeds of up to 50k/sec.
+higher than what is typically possible over a serial line, and speeds
+of up to 50KB/sec are not uncommon.
Finally, for the fastest possible network installation, an ethernet
adaptor is always a good choice! FreeBSD supports most common PC
-ethernet cards, a table of which is provided in the FreeBSD
-Hardware Guide (see the Documentation menu on the boot floppy).
-If you are using one of the supported PCMCIA ethernet cards, also be
-sure that it's plugged in _before_ the laptop is powered on! FreeBSD
-does not, unfortunately, currently support "hot insertion" of PCMCIA
-cards.
+ethernet cards, a table of which is provided in the FreeBSD Hardware
+Guide (see the Documentation menu on the boot floppy). If you are
+using one of the supported PCMCIA ethernet cards, also be sure that
+it's plugged in _before_ the laptop is powered on! FreeBSD does not,
+unfortunately, currently support "hot insertion" of PCMCIA cards.
-You will also need to know your IP address on the network, the "netmask"
-value for your address class, and the name of your machine.
+You will also need to know your IP address on the network, the
+"netmask" value for your address class, and the name of your machine.
Your system administrator can tell you which values to use for your
particular network setup. If you will be referring to other hosts by
name rather than IP address, you'll also need a name server and
possibly the address of a gateway (if you're using PPP, it's your
provider's IP address) to use in talking to it. If you do not know
-the answers to all or most of these questions, then you should
-really probably talk to your system administrator _first_ before
-trying this type of installation!
+the answers to all or most of these questions then you should really
+probably talk to your system administrator _first_ before trying this
+type of installation! Chosing the wrong IP address on a busy network
+will NOT make you popular with your systems administrator! :-)
diff --git a/usr.sbin/sysinstall/help/options.hlp b/usr.sbin/sysinstall/help/options.hlp
index c30180c..689c8cb 100644
--- a/usr.sbin/sysinstall/help/options.hlp
+++ b/usr.sbin/sysinstall/help/options.hlp
@@ -1,4 +1,5 @@
-The following options may be set from this screen:
+The following options may be set from this screen. Use the SPACE key
+to toggle an option's value, Q to leave when you're done.
NFS Secure: NFS server talks only on a secure port
@@ -14,82 +15,93 @@ NFS Slow: User is using a slow PC or ethernet card
the PC from becoming swamped with data.
-FTP Abort: On transfer failure, abort
+Debugging: Turn on the extra debugging flag
- This is pretty self-explanatory. If you're transfering from a
- host that drops the connection or cannot provide a file, abort
- the installation of that piece.
+ This turns on a lot of extra noise over on the second screen
+ (ALT-F2 to see it, ALT-F1 to switch back). If your installation
+ should fail for any reason, PLEASE turn this flag on when
+ attempting to reproduce the problem. It will provide a lot of
+ extra debugging at the failure point and may be very helpful to
+ the developers in tracking such problems down!
-FTP Reselect: On transfer failure, ask for another host
+Yes To All: Assume "Yes" answers to all non-critical dialogs
- This is more useful to someone doing an interactive installation.
- If the current host stops working, ask for a new ftp server to
- resume the installation from. The install will attempt to pick
- up from where it left off on the other server, if at all possible.
+ This flag should be used with caution. It will essentially
+ decide NOT to ask the user about any "boundry" conditions that
+ might not constitute actual errors but may be warnings indicative
+ of other problems. It's most useful to those who are doing unattended
+ installs.
-FTP Active: Use "active mode" for standard FTP
+FTP OnError: What to do when FTP transfer errors occur.
- For all FTP transfers, use "Active" mode. This will not work
- through firewalls, but will often work with older ftp servers
- that do not support passive mode. If your connection hangs
- with passive mode (the default), try active!
+ This is pretty self-explanatory. If you're transfering from a
+ host that drops the connection or cannot provide a file, you can
+ chose to Abort the connection, Retry the request (see next option)
+ or Reselect another FTP host, attempting to retry the request from
+ a new site. Pressing SPACE will toggle through these options.
-FTP Passive: Use "passive mode" for firewalled FTP
+FTP Retries: How many times to retry failing FTP requests.
- For all FTP transfers, use "Passive" mode. This allows the user
- to pass through firewalls that do not allow incoming connections
- on random port addresses.
+ If FTP OnError is set to `retry', this is the number of times to
+ loop on a failing request before giving up. If you're talking to a
+ site that's chronically overloaded (like ours!) you may wish to
+ simply set this to some large value and go to lunch or something.
- NOTE: ACTIVE AND PASSIVE MODES ARE NOT THE SAME AS A `PROXY'
- CONNECTION, WHERE A PROXY FTP SERVER IS LISTENING ON A DIFFERENT
- PORT!
- In such situations, you should specify the URL as something like:
+FTP username: Specify username and password instead of anonymous.
- ftp://foo.bar.com:1234/pub/FreeBSD
+ By default, the installation attempts to log in as the
+ anonymous user. If you wish to log in as someone else,
+ specify the username and password with this option.
- Where "1234" is the port number of the proxy ftp server.
+Tape Blocksize: Specify block size in 512 byte blocks of tape.
-Debugging: Turn on the extra debugging flag
+ This defaults to 20 blocks, which should work with most
+ tape drive + tar combinations. It may not allow your particular
+ drive to win any records for speed, however, and the more
+ adventurous among you might try experimenting with larger sizes.
- This turns on a lot of extra noise over on the second screen
- (ALT-F2 to see it, ALT-F1 to switch back). If your installation
- should fail for any reason, PLEASE turn this flag on when
- attempting to reproduce the problem. It will provide a lot of
- extra debugging at the failure point and may be very helpful to
- the developers in tracking such problems down!
+Extract Detail: How to show filenames on debug screen as they're extracted.
-Yes To All: Assume "Yes" answers to all non-critical dialogs
+ While a distribution is being extracted, the default detail level
+ of "high" will show the full file names as they're extracted.
+ If you would prefer a more terse form for this, namely dots, select
+ the "medium" detail level. If you want nothing to be printed
+ on the debugging screen during extraction, select "low".
- This flag should be used with caution. It will essentially
- decide NOT to ask the user about any "boundry" conditions that
- might not constitute actual errors but may be warnings indicative
- of other problems.
+Release Name: Which release to attempt to load from installation media.
-FTP userpass: Specify username and password instead of anonymous.
+ You should only change this option if you're really sure you know
+ what you are doing! This will change the release name used by
+ sysinstall when fetching components of any distributions.
- By default, the installation attempts to log in as the
- anonymous user. If you wish to log in as someone else,
- specify the username and password with this option.
+
+Browser Package: Which package to load for an HTML browser.
+
+ By default, this is set to lynx but may also be set to any other
+ text capable HTML browser for which a package exists. If you set this
+ to an X based browser, you will not be able to use it if you're running
+ in text mode! :)
+
+
+Browser Exec: Which binary to run for the HTML browser.
+
+ The full pathname to the main executable in Browser Package
-Clear: Clear All Option Flags
+Media Type: Which media type is being used.
- Reset all option flags back to their default values.
+ This is mostly informational and indicates which media type (if any)
+ was last selected in the Media menu. It's also a convenient short-cut
+ to the media menu itself.
-----
-Some of these items, like "FTP Active" or "FTP Passive", are actually
-mutually-exclusive even though you can turn all of them on or off at
-once. This is a limitation of the menuing system, and is compensated
-for by checks that ensure that the various flags are not in conflict.
-If you re-enter the Options menu again after leaving it, you'll see
-the settings it's actually using after checking for any possible
-conflicts.
+Use Defaults: Use default values.
+ Reset all options back to their default values.
diff --git a/usr.sbin/sysinstall/help/partition.hlp b/usr.sbin/sysinstall/help/partition.hlp
index 19b6ce1..cbce9a4 100644
--- a/usr.sbin/sysinstall/help/partition.hlp
+++ b/usr.sbin/sysinstall/help/partition.hlp
@@ -1,21 +1,50 @@
This is the FreeBSD DiskLabel Editor.
+NOTE: If you're entering this editor from the update procedure then
+you probably shouldn't (C)reate anything at all but rather use only
+the (M)ount command to check and mount existing partitions for
+upgrading.
+
+If you would like the label editor to do most of the following for
+you, simply type `A' for automatic partitioning of the disk.
+
+If you wish to create partitions manually you may do so by moving the
+highlighted selection bar with the arrow keys over the FreeBSD
+partition(s) displayed at the top of the screen. Typing (C)reate
+while a partition with available free space is selected will allow you
+to create a BSD partition inside of it using some or all of its
+available space.
+
+Typing (M)ount over an existing partition entry (displayed in the
+middle of the screen) will allow you to set a mount point for it
+without initializing it. If you want it initialized, use the (T)oggle
+command to flip the Newfs flag. When Newfs is set to "Y", the
+filesystem in question will be ERASED and rebuilt from scratch!
+
+NOTE: The (W)rite option is HIGHLY DANGEROUS and should NOT BE USED if
+you're installing a new system! It's only for use in resurrecting
+or changing an existing system, and will cause unpredictable things to
+happen if you use it in any other circumstances. Don't do it! Wait
+for the final commit dialog if you're express/novice installing, or
+use the "Commit" menu item if you're custom installing, and do it there.
+
+
You should use this editor to create at least the following
filesystems:
- Name Purpose Min Size? Optional?
- ---- ------- --------- ---------
- / Root filesystem 20MB No
- swap Swap space 2 * MEM No
- /usr System & user files 80MB or more Yes
+ Name Purpose Min Size? Optional?
+ ---- ------- --------- ---------
+ / Root filesystem 20MB No
+ swap Swap space 2 * MEM No
+ /usr System & user files 80MB or more Yes
Note: If you do not create a /usr filesystem then your / filesystem
will need to be bigger - at least 100MB. This is not recommended as
any media errors that may occur during disk I/O to user files will
corrupt the filesystem containing vital system files as well. It is
for this reason that / is generally kept on its own filesystem, where
-it's basically considered "read only" by the system and hence a good
-deal safer.
+it should be considered essentially "read only" in your administration
+of it.
Swap space is a little tricker, and the rule of "2 * MEM" is simply a
best-guess approximation and not necessarily accurate for your
@@ -44,79 +73,88 @@ instead. You may therefore wish to make the / partition bigger if you
expect a lot of mail or news and do not want to make /var its own
partition.
-
-If you're new to this installation, you should also first understand
-how FreeBSD 2.0.5's new "slices" paradigm for looking at disk storage
-works. It's not very hard to grasp. A "fully qualified slice name",
-that is the name of the file we open in /dev to talk to the slice, is
-optionally broken into 3 parts:
-
- First you have the disk name. Assume we have two SCSI
- drives in our system, which gives us `sd0' and `sd1'.
-
- Next you have the "Slice" (or "FDISK Partition") number,
- as seen in the Partition Editor. Assume that our sd0 contains
- two slices, a FreeBSD slice and a DOS slice. This gives us
- sd0s1 and sd0s2. Let's also say that sd1 is completely devoted
- to FreeBSD, so we have only one slice there: sd1s1.
-
- Next, if a slice is a FreeBSD slice, you have a number of
- (confusingly named) "partitions" you can put inside of it.
- These FreeBSD partitions are where various filesystems or swap
- areas live, and using our hypothetical two-SCSI-disk machine
- again, we might have something like the following layout on sd0:
-
- Name Mountpoint
- ---- ----------
- sd0s1a /
- sd0s1b <swap space>
- sd0s1e /usr
-
- Because of historical convention, there is also a short-cut,
- or "compatibility slice", that is maintained for easy access
- to the first FreeBSD slice on a disk for those programs which
- still don't know how to deal with the new slice scheme.
- The compatibility slice names for our filesystem above would
- look like:
-
- Name Mountpoint
- ---- ----------
- sd0a /
- sd0b <swap space>
- sd0e /usr
-
- FreeBSD automatically maps the compatibility slice to the first
- FreeBSD slice it finds (in this case, sd0s1). You may have multiple
- FreeBSD slices on a drive, but only the first one may be the
- compatibility slice!
-
- The compatibility slice will eventually be phased out, but
- it is still important right now for several reasons:
-
- 1. Some programs, as mentioned before, still don't work
- with the slice paradigm and need time to catch up.
-
- 2. The FreeBSD boot blocks are unable to look for
- a root file system in anything but a compatibility
- slice right now. This means that our root will always
- show up on "sd0a" in the above scenario, even though
- it really lives over on sd0s1a and would otherwise be
- referred to by its full slice name.
-
-Once you understand all this, then the label editor becomes fairly
-simple. You're either carving up the FreeBSD slices displayed at the
-top of the screen into smaller pieces (displayed in the middle of the
-screen) and then putting FreeBSD file systems on them, Or you're just
-mounting existing partitions/slices into your filesystem hierarchy;
-this editor lets you do both. Since a DOS partition is also just
-another slice as far as FreeBSD is concerned, you can mount one into
-in your filesystem hierarchy just as easily with this editor. For
-FreeBSD partitions you can also toggle the "newfs" state so that
-the partitions are either (re)created from scratch or simply checked
-and mounted (the contents are preserved).
+If you're new to this installation, you might also want to read the
+following explanation of how FreeBSD's new "slice" paradigm for
+looking at disk storage works:
+
+
+In FreeBSD's new system, a device name can be broken up into up to 3
+parts. Take a typical name like ``/dev/sd0s1a'':
+
+ The first three characters represent the drive name. If we had
+ a system with two SCSI drives on it then we'd see /dev/sd0 and
+ /dev/sd1 as the device entries representing the entire drives.
+
+ Next you have the "slice" (or "FDISK Partition") number,
+ as seen in the Partition Editor. Assuming that our sd0
+ contained two slices, a FreeBSD slice and a DOS slice, that
+ would give us /dev/sd0s1 and /dev/sd0s2 as device entries pointing
+ to the entire slices.
+
+ Next, if a slice is a FreeBSD slice, you can have a number of
+ (confusingly named) "partitions" inside of it.
+
+ These partitions are where various filesystems or swap areas live,
+ and using our hypothetical two-SCSI-disk machine again, we might
+ have something like the following layout on sd0:
+
+ Name Mountpoint
+ ---- ----------
+ sd0s1a /
+ sd0s1b <swap space>
+ sd0s1e /usr
+
+ Because of historical convention, there is also a short-cut,
+ or "compatibility slice", that is maintained for easy access
+ to the *first* FreeBSD slice on a disk. This gives some
+ backwards compatibility to utilities that still may not know
+ how to deal with the new slice scheme.
+
+ The compatibility slice names for our filesystem above would
+ also look like:
+
+ Name Mountpoint
+ ---- ----------
+ sd0a /
+ sd0b <swap space>
+ sd0e /usr
+
+ Again, let it be noted: FreeBSD automatically maps the
+ compatibility slice to the first FreeBSD slice it finds
+ (in this case, sd0s1). You may have multiple FreeBSD slices on a
+ drive, but only the first one will be mapped to the compatibility
+ slice!
+
+ The compatibility slice will eventually be phased out, but
+ it is still important right now for several reasons:
+
+ 1. Some programs, as mentioned before, still don't work
+ with the slice paradigm and need time to catch up.
+
+ 2. The FreeBSD boot blocks are unable to look for
+ a root file system in anything but a compatibility
+ slice right now. This means that our root will always
+ show up on "sd0a" in the above scenario, even though
+ it really lives over on sd0s1a and would otherwise be
+ referred to by its full slice name.
+
+Once you understand all this, then the purpose of the label editor
+becomes fairly clear: You're carving up the FreeBSD slices displayed
+at the top of the screen into smaller pieces, which are displayed in
+the middle of the screen, and then assigning FreeBSD file system names
+(mount points) to them.
+
+You can also use the label editor to mount existing partitions/slices
+into your filesystem hierarchy, as is frequently done for DOS FAT
+slices. For FreeBSD partitions, you can also toggle the "newfs" state
+so that the partitions are either (re)created from scratch or simply
+checked and mounted (the contents are preserved).
When you're done, type `Q' to exit.
No actual changes will be made to the disk until you (C)ommit from the
-Install menu! You're working with what is essentially a copy of
-the disk label(s), both here and in the FDISK Partition Editor.
+Install menu or (W)rite directly from this one. You're working with
+what is essentially a copy of the disk label(s), both here and in the
+FDISK Partition Editor, and the actual on-disk labels won't be
+affected by any changes you make until you explicitly say so.
+
diff --git a/usr.sbin/sysinstall/help/slice.hlp b/usr.sbin/sysinstall/help/slice.hlp
index e055ca4..1c1581b 100644
--- a/usr.sbin/sysinstall/help/slice.hlp
+++ b/usr.sbin/sysinstall/help/slice.hlp
@@ -1,15 +1,23 @@
-This is the Main Partition (or ``Slice'') Editor.
+This is the Main Partition (or ``FDISK'') Editor.
+
+Possible commands are printed at the bottom and the Master Boot Record
+contents are shown at the top. You can move up and down with the
+arrow keys and (C)reate a new partition whenever the highlighted
+selection bar is over a partition whose type is marked as "unused."
+
+You are expected to leave this screen with at least one partition
+marked "FreeBSD." Note that unlike Linux, you don't need to create
+multiple FreeBSD fdisk partition entries for different things like
+swap, file systems, etc. The usual convention is to create ONE
+FreeBSD partition per drive and then subsection this partition into
+swap and file systems with the Label editor.
-Possible commands are printed at the bottom, and the Master Boot Record
-contents are at the top. You can move up and down with the arrow keys
-and can (C)reate a new partition whenever the "bar" is over a partition
-whose type is set to "unused".
The flags field has the following legend:
- '=' -- Partition is properly aligned.
- '>' -- The partition doesn't end before cylinder 1024
- 'R' -- Has been marked as containing the root (/) filesystem
+ '=' -- This partition is properly aligned.
+ '>' -- This partition doesn't end before cylinder 1024
+ 'R' -- This partition contains the root (/) filesystem
'B' -- Partition employs BAD144 bad-spot handling
'C' -- This is the FreeBSD 2.0-compatibility partition (default)
'A' -- This partition is marked active.
@@ -21,8 +29,39 @@ If no partition is marked Active, you will need to either install
a Boot Manager (the option for which will be presented later in the
installation) or set one Active before leaving this screen.
-To leave this screen, type `Q'.
+To leave the partition editor, type `Q'.
No actual changes will be made to the disk until you (C)ommit from the
-Install menu! You're working with what is essentially a copy of
-the disk label(s), both here and in the Label Editor.
+Install menu or use the (W)rite option here! You're working with what
+is essentially a copy of the disk label(s), both here and in the Label
+Editor.
+
+NOTE: The (W)rite option is HIGHLY DANGEROUS and should NOT BE USED if
+you're installing a new system! It's only for use in resurrecting
+or changing an existing system, and will cause unpredictable things to
+happen if you use it in any other circumstances. Don't do it! Wait
+for the final commit dialog if you're express/novice installing, or
+use the "Commit" menu item if you're custom installing, and do it there.
+
+If you want to use the entire disk for FreeBSD, type `A'. You'll be
+asked whether or not you wish to keep the disk (potentially) compatible
+with other operating systems, i.e. the information in the FDISK table
+should be kept valid. If you select the default of `Yes', slices will be
+aligned to fictitious cylinder boundaries and space will be reserved
+in front of the FreeBSD slice for a [future] possible boot manager.
+
+For the truly dedicated disk case, you can select `No' at the
+compatibility prompt. In that case, all BIOS geometry considerations
+will no longer be in effect and you can safely ignore any
+``The detected geometry is invalid'' warning messages you may later
+see. It is also not necessary in this case to set a partition bootable
+or install an MBR boot manager as both things are then irrelevant.
+
+The FreeBSD slice will start at absolute sector 0 of the disk (so that
+FreeBSD's disk label is identical to the Master Boot Record) and
+extend to the very last sector of the disk medium. Needless to say,
+such a disk cannot have any sort of a boot manager, `disk manager',
+or anything else that has to interact with the BIOS. This option is
+therefore only considered safe for SCSI disks and most IDE disks and
+is primarily intented for people who are going to set up a dedicated
+FreeBSD server or workstation, not a typical `home PC'.
diff --git a/usr.sbin/sysinstall/help/usage.hlp b/usr.sbin/sysinstall/help/usage.hlp
index b01a94b..03a8159 100644
--- a/usr.sbin/sysinstall/help/usage.hlp
+++ b/usr.sbin/sysinstall/help/usage.hlp
@@ -1,6 +1,9 @@
HOW TO USE THIS SYSTEM
======================
+The following keys are recognised in most of the dialogs you'll
+encounter during this installation:
+
KEY ACTION
--- ------
UP ARROW Move to previous item (or up, in a text field).
@@ -12,18 +15,22 @@ LEFT ARROW Move to previous item or group (same as SHIFT-TAB).
RETURN Select item.
PAGE UP In text boxes, scrolls up one page.
PAGE DOWN In text boxes, scrolls down one page.
-SPACE In "radio" or multiple choice menus, toggle the current item.
+SPACE In "radio" or multiple choice menus, toggle the current
+ item. In help screens, scroll to next page of text.
F1 Help (in screens that provide it).
-If you also see small "^(-)" or "v(+)" symbols at the edges of a menu,
-it means that there are more items above or below the current one that
-aren't being shown (due to insufficient screen space). Using the
-up/down arrow keys will cause the menu to scroll. When a symbol
-disappears, it means you are at the top (or bottom) of the menu.
-
In text fields, the amount of text above the current point will be
displayed as a percentage in the lower right corner. 100% means
-you're at the bottom of the field.
+you're at the bottom of the available text.
+
+If you see small "^(-)" or "v(+)" symbols at the edges of a menu, it
+means that there are more items above or below the current one that
+aren't being shown (due to insufficient screen space). Using the
+up/down arrow keys will cause the menu to scroll. The PageUp and
+PageDown keys will scroll by entire screens.
+
+When an arrow symbol disappears, it means you are at the top (or
+bottom) of the menu.
Selecting OK in a menu will confirm whatever action it's controlling.
Selecting Cancel will cancel the operation and generally return you to
@@ -35,20 +42,25 @@ SPECIAL FEATURES:
It is also possible to select a menu item by typing the first
character of its name, if unique. Such "accelerator" characters will
-be specially highlighted in the item name.
+be specially highlighted in the item name. Unfortunately, the
+accellerators aren't always unique (a shortcoming of the dialog menu
+library) so you'll only be able to get at the *first* unique menu
+entry for a given accellerator.
The console driver also contains a scroll-back buffer for reviewing
things that may have scrolled off the screen. To use scroll-back,
-press the "Scroll Lock" key on your keyboard and use the arrow or
-Page Up/Page Down keys to move through the saved text. To leave
-scroll-back mode, press the Scroll Lock key again. This feature
-is most useful for dealing with sub-shells or other "wizard modes"
-that don't use menus.
-
-Once the system is fully installed and running "multi-user", you will
-also find that you have multiple "virtual consoles" and can use them to
-have several active sessions at once. Use ALT-F<n> to switch between
-them, where `F<n>' is the function key corresponding to the screen you
-wish to see. By default, the system comes with 3 virtual consoles enabled.
-You can create more by editing the /etc/ttys file, once the system is up,
-for a maximum of 12.
+press the "Scroll Lock" key on your keyboard and use the arrow or Page
+Up/Page Down keys to move through the saved text. To leave
+scroll-back mode, press the Scroll Lock key again. This feature is
+most useful for reading back through your boot messages (go ahead, try
+it now!) though it's also useful when dealing with sub-shells or other
+"wizard modes" that don't use menus and tend to scroll their output
+off the top of the screen.
+
+Once the system is fully installed and running multi-user you will
+also find that you have multiple "virtual consoles" and can use them
+to have several active sessions at once. Use ALT-F<n> to switch
+between them, where `F<n>' is the function key corresponding to the
+screen you wish to see. By default, the system comes with 3 virtual
+consoles enabled. You can create more by editing the /etc/ttys file
+(up to a maximum of 12).
diff --git a/usr.sbin/sysinstall/install.c b/usr.sbin/sysinstall/install.c
index 5530e9c..462bda0 100644
--- a/usr.sbin/sysinstall/install.c
+++ b/usr.sbin/sysinstall/install.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: install.c,v 1.71.2.1 1995/07/21 10:53:54 rgrimes Exp $
+ * $Id: install.c,v 1.72 1995/09/18 16:52:27 peter Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -42,30 +42,35 @@
*/
#include "sysinstall.h"
+#include <ctype.h>
#include <sys/disklabel.h>
#include <sys/errno.h>
#include <sys/ioctl.h>
#include <sys/fcntl.h>
#include <sys/wait.h>
+#include <sys/param.h>
+#define MSDOSFS
+#include <sys/mount.h>
+#undef MSDOSFS
#include <sys/stat.h>
#include <unistd.h>
+#include <sys/mount.h>
-Boolean SystemWasInstalled = FALSE;
+static void create_termcap(void);
-static Boolean copy_self(void);
-static Boolean root_extract(void);
-
-static Chunk *rootdev;
+#define TERMCAP_FILE "/usr/share/misc/termcap"
static Boolean
-checkLabels(void)
+checkLabels(Chunk **rdev, Chunk **sdev, Chunk **udev)
{
Device **devs;
+ Boolean status;
Disk *disk;
- Chunk *c1, *c2, *swapdev, *usrdev;
+ Chunk *c1, *c2, *rootdev, *swapdev, *usrdev;
int i;
- rootdev = swapdev = usrdev = NULL;
+ status = TRUE;
+ *rdev = *sdev = *udev = rootdev = swapdev = usrdev = NULL;
devs = deviceFind(NULL, DEVICE_TYPE_DISK);
/* First verify that we have a root device */
for (i = 0; devs[i]; i++) {
@@ -81,17 +86,25 @@ checkLabels(void)
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.");
+ dialog_clear();
+ msgConfirm("WARNING: You have more than one root device set?!\n"
+ "Using the first one found.");
continue;
}
rootdev = c2;
+ if (isDebug())
+ msgDebug("Found rootdev at %s!\n", rootdev->name);
}
else if (!strcmp(((PartInfo *)c2->private)->mountpoint, "/usr")) {
if (usrdev) {
- msgConfirm("WARNING: You have more than one /usr filesystem.\nUsing the first one found.");
+ dialog_clear();
+ msgConfirm("WARNING: You have more than one /usr filesystem.\n"
+ "Using the first one found.");
continue;
}
usrdev = c2;
+ if (isDebug())
+ msgDebug("Found usrdev at %s!\n", usrdev->name);
}
}
}
@@ -99,6 +112,7 @@ checkLabels(void)
}
}
+ swapdev = NULL;
/* Now check for swap devices */
for (i = 0; devs[i]; i++) {
disk = (Disk *)devs[i]->private;
@@ -108,8 +122,10 @@ 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) {
+ if (c2->type == part && c2->subtype == FS_SWAP && !swapdev) {
swapdev = c2;
+ if (isDebug())
+ msgDebug("Found swapdev at %s!\n", swapdev->name);
break;
}
}
@@ -117,284 +133,601 @@ checkLabels(void)
}
}
+ *rdev = rootdev;
if (!rootdev) {
- msgConfirm("No root device found - you must label a partition as /\n in the label editor.");
- return FALSE;
- }
- else if (rootdev->name[strlen(rootdev->name) - 1] != 'a') {
- msgConfirm("Invalid placement of root partition. For now, we only support\nmounting root partitions on \"a\" partitions due to limitations\nin the FreeBSD boot code. Please correct this and\ntry again.");
- return FALSE;
+ dialog_clear();
+ msgConfirm("No root device found - you must label a partition as /\n"
+ "in the label editor.");
+ status = FALSE;
}
+
+ *sdev = swapdev;
if (!swapdev) {
- msgConfirm("No swap devices found - you must create at least one\nswap partition.");
- return FALSE;
+ dialog_clear();
+ msgConfirm("No swap devices found - you must create at least one\n"
+ "swap partition.");
+ status = 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;
+
+ *udev = usrdev;
+ if (!usrdev) {
+ dialog_clear();
+ msgConfirm("WARNING: No /usr filesystem found. This is not technically\n"
+ "an error if your root filesystem is big enough (or you later\n"
+ "intend to mount your /usr filesystem over NFS), but it may otherwise\n"
+ "cause you trouble if you're not exactly sure what you are doing!");
+ }
+ return status;
}
-static Boolean
+static int
installInitial(void)
{
static Boolean alreadyDone = FALSE;
if (alreadyDone)
- return TRUE;
+ return RET_SUCCESS;
- if (!getenv(DISK_PARTITIONED)) {
- msgConfirm("You need to partition your disk before you can proceed with\nthe installation.");
- return FALSE;
- }
- if (!getenv(DISK_LABELLED)) {
+ if (!variable_get(DISK_LABELLED)) {
+ dialog_clear();
msgConfirm("You need to assign disk labels before you can proceed with\nthe installation.");
- return FALSE;
+ return RET_FAIL;
}
- if (!checkLabels())
- return FALSE;
+ /* If it's labelled, assume it's also partitioned */
+ if (!variable_get(DISK_PARTITIONED))
+ variable_set2(DISK_PARTITIONED, "yes");
/* If we refuse to proceed, bail. */
- if (msgYesNo("Last Chance! Are you SURE you want continue the installation?\n\nIf you're running this on an existing system, we STRONGLY\nencourage you to make proper backups before proceeding.\nWe take no responsibility for lost disk contents!"))
- return FALSE;
-
- (void)diskPartitionWrite(NULL);
-
- if (!installFilesystems()) {
+ dialog_clear();
+ if (msgYesNo("Last Chance! Are you SURE you want continue the installation?\n\n"
+ "If you're running this on a disk with data you wish to save\n"
+ "then WE STRONGLY ENCOURAGE YOU TO MAKE PROPER BACKUPS before\n"
+ "proceeding!\n\n"
+ "We can take no responsibility for lost disk contents!"))
+ return RET_FAIL;
+
+ if (diskLabelCommit(NULL) != RET_SUCCESS) {
+ dialog_clear();
msgConfirm("Couldn't make filesystems properly. Aborting.");
- return FALSE;
+ return RET_FAIL;
}
- if (!copy_self()) {
- msgConfirm("Couldn't clone the boot floppy onto the root file system.\nAborting.");
- return FALSE;
+ if (!copySelf()) {
+ dialog_clear();
+ msgConfirm("Couldn't clone the boot floppy onto the root file system.\n"
+ "Aborting.");
+ return RET_FAIL;
}
dialog_clear();
- chroot("/mnt");
+ if (chroot("/mnt") == -1) {
+ dialog_clear();
+ msgConfirm("Unable to chroot to /mnt - this is bad!");
+ return RET_FAIL;
+ }
+
chdir("/");
variable_set2(RUNNING_ON_ROOT, "yes");
+
/* stick a helpful shell over on the 4th VTY */
- 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) {
- msgNotify("Can't set controlling terminal");
- exit(1);
+ systemCreateHoloshell();
+ alreadyDone = TRUE;
+ return RET_SUCCESS;
+}
+
+int
+installFixit(char *str)
+{
+ struct ufs_args args;
+ pid_t child;
+ int waitstatus;
+
+ memset(&args, 0, sizeof(args));
+ args.fspec = "/dev/fd0";
+ Mkdir("/mnt2", NULL);
+
+ while (1) {
+ dialog_clear();
+ msgConfirm("Please insert a writable fixit floppy and press return");
+ if (mount(MOUNT_UFS, "/mnt2", 0, (caddr_t)&args) != -1)
+ break;
+ dialog_clear();
+ if (msgYesNo("Unable to mount the fixit floppy - do you want to try again?"))
+ return RET_FAIL;
+ }
+ dialog_clear();
+ dialog_update();
+ end_dialog();
+ DialogActive = FALSE;
+ if (!directoryExists("/tmp"))
+ (void)symlink("/mnt2/tmp", "/tmp");
+ if (!directoryExists("/var/tmp/vi.recover")) {
+ if (Mkdir("/var/tmp/vi.recover", NULL) != RET_SUCCESS) {
+ dialog_clear();
+ msgConfirm("Warning: Was unable to create a /var/tmp/vi.recover directory.\n"
+ "vi will kvetch and moan about it as a result but should still\n"
+ "be essentially usable.");
+ }
+ }
+ /* Link the spwd.db file */
+ if (Mkdir("/etc", NULL) != RET_SUCCESS) {
+ dialog_clear();
+ msgConfirm("Unable to create an /etc directory! Things are weird on this floppy..");
+ }
+ else {
+ if (symlink("/mnt2/etc/spwd.db", "/etc/spwd.db") == -1) {
+ dialog_clear();
+ msgConfirm("Couldn't symlink the /etc/spwd.db file! I'm not sure I like this..");
+ }
+ }
+ if (!file_readable(TERMCAP_FILE))
+ create_termcap();
+ if (!(child = fork())) {
+ struct termios foo;
+
+ signal(SIGTTOU, SIG_IGN);
+ if (tcgetattr(0, &foo) != -1) {
+ foo.c_cc[VERASE] = '\010';
+ if (tcsetattr(0, TCSANOW, &foo) == -1)
+ msgDebug("fixit shell: Unable to set erase character.\n");
}
- printf("Warning: This shell is chroot()'d to /mnt\n");
+ else
+ msgDebug("fixit shell: Unable to get terminal attributes!\n");
+ printf("When you're finished with this shell, please type exit.\n");
+ printf("The fixit floppy itself is mounted as /mnt2\n");
+ setenv("PATH", "/bin:/sbin:/usr/bin:/usr/sbin:/stand:/mnt2/stand", 1);
execlp("sh", "-sh", 0);
- exit(1);
+ msgDebug("fixit shell: Failed to execute shell!\n");
+ return -1;
}
- alreadyDone = TRUE;
- return TRUE;
-}
+ else
+ (void)waitpid(child, &waitstatus, 0);
+ DialogActive = TRUE;
+ clear();
+ dialog_clear();
+ dialog_update();
+ unmount("/mnt2", MNT_FORCE);
+ dialog_clear();
+ msgConfirm("Please remove the fixit floppy now.");
+ return RET_SUCCESS;
+}
+
int
installExpress(char *str)
{
- msgConfirm("In the next menu, you will need to set up a DOS-style\n"
- "partitioning scheme for your hard disk. If you don't\n"
- "want to do anything special, just type `A' to use the\n"
- "whole disk and then `Q' to quit.");
- diskPartitionEditor("express");
-
- msgConfirm("Next, you need to lay out BSD partitions inside of the\n"
- "DOS-style partition just created. If you don't want to\n"
- "do anything special, just type `A' to use the default\n"
- "partitioning scheme and then `Q' to quit.");
- diskLabelEditor("express");
-
- msgConfirm("Now it is time to select an installation subset. There\n"
- "are two basic configurations: Developer and Router. The\n"
- "Developer subset includes sources, documentation, and\n"
- "binaries for almost everything. The Router subset\n"
- "includes the same binaries and documentation, but no\n"
- "sources. You can also install absolutely everything,\n"
- "or select a custom software set.");
+ if (diskPartitionEditor("express") == RET_FAIL)
+ return RET_FAIL;
- while(!Dists) {
- dmenuOpenSimple(&MenuInstallType);
+ if (diskLabelEditor("express") == RET_FAIL)
+ return RET_FAIL;
+
+ if (!Dists) {
+ if (!dmenuOpenSimple(&MenuDistributions))
+ return RET_FAIL;
}
+
+ if (!mediaDevice) {
+ if (!dmenuOpenSimple(&MenuMedia) || !mediaDevice)
+ return RET_FAIL;
+ }
+
+ if (installCommit("express") == RET_FAIL)
+ return RET_FAIL;
+
+ return RET_DONE;
+}
+
+/* Novice mode installation */
+int
+installNovice(char *str)
+{
+ dialog_clear();
+ msgConfirm("In the next menu, you will need to set up a DOS-style (\"fdisk\") partitioning\n"
+ "scheme for your hard disk. If you simply wish to devote all disk space\n"
+ "to FreeBSD (overwritting anything else that might be on the disk(s) selected)\n"
+ "then use the (A)ll command to select the default partitioning scheme followed\n"
+ "by a (Q)uit. If you wish to allocate only free space to FreeBSD, move to a\n"
+ "partition marked \"unused\" and use the (C)reate command.");
+
+ if (diskPartitionEditor("novice") == RET_FAIL)
+ return RET_FAIL;
- msgConfirm("Finally, you must specify an installation medium.");
-
- dmenuOpenSimple(&MenuMedia);
-
- installCommit("express");
-
- dmenuOpenSimple(&MenuConfigure);
- return 0;
+ dialog_clear();
+ msgConfirm("Next, you need to create BSD partitions inside of the fdisk partition(s)\n"
+ "just created. If you have a reasonable amount of disk space (200MB or more)\n"
+ "and don't have any special requirements, simply use the (A)uto command to\n"
+ "allocate space automatically. If you have more specific needs or just don't\n"
+ "care for the layout chosen by (A)uto, press F1 for more information on\n"
+ "manual layout.");
+
+ if (diskLabelEditor("novice") == RET_FAIL)
+ return RET_FAIL;
+
+ dialog_clear();
+ msgConfirm("Now it is time to select an installation subset. There are a number of\n"
+ "canned distribution sets, ranging from minimal installation sets to full\n"
+ "X11 developer oriented configurations. You can also select a custom set\n"
+ "of distributions if none of the provided ones are suitable.");
+ while (1) {
+ if (!dmenuOpenSimple(&MenuDistributions))
+ return RET_FAIL;
+
+ if (Dists || !msgYesNo("No distributions selected. Are you sure you wish to continue?"))
+ break;
+ }
+
+ if (!mediaDevice) {
+ dialog_clear();
+ msgConfirm("Finally, you must specify an installation medium.");
+ if (!dmenuOpenSimple(&MenuMedia) || !mediaDevice)
+ return RET_FAIL;
+ }
+
+ if (installCommit("novice") == RET_FAIL)
+ return RET_FAIL;
+
+ return RET_DONE;
}
/*
* What happens when we select "Commit" in the custom installation menu.
*
- * This is broken into multiple stages so that the user can do a full installation but come
- * back here again to load more distributions, perhaps from a different media type.
- * This would allow, for example, the user to load the majority of the system from CDROM
- * and then use ftp to load just the DES dist.
+ * This is broken into multiple stages so that the user can do a full installation but come back here
+ * again to load more distributions, perhaps from a different media type. This would allow, for
+ * example, the user to load the majority of the system from CDROM and then use ftp to load just the
+ * DES dist.
*/
int
installCommit(char *str)
{
- Device **devs;
int i;
+ extern Boolean cdromMounted;
- if (!Dists) {
- msgConfirm("You haven't told me what distributions to load yet!\nPlease select a distribution from the Distributions menu.");
- return 0;
+ if (!mediaVerify())
+ return RET_FAIL;
+
+ i = RET_DONE;
+ if (RunningAsInit) {
+ if (installInitial() == RET_FAIL)
+ return RET_FAIL;
+ if (configFstab() == RET_FAIL)
+ return RET_FAIL;
+ if (!rootExtract()) {
+ dialog_clear();
+ msgConfirm("Failed to load the ROOT distribution. Please correct\n"
+ "this problem and try again.");
+ return RET_FAIL;
+ }
}
- if (!mediaVerify())
- return 0;
+ if (distExtractAll(NULL) == RET_FAIL)
+ i = RET_FAIL;
- if (RunningAsInit && !SystemWasInstalled) {
- if (!installInitial())
- return 0;
- configFstab();
- }
- if (RunningAsInit && !SystemWasInstalled && !root_extract()) {
- msgConfirm("Failed to load the ROOT distribution. Please correct\nthis problem and try again.");
- return 0;
- }
+ if (installFixup(NULL) == RET_FAIL)
+ i = RET_FAIL;
+
+ if (i != RET_FAIL)
+ variable_set2(SYSTEM_STATE, "base-install");
+
+ if (i != RET_FAIL && !strcmp(str, "novice")) {
+ dialog_clear();
+ msgConfirm("Since you're running the novice installation, a few post-configuration\n"
+ "questions will be asked at this point. For any option you do not wish\n"
+ "to configure, select Cancel.");
+
+ if (mediaDevice->type != DEVICE_TYPE_FTP && mediaDevice->type != DEVICE_TYPE_NFS) {
+ dialog_clear();
+ if (!msgYesNo("Would you like to configure this machine's network interfaces?")) {
+ Device *save = mediaDevice;
- /* If we're about to extract the bin dist again, reset the installed state */
- if (Dists & DIST_BIN)
- SystemWasInstalled = FALSE;
+ /* This will also set the media device, which we don't want */
+ tcpDeviceSelect();
+ mediaDevice = save;
+ }
+ }
- (void)distExtractAll(NULL);
+ dialog_clear();
+ if (!msgYesNo("Would you like to configure Samba for connecting NETBUI clients to this\n"
+ "machine? Windows 95, Windows NT and Windows for Workgroups\n"
+ "machines can use NETBUI transport for disk and printer sharing."))
+ configSamba(NULL);
+
+ dialog_clear();
+ if (!msgYesNo("Will this machine be an IP gateway (e.g. will it forward packets\n"
+ "between interfaces)?"))
+ variable_set2("gateway", "YES");
+
+ dialog_clear();
+ if (!msgYesNo("Do you want to allow anonymous FTP connections to this machine?"))
+ configAnonFTP(NULL);
+
+ dialog_clear();
+ if (!msgYesNo("Do you want to configure this machine as an NFS server?"))
+ configNFSServer(NULL);
+
+ dialog_clear();
+ if (!msgYesNo("Do you want to configure this machine as an NFS client?"))
+ variable_set2("nfs_client", "YES");
+
+ dialog_clear();
+ if (!msgYesNo("Do you want to configure this machine as a WEB server?"))
+ configApache(NULL);
+
+ dialog_clear();
+ if (!msgYesNo("Would you like to customize your system console settings?"))
+ dmenuOpenSimple(&MenuSyscons);
+
+ dialog_clear();
+ if (!msgYesNo("Would you like to set this machine's time zone now?"))
+ systemExecute("rm -f /etc/wall_cmos_clock /etc/localtime; tzsetup");
+
+ dialog_clear();
+ if (!msgYesNo("Does this system have a mouse attached to it?"))
+ dmenuOpenSimple(&MenuMouse);
+
+ if (directoryExists("/usr/X11R6")) {
+ dialog_clear();
+ if (!msgYesNo("Would you like to configure your X server at this time?"))
+ systemExecute("/usr/X11R6/bin/xf86config");
+ }
- if (!SystemWasInstalled && access("/kernel", R_OK)) {
- if (vsystem("ln -f /kernel.GENERIC /kernel")) {
- msgConfirm("Unable to link /kernel into place!");
- return 0;
+ if (cdromMounted) {
+ dialog_clear();
+ if (!msgYesNo("Would you like to link to the ports tree on your CDROM?\n\n"
+ "This will require that you have your FreeBSD CD in the CDROM\n"
+ "drive to use the ports collection, but at a substantial savings\n"
+ "in disk space (NOTE: This may take as long as 15 or 20 minutes\n"
+ "depending on the speed of your CDROM drive)."))
+ configPorts(NULL);
}
+
+ dialog_clear();
+ if (!msgYesNo("The FreeBSD package collection is a collection of over 300 ready-to-run\n"
+ "applications, from text editors to games to WEB servers. Would you like\n"
+ "to browse the collection now?"))
+ configPackages(NULL);
+
+ /* XXX Put whatever other nice configuration questions you'd like to ask the user here XXX */
+
}
+ /* Final menu of last resort */
+ dialog_clear();
+ if (!msgYesNo("Would you like to go to the general configuration menu for a chance to set\n"
+ "any last configuration options?"))
+ dmenuOpenSimple(&MenuConfigure);
+
+ /* Write out any changes .. */
+ configResolv();
+ configSysconfig();
+
+ variable_set2(SYSTEM_STATE, i == RET_FAIL ? "error-install" : "full-install");
+
+ /* Don't print this if we're express or novice installing */
+ if (strcmp(str, "express") && strcmp(str, "novice")) {
+ if (Dists || i == RET_FAIL) {
+ dialog_clear();
+ msgConfirm("Installation completed with some errors. You may wish to\n"
+ "scroll through the debugging messages on VTY1 with the\n"
+ "scroll-lock feature.");
+ }
+ else {
+ dialog_clear();
+ msgConfirm("Installation completed successfully.\n\n"
+ "If you have any network devices you have not yet configured,\n"
+ "see the Interfaces configuration item on the Configuration menu.");
+ }
+ }
+ else if (!strcmp(str, "novice")) {
+ if (Dists || i == RET_FAIL) {
+ dialog_clear();
+ msgConfirm("Installation completed with some errors. You may wish to\n"
+ "scroll through the debugging messages on VTY1 with the\n"
+ "scroll-lock feature. You can also chose \"No\" at the next\n"
+ "prompt and go back into the installation menus to try and retry\n"
+ "whichever operations have failed.");
+ }
+ else {
+ dialog_clear();
+ msgConfirm("Congradulations! You now have FreeBSD installed on your system.\n"
+ "At this stage, there shouldn't be much left to do from this\n"
+ "installation utility so if you wish to come up from the hard disk\n"
+ "now, simply select \"Yes\" at the next prompt to reboot.\n"
+ "If you wish to re-enter this utility after the system is up, you\n"
+ "may do so by typing: /stand/sysinstall.");
+ }
+ }
+ return i;
+}
+
+int
+installFixup(char *str)
+{
+ Device **devs;
+ int i;
+
+ if (!file_readable("/kernel")) {
+ if (file_readable("/kernel.GENERIC")) {
+ if (vsystem("cp -p /kernel.GENERIC /kernel")) {
+ dialog_clear();
+ msgConfirm("Unable to link /kernel into place!");
+ return RET_FAIL;
+ }
+ }
+ else {
+ dialog_clear();
+ msgConfirm("Can't find a kernel image to link to on the root file system!\n"
+ "You're going to have a hard time getting this system to\n"
+ "boot from the hard disk, I'm afraid!");
+ return RET_FAIL;
+ }
+ }
/* Resurrect /dev after bin distribution screws it up */
- if (RunningAsInit && !SystemWasInstalled) {
+ if (RunningAsInit) {
msgNotify("Remaking all devices.. Please wait!");
- if (vsystem("cd /dev; sh MAKEDEV all"))
+ if (vsystem("cd /dev; sh MAKEDEV all")) {
+ dialog_clear();
msgConfirm("MAKEDEV returned non-zero status");
-
+ return RET_FAIL;
+ }
+
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 (!devs[i]->enabled)
+ continue;
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))
+ if (vsystem("cd /dev; sh MAKEDEV %sh", c1->name)) {
+ dialog_clear();
msgConfirm("Unable to make slice entries for %s!", c1->name);
+ return RET_FAIL;
+ }
}
}
}
- }
+ /* XXX Do all the last ugly work-arounds here which we'll try and excise someday right?? XXX */
- /* 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"))
- chmod("/usr/X11R6", 0755);
+ msgNotify("Fixing permissions..");
+ /* BOGON #1: XFree86 extracting /usr/X11R6 with root-only perms */
+ if (directoryExists("/usr/X11R6")) {
+ system("chmod -R a+r /usr/X11R6");
+ system("find /usr/X11R6 -type d | xargs chmod a+x");
+ }
+ /* BOGON #2: We leave /etc in a bad state */
+ chmod("/etc", 0755);
- /* BOGON #2: We leave /etc in a bad state */
- chmod("/etc", 0755);
+ /* BOGON #3: No /var/db/mountdtab complains */
+ Mkdir("/var/db", NULL);
+ creat("/var/db/mountdtab", 0644);
- dialog_clear();
- /* We get a NULL value for str if run from installExpress(), in which case we don't want to print the following */
- if (str) {
- 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.");
+ /* Now run all the mtree stuff to fix things up */
+ vsystem("mtree -deU -f /etc/mtree/BSD.root.dist -p /");
+ vsystem("mtree -deU -f /etc/mtree/BSD.var.dist -p /var");
+ vsystem("mtree -deU -f /etc/mtree/BSD.usr.dist -p /usr");
}
- SystemWasInstalled = TRUE;
- return 0;
+ return RET_SUCCESS;
}
/* Go newfs and/or mount all the filesystems we've been asked to */
-Boolean
-installFilesystems(void)
+int
+installFilesystems(char *str)
{
int i;
Disk *disk;
- Chunk *c1, *c2;
+ Chunk *c1, *c2, *rootdev, *swapdev, *usrdev;
Device **devs;
- char dname[40];
- PartInfo *p = (PartInfo *)rootdev->private;
- Boolean RootReadOnly;
+ PartInfo *root;
+ char dname[80];
+ extern int MakeDevChunk(Chunk *c, char *n);
+ Boolean upgrade = FALSE;
+
+ if (!(str && !strcmp(str, "script")) && !checkLabels(&rootdev, &swapdev, &usrdev))
+ return RET_FAIL;
+ root = (PartInfo *)rootdev->private;
command_clear();
- devs = deviceFind(NULL, DEVICE_TYPE_DISK);
+ upgrade = str && !strcmp(str, "upgrade");
+
+ /* As the very first thing, try to get ourselves some swap space */
+ sprintf(dname, "/dev/%s", swapdev->name);
+ if (!MakeDevChunk(swapdev, "/dev") || !file_readable(dname)) {
+ dialog_clear();
+ msgConfirm("Unable to make device node for %s in /dev!\n"
+ "The creation of filesystems will be aborted.", dname);
+ return RET_FAIL;
+ }
+ if (!swapon(dname))
+ msgNotify("Added %s as initial swap device", dname);
+ else
+ msgConfirm("WARNING! Unable to swap to %s: %s\n"
+ "This may cause the installation to fail at some point\n"
+ "if you don't have a lot of memory.", dname, strerror(errno));
+
+ /* Next, create and/or mount the root device */
+ sprintf(dname, "/dev/r%sa", rootdev->disk->name);
+ if (!MakeDevChunk(rootdev, "/dev") || !file_readable(dname)) {
+ dialog_clear();
+ msgConfirm("Unable to make device node for %s in /dev!\n"
+ "The creation of filesystems will be aborted.", dname);
+ return RET_FAIL;
+ }
- /* First, create and mount the root device */
- if (strcmp(p->mountpoint, "/"))
- msgConfirm("Warning: %s is marked as a root partition but is mounted on %s", rootdev->name, p->mountpoint);
+ if (strcmp(root->mountpoint, "/")) {
+ dialog_clear();
+ msgConfirm("Warning: %s is marked as a root partition but is mounted on %s", rootdev->name, root->mountpoint);
+ }
- if (p->newfs) {
+ if (root->newfs) {
int i;
- sprintf(dname, "/dev/r%sa", rootdev->disk->name);
msgNotify("Making a new root filesystem on %s", dname);
- i = vsystem("%s %s", p->newfs_cmd, dname);
+ i = vsystem("%s %s", root->newfs_cmd, dname);
if (i) {
- msgConfirm("Unable to make new root filesystem! Command returned status %d", i);
- return FALSE;
+ dialog_clear();
+ msgConfirm("Unable to make new root filesystem on %s!\n"
+ "Command returned status %d", dname, i);
+ return RET_FAIL;
}
- 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);
+ if (!upgrade) {
+ dialog_clear();
+ msgConfirm("Warning: Root device is selected read-only. It will be assumed\n"
+ "that you have the appropriate device entries already in /dev.");
+ }
+ msgNotify("Checking integrity of existing %s filesystem.", dname);
i = vsystem("fsck -y %s", dname);
- if (i)
- msgConfirm("Warning: fsck returned status off %d - this partition may be\nunsafe to use.", i);
+ if (i) {
+ dialog_clear();
+ msgConfirm("Warning: fsck returned status of %d for %s.\n"
+ "This partition may be unsafe to use.", i, dname);
+ }
}
+ /* Switch to block device */
sprintf(dname, "/dev/%sa", rootdev->disk->name);
if (Mount("/mnt", dname)) {
- msgConfirm("Unable to mount the root file system! Giving up.");
- return FALSE;
+ dialog_clear();
+ msgConfirm("Unable to mount the root file system on %s! Giving up.", dname);
+ return RET_FAIL;
}
/* Now buzz through the rest of the partitions and mount them too */
+ devs = deviceFind(NULL, DEVICE_TYPE_DISK);
for (i = 0; devs[i]; i++) {
if (!devs[i]->enabled)
continue;
disk = (Disk *)devs[i]->private;
if (!disk->chunks) {
+ dialog_clear();
msgConfirm("No chunk list found for %s!", disk->name);
- return FALSE;
+ return RET_FAIL;
}
-
- /* Make the proper device mount points in /mnt/dev */
- if (!(RootReadOnly && disk == rootdev->disk)) {
+ if (root->newfs || upgrade) {
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) {
if (c2->type == part && c2->subtype != FS_SWAP && c2->private) {
PartInfo *tmp = (PartInfo *)c2->private;
- if (!strcmp(tmp->mountpoint, "/"))
+ /* Already did root */
+ if (c2 == rootdev)
continue;
if (tmp->newfs)
@@ -407,16 +740,20 @@ installFilesystems(void)
char fname[80];
int i;
+ if (c2 == swapdev)
+ continue;
sprintf(fname, "/mnt/dev/%s", c2->name);
i = swapon(fname);
if (!i)
- msgNotify("Added %s as a swap device", fname);
- else
+ msgNotify("Added %s as an additional swap device", fname);
+ else {
+ dialog_clear();
msgConfirm("Unable to add %s as a swap device: %s", fname, strerror(errno));
+ }
}
}
}
- else if (c1->type == fat && c1->private && !RootReadOnly) {
+ else if (c1->type == fat && c1->private && (root->newfs || upgrade)) {
char name[FILENAME_MAX];
sprintf(name, "/mnt%s", ((PartInfo *)c1->private)->mountpoint);
@@ -425,32 +762,58 @@ installFilesystems(void)
}
}
+ msgNotify("Copying initial device files..");
/* Copy the boot floppy's dev files */
- if (vsystem("find -x /dev | cpio -pdmV /mnt")) {
+ if ((root->newfs || upgrade) && vsystem("find -x /dev | cpio -pdmv /mnt")) {
+ dialog_clear();
msgConfirm("Couldn't clone the /dev files!");
- return FALSE;
+ return RET_FAIL;
}
command_sort();
command_execute();
- return TRUE;
+ return RET_SUCCESS;
+}
+
+int
+installVarDefaults(char *unused)
+{
+ /* Set default startup options */
+ variable_set2(VAR_ROUTEDFLAGS, "-q");
+ variable_set2(VAR_RELNAME, RELEASE_NAME);
+ variable_set2(VAR_CPIO_VERBOSITY, "high");
+ variable_set2(VAR_TAPE_BLOCKSIZE, DEFAULT_TAPE_BLOCKSIZE);
+ variable_set2(VAR_FTP_USER, "ftp");
+ variable_set2(VAR_BROWSER_PACKAGE, "lynx-2.4.2");
+ variable_set2(VAR_BROWSER_BINARY, "/usr/local/bin/lynx");
+ variable_set2(VAR_CONFIG_FILE, "freebsd.cfg");
+ variable_set2(VAR_FTP_STATE, "passive");
+ variable_set2(VAR_FTP_ONERROR, "abort");
+ variable_set2(VAR_FTP_RETRIES, MAX_FTP_RETRIES);
+ if (getpid() != 1)
+ variable_set2(SYSTEM_STATE, "update");
+ else
+ variable_set2(SYSTEM_STATE, "init");
+ return RET_SUCCESS;
}
/* Copy the boot floppy contents into /stand */
-static Boolean
-copy_self(void)
+Boolean
+copySelf(void)
{
int i;
msgWeHaveOutput("Copying the boot floppy to /stand on root filesystem");
- i = vsystem("find -x /stand | cpio -pdmV /mnt");
+ i = vsystem("find -x /stand | cpio -pdmv /mnt");
if (i) {
+ dialog_clear();
msgConfirm("Copy returned error status of %d!", i);
return FALSE;
}
/* Copy the /etc files into their rightful place */
- if (vsystem("cd /mnt/stand; find etc | cpio -pdmV /mnt")) {
+ if (vsystem("cd /mnt/stand; find etc | cpio -pdmv /mnt")) {
+ dialog_clear();
msgConfirm("Couldn't copy up the /etc files!");
return TRUE;
}
@@ -459,8 +822,8 @@ copy_self(void)
static Boolean loop_on_root_floppy(void);
-static Boolean
-root_extract(void)
+Boolean
+rootExtract(void)
{
int fd;
static Boolean alreadyExtracted = FALSE;
@@ -470,7 +833,7 @@ root_extract(void)
if (mediaDevice) {
if (isDebug())
- msgDebug("Attempting to extract root image from %s device\n", mediaDevice->description);
+ msgDebug("Attempting to extract root image from %s\n", mediaDevice->name);
switch(mediaDevice->type) {
case DEVICE_TYPE_FLOPPY:
@@ -478,18 +841,20 @@ root_extract(void)
break;
default:
- if (!(*mediaDevice->init)(mediaDevice))
+ if (!mediaDevice->init(mediaDevice))
break;
- fd = (*mediaDevice->get)(mediaDevice, "floppies/root.flp", NULL);
+ fd = mediaDevice->get(mediaDevice, "floppies/root.flp", FALSE);
if (fd < 0) {
- msgConfirm("Couldn't get root image from %s!\nWill try to get it from floppy.", mediaDevice->name);
- (*mediaDevice->shutdown)(mediaDevice);
+ dialog_clear();
+ msgConfirm("Couldn't get root image from %s!\n"
+ "Will try to get it from floppy.", mediaDevice->name);
+ mediaDevice->shutdown(mediaDevice);
alreadyExtracted = loop_on_root_floppy();
}
else {
- msgNotify("Loading root image from %s", mediaDevice->name);
+ msgNotify("Loading root image from:\n%s", mediaDevice->name);
alreadyExtracted = mediaExtractDist("/", fd);
- (*mediaDevice->close)(mediaDevice, fd);
+ mediaDevice->close(mediaDevice, fd);
}
break;
}
@@ -516,3 +881,30 @@ loop_on_root_floppy(void)
}
return status;
}
+
+static void
+create_termcap(void)
+{
+ FILE *fp;
+
+ const char *caps[] = {
+ termcap_vt100, termcap_cons25, termcap_cons25_m, termcap_cons25r,
+ termcap_cons25r_m, termcap_cons25l1, termcap_cons25l1_m, NULL,
+ };
+ const char **cp;
+
+ if (!file_readable(TERMCAP_FILE)) {
+ Mkdir("/usr/share/misc", NULL);
+ fp = fopen(TERMCAP_FILE, "w");
+ if (!fp) {
+ dialog_clear();
+ msgConfirm("Unable to initialize termcap file. Some screen-oriented\nutilities may not work.");
+ return;
+ }
+ cp = caps;
+ while (*cp)
+ fprintf(fp, "%s\n", *(cp++));
+ fclose(fp);
+ }
+}
+
diff --git a/usr.sbin/sysinstall/label.c b/usr.sbin/sysinstall/label.c
index ccfb63b..21ef267 100644
--- a/usr.sbin/sysinstall/label.c
+++ b/usr.sbin/sysinstall/label.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: label.c,v 1.32.2.2 1995/07/21 11:45:39 rgrimes Exp $
+ * $Id: label.c,v 1.33 1995/09/18 16:52:28 peter Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -45,8 +45,6 @@
#include <ctype.h>
#include <sys/disklabel.h>
#include <sys/param.h>
-#undef TRUE
-#undef FALSE
#include <sys/sysctl.h>
/*
@@ -60,14 +58,20 @@
#define CHUNK_SLICE_START_ROW 2
#define CHUNK_PART_START_ROW 11
-/* One MB worth of blocks */
-#define ONE_MEG 2048
-
/* The smallest filesystem we're willing to create */
#define FS_MIN_SIZE ONE_MEG
/* The smallest root filesystem we're willing to create */
-#define ROOT_MIN_SIZE (20 * ONE_MEG)
+#define ROOT_MIN_SIZE 20
+
+/* The smallest swap partition we want to create by default */
+#define SWAP_MIN_SIZE 16
+
+/* The smallest /usr partition we're willing to create by default */
+#define USR_MIN_SIZE 80
+
+/* The smallest /var partition we're willing to create by default */
+#define VAR_MIN_SIZE 30
/* All the chunks currently displayed on the screen */
static struct {
@@ -76,6 +80,118 @@ static struct {
} label_chunk_info[MAX_CHUNKS + 1];
static int here;
+static int diskLabel(char *str);
+static int scriptLabel(char *str);
+
+static int
+labelHook(char *str)
+{
+ Device **devs = NULL;
+
+ /* Clip garbage off the ends */
+ string_prune(str);
+ str = string_skipwhite(str);
+ /* Try and open all the disks */
+ while (str) {
+ char *cp;
+
+ cp = index(str, '\n');
+ if (cp)
+ *cp++ = 0;
+ if (!*str) {
+ beep();
+ return 0;
+ }
+ devs = deviceFind(str, DEVICE_TYPE_DISK);
+ if (!devs) {
+ dialog_clear();
+ msgConfirm("Unable to find disk %s!", str);
+ return 0;
+ }
+ else if (devs[1]) {
+ dialog_clear();
+ msgConfirm("Bizarre multiple match for %s!", str);
+ }
+ devs[0]->enabled = TRUE;
+ str = cp;
+ }
+ return devs ? 1 : 0;
+}
+
+int
+diskLabelEditor(char *str)
+{
+ Device **devs;
+ DMenu *menu;
+ int i, cnt;
+ char *cp;
+
+ cp = variable_get(VAR_DISK);
+ devs = deviceFind(cp, DEVICE_TYPE_DISK);
+ cnt = deviceCount(devs);
+ if (!cnt) {
+ dialog_clear();
+ msgConfirm("No disks found! Please verify that your disk controller is being\n"
+ "properly probed at boot time. See the Hardware Guide on the\n"
+ "Documentation menu for clues on diagnosing this type of problem.");
+ return RET_FAIL;
+ }
+ else if (cnt == 1 || variable_get(DISK_SELECTED)) {
+ devs[0]->enabled = TRUE;
+ if (str && !strcmp(str, "script"))
+ i = scriptLabel(str);
+ else
+ i = diskLabel(str);
+ }
+ else {
+ menu = deviceCreateMenu(&MenuDiskDevices, DEVICE_TYPE_DISK, labelHook);
+ if (!menu) {
+ dialog_clear();
+ msgConfirm("No devices suitable for installation found!\n\n"
+ "Please verify that your disk controller (and attached drives)\n"
+ "were detected properly. This can be done by pressing the\n"
+ "[Scroll Lock] key and using the Arrow keys to move back to\n"
+ "the boot messages. Press [Scroll Lock] again to return.");
+ i = RET_FAIL;
+ }
+ else {
+ if (!dmenuOpenSimple(menu))
+ i = RET_FAIL;
+ else
+ i = diskLabel(str);
+ free(menu);
+ }
+ }
+ return i;
+}
+
+int
+diskLabelCommit(char *str)
+{
+ char *cp;
+ int i;
+
+ /* Already done? */
+ if ((cp = variable_get(DISK_LABELLED)) && strcmp(cp, "yes"))
+ i = RET_SUCCESS;
+ else if (!cp) {
+ dialog_clear();
+ msgConfirm("You must assign disk labels before this option can be used.");
+ i = RET_FAIL;
+ }
+ /* The routine will guard against redundant writes, just as this one does */
+ else if (diskPartitionWrite(str) != RET_SUCCESS)
+ i = RET_FAIL;
+ else if (installFilesystems(str) != RET_SUCCESS)
+ i = RET_FAIL;
+ else {
+ msgInfo("All filesystem information written successfully.");
+ variable_set2(DISK_LABELLED, "written");
+ i = RET_SUCCESS;
+ }
+ return i;
+}
+
/* See if we're already using a desired partition name */
static Boolean
check_conflict(char *name)
@@ -93,13 +209,12 @@ check_conflict(char *name)
static int
space_free(struct chunk *c)
{
- struct chunk *c1 = c->part;
+ struct chunk *c1;
int sz = c->size;
- while (c1) {
+ for (c1 = c->part; c1; c1 = c1->next) {
if (c1->type != unused)
sz -= c1->size;
- c1 = c1->next;
}
if (sz < 0)
msgFatal("Partitions are larger than actual chunk??");
@@ -108,19 +223,12 @@ space_free(struct chunk *c)
/* Snapshot the current situation into the displayed chunks structure */
static void
-record_label_chunks()
+record_label_chunks(Device **devs)
{
int i, j, p;
struct chunk *c1, *c2;
- Device **devs;
Disk *d;
- devs = deviceFind(NULL, DEVICE_TYPE_DISK);
- if (!devs) {
- msgConfirm("No disks found!");
- return;
- }
-
j = p = 0;
/* First buzz through and pick up the FreeBSD slices */
for (i = 0; devs[i]; i++) {
@@ -139,6 +247,7 @@ record_label_chunks()
}
}
}
+
/* Now run through again and get the FreeBSD partition entries */
for (i = 0; devs[i]; i++) {
if (!devs[i]->enabled)
@@ -198,7 +307,7 @@ new_part(char *mpoint, Boolean newfs, u_long size)
}
/* Get the mountpoint for a partition and save it away */
-PartInfo *
+static PartInfo *
get_mountpoint(struct chunk *old)
{
char *val;
@@ -266,7 +375,9 @@ get_partition_type(void)
"A swap partition.",
};
i = dialog_menu("Please choose a partition type",
- "If you want to use this partition for swap space, select Swap.\nIf you want to put a filesystem on it, choose FS.", -1, -1, 2, 2, fs_types, selection, NULL, NULL);
+ "If you want to use this partition for swap space, select Swap.\n"
+ "If you want to put a filesystem on it, choose FS.",
+ -1, -1, 2, 2, fs_types, selection, NULL, NULL);
if (!i) {
if (!strcmp(selection, "FS"))
return PART_FILESYSTEM;
@@ -283,11 +394,124 @@ getNewfsCmd(PartInfo *p)
char *val;
val = msgGetInput(p->newfs_cmd,
- "Please enter the newfs command and options you'd like to use in\ncreating this file system.");
+ "Please enter the newfs command and options you'd like to use in\n"
+ "creating this file system.");
if (val)
strncpy(p->newfs_cmd, val, NEWFS_CMD_MAX);
}
+static int
+scriptLabel(char *str)
+{
+ char *cp;
+ PartType type;
+ PartInfo *p;
+ u_long flags = 0;
+ int i, status;
+ Device **devs;
+ Disk *d;
+
+ status = RET_SUCCESS;
+ cp = variable_get(VAR_DISK);
+ if (!cp) {
+ dialog_clear();
+ msgConfirm("scriptLabel: No disk selected - can't label automatically.");
+ return RET_FAIL;
+ }
+
+ devs = deviceFind(cp, DEVICE_TYPE_DISK);
+ if (!devs) {
+ dialog_clear();
+ msgConfirm("scriptLabel: No disk device %s found!", cp);
+ return RET_FAIL;
+ }
+ d = devs[0]->private;
+
+ record_label_chunks(devs);
+ for (i = 0; label_chunk_info[i].c; i++) {
+ Chunk *c1 = label_chunk_info[i].c;
+
+ if (label_chunk_info[i].type == PART_SLICE) {
+ if ((cp = variable_get(c1->name)) != NULL) {
+ int sz;
+ char typ[10], mpoint[50];
+
+ if (sscanf(cp, "%s %d %s", typ, &sz, mpoint) != 3) {
+ dialog_clear();
+ msgConfirm("For slice entry %s, got an invalid detail entry of: %s", c1->name, cp);
+ status = RET_FAIL;
+ continue;
+ }
+ else {
+ Chunk *tmp;
+
+ if (!strcmp(typ, "swap")) {
+ type = PART_SWAP;
+ strcpy(mpoint, "<swap>");
+ }
+ else {
+ type = PART_FILESYSTEM;
+ if (!strcmp(mpoint, "/"))
+ flags |= CHUNK_IS_ROOT;
+ }
+ if (!sz)
+ sz = space_free(c1);
+ if (sz > space_free(c1)) {
+ dialog_clear();
+ msgConfirm("Not enough free space to create partition: %s", mpoint);
+ status = RET_FAIL;
+ continue;
+ }
+ if (!(tmp = Create_Chunk_DWIM(d, c1, sz, part,
+ (type == PART_SWAP) ? FS_SWAP : FS_BSDFFS, flags))) {
+ dialog_clear();
+ msgConfirm("Unable to create from partition spec: %s. Too big?", cp);
+ status = RET_FAIL;
+ break;
+ }
+ else {
+ tmp->private = new_part(mpoint, TRUE, sz);
+ tmp->private_free = safe_free;
+ status = RET_SUCCESS;
+ }
+ }
+ }
+ }
+ else {
+ /* Must be something we can set a mountpoint */
+ cp = variable_get(c1->name);
+ if (cp) {
+ char mpoint[50], nwfs[8];
+ Boolean newfs = FALSE;
+
+ nwfs[0] = '\0';
+ if (sscanf(cp, "%s %s", mpoint, nwfs) != 2) {
+ dialog_clear();
+ msgConfirm("For slice entry %s, got an invalid detail entry of: %s", c1->name, cp);
+ status = RET_FAIL;
+ continue;
+ }
+ newfs = toupper(nwfs[0]) == 'Y' ? TRUE : FALSE;
+ if (c1->private) {
+ p = c1->private;
+ p->newfs = newfs;
+ strcpy(p->mountpoint, mpoint);
+ }
+ else {
+ c1->private = new_part(mpoint, newfs, 0);
+ c1->private_free = safe_free;
+ }
+ if (!strcmp(mpoint, "/"))
+ c1->flags |= CHUNK_IS_ROOT;
+ else
+ c1->flags &= ~CHUNK_IS_ROOT;
+ }
+ }
+ }
+ if (status == RET_SUCCESS)
+ variable_set2(DISK_LABELLED, "yes");
+ return status;
+}
#define MAX_MOUNT_NAME 12
@@ -401,8 +625,8 @@ print_command_summary()
move(0, 0);
}
-int
-diskLabelEditor(char *str)
+static int
+diskLabel(char *str)
{
int sz, key = 0;
Boolean labeling;
@@ -411,14 +635,17 @@ diskLabelEditor(char *str)
PartType type;
Device **devs;
+ devs = deviceFind(NULL, DEVICE_TYPE_DISK);
+ if (!devs) {
+ dialog_clear();
+ msgConfirm("No disks found!");
+ return RET_FAIL;
+ }
+
labeling = TRUE;
keypad(stdscr, TRUE);
- record_label_chunks();
+ record_label_chunks(devs);
- if (!getenv(DISK_PARTITIONED)) {
- msgConfirm("You need to partition your disk(s) before you can assign disk labels.");
- return 0;
- }
dialog_clear(); clear();
while (labeling) {
clear();
@@ -426,6 +653,7 @@ diskLabelEditor(char *str)
print_command_summary();
if (msg) {
attrset(A_REVERSE); mvprintw(23, 0, msg); attrset(A_NORMAL);
+ clrtoeol();
beep();
msg = NULL;
}
@@ -467,7 +695,7 @@ diskLabelEditor(char *str)
case KEY_F(1):
case '?':
- systemDisplayFile("partition.hlp");
+ systemDisplayHelp("partition");
break;
case 'A':
@@ -481,73 +709,105 @@ diskLabelEditor(char *str)
if (label_chunk_info[i++].type != PART_SLICE)
cnt++;
if (cnt == (CHUNK_COLUMN_MAX * 2) + 4) {
- msgConfirm("Sorry, I can't fit any more partitions on the screen! You can get around\nthis limitation by partitioning your disks individually rather than all\nat once. This will be fixed just as soon as we get a scrolling partition\nbox written. Sorry for the inconvenience!");
+ dialog_clear();
+ msgConfirm("Sorry, I can't fit any more partitions on the screen! You can get around\n"
+ "this limitation by partitioning your disks individually rather than all\n"
+ "at once. This will be fixed just as soon as we get a scrolling partition\n"
+ "box written. Sorry for the inconvenience!");
break;
}
sz = space_free(label_chunk_info[here].c);
if (sz <= FS_MIN_SIZE) {
- msg = "Not enough space to create additional FreeBSD partition";
+ msg = "Not enough space to create an additional FreeBSD partition";
break;
}
{
struct chunk *tmp;
int mib[2];
int physmem;
- size_t size;
-
+ size_t size, swsize;
+ char *cp;
+
+ cp = variable_get(VAR_ROOT_SIZE);
tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk,
label_chunk_info[here].c,
- 32 * ONE_MEG, part, FS_BSDFFS,
+ (cp ? atoi(cp) : 32) * ONE_MEG, part, FS_BSDFFS,
CHUNK_IS_ROOT);
if (!tmp) {
+ dialog_clear();
msgConfirm("Unable to create the root partition. Too big?");
break;
}
tmp->private = new_part("/", TRUE, tmp->size);
tmp->private_free = safe_free;
- record_label_chunks();
-
- mib[0] = CTL_HW;
- mib[1] = HW_PHYSMEM;
- size = sizeof physmem;
- sysctl(mib, 2, &physmem, &size, (void *)0, (size_t)0);
+ record_label_chunks(devs);
+ cp = variable_get(VAR_SWAP_SIZE);
+ if (cp)
+ swsize = atoi(cp) * ONE_MEG;
+ else {
+ mib[0] = CTL_HW;
+ mib[1] = HW_PHYSMEM;
+ size = sizeof physmem;
+ sysctl(mib, 2, &physmem, &size, (void *)0, (size_t)0);
+ swsize = 16 * ONE_MEG + (physmem * 2 / 512);
+ }
tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk,
label_chunk_info[here].c,
- physmem * 2 / 512, part, FS_SWAP, 0);
+ swsize,
+ part, FS_SWAP, 0);
if (!tmp) {
+ dialog_clear();
msgConfirm("Unable to create the swap partition. Too big?");
break;
}
tmp->private = 0;
tmp->private_free = safe_free;
- record_label_chunks();
+ record_label_chunks(devs);
+ cp = variable_get(VAR_VAR_SIZE);
tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk,
label_chunk_info[here].c,
- 16 * ONE_MEG, part, FS_BSDFFS, 0);
+ (cp ? atoi(cp) : VAR_MIN_SIZE) * ONE_MEG, part, FS_BSDFFS, 0);
if (!tmp) {
- msgConfirm("Unable to create the /var partition. Too big?");
+ dialog_clear();
+ msgConfirm("Less than %dMB free for /var - you will need to\n"
+ "partition your disk manually with a custom install!", (cp ? atoi(cp) : VAR_MIN_SIZE));
break;
}
tmp->private = new_part("/var", TRUE, tmp->size);
tmp->private_free = safe_free;
- record_label_chunks();
+ record_label_chunks(devs);
- sz = space_free(label_chunk_info[here].c);
+ cp = variable_get(VAR_USR_SIZE);
+ if (cp)
+ sz = atoi(cp) * ONE_MEG;
+ else
+ sz = space_free(label_chunk_info[here].c);
+ if (!sz || sz < (USR_MIN_SIZE * ONE_MEG)) {
+ dialog_clear();
+ msgConfirm("Less than %dMB free for /usr - you will need to\n"
+ "partition your disk manually with a custom install!", USR_MIN_SIZE);
+ break;
+ }
+
tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk,
label_chunk_info[here].c,
sz, part, FS_BSDFFS, 0);
if (!tmp) {
- msgConfirm("Unable to create the /usr partition. Too big?");
+ dialog_clear();
+ msgConfirm("Unable to create the /usr partition. Not enough space?\n"
+ "You will need to partition your disk manually with a custom install!");
break;
}
+ /* At this point, we're reasonably "labelled" */
+ variable_set2(DISK_LABELLED, "yes");
tmp->private = new_part("/usr", TRUE, tmp->size);
tmp->private_free = safe_free;
- record_label_chunks();
+ record_label_chunks(devs);
}
break;
@@ -564,13 +824,17 @@ diskLabelEditor(char *str)
if (label_chunk_info[i++].type != PART_SLICE)
cnt++;
if (cnt == (CHUNK_COLUMN_MAX * 2)) {
- msgConfirm("Sorry, I can't fit any more partitions on the screen! You can get around\nthis limitation by partitioning your disks individually rather than all\nat once. This will be fixed just as soon as we get a scrolling partition\nbox written. Sorry for the inconvenience!");
+ dialog_clear();
+ msgConfirm("Sorry, I can't fit any more partitions on the screen! You can get around\n"
+ "this limitation by partitioning your disks individually rather than all\n"
+ "at once. This will be fixed just as soon as we get a scrolling partition\n"
+ "box written. Sorry for the inconvenience!");
break;
}
}
sz = space_free(label_chunk_info[here].c);
if (sz <= FS_MIN_SIZE) {
- msg = "Not enough space to create additional FreeBSD partition";
+ msg = "Not enough space to create an additional FreeBSD partition";
break;
}
{
@@ -581,7 +845,9 @@ diskLabelEditor(char *str)
u_long flags = 0;
sprintf(osize, "%d", sz);
- val = msgGetInput(osize, "Please specify the size for new FreeBSD partition in blocks, or\nappend a trailing `M' for megabytes (e.g. 20M) or `C' for cylinders.\n\nSpace free is %d blocks (%dMB)", sz, sz / ONE_MEG);
+ val = msgGetInput(osize, "Please specify the size for new FreeBSD partition in blocks, or\n"
+ "append a trailing `M' for megabytes (e.g. 20M) or `C' for cylinders.\n\n"
+ "Space free is %d blocks (%dMB)", sz, sz / ONE_MEG);
if (!val || (size = strtol(val, &cp, 0)) <= 0)
break;
@@ -611,11 +877,17 @@ diskLabelEditor(char *str)
if ((flags & CHUNK_IS_ROOT)) {
if (!(label_chunk_info[here].c->flags & CHUNK_BSD_COMPAT)) {
- msgConfirm("This region cannot be used for your root partition as\nthe FreeBSD boot code cannot deal with a root partition created in\nsuch a location. Please choose another location for your root\npartition and try again!");
+ msgConfirm("This region cannot be used for your root partition as the\n"
+ "FreeBSD boot code cannot deal with a root partition created\n"
+ "in that location. Please choose another location or smaller\n"
+ "size for your root partition and try again!");
break;
}
- if (size < ROOT_MIN_SIZE)
- msgConfirm("Warning: This is smaller than the recommended size for a\nroot partition. For a variety of reasons, root\npartitions should usually be at least %dMB in size", ROOT_MIN_SIZE / ONE_MEG);
+ if (size < (ROOT_MIN_SIZE * ONE_MEG)) {
+ msgConfirm("Warning: This is smaller than the recommended size for a\n"
+ "root partition. For a variety of reasons, root\n"
+ "partitions should usually be at least %dMB in size", ROOT_MIN_SIZE);
+ }
}
tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk,
label_chunk_info[here].c,
@@ -627,7 +899,10 @@ diskLabelEditor(char *str)
break;
}
if ((flags & CHUNK_IS_ROOT) && (tmp->flags & CHUNK_PAST_1024)) {
- msgConfirm("This region cannot be used for your root partition as it starts\nor extends past the 1024'th cylinder mark and is thus a\npoor location to boot from. Please choose another\nlocation for your root partition and try again!");
+ msgConfirm("This region cannot be used for your root partition as it starts\n"
+ "or extends past the 1024'th cylinder mark and is thus a\n"
+ "poor location to boot from. Please choose another\n"
+ "location (or smaller size) for your root partition and try again!");
Delete_Chunk(label_chunk_info[here].c->disk, tmp);
break;
}
@@ -640,7 +915,8 @@ diskLabelEditor(char *str)
tmp->private = p;
}
tmp->private_free = safe_free;
- record_label_chunks();
+ variable_set2(DISK_LABELLED, "yes");
+ record_label_chunks(devs);
}
break;
@@ -654,7 +930,8 @@ diskLabelEditor(char *str)
break;
}
Delete_Chunk(label_chunk_info[here].c->disk, label_chunk_info[here].c);
- record_label_chunks();
+ variable_set2(DISK_LABELLED, "yes");
+ record_label_chunks(devs);
break;
case 'M': /* mount */
@@ -681,7 +958,8 @@ diskLabelEditor(char *str)
strcpy(p->mountpoint, "/bogus");
}
}
- record_label_chunks();
+ variable_set2(DISK_LABELLED, "yes");
+ record_label_chunks(devs);
break;
default:
@@ -704,33 +982,49 @@ diskLabelEditor(char *str)
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;
+ variable_set2(DISK_LABELLED, "yes");
}
else
msg = MSG_NOT_APPLICABLE;
break;
case 'U':
- devs = deviceFind(NULL, DEVICE_TYPE_DISK);
+ clear();
+ if (msgYesNo("Are you SURE you want to Undo everything?"))
+ break;
+ variable_unset(DISK_PARTITIONED);
for (i = 0; devs[i]; i++) {
+ extern void diskPartition(Device *dev, Disk *d);
+ Disk *d;
+
if (!devs[i]->enabled)
continue;
- else {
- char *cp = devs[i]->name;
-
+ else if ((d = Open_Disk(devs[i]->name)) != NULL) {
Free_Disk(devs[i]->private);
- devs[i]->private = Open_Disk(cp);
+ devs[i]->private = d;
+ diskPartition(devs[i], d);
}
}
- record_label_chunks();
+ variable_unset(DISK_LABELLED);
+ record_label_chunks(devs);
break;
case 'W':
- if (!msgYesNo("Are you sure that you wish to make and mount all filesystems\nat this time? You also have the option of doing it later in\none final 'commit' operation, and if you're at all unsure as\nto which option to chose, then chose No."))
- diskLabelCommit(NULL);
+ if (!msgYesNo("Are you SURE that you wish to make and mount all filesystems\n"
+ "at this time? You also have the option of doing it later in\n"
+ "one final 'commit' operation, and if you're at all unsure as\n"
+ "to which option to chose, then PLEASE CHOSE NO! This option\n"
+ "is DANGEROUS if you're not EXACTLY sure what you are doing!")) {
+ variable_set2(DISK_LABELLED, "yes");
+ clear();
+ diskLabelCommit(NULL);
+ }
break;
case '|':
- if (!msgYesNo("Are you sure you want to go into Wizard mode?\n\nThis is an entirely undocumented feature which you are not\nexpected to understand!")) {
+ if (!msgYesNo("Are you sure you want to go into Wizard mode?\n\n"
+ "This is an entirely undocumented feature which you are not\n"
+ "expected to understand!")) {
int i;
Device **devs;
@@ -739,16 +1033,18 @@ diskLabelEditor(char *str)
DialogActive = FALSE;
devs = deviceFind(NULL, DEVICE_TYPE_DISK);
if (!devs) {
- msgConfirm("Can't find any disk devicse!");
+ dialog_clear();
+ msgConfirm("Can't find any disk devices!");
break;
}
for (i = 0; devs[i] && ((Disk *)devs[i]->private); i++) {
if (devs[i]->enabled)
slice_wizard(((Disk *)devs[i]->private));
}
+ variable_set2(DISK_LABELLED, "yes");
DialogActive = TRUE;
dialog_clear();
- record_label_chunks();
+ record_label_chunks(devs);
}
else
msg = "A most prudent choice!";
@@ -764,17 +1060,6 @@ diskLabelEditor(char *str)
break;
}
}
- variable_set2(DISK_LABELLED, "yes");
dialog_clear();
- return 0;
-}
-
-int
-diskLabelCommit(char *str)
-{
- if (!getenv(DISK_LABELLED))
- msgConfirm("You must assign disk labels before this option can be used.");
- else if (!installFilesystems())
- msgConfirm("Failed to make/mount all filesystems. Please correct\nwhatever went wrong and try again.");
- return 0;
+ return RET_SUCCESS;
}
diff --git a/usr.sbin/sysinstall/main.c b/usr.sbin/sysinstall/main.c
index 7d22216..a94f133 100644
--- a/usr.sbin/sysinstall/main.c
+++ b/usr.sbin/sysinstall/main.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated for what's essentially a complete rewrite.
*
- * $Id: main.c,v 1.13 1995/06/11 19:30:02 rgrimes Exp $
+ * $Id: main.c,v 1.14 1995/09/18 16:52:29 peter Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -43,12 +43,24 @@
#include "sysinstall.h"
#include <stdio.h>
+#include <sys/signal.h>
+
+static void
+screech(int sig)
+{
+ fprintf(stderr, "\007Fatal signal %d caught! I'm dead..\n", sig);
+ pause();
+}
int
main(int argc, char **argv)
{
int choice, scroll, curr, max;
+ if (getpid() == 1) {
+ signal(SIGBUS, screech);
+ signal(SIGSEGV, screech);
+ }
if (geteuid() != 0) {
fprintf(stderr, "Warning: This utility should be run as root.\n");
sleep(1);
@@ -64,21 +76,18 @@ main(int argc, char **argv)
/* Probe for all relevant devices on the system */
deviceGetAll();
- /* Default to passive mode ftp since it's the only thing we currently support :-( */
- OptFlags |= OPT_FTP_PASSIVE;
+ /* Set default flag and variable values */
+ installVarDefaults(NULL);
/* Begin user dialog at outer menu */
while (1) {
choice = scroll = curr = max = 0;
dmenuOpen(&MenuInitial, &choice, &scroll, &curr, &max);
- if (getpid() != 1 || !msgYesNo("Are you sure you wish to exit? System will reboot."))
+ if (getpid() != 1 || !msgYesNo("Are you sure you wish to exit? The system will reboot\n"
+ "(be sure to remove any floppies from the drives)."))
break;
}
- /* Write out any changes to /etc/sysconfig */
- if (SystemWasInstalled)
- configSysconfig();
-
/* Say goodnight, Gracie */
systemShutdown();
diff --git a/usr.sbin/sysinstall/media.c b/usr.sbin/sysinstall/media.c
index 8f77630..d502c1e 100644
--- a/usr.sbin/sysinstall/media.c
+++ b/usr.sbin/sysinstall/media.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: media.c,v 1.25.2.1 1995/07/21 10:53:58 rgrimes Exp $
+ * $Id: media.c,v 1.26 1995/09/18 16:52:31 peter Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -72,6 +72,16 @@ cdromHook(char *str)
return genericHook(str, DEVICE_TYPE_CDROM);
}
+char *
+cpioVerbosity()
+{
+ if (!strcmp(variable_get(VAR_CPIO_VERBOSITY), "high"))
+ return "-v";
+ else if (!strcmp(variable_get(VAR_CPIO_VERBOSITY), "medium"))
+ return "-V";
+ return "";
+}
+
/*
* Return 1 if we successfully found and set the installation type to
* be a CD.
@@ -82,11 +92,24 @@ mediaSetCDROM(char *str)
Device **devs;
int cnt;
+ if (!RunningAsInit) {
+ vsystem("mount /cdrom");
+ if (!file_readable("/cdrom/kernel")) {
+ msgConfirm("Can't find a FreeBSD CD in /cdrom?");
+ return RET_FAIL;
+ }
+ else
+ return RET_SUCCESS;
+ }
devs = deviceFind(NULL, DEVICE_TYPE_CDROM);
cnt = deviceCount(devs);
if (!cnt) {
- msgConfirm("No CDROM devices found! Please check that your system's\nconfiguration is correct and that the CDROM drive is of a supported\ntype. For more information, consult the hardware guide\nin the Doc menu.");
- return 0;
+ dialog_clear();
+ msgConfirm("No CDROM devices found! Please check that your system's\n"
+ "configuration is correct and that the CDROM drive is of a supported\n"
+ "type. For more information, consult the hardware guide\n"
+ "in the Doc menu.");
+ return RET_FAIL;
}
else if (cnt > 1) {
DMenu *menu;
@@ -98,11 +121,11 @@ mediaSetCDROM(char *str)
status = dmenuOpenSimple(menu);
free(menu);
if (!status)
- return 0;
+ return RET_FAIL;
}
else
mediaDevice = devs[0];
- return mediaDevice ? 1 : 0;
+ return mediaDevice ? RET_DONE : RET_FAIL;
}
static int
@@ -124,8 +147,11 @@ mediaSetFloppy(char *str)
devs = deviceFind(NULL, DEVICE_TYPE_FLOPPY);
cnt = deviceCount(devs);
if (!cnt) {
- msgConfirm("No floppy devices found! Please check that your system's\nconfiguration is correct. For more information, consult the hardware guide\nin the Doc menu.");
- return 0;
+ dialog_clear();
+ msgConfirm("No floppy devices found! Please check that your system's configuration\n"
+ "is correct. For more information, consult the hardware guide in the Doc\n"
+ "menu.");
+ return RET_FAIL;
}
else if (cnt > 1) {
DMenu *menu;
@@ -137,11 +163,11 @@ mediaSetFloppy(char *str)
status = dmenuOpenSimple(menu);
free(menu);
if (!status)
- return 0;
+ return RET_FAIL;
}
else
mediaDevice = devs[0];
- return mediaDevice ? 1 : 0;
+ return mediaDevice ? RET_DONE : RET_FAIL;
}
static int
@@ -163,8 +189,9 @@ mediaSetDOS(char *str)
devs = deviceFind(NULL, DEVICE_TYPE_DOS);
cnt = deviceCount(devs);
if (!cnt) {
+ dialog_clear();
msgConfirm("No DOS primary partitions found! This installation method is unavailable");
- return 0;
+ return RET_FAIL;
}
else if (cnt > 1) {
DMenu *menu;
@@ -176,11 +203,11 @@ mediaSetDOS(char *str)
status = dmenuOpenSimple(menu);
free(menu);
if (!status)
- return 0;
+ return RET_FAIL;
}
else
mediaDevice = devs[0];
- return mediaDevice ? 1 : 0;
+ return mediaDevice ? RET_DONE : RET_FAIL;
}
static int
@@ -202,8 +229,11 @@ mediaSetTape(char *str)
devs = deviceFind(NULL, DEVICE_TYPE_TAPE);
cnt = deviceCount(devs);
if (!cnt) {
- msgConfirm("No tape drive devices found! Please check that your system's\nconfiguration is correct. For more information, consult the hardware guide\nin the Doc menu.");
- return 0;
+ dialog_clear();
+ msgConfirm("No tape drive devices found! Please check that your system's configuration\n"
+ "is correct. For more information, consult the hardware guide in the Doc\n"
+ "menu.");
+ return RET_FAIL;
}
else if (cnt > 1) {
DMenu *menu;
@@ -215,20 +245,24 @@ mediaSetTape(char *str)
status = dmenuOpenSimple(menu);
free(menu);
if (!status)
- return 0;
+ return RET_FAIL;
}
else
mediaDevice = devs[0];
if (mediaDevice) {
char *val;
- val = msgGetInput("/usr/tmp", "Please enter the name of a temporary directory containing\nsufficient space for holding the contents of this tape (or\ntapes). The contents of this directory will be removed\nafter installation, so be sure to specify a directory that\ncan be erased afterward!");
+ val = msgGetInput("/usr/tmp", "Please enter the name of a temporary directory containing\n"
+ "sufficient space for holding the contents of this tape (or\n"
+ "tapes). The contents of this directory will be removed\n"
+ "after installation, so be sure to specify a directory that\n"
+ "can be erased afterwards!\n");
if (!val)
mediaDevice = NULL;
else
mediaDevice->private = strdup(val);
}
- return mediaDevice ? 1 : 0;
+ return mediaDevice ? RET_DONE : RET_FAIL;
}
/*
@@ -241,24 +275,40 @@ mediaSetFTP(char *str)
static Device ftpDevice;
char *cp;
- if (!dmenuOpenSimple(&MenuMediaFTP))
- return 0;
- cp = getenv("ftp");
- if (!cp)
- return 0;
- if (!strcmp(cp, "other")) {
- cp = msgGetInput("ftp://", "Please specify the URL of a FreeBSD distribution on a\nremote ftp site. This site must accept either anonymous\nftp or you should have set an ftp username and password\nin the Options Menu.\nA URL looks like this: ftp://<hostname>/<path>\nWhere <path> is relative to the anonymous ftp directory or the\nhome directory of the user being logged in as.");
- if (!cp || strncmp("ftp://", cp, 6))
- return 0;
+ if (!(str && !strcmp(str, "script") && (cp = variable_get(VAR_FTP_PATH)))) {
+ if (!dmenuOpenSimple(&MenuMediaFTP))
+ return RET_FAIL;
else
- variable_set2("ftp", cp);
+ cp = variable_get(VAR_FTP_PATH);
+ }
+ if (!cp) {
+ dialog_clear();
+ msgConfirm("%s not set! Not setting an FTP installation path, OK?", VAR_FTP_PATH);
+ return RET_FAIL;
+ }
+ else if (!strcmp(cp, "other")) {
+ variable_set2(VAR_FTP_PATH, "ftp://");
+ cp = variable_get_value(VAR_FTP_PATH, "Please specify the URL of a FreeBSD distribution on a\n"
+ "remote ftp site. This site must accept either anonymous\n"
+ "ftp or you should have set an ftp username and password\n"
+ "in the Options screen.\n\n"
+ "A URL looks like this: ftp://<hostname>/<path>\n"
+ "Where <path> is relative to the anonymous ftp directory or the\n"
+ "home directory of the user being logged in as.");
+ if (!cp || !*cp)
+ return RET_FAIL;
+ }
+ if (strncmp("ftp://", cp, 6)) {
+ dialog_clear();
+ msgConfirm("Sorry, %s is an invalid URL!", cp);
+ return RET_FAIL;
}
strcpy(ftpDevice.name, cp);
- /* XXX hack: if str == NULL, we were called by an ftp strategy routine and don't need to reinit all */
- if (!str)
- return 1;
- if (!tcpDeviceSelect())
- return 0;
+
+ /* If str == NULL || "script", we were called just to change FTP sites, not network devices */
+ if (str && strcmp(str, "script") && !tcpDeviceSelect())
+ return RET_FAIL;
+
ftpDevice.type = DEVICE_TYPE_FTP;
ftpDevice.init = mediaInitFTP;
ftpDevice.get = mediaGetFTP;
@@ -266,20 +316,20 @@ mediaSetFTP(char *str)
ftpDevice.shutdown = mediaShutdownFTP;
ftpDevice.private = mediaDevice; /* Set to network device by tcpDeviceSelect() */
mediaDevice = &ftpDevice;
- return 1;
+ return RET_DONE;
}
int
mediaSetFTPActive(char *str)
{
- OptFlags &= OPT_FTP_ACTIVE;
+ variable_set2(VAR_FTP_STATE, "active");
return mediaSetFTP(str);
}
int
mediaSetFTPPassive(char *str)
{
- OptFlags &= OPT_FTP_PASSIVE;
+ variable_set2(VAR_FTP_STATE, "passive");
return mediaSetFTP(str);
}
@@ -289,9 +339,12 @@ mediaSetUFS(char *str)
static Device ufsDevice;
char *val;
- val = msgGetInput(NULL, "Enter a fully qualified pathname for the directory\ncontaining the FreeBSD distribution files:");
- if (!val)
- return 0;
+ if (!(str && !strcmp(str, "script") && (val = variable_get(VAR_UFS_PATH)))) {
+ val = variable_get_value(VAR_UFS_PATH, "Enter a fully qualified pathname for the directory\n"
+ "containing the FreeBSD distribution files:");
+ if (!val)
+ return RET_FAIL;
+ }
strcpy(ufsDevice.name, "ufs");
ufsDevice.type = DEVICE_TYPE_UFS;
ufsDevice.init = dummyInit;
@@ -300,21 +353,26 @@ mediaSetUFS(char *str)
ufsDevice.shutdown = dummyShutdown;
ufsDevice.private = strdup(val);
mediaDevice = &ufsDevice;
- return 1;
+ return RET_DONE;
}
int
mediaSetNFS(char *str)
{
static Device nfsDevice;
- char *val;
+ char *cp;
- val = msgGetInput(NULL, "Please enter the full NFS file specification for the remote\nhost and directory containing the FreeBSD distribution files.\nThis should be in the format: hostname:/some/freebsd/dir");
- if (!val)
- return 0;
- strncpy(nfsDevice.name, val, DEV_NAME_MAX);
- if (!tcpDeviceSelect())
- return 0;
+ if (!(str && !strcmp(str, "script") && (cp = variable_get(VAR_NFS_PATH)))) {
+ cp = variable_get_value(VAR_NFS_PATH, "Please enter the full NFS file specification for the remote\n"
+ "host and directory containing the FreeBSD distribution files.\n"
+ "This should be in the format: hostname:/some/freebsd/dir");
+ if (!cp)
+ return RET_FAIL;
+ }
+ strncpy(nfsDevice.name, cp, DEV_NAME_MAX);
+ /* str == NULL means we were just called to change NFS paths, not network interfaces */
+ if (str && strcmp(str, "script") && !tcpDeviceSelect())
+ return RET_FAIL;
nfsDevice.type = DEVICE_TYPE_NFS;
nfsDevice.init = mediaInitNFS;
nfsDevice.get = mediaGetNFS;
@@ -322,7 +380,7 @@ mediaSetNFS(char *str)
nfsDevice.shutdown = mediaShutdownNFS;
nfsDevice.private = mediaDevice;
mediaDevice = &nfsDevice;
- return 1;
+ return RET_DONE;
}
Boolean
@@ -368,7 +426,7 @@ mediaExtractDistBegin(char *dir, int *fd, int *zpid, int *cpid)
close(1); open("/dev/null", O_WRONLY);
dup2(1, 2);
}
- i = execl("/stand/cpio", "/stand/cpio", "-iduVm", "-H", "tar", 0);
+ i = execl("/stand/cpio", "/stand/cpio", "-idum", cpioVerbosity(), "--block-size", mediaTapeBlocksize(), 0);
if (isDebug())
msgDebug("/stand/cpio command returns %d status\n", i);
exit(i);
@@ -441,7 +499,7 @@ mediaExtractDist(char *dir, int fd)
close(1); open("/dev/null", O_WRONLY);
dup2(1, 2);
}
- i = execl("/stand/cpio", "/stand/cpio", "-iduVm", "-H", "tar", 0);
+ i = execl("/stand/cpio", "/stand/cpio", "-idum", cpioVerbosity(), "--block-size", mediaTapeBlocksize(), 0);
if (isDebug())
msgDebug("/stand/cpio command returns %d status\n", i);
exit(i);
@@ -466,12 +524,12 @@ mediaExtractDist(char *dir, int fd)
return TRUE;
}
-Boolean
-mediaGetType(void)
+int
+mediaGetType(char *unused)
{
if (!dmenuOpenSimple(&MenuMedia))
- return FALSE;
- return TRUE;
+ return RET_FAIL;
+ return RET_SUCCESS;
}
/* Return TRUE if all the media variables are set up correctly */
@@ -479,8 +537,69 @@ Boolean
mediaVerify(void)
{
if (!mediaDevice) {
- msgConfirm("Media type not set! Please select a media type\nfrom the Installation menu before proceeding.");
- return FALSE;
+ dialog_clear();
+ msgConfirm("Media type not set! Please select a media type\n"
+ "from the Installation menu before proceeding.");
+ return mediaGetType(NULL) == RET_SUCCESS;
}
return TRUE;
}
+
+/* Set FTP error behavior */
+int
+mediaSetFtpOnError(char *str)
+{
+ char *cp = variable_get(VAR_FTP_ONERROR);
+
+ if (!cp) {
+ dialog_clear();
+ msgConfirm("FTP error handling is not set to anything!");
+ return RET_FAIL;
+ }
+ else {
+ if (!strcmp(cp, "abort"))
+ variable_set2(VAR_FTP_ONERROR, "retry");
+ else if (!strcmp(cp, "retry"))
+ variable_set2(VAR_FTP_ONERROR, "reselect");
+ else /* must be "reselect" - wrap around */
+ variable_set2(VAR_FTP_ONERROR, "abort");
+ }
+ return RET_SUCCESS;
+}
+
+/* Set the FTP username and password fields */
+int
+mediaSetFtpUserPass(char *str)
+{
+ char *pass;
+
+ dialog_clear();
+ if (variable_get_value(VAR_FTP_USER, "Please enter the username you wish to login as:"))
+ pass = variable_get_value(VAR_FTP_PASS, "Please enter the password for this user:");
+ else
+ pass = NULL;
+ dialog_clear();
+ return pass ? RET_SUCCESS : RET_FAIL;
+}
+
+/* Set CPIO verbosity level */
+int
+mediaSetCPIOVerbosity(char *str)
+{
+ char *cp = variable_get(VAR_CPIO_VERBOSITY);
+
+ if (!cp) {
+ dialog_clear();
+ msgConfirm("CPIO Verbosity is not set to anything!");
+ return RET_FAIL;
+ }
+ else {
+ if (!strcmp(cp, "low"))
+ variable_set2(VAR_CPIO_VERBOSITY, "medium");
+ else if (!strcmp(cp, "medium"))
+ variable_set2(VAR_CPIO_VERBOSITY, "high");
+ else /* must be "high" - wrap around */
+ variable_set2(VAR_CPIO_VERBOSITY, "low");
+ }
+ return RET_SUCCESS;
+}
diff --git a/usr.sbin/sysinstall/menus.c b/usr.sbin/sysinstall/menus.c
index 87213fd..017bb268 100644
--- a/usr.sbin/sysinstall/menus.c
+++ b/usr.sbin/sysinstall/menus.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: menus.c,v 1.42.2.3 1995/07/27 01:37:18 jkh Exp $
+ * $Id: menus.c,v 1.43 1995/09/18 16:52:32 peter Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -53,81 +53,118 @@
/* The initial installation menu */
DMenu MenuInitial = {
DMENU_NORMAL_TYPE,
- "Welcome to FreeBSD RELEASE_NAME!", /* title */
+ "Welcome to FreeBSD!", /* title */
"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].", /* prompt */
- "Press F1 for usage instructions", /* help line */
- "usage.hlp", /* help file */
- { { "Usage", "Quick start - How to use this menu system.", /* U */
- DMENU_DISPLAY_FILE, "usage.hlp", 0, 0 },
- { "Doc", "More detailed documentation on FreeBSD.", /* D */
+ "Press F1 for usage instructions", /* help line */
+ "usage", /* help file */
+{ { "Usage", "Quick start - How to use this menu system", /* U */
+ DMENU_DISPLAY_FILE, "usage", 0, 0 },
+ { "Doc", "More detailed documentation on FreeBSD", /* D */
DMENU_SUBMENU, &MenuDocumentation, 0, 0 },
- { "Options", "Select various options for this utility.", /* O */
- DMENU_SUBMENU, &MenuOptions, 0, 0 },
- { "Custom", "Begin a custom installation", /* C */
+ { "Options", "Go to options editor", /* O */
+ DMENU_CALL, optionsEditor, 0, 0 },
+ { "Novice", "Begin a novice installation (for beginners)", /* N */
+ DMENU_CALL, installNovice, 0, 0 },
+ { "Express", "Begin a quick installation (for the impatient)", /* E */
+ DMENU_CALL, installExpress, 0, 0 },
+ { "Custom", "Begin a custom installation (for experts)", /* C */
DMENU_SUBMENU, &MenuInstallCustom, 0, 0 },
- { "Express", "Begin a quick installation", /* E */
- DMENU_CALL, &installExpress, 0, 0 },
- { "Shell", "Go to a shell for debugging or repair",
- DMENU_SYSTEM_COMMAND, "sh", 0, 0 },
- { "Quit", "Exit this menu (and the installation)", /* Q */
+ { "Fixit", "Mount fixit floppy and go into repair mode", /* F */
+ DMENU_CALL, installFixit, 0, 0 },
+ { "Upgrade", "Upgrade an existing 2.0.5 system", /* U */
+ DMENU_CALL, installUpgrade, 0, 0 },
+ { "Configure", "Do post-install configuration of FreeBSD", /* C (dup) */
+ DMENU_SUBMENU, &MenuConfigure, 0, 0 },
+ { "Quit", "Exit this menu (and the installation)", /* Q */
DMENU_CANCEL, NULL, 0, 0 },
- { NULL } },
+ { "Load", "Load a pre-configuration file from floppy",
+ DMENU_CALL, installPreconfig, 0, },
+ { NULL } },
};
/* The main documentation menu */
DMenu MenuDocumentation = {
- DMENU_NORMAL_TYPE,
- "Documentation for FreeBSD RELEASE_NAME", /* Title */
- "If you are at all unsure about the configuration of your hardware\n\
+DMENU_NORMAL_TYPE,
+"Documentation for FreeBSD " RELEASE_NAME, /* Title */
+"If you are at all unsure about the configuration of your hardware\n\
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.",
- "Confused? Press F1 for help.",
- "usage.hlp",
- { { "README", "Read this for a general description of FreeBSD",
- DMENU_DISPLAY_FILE, "README", 0, 0 },
- { "Hardware", "The FreeBSD survival guide for PC hardware.",
- DMENU_DISPLAY_FILE, "hardware.hlp", 0, 0 },
- { "Install", "A step-by-step guide to installing FreeBSD.",
- DMENU_DISPLAY_FILE, "install.hlp", 0, 0 },
- { "Copyright", "The FreeBSD Copyright notices.",
+"Confused? Press F1 for help.",
+"usage",
+{ { "README", "Read this for a general description of FreeBSD",
+ DMENU_DISPLAY_FILE, "readme", 0, 0 },
+ { "Hardware", "The FreeBSD survival guide for PC hardware.",
+ DMENU_DISPLAY_FILE, "hardware", 0, 0 },
+ { "Install", "A step-by-step guide to installing FreeBSD.",
+ DMENU_DISPLAY_FILE, "install", 0, 0 },
+ { "Copyright", "The FreeBSD Copyright notices.",
DMENU_DISPLAY_FILE, "COPYRIGHT", 0, 0 },
- { "Release", "The release notes for this version of FreeBSD.",
- DMENU_DISPLAY_FILE, "RELNOTES", 0, 0 },
- { "Exit", "Exit this menu (returning to previous)",
+ { "Release", "The release notes for this version of FreeBSD.",
+ DMENU_DISPLAY_FILE, "relnotes", 0, 0 },
+ { "HTML Docs", "Go to the HTML documentation menu (post-install).",
+ DMENU_CALL, docBrowser, 0, 0 },
+ { "Exit", "Exit this menu (returning to previous)",
DMENU_CANCEL, NULL, 0, 0 },
- { NULL } },
+ { NULL } },
+};
+
+DMenu MenuMouse = {
+DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
+"Please select your mouse type from the following menu",
+"There are many different types of mice currently on the market,\n\
+but this configuration menu should at least narrow down the choices\n\
+somewhat. Once you've selected one of the below, you can specify\n\
+/dev/mouse as your mouse device when running the XFree86 configuration\n\
+utility (see Configuration menu). Please note that for PS/2 mice,\n\
+a kernel recompile is also required! See the handbook for more details\n\
+on building a kernel.",
+"For more information, visit the Documentation menu",
+NULL,
+{ { "COM1", "Serial mouse on COM1",
+ DMENU_SYSTEM_COMMAND, "ln -fs /dev/cuaa0 /dev/mouse", 0, 0 },
+ { "COM2", "Serial mouse on COM2",
+ DMENU_SYSTEM_COMMAND, "ln -fs /dev/cuaa1 /dev/mouse", 0, 0 },
+ { "COM3", "Serial mouse on COM3",
+ DMENU_SYSTEM_COMMAND, "ln -fs /dev/cuaa2 /dev/mouse", 0, 0 },
+ { "COM4", "Serial mouse on COM4",
+ DMENU_SYSTEM_COMMAND, "ln -fs /dev/cuaa3 /dev/mouse", 0, 0 },
+ { "BusMouse", "Logitech or ATI bus mouse",
+ DMENU_SYSTEM_COMMAND, "ln -fs /dev/mse0 /dev/mouse", 0, 0 },
+ { "PS/2", "PS/2 style mouse (requires new kernel)",
+ DMENU_SYSTEM_COMMAND, "ln -fs /dev/psm0 /dev/mouse", 0, 0 },
+ { NULL } },
};
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 RELEASE_NAME distribution. If you are seeing this menu it is because\n\
+DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
+"Choose a CDROM type",
+"FreeBSD can be installed directly from a CDROM containing a valid\n\
+FreeBSD 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",
- { { NULL } },
+"Press F1 to read the installation guide",
+"install",
+{ { NULL } },
};
DMenu MenuMediaFloppy = {
- DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
- "Choose a Floppy drive",
+DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
+"Choose a Floppy drive",
"You have more than one floppy drive. Please chose the drive\n\
you would like to use for this operation",
- NULL,
- NULL,
- { { NULL } },
+NULL,
+NULL,
+{ { NULL } },
};
DMenu MenuMediaDOS = {
- DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
- "Choose a DOS partition",
+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 have copied the relevant\n\
distributions into your DOS partition before starting this\n\
@@ -136,182 +173,191 @@ 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 } },
+"Press F1 to read the installation guide",
+"install",
+{ { NULL } },
};
DMenu MenuMediaFTP = {
- DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
- "Please specify an FTP site",
- "FreeBSD is distributed from a number of sites on the Internet. Please\n\
-select the site closest to you or \"other\" if you'd like to specify another\n\
-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 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/RELEASE_NAME", 0, 0 },
- { "Secondary Site", "freefall.cdrom.com",
- DMENU_SET_VARIABLE, "ftp=ftp://freefall.cdrom.com/pub/FreeBSD/RELEASE_NAME", 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/RELEASE_NAME", 0, 0 },
- { "Finland", "nic.funet.fi",
- DMENU_SET_VARIABLE, "ftp=ftp://nic.funet.fi/pub/unix/FreeBSD/RELEASE_NAME", 0, 0 },
- { "France", "ftp.ibp.fr",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.ibp.fr/pub/FreeBSD/RELEASE_NAME", 0, 0 },
- { "Germany", "ftp.fb9dv.uni-duisburg.de",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.fb9dv.uni-duisburg.de/pub/unix/FreeBSD/RELEASE_NAME", 0, 0 },
- { "Germany #2", "gil.physik.rwth-aachen.de",
- DMENU_SET_VARIABLE, "ftp=ftp://gil.physik.rwth-aachen.de/pub/FreeBSD/RELEASE_NAME", 0, 0 },
- { "Germany #3", "ftp.uni-paderborn.de",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.uni-paderborn.de/freebsd/RELEASE_NAME", 0, 0 },
- { "Hong Kong", "ftp.hk.super.net",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.hk.super.net/pub/FreeBSD/RELEASE_NAME", 0, 0 },
- { "Israel", "orgchem.weizmann.ac.il",
- DMENU_SET_VARIABLE, "ftp=ftp://orgchem.weizmann.ac.il/pub/FreeBSD-RELEASE_NAME", 0, 0 },
- { "Japan", "ftp.sra.co.jp",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.sra.co.jp/pub/os/FreeBSD/RELEASE_NAME", 0, 0 },
- { "Japan #2", "ftp.mei.co.jp",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.mei.co.jp/free/PC-UNIX/FreeBSD/RELEASE_NAME", 0, 0 },
- { "Japan #3", "ftp.waseda.ac.jp",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.waseda.ac.jp/pub/FreeBSD/RELEASE_NAME", 0, 0 },
- { "Japan #4", "ftp.pu-toyama.ac.jp",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.pu-toyama.ac.jp/pub/FreeBSD/RELEASE_NAME", 0, 0 },
- { "Japan #5", "ftpsv1.u-aizu.ac.jp",
- DMENU_SET_VARIABLE, "ftp=ftp://ftpsv1.u-aizu.ac.jp/pub/os/FreeBSD/RELEASE_NAME", 0, 0 },
- { "Japan #6", "ftp.tut.ac.jp",
- DMENU_SET_VARIABLE, "ftp://ftp.tut.ac.jp/FreeBSD/RELEASE_NAME", 0, 0 },
- { "Japan #7", "ftp.ee.uec.ac.jp",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.ee.uec.ac.jp/pub/os/mirror/ftp.freebsd.org/RELEASE_NAME", 0, 0 },
- { "Japan #8", "ftp.tokyonet.ad.jp",
- DMENU_SET_VARIABLE, "ftp://ftp.tokyonet.ad.jp/pub/FreeBSD/RELEASE_NAME", 0, 0 },
- { "Korea", "ftp.cau.ac.kr",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.cau.ac.kr/pub/FreeBSD/RELEASE_NAME", 0, 0 },
- { "Netherlands", "ftp.nl.net",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.nl.net/pub/os/FreeBSD/RELEASE_NAME", 0, 0 },
- { "Russia", "ftp.kiae.su",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.kiae.su/FreeBSD/RELEASE_NAME", 0, 0 },
- { "Sweden", "ftp.luth.se",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.luth.se/pub/FreeBSD/RELEASE_NAME", 0, 0 },
- { "Taiwan", "netbsd.csie.nctu.edu.tw",
- DMENU_SET_VARIABLE, "ftp=ftp://netbsd.csie.nctu.edu.tw/pub/FreeBSD/RELEASE_NAME", 0, 0 },
- { "Thailand", "ftp.nectec.or.th",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.nectec.or.th/pub/FreeBSD/RELEASE_NAME", 0, 0 },
- { "UK", "ftp.demon.co.uk",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.demon.co.uk/pub/BSD/FreeBSD/RELEASE_NAME", 0, 0 },
- { "UK #2", "src.doc.ic.ac.uk",
- DMENU_SET_VARIABLE, "ftp=ftp://src.doc.ic.ac.uk/packages/unix/FreeBSD/RELEASE_NAME", 0, 0 },
- { "UK #3", "unix.hensa.ac.uk",
- DMENU_SET_VARIABLE, "ftp=ftp://unix.hensa.ac.uk/mirrors/walnut.creek/FreeBSD/RELEASE_NAME", 0, 0 },
- { "USA", "ref.tfs.com",
- DMENU_SET_VARIABLE, "ftp=ftp://ref.tfs.com/pub/FreeBSD/RELEASE_NAME", 0, 0 },
- { "USA #2", "ftp.dataplex.net",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.dataplex.net/pub/FreeBSD/RELEASE_NAME", 0, 0 },
- { "USA #3", "kryten.atinc.com",
- DMENU_SET_VARIABLE, "ftp=ftp://kryten.atinc.com/pub/FreeBSD/RELEASE_NAME", 0, 0 },
- { "USA #4", "ftp.neosoft.com",
- DMENU_SET_VARIABLE, "ftp=ftp://ftp.neosoft.com/systems/FreeBSD/RELEASE_NAME", 0, 0 },
- { NULL } }
+DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
+"Please select a FreeBSD FTP distribution site",
+"Please select the site closest to you or \"other\" if you'd like to\n\
+specify a different choice. Also note that not every site listed here\n\
+carries more than the base distribution kits. Only the Primary site is\n\
+guaranteed to carry the full range of possible distributions.",
+"Select a site that's close!",
+"install",
+{ { "Primary Site", "ftp.freebsd.org",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://ftp.freebsd.org/pub/FreeBSD/", 0, 0 },
+ { "Other", "Specify some other ftp site by URL",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=other", 0, 0 },
+ { "Australia", "ftp.physics.usyd.edu.au",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://ftp.physics.usyd.edu.au/FreeBSD/", 0, 0 },
+ { "Australia #2", "minnie.cs.adfa.oz.au",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://minnie.cs.adfa.oz.au/FreeBSD/", 0, 0 },
+ { "Canada", "ftp.synapse.net",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://ftp.synapse.net/contrib/FreeBSD/", 0, 0 },
+ { "Finland", "nic.funet.fi",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://nic.funet.fi/pub/unix/FreeBSD/", 0, 0 },
+ { "France", "ftp.ibp.fr",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://ftp.ibp.fr/pub/FreeBSD/", 0, 0 },
+ { "Germany", "ftp.fb9dv.uni-duisburg.de",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://ftp.fb9dv.uni-duisburg.de/pub/unix/FreeBSD/", 0, 0 },
+ { "Germany #2", "gil.physik.rwth-aachen.de",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://gil.physik.rwth-aachen.de/pub/FreeBSD/", 0, 0 },
+ { "Germany #3", "ftp.uni-paderborn.de",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://ftp.uni-paderborn.de/freebsd/", 0, 0 },
+ { "Germany #4", "ftp.leo.org",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://ftp.leo.org/pub/comp/os/bsd/FreeBSD/", 0, 0 },
+ { "Germany #5", "ftp.tu-dresden.de",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://ftp.tu-dresden.de/pub/soft/unix/bsd/FreeBSD/", 0, 0 },
+ { "Hong Kong", "ftp.hk.super.net",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://ftp.hk.super.net/pub/FreeBSD/", 0, 0 },
+ { "Ireland", "ftp.internet-eireann.ie",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://ftp.internet-eireann.ie/pub/FreeBSD/", 0, 0 },
+ { "Israel", "orgchem.weizmann.ac.il",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://orgchem.weizmann.ac.il/pub/FreeBSD/", 0, 0 },
+ { "Japan", "ftp.tokyonet.ad.jp",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://ftp.tokyonet.ad.jp/pub/FreeBSD/", 0, 0 },
+ { "Japan #2", "ftp.nisiq.net",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://ftp.nisiq.net/pub/os/FreeBSD/", 0, 0 },
+ { "Japan #3", "ftp.iij.ad.jp",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://ftp.iij.ad.jp/pub/FreeBSD/", 0, 0 },
+ { "Japan #4", "ftp.kuis.kyoto-u.ac.jp",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://ftp.kuis.kyoto-u.ac.jp/BSD/FreeBSD/", 0, 0 },
+ { "Japan #5", "ftp.ee.uec.ac.jp",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://ftp.ee.uec.ac.jp/pub/os/mirror/ftp.freebsd.org/", 0, 0 },
+ { "Japan #6", "ftp.u-aizu.ac.jp",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://ftp.u-aizu.ac.jp/pub/os/FreeBSD/", 0, 0 },
+ { "Korea", "ftp.cau.ac.kr",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://ftp.cau.ac.kr/pub/FreeBSD/", 0, 0 },
+ { "Netherlands", "ftp.nl.net",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://ftp.nl.net/pub/os/FreeBSD/", 0, 0 },
+ { "Poland", "SunSITE.icm.edu.pl",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://SunSITE.icm.edu.pl/pub/FreeBSD/", 0, 0 },
+ { "Russia", "ftp.kiae.su",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://ftp.kiae.su/FreeBSD/", 0, 0 },
+ { "Sweden", "ftp.luth.se",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://ftp.luth.se/pub/FreeBSD/", 0, 0 },
+ { "Taiwan", "NCTUCCCA.edu.tw",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://NCTUCCCA.edu.tw/Operating-Systems/FreeBSD", 0, 0 },
+ { "Taiwan #2", "netbsd.csie.nctu.edu.tw",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://netbsd.csie.nctu.edu.tw/pub/FreeBSD/", 0, 0 },
+ { "Thailand", "ftp.nectec.or.th",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://ftp.nectec.or.th/pub/mirrors/FreeBSD/", 0, 0 },
+ { "UK", "ftp.demon.co.uk",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://ftp.demon.co.uk/pub/BSD/FreeBSD/", 0, 0 },
+ { "UK #2", "src.doc.ic.ac.uk",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://src.doc.ic.ac.uk/packages/unix/FreeBSD/", 0, 0 },
+ { "UK #3", "unix.hensa.ac.uk",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://unix.hensa.ac.uk/mirrors/walnut.creek/FreeBSD/", 0, 0 },
+ { "USA", "ref.tfs.com",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://ref.tfs.com/pub/FreeBSD/", 0, 0 },
+ { "USA #2", "ftp.dataplex.net",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://ftp.dataplex.net/pub/FreeBSD/", 0, 0 },
+ { "USA #3", "kryten.atinc.com",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://kryten.atinc.com/pub/FreeBSD/", 0, 0 },
+ { "USA #4", "ftp.neosoft.com",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://ftp.neosoft.com/systems/FreeBSD/", 0, 0 },
+ { "USA #5", "ftp.cybernetics.net",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://ftp.cybernetics.net/pub/FreeBSD/", 0, 0 },
+ { "USA #6", "ftp.cps.cmich.edu",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://ftp.cps.cmich.edu/pub/ftp.freebsd.org/", 0, 0 },
+ { "USA #7", "ftp.cslab.vt.edu",
+ DMENU_SET_VARIABLE, VAR_FTP_PATH "=ftp://ftp.cslab.vt.edu/pub/FreeBSD/", 0, 0 },
+ { NULL } }
};
DMenu MenuMediaTape = {
- DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
- "Choose a tape drive type",
- "FreeBSD can be installed from tape drive, though this installation\n\
+DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
+"Choose a tape drive type",
+"FreeBSD can be installed from tape drive, though this installation\n\
method requires a certain amount of temporary storage in addition\n\
to the space required by the distribution itself (tape drives make\n\
poor random-access devices, so we extract _everything_ on the tape\n\
in one pass). If you have sufficient space for this, then you should\n\
select one of the following tape devices detected on your system.",
- "Press F1 to read the installation guide",
- "install.hlp",
- { { NULL } },
+"Press F1 to read the installation guide",
+"install",
+{ { NULL } },
};
DMenu MenuNetworkDevice = {
- DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
- "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\
+DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
+"Network interface information required",
+"If you are using PPP over a serial device (cuaa0 or cuaa1) as opposed\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\
-To use PPP select one of the serial devices, otherwise select lp0 for\n\
+To use PPP, select one of the serial devices, otherwise select lp0 for\n\
the parallel port or one of the ethernet controllers (if you have one)\n\
for an ethernet installation.",
- "Press F1 to read network configuration manual",
- "network_device.hlp",
- { { NULL } },
+"Press F1 to read network configuration manual",
+"network_device",
+{ { NULL } },
};
/* The media selection menu */
DMenu MenuMedia = {
- DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
- "Choose Installation Media",
- "FreeBSD can be installed from a variety of different installation\n\
-media, ranging from floppies to the Internet. If you're installing\n\
-FreeBSD from a supported CDROM drive then this is generally the best\n\
-media to use, unless you have some overriding reason for using another\n\
+DMENU_NORMAL_TYPE,
+"Choose Installation Media",
+"FreeBSD can be installed from a variety of different installation\n\
+media, ranging from floppies to an Internet FTP server. If you're\n\
+installing FreeBSD from a supported CDROM drive then this is generally\n\
+the best media to use if you have no overriding reason for using other\n\
media.",
- "Press F1 for more information on the various media types",
- "media.hlp",
- { { "CDROM", "Install from a FreeBSD CDROM",
+"Press F1 for more information on the various media types",
+"media",
+{ { "CDROM", "Install from a FreeBSD CDROM",
DMENU_CALL, mediaSetCDROM, 0, 0 },
- { "DOS", "Install from a DOS partition",
+ { "DOS", "Install from a DOS partition",
DMENU_CALL, mediaSetDOS, 0, 0 },
- { "File System", "Install from a mounted filesystem",
+ { "File System", "Install from an existing filesystem",
DMENU_CALL, mediaSetUFS, 0, 0 },
- { "Floppy", "Install from a floppy disk set",
+ { "Floppy", "Install from a floppy disk set",
DMENU_CALL, mediaSetFloppy, 0, 0 },
- { "FTP Active", "Install from an FTP server in active mode",
+ { "FTP", "Install from an FTP server",
DMENU_CALL, mediaSetFTPActive, 0, 0 },
- { "FTP Passive", "Install from an FTP server in passive mode",
+ { "FTP Passive", "Install from an FTP server through a firewall",
DMENU_CALL, mediaSetFTPPassive, 0, 0 },
- { "NFS", "Install over NFS",
+ { "NFS", "Install over NFS",
DMENU_CALL, mediaSetNFS, 0, 0 },
- { "Tape", "Install from SCSI or QIC tape",
+ { "Tape", "Install from SCSI or QIC tape",
DMENU_CALL, mediaSetTape, 0, 0 },
- { NULL } },
+ { NULL } },
};
-/* The installation type menu */
-DMenu MenuInstallType = {
- DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
- "Choose Installation Type",
- "As a convenience, we provide several \"canned\" installation types.\n\
+/* The distributions menu */
+DMenu MenuDistributions = {
+DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
+"Choose Distributions",
+"As a convenience, we provide several \"canned\" distribution sets.\n\
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\".",
- "Press F1 for more information on these options.",
- "distributions.hlp",
- { { "Developer", "Full sources, binaries and doc but no games [171MB]",
+the list of distributions yourself, simply select \"Custom\".",
+"Press F1 for more information on these options.",
+"distributions",
+{ { "Developer", "Full sources, binaries and doc but no games [180MB]",
DMENU_CALL, distSetDeveloper, 0, 0 },
- { "X-Developer", "Same as above, but includes XFree86 [196MB]",
+ { "X-Developer", "Same as above, but includes XFree86 [201MB]",
DMENU_CALL, distSetXDeveloper, 0, 0 },
- { "Kern-Developer", "Full binaries and doc, kernel sources only [35MB]",
+ { "Kern-Developer", "Full binaries and doc, kernel sources only [70MB]",
DMENU_CALL, distSetKernDeveloper, 0, 0 },
- { "User", "Average user - binaries and doc but no sources [19MB]",
+ { "User", "Average user - binaries and doc but no sources [52MB]",
DMENU_CALL, distSetUser, 0, 0 },
- { "X-User", "Same as above, but includes XFree86 [45MB]",
+ { "X-User", "Same as above, but includes XFree86 [52MB]",
DMENU_CALL, distSetXUser, 0, 0 },
- { "Minimal", "The smallest configuration possible [15MB]",
+ { "Minimal", "The smallest configuration possible [44MB]",
DMENU_CALL, distSetMinimum, 0, 0 },
- { "Everything", "All sources, binaries and XFree86 binaries [203MB]",
+ { "Everything", "All sources, binaries and XFree86 binaries [700MB]",
DMENU_CALL, distSetEverything, 0, 0 },
- { "Custom", "Specify your own distribution set [?]",
- DMENU_SUBMENU, &MenuDistributions, 0, 0 },
- { "Clear", "Reset selected distribution list to None",
+ { "Custom", "Specify your own distribution set [?]",
+ DMENU_SUBMENU, &MenuSubDistributions, 0, 0 },
+ { "Clear", "Reset selected distribution list to None",
DMENU_CALL, distReset, 0, 0 },
- { NULL } },
+ { NULL } },
};
static char *
@@ -332,7 +378,7 @@ x11FlagCheck(DMenuItem *item)
return (Dists & DIST_XF86) ? "ON" : "OFF";
}
-DMenu MenuDistributions = {
+DMenu MenuSubDistributions = {
DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS,
"Select the distributions you wish to install.",
"Please check off the distributions you wish to install. At the\n\
@@ -340,94 +386,96 @@ 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]",
+{ { "bin", "Binary base distribution (required) [36MB]",
DMENU_SET_FLAG, &Dists, DIST_BIN, 0, dmenuFlagCheck },
- { "commercial", "Commercial demos and shareware [10MB]",
+ { "commercial", "Commercial demos and shareware [10MB]",
DMENU_SET_FLAG, &Dists, DIST_COMMERCIAL, 0, dmenuFlagCheck },
- { "compat1x", "FreeBSD 1.x binary compatibility package [2MB]",
+ { "compat1x", "FreeBSD 1.x binary compatibility package [2MB]",
DMENU_SET_FLAG, &Dists, DIST_COMPAT1X, 0, dmenuFlagCheck },
- { "compat20", "FreeBSD 2.0 binary compatibility package [2MB]",
+ { "compat20", "FreeBSD 2.0 binary compatibility package [2MB]",
DMENU_SET_FLAG, &Dists, DIST_COMPAT20, 0, dmenuFlagCheck },
- { "DES", "DES encryption code - NOT FOR EXPORT! [.3MB]",
+ { "DES", "DES encryption code - NOT FOR EXPORT! [.3MB]",
DMENU_CALL, distSetDES, 0, 0, DESFlagCheck },
- { "dict", "Spelling checker dictionary files [4.2MB]",
+ { "dict", "Spelling checker dictionary files [4.2MB]",
DMENU_SET_FLAG, &Dists, DIST_DICT, 0, dmenuFlagCheck },
- { "games", "Games (non-commercial) [6.4MB]",
+ { "games", "Games (non-commercial) [6.4MB]",
DMENU_SET_FLAG, &Dists, DIST_GAMES, 0, dmenuFlagCheck },
- { "info", "GNU info files [4.1MB]",
+ { "info", "GNU info files [4.1MB]",
DMENU_SET_FLAG, &Dists, DIST_INFO, 0, dmenuFlagCheck },
- { "man", "System manual pages - recommended [3.3MB]",
+ { "man", "System manual pages - recommended [3.3MB]",
DMENU_SET_FLAG, &Dists, DIST_MANPAGES, 0, dmenuFlagCheck },
- { "proflibs", "Profiled versions of the libraries [3.3MB]",
+ { "proflibs", "Profiled versions of the libraries [3.3MB]",
DMENU_SET_FLAG, &Dists, DIST_PROFLIBS, 0, dmenuFlagCheck },
- { "src", "Sources for everything but DES [120MB]",
+ { "src", "Sources for everything but DES [120MB]",
DMENU_CALL, distSetSrc, 0, 0, srcFlagCheck },
- { "XFree86", "The XFree86 3.1.1u1 distribution [?]",
+ { "XFree86", "The XFree86 3.1.2-S distribution",
DMENU_CALL, distSetXF86, 0, 0, x11FlagCheck },
- { "Experimental", "Work in progress!",
+ { "Experimental", "Work in progress!",
DMENU_SET_FLAG, &Dists, DIST_EXPERIMENTAL, 0, dmenuFlagCheck },
- { NULL } },
+ { 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\
+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]",
+NULL,
+NULL,
+{ { "des", "Basic DES services (rlogin, init, etc) [1MB]",
DMENU_SET_FLAG, &DESDists, DIST_DES_DES, 0, dmenuFlagCheck },
- { "krb", "Kerberos encryption services [2MB]",
+ { "krb", "Kerberos encryption services [2MB]",
DMENU_SET_FLAG, &DESDists, DIST_DES_KERBEROS, 0, dmenuFlagCheck },
- { "sebones", "Sources for eBones (Kerberos) [1MB]",
+ { "sebones", "Sources for eBones (Kerberos) [1MB]",
DMENU_SET_FLAG, &DESDists, DIST_DES_SEBONES, 0, dmenuFlagCheck },
- { "ssecure", "Sources for DES libs and utilities [1MB]",
+ { "ssecure", "Sources for DES libs and utilities [1MB]",
DMENU_SET_FLAG, &DESDists, DIST_DES_SSECURE, 0, dmenuFlagCheck },
- { NULL } },
+ { NULL } },
};
-
+
DMenu MenuSrcDistributions = {
- DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS,
- "Select the sub-components of src you wish to install.",
- "Please check off those portions of the FreeBSD source tree\n\
+DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS,
+"Select the sub-components of src you wish to install.",
+"Please check off those portions of the FreeBSD source tree\n\
you wish to install.",
- NULL,
- NULL,
- { { "base", "top-level files in /usr/src [300K]",
+NULL,
+NULL,
+{ { "base", "top-level files in /usr/src [300K]",
DMENU_SET_FLAG, &SrcDists, DIST_SRC_BASE, 0, dmenuFlagCheck },
- { "gnu", "/usr/src/gnu (software from the GNU Project) [42MB]",
+ { "gnu", "/usr/src/gnu (software from the GNU Project) [42MB]",
DMENU_SET_FLAG, &SrcDists, DIST_SRC_GNU, 0, dmenuFlagCheck },
- { "etc", "/usr/src/etc (miscellaneous system files) [460K]",
+ { "etc", "/usr/src/etc (miscellaneous system files) [460K]",
DMENU_SET_FLAG, &SrcDists, DIST_SRC_ETC, 0, dmenuFlagCheck },
- { "games", "/usr/src/games (diversions) [7.8MB]",
+ { "games", "/usr/src/games (diversions) [7.8MB]",
DMENU_SET_FLAG, &SrcDists, DIST_SRC_GAMES, 0, dmenuFlagCheck },
- { "include", "/usr/src/include (header files) [467K]",
+ { "include", "/usr/src/include (header files) [467K]",
DMENU_SET_FLAG, &SrcDists, DIST_SRC_INCLUDE, 0, dmenuFlagCheck },
- { "lib", "/usr/src/lib (system libraries) [9.2MB]",
+ { "lib", "/usr/src/lib (system libraries) [9.2MB]",
DMENU_SET_FLAG, &SrcDists, DIST_SRC_LIB, 0, dmenuFlagCheck },
- { "libexec", "/usr/src/libexec (system programs) [1.2MB]",
+ { "libexec", "/usr/src/libexec (system programs) [1.2MB]",
DMENU_SET_FLAG, &SrcDists, DIST_SRC_LIBEXEC, 0, dmenuFlagCheck },
- { "lkm", "/usr/src/lkm (Loadable Kernel Modules) [193K]",
+ { "lkm", "/usr/src/lkm (Loadable Kernel Modules) [193K]",
DMENU_SET_FLAG, &SrcDists, DIST_SRC_LKM, 0, dmenuFlagCheck },
- { "release", "/usr/src/release (release-generation tools) [533K]",
+ { "release", "/usr/src/release (release-generation tools) [533K]",
DMENU_SET_FLAG, &SrcDists, DIST_SRC_RELEASE, 0, dmenuFlagCheck },
- { "bin", "/usr/src/bin (system binaries) [2.5MB]",
+ { "bin", "/usr/src/bin (system binaries) [2.5MB]",
DMENU_SET_FLAG, &SrcDists, DIST_SRC_BIN, 0, dmenuFlagCheck },
- { "sbin", "/usr/src/sbin (system binaries) [1.3MB]",
+ { "sbin", "/usr/src/sbin (system binaries) [1.3MB]",
DMENU_SET_FLAG, &SrcDists, DIST_SRC_SBIN, 0, dmenuFlagCheck },
- { "share", "/usr/src/share (documents and shared files) [10MB]",
+ { "share", "/usr/src/share (documents and shared files) [10MB]",
DMENU_SET_FLAG, &SrcDists, DIST_SRC_SHARE, 0, dmenuFlagCheck },
- { "sys", "/usr/src/sys (FreeBSD kernel) [13MB]",
+ { "sys", "/usr/src/sys (FreeBSD kernel) [13MB]",
DMENU_SET_FLAG, &SrcDists, DIST_SRC_SYS, 0, dmenuFlagCheck },
- { "ubin", "/usr/src/usr.bin (user binaries) [13MB]",
+ { "ubin", "/usr/src/usr.bin (user binaries) [13MB]",
DMENU_SET_FLAG, &SrcDists, DIST_SRC_UBIN, 0, dmenuFlagCheck },
- { "usbin", "/usr/src/usr.sbin (aux system binaries) [14MB]",
+ { "usbin", "/usr/src/usr.sbin (aux system binaries) [14MB]",
DMENU_SET_FLAG, &SrcDists, DIST_SRC_USBIN, 0, dmenuFlagCheck },
- { NULL } },
+ { "smailcf", "/usr/src/usr.sbin (sendmail config macros) [341K]",
+ DMENU_SET_FLAG, &SrcDists, DIST_SRC_SMAILCF, 0, dmenuFlagCheck },
+ { NULL } },
};
static int
@@ -442,67 +490,76 @@ clearx11(char *str)
DMenu MenuXF86Select = {
DMENU_NORMAL_TYPE,
- "XFree86 3.1.1u1 Distribution",
- "Please select the components you need from the XFree86 3.1.1u1\n\
+ "XFree86 3.1.2-S Distribution",
+ "Please select the components you need from the XFree86 3.1.2-S\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.",
+component 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)",
+ "XF86",
+{ { "Basic", "Basic component menu (required)",
DMENU_SUBMENU, &MenuXF86SelectCore, 0, 0 },
- { "Server", "X server menu",
+ { "Server", "X server menu",
DMENU_SUBMENU, &MenuXF86SelectServer, 0, 0 },
- { "Fonts", "Font set menu",
+ { "Fonts", "Font set menu",
DMENU_SUBMENU, &MenuXF86SelectFonts, 0, 0 },
- { "Clear", "Reset XFree86 distribution list",
- DMENU_CALL, clearx11, 0, 0, 0 },
- { "Exit", "Exit this menu (returning to previous)",
+ { "Exit", "Exit this menu (returning to previous)",
DMENU_CANCEL, NULL, 0, 0 },
- { NULL } },
+ { "Clear", "Reset XFree86 distribution list",
+ DMENU_CALL, clearx11, 0, 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.",
- "Press F1 to read the XFree86 release notes for FreeBSD",
- "XF86.hlp",
- { { "bin", "X client applications and shared libs [4MB].",
+"XFree86 3.1.2-S base distribution types",
+"Please check off the basic XFree86 components you wish to install.\n\
+Bin, lib, xicf, and xdcf are recommended for a minimum installaion.",
+"Press F1 to read the XFree86 release notes for FreeBSD",
+"XF86",
+{ { "bin", "Client applications and shared libs [4.1MB].",
DMENU_SET_FLAG, &XF86Dists, DIST_XF86_BIN, 0, dmenuFlagCheck },
- { "lib", "Data files needed at runtime [600K]",
+ { "lib", "Data files needed at runtime [750K]",
DMENU_SET_FLAG, &XF86Dists, DIST_XF86_LIB, 0, dmenuFlagCheck },
- { "xicf", "Customizable xinit runtime configuration file [100K]",
+ { "xicf", "Customizable xinit runtime configuration file [10K]",
DMENU_SET_FLAG, &XF86Dists, DIST_XF86_XINIT, 0, dmenuFlagCheck },
- { "xdcf", "Customizable xdm runtime configuration file [100K]",
+ { "xdcf", "Customizable xdm runtime configuration file [20K]",
DMENU_SET_FLAG, &XF86Dists, DIST_XF86_XDMCF, 0, dmenuFlagCheck },
- { "doc", "READMEs and XFree86 specific man pages [500K]",
+ { "etc", "Clock setting and diagnostic source codes [70K]",
+ DMENU_SET_FLAG, &XF86Dists, DIST_XF86_ETC, 0, dmenuFlagCheck },
+ { "doc", "READMEs and release notes [600K]",
DMENU_SET_FLAG, &XF86Dists, DIST_XF86_DOC, 0, dmenuFlagCheck },
- { "man", "Man pages (except XFree86 specific ones) [1.2MB]",
+ { "man", "Man pages [1.7MB]",
DMENU_SET_FLAG, &XF86Dists, DIST_XF86_MAN, 0, dmenuFlagCheck },
- { "prog", "Programmer's header and library files [4MB]",
+ { "ctrb", "Various contributed binaries (ico, xman, etc) [550K]",
+ DMENU_SET_FLAG, &XF86Dists, DIST_XF86_CTRB, 0, dmenuFlagCheck },
+ { "prog", "Programmer's header and library files [4.1MB]",
DMENU_SET_FLAG, &XF86Dists, DIST_XF86_PROG, 0, dmenuFlagCheck },
- { "link", "X Server reconfiguration kit [7.8MB]",
+ { "link", "Kit to reconfigure/rebuild X Servers [8.8MB]",
DMENU_SET_FLAG, &XF86Dists, DIST_XF86_LINK, 0, dmenuFlagCheck },
- { "pex", "PEX fonts and libs needed by PEX apps [500K]",
+ { "ubin", "rstart daemon [2K]",
+ DMENU_SET_FLAG, &XF86Dists, DIST_XF86_UBIN, 0, dmenuFlagCheck },
+ { "pex", "PEX fonts and libs needed by PEX apps [290K]",
DMENU_SET_FLAG, &XF86Dists, DIST_XF86_PEX, 0, dmenuFlagCheck },
- { "sources", "XFree86 3.1.1u1 standard + contrib sources [200MB]",
+ { "sources", "XFree86 3.1.2-S standard + contrib sources [200MB]",
DMENU_SET_FLAG, &XF86Dists, DIST_XF86_SRC, 0, dmenuFlagCheck },
- { NULL } },
+ { NULL } },
};
DMenu MenuXF86SelectFonts = {
- DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS,
- "Font distribution selection.",
- "Please check off the individual font distributions you wish to\n\
+DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS,
+"Font distribution selection.",
+"Please check off the individual font distributions you wish to\n\
install. At the minimum, you should install the standard\n\
75 DPI and misc fonts if you're also installing a server\n\
(these are selected by default).",
"Press F1 to read the XFree86 release notes for FreeBSD",
- "XF86.hlp",
+ "XF86",
{ { "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, dmenuFlagCheck },
+ { "fcyr", "Cyrillic Fonts [1.8MB]",
+ DMENU_SET_FLAG, &XF86FontDists, DIST_XF86_FONTS_CYR, 0, dmenuFlagCheck },
{ "fscl", "Speedo and Type scalable fonts [1.6MB]",
DMENU_SET_FLAG, &XF86FontDists, DIST_XF86_FONTS_SCALE, 0, dmenuFlagCheck },
{ "non", "Japanese, Chinese and other non-english fonts [3.3MB]",
@@ -520,30 +577,30 @@ If you are unsure as to which server will work for your graphics card,\n\
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]",
+ "XF86",
+ { { "SVGA", "Standard VGA or Super VGA display [2.8MB]",
DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_SVGA, 0, dmenuFlagCheck },
- { "VGA16", "Standard 16 color VGA display [1MB]",
+ { "VGA16", "Standard 16 color VGA display [1.3MB]",
DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_VGA16, 0, dmenuFlagCheck },
- { "Mono", "Standard Monochrome display [1MB]",
+ { "Mono", "Standard Monochrome display [1.3MB]",
DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_MONO, 0, dmenuFlagCheck },
- { "8514", "8-bit (256 color) IBM 8514 or compatible card [1MB]",
+ { "8514", "8-bit (256 color) IBM 8514 or compatible card [2.2MB]",
DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_8514, 0, dmenuFlagCheck },
- { "AGX", "8-bit AGX card [1MB]",
+ { "AGX", "8-bit AGX card [2.4MB]",
DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_AGX, 0, dmenuFlagCheck },
- { "Ma8", "8-bit ATI Mach8 card [1MB]",
+ { "Ma8", "8-bit ATI Mach8 card [2.3MB]",
DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_MACH8, 0, dmenuFlagCheck },
- { "Ma32", "8 and 16-bit (65K color) for ATI Mach32 card [1MB]",
+ { "Ma32", "8 and 16-bit (65K color) for ATI Mach32 card [2.4MB]",
DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_MACH32, 0, dmenuFlagCheck },
- { "Ma64", "8 and 16-bit (65K color) for ATI Mach64 card [1MB]",
+ { "Ma64", "8 and 16-bit (65K color) for ATI Mach64 card [2.5MB]",
DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_MACH64, 0, dmenuFlagCheck },
- { "P9K", "8, 16, and 24-bit color for Weitek P9000 based boards [1MB]",
+ { "P9K", "8, 16, and 24-bit color for Weitek P9000 based boards [2.5MB]",
DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_P9000, 0, dmenuFlagCheck },
- { "S3", "8, 16 and 24-bit color for S3 based boards [1MB]",
+ { "S3", "8, 16 and 24-bit color for S3 based boards [2.7MB]",
DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_S3, 0, dmenuFlagCheck },
- { "W32", "8-bit Color for ET4000/W32, /W32i and /W32p cards [1MB]",
+ { "W32", "8-bit Color for ET4000/W32, /W32i and /W32p cards [2.3MB]",
DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_W32, 0, dmenuFlagCheck },
- { "nest", "A nested server for testing purposes [1MB]",
+ { "nest", "A nested server for testing purposes [1.8MB]",
DMENU_SET_FLAG, &XF86ServerDists, DIST_XF86_SERVER_NEST, 0, dmenuFlagCheck },
{ NULL } },
};
@@ -551,88 +608,33 @@ Mono servers are particularly well-suited to most LCD displays).",
DMenu MenuDiskDevices = {
DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS,
"Select Drive(s)",
- "Please select the drive, or drives, on which you wish to install\n\
-FreeBSD. You need to select at least one drive containing some free\n\
-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\
+ "Please select the drive, or drives, on which you wish to perform\n\
+this operation. If you are attempting to install a boot partition\n\
+on a drive other than the first one or have multiple operating\n\
systems on your machine, you will have the option to install a boot\n\
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",
+ "Press F1 for important information regarding disk geometry!",
+ "drives",
{ { 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 (*((unsigned int *)item->ptr) & item->parm)
- return "ON";
- return "OFF";
-}
-
-/* The installation options menu */
-DMenu MenuOptions = {
- 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.",
- "Press F1 for more help on these options",
- "options.hlp",
- { { "FTP Options", "Set FTP specific options",
- DMENU_SUBMENU, &MenuFTPOptions, 0, 0, 0 },
- { "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_FLAG, &OptFlags, OPT_SLOW_ETHER, 0, dmenuFlagCheck },
- { "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 },
- { "Clear", "Clear All Option Flags",
- DMENU_CALL, clearFlags, 0, 0 },
- { "Exit", "Exit this menu (returning to previous)",
- DMENU_CANCEL, NULL, 0, 0 },
- { NULL } },
-};
-
-DMenu MenuFTPOptions = {
- DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS,
- "Choose FTP Options",
- "This menu allows you to customize the behavior of FTP transfers\n\
-for an FTP installation. To select \"Active\" or \"Passive\" mode\n\
-FTP, see the Media menu.",
- NULL,
- NULL,
- { { "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_FLAG, &OptFlags, OPT_FTP_RESELECT, 0, ftpFlagCheck },
- { "FTP userpass", "Specify username and password instead of anonymous",
- DMENU_CALL, mediaSetFtpUserPass, 0, 0, userPassCheck },
+DMenu MenuHTMLDoc = {
+ DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
+ "Select HTML Documentation pointer",
+ "Please select the body of documentation you're interested in, the main\n\
+ones right now being the FAQ and the Handbook. You can also chose \"other\"\n\
+to enter an arbitrary URL for browsing.",
+ "Press F1 for more help on what you see here.",
+ "html",
+ { { "Handbook", "The FreeBSD Handbook.",
+ DMENU_CALL, docShowDocument, 0, 0 },
+ { "FAQ", "The Frequently Asked Questions guide.",
+ DMENU_CALL, docShowDocument, 0, 0 },
+ { "Home", "The Home Pages for the FreeBSD Project (requires net)",
+ DMENU_CALL, docShowDocument, 0, 0 },
+ { "Other", "Enter a URL.",
+ DMENU_CALL, docShowDocument, 0, 0 },
{ NULL } },
};
@@ -644,23 +646,21 @@ DMenu MenuInstallCustom = {
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.",
"Press F1 to read the installation guide",
- "install.hlp",
- { { "Partition", "Allocate disk space for FreeBSD",
- DMENU_CALL, diskPartitionEditor, 0, 0 },
+ "install",
+ { { "Options", "Go to Options editor",
+ DMENU_CALL, optionsEditor, 0, 0 },
+ { "Partition", "Allocate disk space for FreeBSD",
+ DMENU_CALL, diskPartitionEditor, 0, 0 },
{ "Label", "Label allocated disk partitions",
DMENU_CALL, diskLabelEditor, 0, 0 },
- { "Distributions", "Choose the type of installation you want",
- DMENU_SUBMENU, &MenuInstallType, 0, 0 },
+ { "Distributions", "Select distribution(s) to extract",
+ DMENU_SUBMENU, &MenuDistributions, 0, 0 },
{ "Media", "Choose the installation media type",
DMENU_SUBMENU, &MenuMedia, 0, 0 },
- { "Extract", "Extract distributions from selected media",
- DMENU_CALL, distExtractAll, 0, 0 },
- { "Options", "Go to Options submenu",
- DMENU_SUBMENU, &MenuOptions, 0, 0 },
- { "Commit", "Do Write/Make/Extract options in one step",
+ { "Commit", "Perform any pending Partition/Label/Extract actions",
DMENU_CALL, installCommit, 0, 0 },
- { "Configure", "Do post-install configuration of FreeBSD",
- DMENU_SUBMENU, &MenuConfigure, 0, 0 },
+ { "Extract", "Just do distribution extract step",
+ DMENU_CALL, distExtractAll, 0, 0 },
{ "Exit", "Exit this menu (returning to previous)",
DMENU_CANCEL, NULL, 0, 0 },
{ NULL } },
@@ -669,20 +669,21 @@ to install it from and how you wish to allocate disk storage to FreeBSD.",
/* MBR type menu */
DMenu MenuMBRType = {
DMENU_RADIO_TYPE | DMENU_SELECTION_RETURNS,
- "Chose boot manager type", /* title */
- "FreeBSD comes with a boot selector that allows you to easily\n\
-select between FreeBSD and other operating systems on your machine\n\
-at boot time. If you have more than one drive and wish to boot\n\
-from other than the first, the boot selector will also allow you\n\
-to do so (limitations in the PC BIOS usually prevent this otherwise).\n\
-If you do not want a boot selector, or wish to replace an existing\n\
-one, select \"standard\". If you would prefer your Master Boot\n\
-Record to remain untouched, then select \"none\".",
+ "overwrite me", /* will be disk specific label */
+ "FreeBSD comes with a boot selector that allows you to easily\n"
+"select between FreeBSD and any other operating systems on your machine\n"
+"at boot time. If you have more than one drive and want to boot\n"
+"from the second one, the boot selector will also make it possible\n"
+"to do so (limitations in the PC BIOS usually prevent this otherwise).\n"
+"If you do not want a boot selector, or wish to replace an existing\n"
+"one, select \"standard\". If you would prefer your Master Boot\n"
+"Record to remain untouched then select \"none\". NOTE: PC-DOS users\n"
+"will almost certainly NOT want to select one!",
"Press F1 to read the installation guide",
- "install.hlp",
+ "install",
{ { "BootMgr", "Install the FreeBSD Boot Manager (\"Booteasy\")",
DMENU_SET_VALUE, &BootMgr, 0, 0, dmenuRadioCheck },
- { "Standard", "Use a standard MBR (no boot manager)",
+ { "Standard", "Install a standard MBR (no boot manager)",
DMENU_SET_VALUE, &BootMgr, 1, 0, dmenuRadioCheck },
{ "None", "Leave the Master Boot Record untouched",
DMENU_SET_VALUE, &BootMgr, 2, 0, dmenuRadioCheck },
@@ -693,26 +694,34 @@ Record to remain untouched, then select \"none\".",
DMenu MenuConfigure = {
DMENU_NORMAL_TYPE,
"FreeBSD Configuration Menu", /* title */
- "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\
+"If you've already installed FreeBSD, you may use this menu to customize\n\
+it somewhat to suit your particular configuration. Most importantly,\n\
+you can use the Packages utility to load extra \"3rd party\"\n\
software not provided in the base distributions.",
"Press F1 for more information on these options",
- "configure.hlp",
+ "configure",
{ { "Add User", "Add users to the system",
- DMENU_SYSTEM_COMMAND, "adduser -silent", 0, 0 },
+ DMENU_SYSTEM_COMMAND, "adduser -config_create ; adduser -s", 0, 0 },
{ "Console", "Customize system console behavior",
DMENU_SUBMENU, &MenuSyscons, 0, 0 },
- { "Networking", "Configure additional network services",
- DMENU_SUBMENU, &MenuNetworking, 0, 0 },
{ "Time Zone", "Set which time zone you're in",
DMENU_SYSTEM_COMMAND, "rm -f /etc/wall_cmos_clock /etc/localtime; tzsetup", 0, 0 },
- { "Packages", "Install extra FreeBSD packaged software",
+ { "Media", "Change the installation media type",
+ DMENU_SUBMENU, &MenuMedia, 0, 0 },
+ { "Mouse", "Select the type of mouse you have",
+ DMENU_SUBMENU, &MenuMouse, 0, 0 },
+ { "Networking", "Configure additional network services",
+ DMENU_SUBMENU, &MenuNetworking, 0, 0 },
+ { "Options", "Go to options editor.",
+ DMENU_CALL, optionsEditor, 0, 0 },
+ { "Packages", "Install pre-packaged software for FreeBSD",
DMENU_CALL, configPackages, 0, 0 },
- { "Ports", "Enable the FreeBSD Ports Collection from CD",
+ { "Ports", "Link to FreeBSD Ports Collection on CD/NFS",
DMENU_CALL, configPorts, 0, 1 },
{ "Root Password", "Set the system manager's password",
DMENU_SYSTEM_COMMAND, "passwd root", 0, 0 },
+ { "HTML Docs", "Go to the HTML documentation menu (post-install).",
+ DMENU_CALL, docBrowser, 0, 0 },
{ "XFree86", "Configure XFree86 (if installed)",
DMENU_SYSTEM_COMMAND, "/usr/X11R6/bin/xf86config", 0, 0 },
{ "Exit", "Exit this menu (returning to previous)",
@@ -720,119 +729,117 @@ software not provided in the base distributions.",
{ NULL } },
};
-static char *
-menuCheckNTP(DMenuItem *item)
-{
- return getenv("ntpdate") ? "ON" : "OFF";
-}
-
-static char *
-menuCheckRouted(DMenuItem *item)
-{
- return getenv("routedflags") ? "ON" : "OFF";
-}
-
DMenu MenuNetworking = {
- DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS,
+ DMENU_NORMAL_TYPE,
"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\
+"You may have already configured one network device (and the other\n\
+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.",
NULL,
NULL,
- { { "NFS client", "This machine will be an NFS client",
- 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, dmenuVarCheck },
- { "Interfaces", "Configure network interfaces",
- DMENU_CALL, tcpMenuSelect, 0, 0 },
- { "ntpdate", "Select a clock-syncronization server",
- DMENU_SUBMENU, &MenuNTP, 0, 0, menuCheckNTP },
- { "routed", "Set flags for routed (default: -q)",
- DMENU_CALL, configRoutedFlags, 0, 0, menuCheckRouted },
- { "rwhod", "This machine wants to run the rwho daemon",
- DMENU_SET_VARIABLE, "rwhod=YES", 0, 0, dmenuVarCheck },
- { "Exit", "Exit this menu (returning to previous)",
- DMENU_CANCEL, NULL, 0, 0 },
- { NULL } },
+{ { "Interfaces", "Configure additional network interfaces",
+ DMENU_CALL, tcpMenuSelect, 0, 0 },
+ { "NFS client", "This machine will be an NFS client",
+ DMENU_SET_VARIABLE, "nfs_client=YES", 0, 0, 0 },
+ { "NFS server", "This machine will be an NFS server",
+ DMENU_CALL, configNFSServer, 0, 0, 0 },
+ { "Gateway", "This machine will route packets between interfaces",
+ DMENU_SET_VARIABLE, "gateway=YES", 0, 0, 0 },
+ { "Gated", "This machine wants to run gated",
+ DMENU_CALL, configGated, 0, 0, 0 },
+ { "Ntpdate", "Select a clock-syncronization server",
+ DMENU_SUBMENU, &MenuNTP, (int)"ntpdate", 0, dmenuVarCheck },
+ { "Routed", "Set flags for routed (default: -q)",
+ DMENU_CALL, configRoutedFlags, (int)"routed", 0, dmenuVarCheck },
+ { "Rwhod", "This machine wants to run the rwho daemon",
+ DMENU_SET_VARIABLE, "rwhod=YES", 0, 0, dmenuVarCheck },
+ { "Anon FTP", "This machine wishes to allow anonymous FTP.",
+ DMENU_CALL, configAnonFTP, 0, 0, 0 },
+ { "WEB Server", "This machine wishes to be a WWW server.",
+ DMENU_CALL, configApache, 0, 0, 0 },
+ { "Samba", "Install Samba for LanManager (NETBUI) access.",
+ DMENU_CALL, configSamba, 0, 0, 0 },
+ { "PCNFSD", "Run authentication server for clients with PC-NFS.",
+ DMENU_CALL, configPCNFSD, 0, 0, 0 },
+ { NULL } },
};
DMenu MenuNTP = {
- DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
- "NTPDATE Server Selection",
- "There are a number of time syncronization servers available\n\
+DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
+"NTPDATE Server Selection",
+"There are a number of time syncronization servers available\n\
for public use around the Internet. Please select one reasonably\n\
close to you to have your system time syncronized accordingly.",
- "These are the primary open-access NTP servers",
- NULL,
- { { "Other", "Select a site not on this list",
+"These are the primary open-access NTP servers",
+NULL,
+{ { "Other", "Select a site not on this list",
DMENU_CALL, configNTP, 0, 0 },
- { "Australia", "ntp.syd.dms.csiro.au (HP 5061 Cesium Beam)",
+ { "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)",
+ { "Canada", "tick.usask.ca (GOES clock)",
DMENU_SET_VARIABLE, "ntpdate=tick.usask.ca", 0, 0 },
- { "France", "canon.inria.fr (TDF clock)",
+ { "France", "canon.inria.fr (TDF clock)",
DMENU_SET_VARIABLE, "ntpdate=canon.inria.fr", 0, 0 },
- { "Germany", "ntps1-{0,1,2}.uni-erlangen.de (GPS)",
+ { "Germany", "ntps1-{0,1,2}.uni-erlangen.de (GPS)",
DMENU_SET_VARIABLE, "ntpdate=ntps1-0.uni-erlangen.de", 0, 0 },
- { "Germany #2", "ntps1-0.cs.tu-berlin.de (GPS)",
+ { "Germany #2", "ntps1-0.cs.tu-berlin.de (GPS)",
DMENU_SET_VARIABLE, "ntpdate=ntps1-0.cs.tu-berlin.de", 0, 0 },
- { "Japan", "clock.nc.fukuoka-u.ac.jp (GPS clock)",
+ { "Japan", "clock.nc.fukuoka-u.ac.jp (GPS clock)",
DMENU_SET_VARIABLE, "ntpdate=clock.nc.fukuoka-u.ac.jp", 0, 0},
- { "Japan #2", "clock.tl.fukuoka-u.ac.jp (GPS clock)",
+ { "Japan #2", "clock.tl.fukuoka-u.ac.jp (GPS clock)",
DMENU_SET_VARIABLE, "ntpdate=clock.tl.fukuoka-u.ac.jp", 0, 0},
- { "Netherlands", "ntp0.nl.net (GPS clock)",
+ { "Netherlands", "ntp0.nl.net (GPS clock)",
DMENU_SET_VARIABLE, "ntpdate=ntp0.nl.net", 0, 0 },
- { "Norway", "timer.unik.no (NTP clock)",
+ { "Norway", "timer.unik.no (NTP clock)",
DMENU_SET_VARIABLE, "ntpdate=timer.unik.no", 0, 0 },
- { "Sweden", "Time1.Stupi.SE (Cesium/GPS)",
+ { "Sweden", "Time1.Stupi.SE (Cesium/GPS)",
DMENU_SET_VARIABLE, "ntpdate=Time1.Stupi.SE", 0, 0 },
- { "Switzerland", "swisstime.ethz.ch (DCF77 clock)",
+ { "Switzerland", "swisstime.ethz.ch (DCF77 clock)",
DMENU_SET_VARIABLE, "ntpdate=swisstime.ethz.ch", 0, 0 },
- { "U.S. East Coast", "bitsy.mit.edu (WWV clock)",
+ { "U.S. East Coast", "bitsy.mit.edu (WWV clock)",
DMENU_SET_VARIABLE, "ntpdate=bitsy.mit.edu", 0, 0 },
- { "U.S. East Coast #2", "otc1.psu.edu (WWV clock)",
+ { "U.S. East Coast #2", "otc1.psu.edu (WWV clock)",
DMENU_SET_VARIABLE, "ntpdate=otc1.psu.edu", 0, 0 },
- { "U.S. West Coast", "apple.com (WWV clock)",
+ { "U.S. West Coast", "apple.com (WWV clock)",
DMENU_SET_VARIABLE, "ntpdate=apple.com", 0, 0 },
- { "U.S. West Coast #2", "clepsydra.dec.com (GOES clock)",
+ { "U.S. West Coast #2", "clepsydra.dec.com (GOES clock)",
DMENU_SET_VARIABLE, "ntpdate=clepsydra.dec.com", 0, 0 },
- { "U.S. West Coast #3", "clock.llnl.gov (WWVB clock)",
+ { "U.S. West Coast #3", "clock.llnl.gov (WWVB clock)",
DMENU_SET_VARIABLE, "ntpdate=clock.llnl.gov", 0, 0 },
- { "U.S. Midwest", "ncar.ucar.edu (WWVB clock)",
+ { "U.S. Midwest", "ncar.ucar.edu (WWVB clock)",
DMENU_SET_VARIABLE, "ntpdate=ncar.ucar.edu", 0, 0 },
- { "U.S. Pacific", "chantry.hawaii.net (WWV/H clock)",
+ { "U.S. Pacific", "chantry.hawaii.net (WWV/H clock)",
DMENU_SET_VARIABLE, "ntpdate=chantry.hawaii.net", 0, 0 },
- { "U.S. Southwest", "shorty.chpc.utexas.edu (WWV clock)",
+ { "U.S. Southwest", "shorty.chpc.utexas.edu (WWV clock)",
DMENU_SET_VARIABLE, "ntpdate=shorty.chpc.utexas.edu", 0, 0 },
- { NULL } },
+ { NULL } },
};
DMenu MenuSyscons = {
- DMENU_NORMAL_TYPE,
- "System Console Configuration",
- "The default system console driver for FreeBSD (syscons) has a\n\
+DMENU_NORMAL_TYPE,
+"System Console Configuration",
+"The default system console driver for FreeBSD (syscons) has a\n\
number of configuration options which may be set according to\n\
your preference.\n\n\
When you are done setting configuration options, select Cancel.",
- "Configure your system console settings",
- NULL,
- { { "Keymap", "Choose an alternate keyboard map",
+"Configure your system console settings",
+NULL,
+{ { "Keymap", "Choose an alternate keyboard map",
DMENU_SUBMENU, &MenuSysconsKeymap, 0, 0 },
- { "Repeat", "Set the rate at which keys repeat",
+ { "Repeat", "Set the rate at which keys repeat",
DMENU_SUBMENU, &MenuSysconsKeyrate, 0, 0 },
- { "Saver", "Configure the screen saver",
+ { "Saver", "Configure the screen saver",
DMENU_SUBMENU, &MenuSysconsSaver, 0, 0 },
- { "Exit", "Exit this menu (returning to previous)",
+ { "Exit", "Exit this menu (returning to previous)",
DMENU_CANCEL, NULL, 0, 0 },
- { NULL } },
+ { NULL } },
};
DMenu MenuSysconsKeymap = {
- DMENU_RADIO_TYPE | DMENU_SELECTION_RETURNS,
- "System Console Keymap",
- "The default system console driver for FreeBSD (syscons) defaults\n\
+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\
(or with different keyboard preferences) may wish to choose one of\n\
the other keymaps below.",
@@ -885,12 +892,6 @@ when held down.",
{ NULL } },
};
-static char *
-menuSaverTimeoutCheck(DMenuItem *item)
-{
- return getenv("blanktime") ? "ON" : "OFF";
-}
-
DMenu MenuSysconsSaver = {
DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS,
"System Console Screen Saver",
@@ -900,17 +901,15 @@ monitor switched on and idle for long periods of time then you should\n\
probably enable one of these screen savers to prevent phosphor burn-in.",
"Choose a nifty-looking screen saver",
NULL,
- { { "blank", "Simply blank the screen",
+{ { "blank", "Simply blank the screen",
DMENU_SET_VARIABLE, "saver=blank", 0, 0, dmenuVarCheck },
- { "Green", "\"Green\" power saving mode (if supported by monitor)",
+ { "Green", "\"Green\" power saving mode (if supported by monitor)",
DMENU_SET_VARIABLE, "saver=green", 0, 0, dmenuVarCheck },
- { "Snake", "Draw a FreeBSD \"snake\" on your screen",
+ { "Snake", "Draw a FreeBSD \"snake\" on your screen",
DMENU_SET_VARIABLE, "saver=snake", 0, 0, dmenuVarCheck },
- { "Star", "A \"twinkling stars\" effect",
+ { "Star", "A \"twinkling stars\" effect",
DMENU_SET_VARIABLE, "saver=star", 0, 0, dmenuVarCheck },
- { "Timeout", "Set the screen saver timeout interval",
- DMENU_CALL, configSaverTimeout, 0, 0, menuSaverTimeoutCheck },
- { "Exit", "Exit this menu (returning to previous)",
- DMENU_CANCEL, NULL, 0, 0 },
- { NULL } },
+ { "Timeout", "Set the screen saver timeout interval",
+ DMENU_CALL, configSaverTimeout, (int)"blanktime", 0, dmenuVarCheck },
+ { NULL } },
};
diff --git a/usr.sbin/sysinstall/misc.c b/usr.sbin/sysinstall/misc.c
index 4a93b9e..b4dd63b 100644
--- a/usr.sbin/sysinstall/misc.c
+++ b/usr.sbin/sysinstall/misc.c
@@ -1,7 +1,7 @@
/*
* Miscellaneous support routines..
*
- * $Id: misc.c,v 1.11.2.2 1995/06/01 22:32:06 jkh Exp $
+ * $Id: misc.c,v 1.12.2.8 1995/11/04 15:08:21 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -45,6 +45,7 @@
#include <sys/errno.h>
#include <sys/file.h>
#include <sys/types.h>
+#include <dirent.h>
#include <sys/wait.h>
#include <sys/param.h>
#include <sys/mount.h>
@@ -76,11 +77,25 @@ string_concat(char *one, char *two)
{
static char tmp[FILENAME_MAX];
+ /* Yes, we're deliberately cavalier about not checking for overflow */
strcpy(tmp, one);
strcat(tmp, two);
return tmp;
}
+/* Concatenate three strings into static storage */
+char *
+string_concat3(char *one, char *two, char *three)
+{
+ static char tmp[FILENAME_MAX];
+
+ /* Yes, we're deliberately cavalier about not checking for overflow */
+ strcpy(tmp, one);
+ strcat(tmp, two);
+ strcat(tmp, three);
+ return tmp;
+}
+
/* Clip the whitespace off the end of a string */
char *
string_prune(char *str)
@@ -101,6 +116,53 @@ string_skipwhite(char *str)
return str;
}
+/* copy optionally and allow second arg to be null */
+char *
+string_copy(char *s1, char *s2)
+{
+ if (!s1)
+ return NULL;
+ if (!s2)
+ s1[0] = '\0';
+ else
+ strcpy(s1, s2);
+ return s1;
+}
+
+Boolean
+directoryExists(const char *dirname)
+{
+ DIR *tptr;
+
+ if (!dirname)
+ return FALSE;
+ if (!strlen(dirname))
+ return FALSE;
+
+ tptr = opendir(dirname);
+ if (!tptr)
+ return (FALSE);
+
+ closedir(tptr);
+ return (TRUE);
+}
+
+char *
+pathBaseName(const char *path)
+{
+ char *pt;
+ char *ret = (char *)path;
+
+ pt = strrchr(path,(int)'/');
+
+ if (pt != 0) /* if there is a slash */
+ {
+ ret = ++pt; /* start the file after it */
+ }
+
+ return(ret);
+}
+
/* A free guaranteed to take NULL ptrs */
void
safe_free(void *ptr)
@@ -120,6 +182,7 @@ safe_malloc(size_t size)
ptr = malloc(size);
if (!ptr)
msgFatal("Out of memory!");
+ bzero(ptr, size);
return ptr;
}
@@ -179,8 +242,8 @@ Mkdir(char *ipath, void *data)
int final=0;
char *p, *path;
- if (access(ipath, R_OK) == 0)
- return 0;
+ if (file_readable(ipath))
+ return RET_SUCCESS;
path = strdup(ipath);
if (isDebug())
@@ -196,20 +259,22 @@ Mkdir(char *ipath, void *data)
*p = '\0';
if (stat(path, &sb)) {
if (errno != ENOENT) {
+ dialog_clear();
msgConfirm("Couldn't stat directory %s: %s", path, strerror(errno));
- return 1;
+ return RET_FAIL;
}
if (isDebug())
msgDebug("mkdir(%s..)\n", path);
if (mkdir(path, S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
+ dialog_clear();
msgConfirm("Couldn't create directory %s: %s", path,strerror(errno));
- return 1;
+ return RET_FAIL;
}
}
*p = '/';
}
free(path);
- return 0;
+ return RET_SUCCESS;
}
int
@@ -230,16 +295,18 @@ Mount(char *mountp, void *dev)
memset(&ufsargs,0,sizeof ufsargs);
if (Mkdir(mountpoint, NULL)) {
+ dialog_clear();
msgConfirm("Unable to make directory mountpoint for %s!", mountpoint);
- return 1;
+ return RET_FAIL;
}
if (isDebug())
msgDebug("mount %s %s\n", device, mountpoint);
bzero(&ufsargs, sizeof(ufsargs));
ufsargs.fspec = device;
if (mount(MOUNT_UFS, mountpoint, 0, (caddr_t)&ufsargs) == -1) {
- msgConfirm("Error mounting %s on %s : %s\n", device, mountpoint, strerror(errno));
- return 1;
+ dialog_clear();
+ msgConfirm("Error mounting %s on %s : %s", device, mountpoint, strerror(errno));
+ return RET_FAIL;
}
- return 0;
+ return RET_SUCCESS;
}
diff --git a/usr.sbin/sysinstall/msg.c b/usr.sbin/sysinstall/msg.c
index 088da89..ae5e3f3 100644
--- a/usr.sbin/sysinstall/msg.c
+++ b/usr.sbin/sysinstall/msg.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: msg.c,v 1.28.2.2 1995/06/02 15:31:31 jkh Exp $
+ * $Id: msg.c,v 1.29.2.8 1995/10/22 21:38:17 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -52,9 +52,9 @@
Boolean
isDebug(void)
{
- if (OptFlags & OPT_DEBUG)
- return TRUE;
- return FALSE;
+ char *cp;
+
+ return (cp = variable_get(VAR_DEBUG)) && strcmp(cp, "no");
}
/* Whack up an informational message on the status line, in stand-out */
@@ -216,7 +216,7 @@ msgConfirm(char *fmt, ...)
use_helpfile(NULL);
w = dupwin(newscr);
if (OnVTY) {
- msgDebug("Switching back to VTY 0\n");
+ msgDebug("Switching back to VTY1\n");
ioctl(0, VT_ACTIVATE, 1);
msgInfo(NULL);
}
@@ -264,7 +264,7 @@ msgYesNo(char *fmt, ...)
use_helpfile(NULL);
w = dupwin(newscr);
if (OnVTY) {
- msgDebug("Switching back to VTY 0\n");
+ msgDebug("Switching back to VTY1\n");
ioctl(0, VT_ACTIVATE, 1); /* Switch back */
msgInfo(NULL);
}
@@ -298,7 +298,7 @@ msgGetInput(char *buf, char *fmt, ...)
input_buffer[0] = '\0';
w = dupwin(newscr);
if (OnVTY) {
- msgDebug("Switching back to VTY 0\n");
+ msgDebug("Switching back to VTY1\n");
ioctl(0, VT_ACTIVATE, 1); /* Switch back */
msgInfo(NULL);
}
@@ -349,5 +349,20 @@ msgWeHaveOutput(char *fmt, ...)
dialog_msgbox("Information Dialog", errstr, -1, -1, 0);
free(errstr);
if (OnVTY)
- msgInfo("Command output is on debugging screen - type ALT-F2 to see it");
+ msgInfo("Command output is on VTY2 - type ALT-F2 to see it");
+}
+
+/* Simple versions of msgConfirm() and msgNotify() for calling from scripts */
+int
+msgSimpleConfirm(char *str)
+{
+ msgConfirm(str);
+ return RET_SUCCESS;
+}
+
+int
+msgSimpleNotify(char *str)
+{
+ msgNotify(str);
+ return RET_SUCCESS;
}
diff --git a/usr.sbin/sysinstall/network.c b/usr.sbin/sysinstall/network.c
index 821e57a..3340d1c 100644
--- a/usr.sbin/sysinstall/network.c
+++ b/usr.sbin/sysinstall/network.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: network.c,v 1.7.2.2 1995/07/21 10:57:33 rgrimes Exp $
+ * $Id: network.c,v 1.8 1995/09/18 16:52:33 peter Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -44,12 +44,12 @@
/* These routines deal with getting things off of network media */
#include "sysinstall.h"
-#include <sys/fcntl.h>
#include <signal.h>
+#include <sys/fcntl.h>
+#include <sys/ioctl.h>
#include <sys/stat.h>
static Boolean networkInitialized;
-static pid_t pppPid;
static pid_t startPPP(Device *devp);
Boolean
@@ -58,15 +58,27 @@ mediaInitNetwork(Device *dev)
int i;
char *rp;
char *cp, ifconfig[64];
+ char ifname[255];
- if (!RunningAsInit || networkInitialized || (dev->flags & OPT_LEAVE_NETWORK_UP))
+ if (!RunningAsInit || networkInitialized)
return TRUE;
- configResolv();
+ msgDebug("Init routine called for network device %s.\n", dev->name);
+ if (!file_readable("/etc/resolv.conf"))
+ configResolv();
+
+ /* Old process lying around? */
+ if (dev->private) {
+ kill((pid_t)dev->private, SIGTERM);
+ dev->private = NULL;
+ }
if (!strncmp("cuaa", dev->name, 4)) {
- if (!msgYesNo("You have selected a serial-line network interface.\nDo you want to use PPP with it?")) {
+ dialog_clear();
+ if (!msgYesNo("You have selected a serial-line network interface.\n"
+ "Do you want to use PPP with it?")) {
if (!(dev->private = (void *)startPPP(dev))) {
- msgConfirm("Unable to start PPP! This installation method\ncannot be used.");
+ dialog_clear();
+ msgConfirm("Unable to start PPP! This installation method cannot be used.");
return FALSE;
}
networkInitialized = TRUE;
@@ -78,37 +90,59 @@ mediaInitNetwork(Device *dev)
/* Cheesy slip attach */
snprintf(attach, 256, "slattach -a -h -l -s 9600 %s", dev->devname);
- val = msgGetInput(attach, "Warning: SLIP is rather poorly supported in this revision\nof the installation due to the lack of a dialing utility.\nIf you can use PPP for this instead then you're much better\noff doing so, otherwise SLIP works fairly well for *hardwired*\nlinks. Please edit the following slattach command for\ncorrectness (default here is VJ compression, Hardware flow-control,\nignore carrier and 9600 baud data rate) and hit return to execute it.");
+ val = msgGetInput(attach,
+ "Warning: SLIP is rather poorly supported in this revision\n"
+ "of the installation due to the lack of a dialing utility.\n"
+ "If you can use PPP for this instead then you're much better\n"
+ "off doing so, otherwise SLIP works fairly well for *hardwired*\n"
+ "links. Please edit the following slattach command for\n"
+ "correctness (default here is: VJ compression, Hardware flow-\n"
+ "control, ignore carrier and 9600 baud data rate). When you're\n"
+ "ready, press [ENTER] to execute it.");
if (!val)
return FALSE;
else
strcpy(attach, val);
- if (!vsystem(attach))
- dev->private = NULL;
- else {
- msgConfirm("slattach returned a bad status! Please verify that\nthe command is correct and try again.");
+ if (vsystem(attach)) {
+ dialog_clear();
+ msgConfirm("slattach returned a bad status! Please verify that\n"
+ "the command is correct and try again.");
return FALSE;
}
}
+ strcpy(ifname, "sl0");
}
+ else
+ strcpy(ifname, dev->name);
- snprintf(ifconfig, 64, "%s%s", VAR_IFCONFIG, dev->name);
- cp = getenv(ifconfig);
+ snprintf(ifconfig, 255, "%s%s", VAR_IFCONFIG, dev->name);
+ cp = variable_get(ifconfig);
if (!cp) {
- msgConfirm("The %s device is not configured. You will need to do so\nin the Networking configuration menu before proceeding.");
+ dialog_clear();
+ msgConfirm("The %s device is not configured. You will need to do so\n"
+ "in the Networking configuration menu before proceeding.", ifname);
return FALSE;
}
- i = vsystem("ifconfig %s %s", "sl0", cp);
+ msgNotify("Configuring network device %s.", ifname);
+ i = vsystem("ifconfig %s %s", ifname, cp);
if (i) {
- msgConfirm("Unable to configure the %s interface!\nThis installation method cannot be used.", dev->name);
+ dialog_clear();
+ msgConfirm("Unable to configure the %s interface!\n"
+ "This installation method cannot be used.", ifname);
return FALSE;
}
- rp = getenv(VAR_GATEWAY);
- if (!rp || *rp == '0')
- msgConfirm("No gateway has been set. You may be unable to access hosts\nnot on your local network\n");
- else
+ rp = variable_get(VAR_GATEWAY);
+ if (!rp || *rp == '0') {
+ dialog_clear();
+ msgConfirm("No gateway has been set. You may be unable to access hosts\n"
+ "not on your local network");
+ }
+ else {
+ msgNotify("Adding default route to %s.", rp);
vsystem("route add default %s", rp);
+ }
+ msgDebug("Network initialized successfully.\n");
networkInitialized = TRUE;
return TRUE;
}
@@ -118,28 +152,36 @@ mediaShutdownNetwork(Device *dev)
{
char *cp;
- if (!RunningAsInit || !networkInitialized || (dev->flags & OPT_LEAVE_NETWORK_UP))
+ if (!RunningAsInit || !networkInitialized)
return;
+ msgDebug("Shutdown called for network device %s\n", dev->name);
if (strncmp("cuaa", dev->name, 4)) {
int i;
- char ifconfig[64];
+ char ifconfig[255];
- snprintf(ifconfig, 64, "%s%s", VAR_IFCONFIG, dev->name);
- cp = getenv(ifconfig);
+ snprintf(ifconfig, 255, "%s%s", VAR_IFCONFIG, dev->name);
+ cp = variable_get(ifconfig);
if (!cp)
return;
+ msgNotify("Shutting interface %s down.", dev->name);
i = vsystem("ifconfig %s down", dev->name);
- if (i)
+ if (i) {
+ dialog_clear();
msgConfirm("Warning: Unable to down the %s interface properly", dev->name);
- cp = getenv(VAR_GATEWAY);
- if (cp)
+ }
+ cp = variable_get(VAR_GATEWAY);
+ if (cp) {
+ msgNotify("Deleting default route.");
vsystem("route delete default");
+ }
networkInitialized = FALSE;
}
- else if (pppPid != 0) {
- kill(pppPid, SIGTERM);
- pppPid = 0;
+ else if (dev->private) {
+ msgNotify("Killing PPP process %d.", (int)dev->private);
+ kill((pid_t)dev->private, SIGTERM);
+ dev->private = NULL;
+ networkInitialized = FALSE;
}
}
@@ -147,29 +189,30 @@ mediaShutdownNetwork(Device *dev)
static pid_t
startPPP(Device *devp)
{
- int vfd, fd2;
+ int fd2;
FILE *fp;
char *val;
pid_t pid;
char myaddr[16], provider[16], speed[16];
- /* We're going over to VTY2 */
- vfd = open("/dev/ttyv2", O_RDWR);
- if (vfd == -1)
- return 0;
-
/* These are needed to make ppp work */
Mkdir("/var/log", NULL);
Mkdir("/var/spool/lock", NULL);
Mkdir("/etc/ppp", NULL);
+ if (!variable_get(VAR_SERIAL_SPEED))
+ variable_set2(VAR_SERIAL_SPEED, "115200");
/* Get any important user values */
- val = msgGetInput("115200",
-"Enter the baud rate for your modem - this can be higher than the actual\nmaximum data rate since most modems can talk at one speed to the\ncomputer and at another speed to the remote end.\n\nIf you're not sure what to put here, just select the default.");
- strcpy(speed, val ? val : "115200");
+ val = variable_get_value(VAR_SERIAL_SPEED,
+ "Enter the baud rate for your modem - this can be higher than the actual\n"
+ "maximum data rate since most modems can talk at one speed to the\n"
+ "computer and at another speed to the remote end.\n\n"
+ "If you're not sure what to put here, just select the default.");
+ strcpy(speed, (val && *val) ? val : "115200");
- strcpy(provider, getenv(VAR_GATEWAY) ? getenv(VAR_GATEWAY) : "0");
- val = msgGetInput(provider, "Enter the IP address of your service provider or 0 if you\ndon't know it and would prefer to negotiate it dynamically.");
+ strcpy(provider, variable_get(VAR_GATEWAY) ? variable_get(VAR_GATEWAY) : "0");
+ val = msgGetInput(provider, "Enter the IP address of your service provider or 0 if you\n"
+ "don't know it and would prefer to negotiate it dynamically.");
strcpy(provider, val ? val : "0");
if (devp->private && ((DevInfo *)devp->private)->ipaddr[0])
@@ -187,11 +230,12 @@ startPPP(Device *devp)
}
fd2 = open("/etc/ppp/ppp.secret", O_CREAT);
if (fd2 != -1) {
- fchmod(fd2, 0755);
+ fchmod(fd2, 0700);
close(fd2);
}
fp = fopen("/etc/ppp/ppp.conf", "w");
if (!fp) {
+ dialog_clear();
msgConfirm("Couldn't open /etc/ppp/ppp.conf file! This isn't going to work");
return 0;
}
@@ -201,19 +245,47 @@ startPPP(Device *devp)
fprintf(fp, " set ifaddr %s %s\n", myaddr, provider);
fclose(fp);
- if (isDebug())
- msgDebug("Creating /dev/tun0 device.\n");
if (!file_readable("/dev/tun0") && mknod("/dev/tun0", 0600 | S_IFCHR, makedev(52, 0))) {
+ dialog_clear();
msgConfirm("Warning: No /dev/tun0 device. PPP will not work!");
return 0;
}
if (!(pid = fork())) {
- dup2(vfd, 0);
- dup2(vfd, 1);
- dup2(vfd, 2);
- execl("/stand/ppp", "/stand/ppp", (char *)NULL);
+ int i, fd;
+ struct termios foo;
+ extern int login_tty(int);
+
+ for (i = 0; i < 64; i++)
+ close(i);
+
+ /* We're going over to VTY2 */
+ DebugFD = fd = open("/dev/ttyv2", O_RDWR);
+ ioctl(0, TIOCSCTTY, &fd);
+ dup2(0, 1);
+ dup2(0, 2);
+ if (login_tty(fd) == -1)
+ msgDebug("ppp: Can't set the controlling terminal.\n");
+ signal(SIGTTOU, SIG_IGN);
+ if (tcgetattr(fd, &foo) != -1) {
+ foo.c_cc[VERASE] = '\010';
+ if (tcsetattr(fd, TCSANOW, &foo) == -1)
+ msgDebug("ppp: Unable to set the erase character.\n");
+ }
+ else
+ msgDebug("ppp: Unable to get the terminal attributes!\n");
+ execlp("ppp", "ppp", (char *)NULL);
+ msgDebug("PPP process failed to exec!\n");
exit(1);
}
- msgConfirm("The PPP command is now started on screen 3 (type ALT-F3 to\ninteract with it, ALT-F1 to switch back here). The only command\nyou'll probably want or need to use is the \"term\" command\nwhich starts a terminal emulator you can use to talk to your\nmodem and dial the service provider. Once you're connected,\ncome back to this screen and press return. DO NOT PRESS RETURN\nHERE UNTIL THE CONNECTION IS FULLY ESTABLISHED!");
+ else {
+ dialog_clear();
+ msgConfirm("The PPP command is now started on VTY3 (type ALT-F3 to\n"
+ "interact with it, ALT-F1 to switch back here). The only command\n"
+ "you'll probably want or need to use is the \"term\" command\n"
+ "which starts a terminal emulator you can use to talk to your\n"
+ "modem and dial the service provider. Once you're connected,\n"
+ "come back to this screen and press return. DO NOT PRESS [ENTER]\n"
+ "HERE UNTIL THE CONNECTION IS FULLY ESTABLISHED!");
+ }
return pid;
}
diff --git a/usr.sbin/sysinstall/nfs.c b/usr.sbin/sysinstall/nfs.c
index cf04e5e..4dc2b97 100644
--- a/usr.sbin/sysinstall/nfs.c
+++ b/usr.sbin/sysinstall/nfs.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: nfs.c,v 1.4.2.6 1995/06/10 02:21:40 jkh Exp $
+ * $Id: nfs.c,v 1.5.2.15 1995/11/04 11:09:16 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -58,46 +58,59 @@ mediaInitNFS(Device *dev)
if (NFSMounted)
return TRUE;
- if (!(*netDevice->init)(netDevice))
+ if (!netDevice->init(netDevice))
return FALSE;
- if (Mkdir("/nfs", NULL))
+ if (Mkdir("/dist", NULL))
return FALSE;
- if (vsystem("mount_nfs %s %s %s /nfs", (OptFlags & OPT_SLOW_ETHER) ? "-r 1024 -w 1024" : "",
- (OptFlags & OPT_NFS_SECURE) ? "-P" : "", dev->name)) {
- msgConfirm("Error mounting %s on /nfs: %s (%u)\n", dev->name, strerror(errno), errno);
+ msgNotify("Mounting %s over NFS.", dev->name);
+ if (vsystem("mount_nfs %s %s %s /dist",
+ variable_get(VAR_SLOW_ETHER) ? "-r 1024 -w 1024" : "",
+ variable_get(VAR_NFS_SECURE) ? "-P" : "", dev->name)) {
+ dialog_clear();
+ msgConfirm("Error mounting %s on /dist: %s (%u)", dev->name, strerror(errno), errno);
+ netDevice->shutdown(netDevice);
return FALSE;
}
NFSMounted = TRUE;
+ msgDebug("Mounted NFS device %s onto /dist\n", dev->name);
return TRUE;
}
int
-mediaGetNFS(Device *dev, char *file, Attribs *dist_attrs)
+mediaGetNFS(Device *dev, char *file, Boolean tentative)
{
- char buf[PATH_MAX];
+ char buf[PATH_MAX];
- snprintf(buf, PATH_MAX, "/nfs/%s", file);
- if (!access(buf, R_OK))
+ msgDebug("Request for %s from NFS\n", file);
+ snprintf(buf, PATH_MAX, "/dist/%s", file);
+ if (file_readable(buf))
return open(buf, O_RDONLY);
- snprintf(buf, PATH_MAX, "/nfs/dists/%s", file);
+ snprintf(buf, PATH_MAX, "/dist/dists/%s", file);
+ if (file_readable(buf))
+ return open(buf, O_RDONLY);
+ snprintf(buf, PATH_MAX, "/dist/%s/%s", variable_get(VAR_RELNAME), file);
+ if (file_readable(buf))
+ return open(buf, O_RDONLY);
+ snprintf(buf, PATH_MAX, "/dist/%s/dists/%s", variable_get(VAR_RELNAME), file);
return open(buf, O_RDONLY);
}
void
mediaShutdownNFS(Device *dev)
{
- Device *netdev = (Device *)dev->private;
+ /* Device *netdev = (Device *)dev->private; */
if (!NFSMounted)
return;
- msgDebug("Unmounting /nfs\n");
- if (unmount("/nfs", MNT_FORCE) != 0)
- msgConfirm("Could not unmount the NFS partition: %s\n", strerror(errno));
- if (isDebug())
- msgDebug("Unmount returned\n");
- (*netdev->shutdown)(netdev);
+ msgNotify("Unmounting NFS partition on /dist");
+ if (unmount("/dist", MNT_FORCE) != 0) {
+ dialog_clear();
+ msgConfirm("Could not unmount the NFS partition: %s", strerror(errno));
+ }
+ msgDebug("Unmount of NFS partition successful\n");
+ /* (*netdev->shutdown)(netdev); */
NFSMounted = FALSE;
return;
}
diff --git a/usr.sbin/sysinstall/sysinstall.h b/usr.sbin/sysinstall/sysinstall.h
index b1b1ba3..b8e1f43 100644
--- a/usr.sbin/sysinstall/sysinstall.h
+++ b/usr.sbin/sysinstall/sysinstall.h
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: sysinstall.h,v 1.42.2.1 1995/07/21 10:54:06 rgrimes Exp $
+ * $Id: sysinstall.h,v 1.43 1995/09/18 16:52:35 peter Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -49,8 +49,11 @@
#include <string.h>
#include <unistd.h>
#include <dialog.h>
+#include <sys/types.h>
+#include <sys/wait.h>
#include "libdisk.h"
#include "dist.h"
+#include "version.h"
/*** Defines ***/
@@ -66,10 +69,14 @@
#define VAR_VALUE_MAX 1024
/* device limits */
-#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 DEV_NAME_MAX 64 /* The maximum length of a device name */
+#define DEV_MAX 100 /* 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 */
+#define MAX_FTP_RETRIES "4" /* How many times to beat our heads against the wall */
+
+#define RET_FAIL -1
+#define RET_SUCCESS 0
+#define RET_DONE 1
/*
* I make some pretty gross assumptions about having a max of 50 chunks
@@ -79,36 +86,65 @@
* For 2.1 I'll revisit this and try to make it more dynamic, but since
* this will catch 99.99% of all possible cases, I'm not too worried.
*/
-#define MAX_CHUNKS 50
+#define MAX_CHUNKS 40
-/* Internal flag variables */
+/* Internal environment variable names */
#define DISK_PARTITIONED "_diskPartitioned"
#define DISK_LABELLED "_diskLabelled"
+#define DISK_SELECTED "_diskSelected"
+#define SYSTEM_STATE "_systemState"
#define RUNNING_ON_ROOT "_runningOnRoot"
#define TCP_CONFIGURED "_tcpConfigured"
-#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"
-#define VAR_NAMESERVER "nameserver"
-#define VAR_GATEWAY "defaultrouter"
-#define VAR_IPADDR "ipaddr"
-
-#define VAR_IFCONFIG "ifconfig_"
-#define VAR_INTERFACES "network_interfaces"
+/* Ones that can be tweaked from config files */
+#define VAR_BLANKTIME "blanktime"
+#define VAR_BOOTMGR "bootManager"
+#define VAR_BROWSER_BINARY "browserBinary"
+#define VAR_BROWSER_PACKAGE "browserPackage"
+#define VAR_CONFIG_FILE "configFile"
+#define VAR_CPIO_VERBOSITY "cpioVerbose"
+#define VAR_DEBUG "debug"
+#define VAR_DISK "disk"
+#define VAR_DISKSPACE "diskSpace"
+#define VAR_DOMAINNAME "domainname"
+#define VAR_EXTRAS "ifconfig_"
+#define VAR_FTP_ONERROR "ftpOnError"
+#define VAR_FTP_PASS "ftpPass"
+#define VAR_FTP_PATH "ftp"
+#define VAR_FTP_RETRIES "ftpRetryCount"
+#define VAR_FTP_STATE "ftpState"
+#define VAR_FTP_USER "ftpUser"
+#define VAR_GATEWAY "defaultrouter"
+#define VAR_GEOMETRY "geometry"
+#define VAR_HOSTNAME "hostname"
+#define VAR_IFCONFIG "ifconfig_"
+#define VAR_INTERFACES "network_interfaces"
+#define VAR_IPADDR "ipaddr"
+#define VAR_LABEL "label"
+#define VAR_LABEL_COUNT "labelCount"
+#define VAR_MEDIA_TYPE "mediaType"
+#define VAR_NAMESERVER "nameserver"
+#define VAR_NETMASK "netmask"
+#define VAR_NFS_PATH "nfs"
+#define VAR_NFS_SECURE "nfsSecure"
+#define VAR_NO_CONFIRM "noConfirm"
+#define VAR_NTPDATE "ntpDate"
+#define VAR_PORTS_PATH "ports"
+#define VAR_RELNAME "releaseName"
+#define VAR_ROOT_SIZE "rootSize"
+#define VAR_ROUTEDFLAGS "routedflags"
+#define VAR_SLOW_ETHER "slowEthernetCard"
+#define VAR_SWAP_SIZE "swapSize"
+#define VAR_TAPE_BLOCKSIZE "tapeBlocksize"
+#define VAR_UFS_PATH "ufs"
+#define VAR_USR_SIZE "usrSize"
+#define VAR_VAR_SIZE "varSize"
+#define VAR_SERIAL_SPEED "serialSpeed"
+
+#define DEFAULT_TAPE_BLOCKSIZE "20"
+
+/* One MB worth of blocks */
+#define ONE_MEG 2048
/* The help file for the TCP/IP setup screen */
#define TCP_HELPFILE "tcp"
@@ -136,7 +172,7 @@ typedef struct _dmenuItem {
char *prompt; /* Our prompt */
DMenuItemType type; /* What type of item we are */
void *ptr; /* Generic data ptr */
- u_long parm; /* Parameter for above */
+ int parm; /* Parameter for above */
Boolean disabled; /* Are we temporarily disabled? */
char * (*check)(struct _dmenuItem *); /* Our state */
} DMenuItem;
@@ -157,13 +193,14 @@ typedef struct _variable {
char value[VAR_VALUE_MAX];
} Variable;
+/* For attribs */
#define MAX_ATTRIBS 200
-#define MAX_NAME 511
-#define MAX_VALUE 4095
+#define MAX_NAME 64
+#define MAX_VALUE 256
typedef struct _attribs {
- char *name;
- char *value;
+ char name[MAX_NAME];
+ char value[MAX_VALUE];
} Attribs;
typedef enum {
@@ -188,7 +225,7 @@ typedef struct _device {
DeviceType type;
Boolean enabled;
Boolean (*init)(struct _device *dev);
- int (*get)(struct _device *dev, char *file, Attribs *dist_attrs);
+ int (*get)(struct _device *dev, char *file, Boolean tentative);
Boolean (*close)(struct _device *dev, int fd);
void (*shutdown)(struct _device *dev);
void *private;
@@ -213,11 +250,49 @@ typedef struct _part_info {
char newfs_cmd[NEWFS_CMD_MAX];
} PartInfo;
+/* An option */
+typedef struct _opt {
+ char *name;
+ char *desc;
+ enum { OPT_IS_STRING, OPT_IS_INT, OPT_IS_FUNC, OPT_IS_VAR } type;
+ void *data;
+ void *aux;
+ char *(*check)();
+} Option;
+
+/* Weird index nodey things we use for keeping track of package information */
+typedef enum { PACKAGE, PLACE } node_type; /* Types of nodes */
+
+typedef struct _pkgnode { /* A node in the reconstructed hierarchy */
+ struct _pkgnode *next; /* My next sibling */
+ node_type type; /* What am I? */
+ char *name; /* My name */
+ char *desc; /* My description (Hook) */
+ struct _pkgnode *kids; /* My little children */
+ void *data; /* A place to hang my data */
+} PkgNode;
+typedef PkgNode *PkgNodePtr;
+
+/* A single package */
+typedef struct _indexEntry { /* A single entry in an INDEX file */
+ char *name; /* name */
+ char *path; /* full path to port */
+ char *prefix; /* port prefix */
+ char *comment; /* one line description */
+ char *descrfile; /* path to description file */
+ char *maintainer; /* maintainer */
+} IndexEntry;
+typedef IndexEntry *IndexEntryPtr;
+
typedef int (*commandFunc)(char *key, void *data);
-#define HOSTNAME_FIELD_LEN 256
+#define HOSTNAME_FIELD_LEN 128
#define IPADDR_FIELD_LEN 16
-#define EXTRAS_FIELD_LEN 256
+#define EXTRAS_FIELD_LEN 128
+
+/* Verbosity levels for CPIO as expressed by cpio arguments - yuck */
+#define CPIO_VERBOSITY (!strcmp(variable_get(CPIO_VERBOSITY_LEVEL), "low") ? "" : \
+ !strcmp(variable_get(CPIO_VERBOSITY_LEVEL), "medium") ? "-V" : "-v")
/* This is the structure that Network devices carry around in their private, erm, structures */
typedef struct _devPriv {
@@ -242,9 +317,7 @@ 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 */
@@ -255,6 +328,7 @@ extern DMenu MenuFTPOptions; /* FTP Installation options */
extern DMenu MenuOptions; /* Installation options */
extern DMenu MenuOptionsLanguage; /* Language options menu */
extern DMenu MenuMedia; /* Media type menu */
+extern DMenu MenuMouse; /* Mouse type menu */
extern DMenu MenuMediaCDROM; /* CDROM media menu */
extern DMenu MenuMediaDOS; /* DOS media menu */
extern DMenu MenuMediaFloppy; /* Floppy media menu */
@@ -268,8 +342,8 @@ extern DMenu MenuSysconsKeyrate; /* System console keyrate configuration menu *
extern DMenu MenuSysconsSaver; /* System console saver configuration menu */
extern DMenu MenuNetworking; /* Network configuration menu */
extern DMenu MenuInstallCustom; /* Custom Installation menu */
-extern DMenu MenuInstallType; /* Installation type menu */
extern DMenu MenuDistributions; /* Distribution menu */
+extern DMenu MenuSubDistributions; /* Custom distribution menu */
extern DMenu MenuDESDistributions; /* DES distribution menu */
extern DMenu MenuSrcDistributions; /* Source distribution menu */
extern DMenu MenuXF86; /* XFree86 main menu */
@@ -278,17 +352,25 @@ extern DMenu MenuXF86SelectCore; /* XFree86 core distribution menu */
extern DMenu MenuXF86SelectServer; /* XFree86 server distribution menu */
extern DMenu MenuXF86SelectFonts; /* XFree86 font selection menu */
extern DMenu MenuDiskDevices; /* Disk devices menu */
+extern DMenu MenuHTMLDoc; /* HTML Documentation menu */
/*** Prototypes ***/
+/* apache.c */
+extern int configApache(char *str);
+
+/* anonFTP.c */
+extern int configAnonFTP(char *unused);
+
/* attrs.c */
-extern const char *attr_match(Attribs *attr, char *name);
-extern int attr_parse(Attribs **attr, char *file);
+extern char *attr_match(Attribs *attr, char *name);
+extern int attr_parse_file(Attribs *attr, char *file);
+extern int attr_parse(Attribs *attr, int fd);
/* cdrom.c */
extern Boolean mediaInitCDROM(Device *dev);
-extern int mediaGetCDROM(Device *dev, char *file, Attribs *dist_attrs);
+extern int mediaGetCDROM(Device *dev, char *file, Boolean tentative);
extern void mediaShutdownCDROM(Device *dev);
/* command.c */
@@ -299,7 +381,7 @@ extern void command_shell_add(char *key, char *fmt, ...);
extern void command_func_add(char *key, commandFunc func, void *data);
/* config.c */
-extern void configFstab(void);
+extern int configFstab(void);
extern void configSysconfig(void);
extern void configResolv(void);
extern int configPorts(char *str);
@@ -313,8 +395,8 @@ extern int crc(int, unsigned long *, unsigned long *);
/* decode.c */
extern DMenuItem *decode(DMenu *menu, char *name);
-extern Boolean dispatch(DMenuItem *tmp, char *name);
-extern Boolean decode_and_dispatch_multiple(DMenu *menu, char *names);
+extern int dispatch(DMenuItem *tmp, char *name);
+extern int decode_and_dispatch_multiple(DMenu *menu, char *names);
/* devices.c */
extern DMenu *deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)());
@@ -323,11 +405,11 @@ 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)(Device *dev, char *file, Attribs *dist_attrs),
+ Boolean (*init)(Device *mediadev), int (*get)(Device *dev, char *file, Boolean tentative),
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 int dummyGet(Device *dev, char *dist, Boolean tentative);
extern Boolean dummyClose(Device *dev, int fd);
extern void dummyShutdown(Device *dev);
@@ -337,6 +419,7 @@ extern int diskPartitionWrite(char *unused);
/* dist.c */
extern int distReset(char *str);
+extern int distSetCustom(char *str);
extern int distSetDeveloper(char *str);
extern int distSetXDeveloper(char *str);
extern int distSetKernDeveloper(char *str);
@@ -356,49 +439,66 @@ extern char *dmenuVarCheck(DMenuItem *item);
extern char *dmenuFlagCheck(DMenuItem *item);
extern char *dmenuRadioCheck(DMenuItem *item);
+/* doc.c */
+extern int docBrowser(char *junk);
+extern int docShowDocument(char *str);
+
/* dos.c */
extern Boolean mediaInitDOS(Device *dev);
-extern int mediaGetDOS(Device *dev, char *file, Attribs *dist_attrs);
+extern int mediaGetDOS(Device *dev, char *file, Boolean tentative);
extern void mediaShutdownDOS(Device *dev);
/* floppy.c */
extern int getRootFloppy(void);
extern Boolean mediaInitFloppy(Device *dev);
-extern int mediaGetFloppy(Device *dev, char *file, Attribs *dist_attrs);
+extern int mediaGetFloppy(Device *dev, char *file, Boolean tentative);
extern void mediaShutdownFloppy(Device *dev);
/* ftp_strat.c */
extern Boolean mediaCloseFTP(Device *dev, int fd);
extern Boolean mediaInitFTP(Device *dev);
-extern int mediaGetFTP(Device *dev, char *file, Attribs *dist_attrs);
+extern int mediaGetFTP(Device *dev, char *file, Boolean tentative);
extern void mediaShutdownFTP(Device *dev);
-extern int mediaSetFtpUserPass(char *str);
/* globals.c */
extern void globalsInit(void);
+/* index.c */
+int index_get(char *fname, PkgNodePtr papa);
+int index_read(int fd, PkgNodePtr papa);
+int index_menu(PkgNodePtr top, PkgNodePtr plist, int *pos, int *scroll);
+void index_init(PkgNodePtr top, PkgNodePtr plist);
+void index_node_free(PkgNodePtr top, PkgNodePtr plist);
+void index_sort(PkgNodePtr top);
+void index_print(PkgNodePtr top, int level);
+int index_extract(Device *dev, PkgNodePtr plist);
+
/* install.c */
extern int installCommit(char *str);
extern int installExpress(char *str);
-extern Boolean installFilesystems(void);
-
-/* lang.c */
-extern void lang_set_Danish(char *str);
-extern void lang_set_Dutch(char *str);
-extern void lang_set_English(char *str);
-extern void lang_set_French(char *str);
-extern void lang_set_German(char *str);
-extern void lang_set_Italian(char *str);
-extern void lang_set_Japanese(char *str);
-extern void lang_set_Norwegian(char *str);
-extern void lang_set_Russian(char *str);
-extern void lang_set_Spanish(char *str);
-extern void lang_set_Swedish(char *str);
+extern int installNovice(char *str);
+extern int installFixit(char *str);
+extern int installFixup(char *str);
+extern int installUpgrade(char *str);
+extern int installPreconfig(char *str);
+extern int installFilesystems(char *str);
+extern int installVarDefaults(char *str);
+extern Boolean copySelf(void);
+extern Boolean rootExtract(void);
+
+/* installFinal.c */
+extern int configGated(char *unused);
+extern int configSamba(char *unused);
+extern int configPCNFSD(char *unused);
+extern int configNFSServer(char *unused);
/* label.c */
extern int diskLabelEditor(char *str);
extern int diskLabelCommit(char *str);
+/* lndir.c */
+extern int lndir(char *from, char *to);
+
/* makedevs.c (auto-generated) */
extern const char termcap_vt100[];
extern const char termcap_cons25[];
@@ -414,6 +514,7 @@ extern const u_char koi8_r2cp866[];
extern u_char default_scrnmap[];
/* media.c */
+extern char *cpioVerbosity(void);
extern int mediaSetCDROM(char *str);
extern int mediaSetFloppy(char *str);
extern int mediaSetDOS(char *str);
@@ -423,7 +524,10 @@ extern int mediaSetFTPActive(char *str);
extern int mediaSetFTPPassive(char *str);
extern int mediaSetUFS(char *str);
extern int mediaSetNFS(char *str);
-extern Boolean mediaGetType(void);
+extern int mediaSetFtpOnError(char *str);
+extern int mediaSetFtpUserPass(char *str);
+extern int mediaSetCPIOVerbosity(char *str);
+extern int mediaGetType(char *str);
extern Boolean mediaExtractDist(char *dir, int fd);
extern Boolean mediaExtractDistBegin(char *dir, int *fd, int *zpid, int *cpic);
extern Boolean mediaExtractDistEnd(int zpid, int cpid);
@@ -432,9 +536,13 @@ extern Boolean mediaVerify(void);
/* misc.c */
extern Boolean file_readable(char *fname);
extern Boolean file_executable(char *fname);
+extern Boolean directoryExists(const char *dirname);
extern char *string_concat(char *p1, char *p2);
+extern char *string_concat3(char *p1, char *p2, char *p3);
extern char *string_prune(char *str);
extern char *string_skipwhite(char *str);
+extern char *string_copy(char *s1, char *s2);
+extern char *pathBaseName(const char *path);
extern void safe_free(void *ptr);
extern void *safe_malloc(size_t size);
extern void *safe_realloc(void *orig, size_t size);
@@ -458,6 +566,8 @@ extern void msgNotify(char *fmt, ...);
extern void msgWeHaveOutput(char *fmt, ...);
extern int msgYesNo(char *fmt, ...);
extern char *msgGetInput(char *buf, char *fmt, ...);
+extern int msgSimpleConfirm(char *);
+extern int msgSimpleNotify(char *);
/* network.c */
extern Boolean mediaInitNetwork(Device *dev);
@@ -465,30 +575,42 @@ extern void mediaShutdownNetwork(Device *dev);
/* nfs.c */
extern Boolean mediaInitNFS(Device *dev);
-extern int mediaGetNFS(Device *dev, char *file, Attribs *dist_attrs);
+extern int mediaGetNFS(Device *dev, char *file, Boolean tentative);
extern void mediaShutdownNFS(Device *dev);
+/* options.c */
+extern int optionsEditor(char *str);
+
+/* package.c */
+extern int package_add(char *name);
+extern int package_extract(Device *dev, char *name);
+
/* system.c */
extern void systemInitialize(int argc, char **argv);
extern void systemShutdown(void);
+extern int execExecute(char *cmd, char *name);
extern int systemExecute(char *cmd);
-extern int systemDisplayFile(char *file);
+extern int systemDisplayHelp(char *file);
extern char *systemHelpFile(char *file, char *buf);
extern void systemChangeFont(const u_char font[]);
extern void systemChangeLang(char *lang);
-extern void systemChangeTerminal(char *color, const u_char c_termcap[],
- char *mono, const u_char m_termcap[]);
+extern void systemChangeTerminal(char *color, const u_char c_termcap[], char *mono, const u_char m_termcap[]);
extern void systemChangeScreenmap(const u_char newmap[]);
+extern void systemCreateHoloshell(void);
extern int vsystem(char *fmt, ...);
+extern int docBrowser(char *junk);
+extern int docShowDocument(char *str);
/* tape.c */
+extern char *mediaTapeBlocksize(void);
extern Boolean mediaInitTape(Device *dev);
-extern int mediaGetTape(Device *dev, char *file, Attribs *dist_attrs);
+extern int mediaGetTape(Device *dev, char *file, Boolean tentative);
extern void mediaShutdownTape(Device *dev);
/* tcpip.c */
extern int tcpOpenDialog(Device *dev);
extern int tcpMenuSelect(char *str);
+extern int tcpInstallDevice(char *str);
extern Boolean tcpDeviceSelect(void);
/* termcap.c */
@@ -497,11 +619,14 @@ extern int set_termcap(void);
/* ufs.c */
extern void mediaShutdownUFS(Device *dev);
extern Boolean mediaInitUFS(Device *dev);
-extern int mediaGetUFS(Device *dev, char *file, Attribs *dist_attrs);
+extern int mediaGetUFS(Device *dev, char *file, Boolean tentative);
-/* variables.c */
+/* variable.c */
extern void variable_set(char *var);
extern void variable_set2(char *name, char *value);
+extern char *variable_get(char *var);
+extern void variable_unset(char *var);
+extern char *variable_get_value(char *var, char *prompt);
/* wizard.c */
extern void slice_wizard(Disk *d);
diff --git a/usr.sbin/sysinstall/system.c b/usr.sbin/sysinstall/system.c
index 880dff9..d9003cb 100644
--- a/usr.sbin/sysinstall/system.c
+++ b/usr.sbin/sysinstall/system.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: system.c,v 1.44 1995/06/11 19:30:10 rgrimes Exp $
+ * $Id: system.c,v 1.45 1995/09/18 16:52:36 peter Exp $
*
* Jordan Hubbard
*
@@ -70,6 +70,9 @@ systemInitialize(int argc, char **argv)
/* If we haven't crashed I guess dialog is running ! */
DialogActive = TRUE;
+ /* Make sure HOME is set for those utilities that need it */
+ if (!getenv("HOME"))
+ setenv("HOME", "/", 1);
signal(SIGINT, handle_intr);
}
@@ -85,7 +88,7 @@ systemShutdown(void)
if (RunningAsInit) {
/* Put the console back */
ioctl(0, VT_ACTIVATE, 2);
- reboot(RB_HALT);
+ reboot(0);
}
else
exit(1);
@@ -96,11 +99,16 @@ int
systemExecute(char *command)
{
int status;
+ struct termios foo;
dialog_clear();
dialog_update();
end_dialog();
DialogActive = FALSE;
+ if (tcgetattr(0, &foo) != -1) {
+ foo.c_cc[VERASE] = '\010';
+ tcsetattr(0, TCSANOW, &foo);
+ }
status = system(command);
DialogActive = TRUE;
dialog_clear();
@@ -108,9 +116,9 @@ systemExecute(char *command)
return status;
}
-/* Display a file in a filebox */
+/* Display a help file in a filebox */
int
-systemDisplayFile(char *file)
+systemDisplayHelp(char *file)
{
char *fname = NULL;
char buf[FILENAME_MAX];
@@ -189,8 +197,8 @@ vsystem(char *fmt, ...)
pid_t pid;
int omask;
sig_t intsave, quitsave;
- char *cmd,*p;
- int i,magic=0;
+ char *cmd;
+ int i;
cmd = (char *)malloc(FILENAME_MAX);
cmd[0] = '\0';
@@ -198,67 +206,72 @@ vsystem(char *fmt, ...)
vsnprintf(cmd, FILENAME_MAX, fmt, args);
va_end(args);
- /* Find out if this command needs the wizardry of the shell */
- for (p="<>|'`=\"()" ; *p; p++)
- if (strchr(cmd, *p))
- magic++;
omask = sigblock(sigmask(SIGCHLD));
if (isDebug())
- msgDebug("Executing command `%s' (Magic=%d)\n", cmd, magic);
- switch(pid = fork()) {
- case -1: /* error */
+ msgDebug("Executing command `%s'\n", cmd);
+ pid = fork();
+ if (pid == -1) {
(void)sigsetmask(omask);
i = 127;
-
- case 0: /* child */
+ }
+ else if (!pid) { /* Junior */
(void)sigsetmask(omask);
if (DebugFD != -1) {
if (OnVTY && isDebug())
- msgInfo("Command output is on debugging screen - type ALT-F2 to see it");
+ msgInfo("Command output is on VTY2 - type ALT-F2 to see it");
dup2(DebugFD, 0);
dup2(DebugFD, 1);
dup2(DebugFD, 2);
}
-#ifdef NOT_A_GOOD_IDEA_CRUNCHED_BINARY
- if (magic) {
- char *argv[100];
- i = 0;
- argv[i++] = "crunch";
- argv[i++] = "sh";
- argv[i++] = "-c";
- argv[i++] = cmd;
- argv[i] = 0;
- exit(crunched_main(i,argv));
- } else {
- char *argv[100];
- i = 0;
- argv[i++] = "crunch";
- while (cmd && *cmd) {
- argv[i] = strsep(&cmd," \t");
- if (*argv[i])
- i++;
+ execl("/stand/sh", "sh", "-c", cmd, (char *)NULL);
+ exit(1);
+ }
+ else {
+ intsave = signal(SIGINT, SIG_IGN);
+ quitsave = signal(SIGQUIT, SIG_IGN);
+ pid = waitpid(pid, &pstat, 0);
+ (void)sigsetmask(omask);
+ (void)signal(SIGINT, intsave);
+ (void)signal(SIGQUIT, quitsave);
+ i = (pid == -1) ? -1 : WEXITSTATUS(pstat);
+ if (isDebug())
+ msgDebug("Command `%s' returns status of %d\n", cmd, i);
+ free(cmd);
+ }
+ return i;
+}
+
+void
+systemCreateHoloshell(void)
+{
+ if (OnVTY) {
+ if (!fork()) {
+ int i, fd;
+ struct termios foo;
+ extern int login_tty(int);
+
+ for (i = 0; i < 64; i++)
+ close(i);
+ DebugFD = fd = open("/dev/ttyv3", O_RDWR);
+ ioctl(0, TIOCSCTTY, &fd);
+ dup2(0, 1);
+ dup2(0, 2);
+ if (login_tty(fd) == -1)
+ msgDebug("Doctor: I can't set the controlling terminal.\n");
+ signal(SIGTTOU, SIG_IGN);
+ if (tcgetattr(fd, &foo) != -1) {
+ foo.c_cc[VERASE] = '\010';
+ if (tcsetattr(fd, TCSANOW, &foo) == -1)
+ msgDebug("Doctor: I'm unable to set the erase character.\n");
}
- argv[i] = 0;
- if (crunched_here(argv[1]))
- exit(crunched_main(i,argv));
else
- execvp(argv[1],argv+1);
- kill(getpid(),9);
+ msgDebug("Doctor: I'm unable to get the terminal attributes!\n");
+ printf("Warning: This shell is chroot()'d to /mnt\n");
+ execlp("sh", "-sh", 0);
+ msgDebug("Was unable to execute sh for Holographic shell!\n");
+ exit(1);
}
-#else /* !CRUNCHED_BINARY */
- execl("/stand/sh", "sh", "-c", cmd, (char *)NULL);
- kill(getpid(),9);
-#endif /* CRUNCHED_BINARY */
+ else
+ msgNotify("Starting an emergency holographic shell on VTY4");
}
- intsave = signal(SIGINT, SIG_IGN);
- quitsave = signal(SIGQUIT, SIG_IGN);
- pid = waitpid(pid, &pstat, 0);
- (void)sigsetmask(omask);
- (void)signal(SIGINT, intsave);
- (void)signal(SIGQUIT, quitsave);
- i = (pid == -1) ? -1 : WEXITSTATUS(pstat);
- if (isDebug())
- msgDebug("Command `%s' returns status of %d\n", cmd, i);
- free(cmd);
- return i;
}
diff --git a/usr.sbin/sysinstall/tape.c b/usr.sbin/sysinstall/tape.c
index bf72d8b..7cc92dd1a 100644
--- a/usr.sbin/sysinstall/tape.c
+++ b/usr.sbin/sysinstall/tape.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: tape.c,v 1.6 1995/06/11 19:30:11 rgrimes Exp $
+ * $Id: tape.c,v 1.6.2.11 1995/11/15 06:59:52 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -49,42 +49,61 @@
static Boolean tapeInitted;
+char *
+mediaTapeBlocksize(void)
+{
+ char *cp = variable_get(VAR_TAPE_BLOCKSIZE);
+
+ return cp ? cp : DEFAULT_TAPE_BLOCKSIZE;
+}
+
Boolean
mediaInitTape(Device *dev)
{
int i;
-
if (tapeInitted)
return TRUE;
+ msgDebug("Tape init routine called for %s (private dir is %s)\n", dev->name, dev->private);
Mkdir(dev->private, NULL);
if (chdir(dev->private))
- return FALSE;
- msgConfirm("Insert tape into %s and press return", dev->description);
+ return FALSE;
+ /* We know the tape is already in the drive, so go for it */
msgNotify("Attempting to extract from %s...", dev->description);
- if (!strcmp(dev->name, "ft0"))
- i = vsystem("ft | cpio -iduVm -H tar");
+ if (!strcmp(dev->name, "rft0"))
+ i = vsystem("ft | cpio -idum %s --block-size %s", cpioVerbosity(), mediaTapeBlocksize());
else
- i = vsystem("cpio -iduVm -H tar -I %s", dev->devname);
+ i = vsystem("cpio -idum %s --block-size %s -I %s", cpioVerbosity(), mediaTapeBlocksize(), dev->devname);
if (!i) {
tapeInitted = TRUE;
+ msgDebug("Tape initialized successfully.\n");
return TRUE;
}
- else
+ else {
+ dialog_clear();
msgConfirm("Tape extract command failed with status %d!", i);
+ }
return FALSE;
}
int
-mediaGetTape(Device *dev, char *file, Attribs *dist_attrs)
+mediaGetTape(Device *dev, char *file, Boolean tentative)
{
char buf[PATH_MAX];
+ int fd;
sprintf(buf, "%s/%s", (char *)dev->private, file);
+ msgDebug("Request for %s from tape (looking in %s)\n", file, buf);
if (file_readable(buf))
- return open(buf, O_RDONLY);
- sprintf(buf, "%s/dists/%s", (char *)dev->private, file);
- return open(buf, O_RDONLY);
+ fd = open(buf, O_RDONLY);
+ else {
+ sprintf(buf, "%s/dists/%s", (char *)dev->private, file);
+ fd = open(buf, O_RDONLY);
+ }
+ /* Nuke the files behind us to save space */
+ if (fd != -1)
+ unlink(buf);
+ return fd;
}
void
@@ -92,7 +111,8 @@ mediaShutdownTape(Device *dev)
{
if (!tapeInitted)
return;
- if (!access(dev->private, X_OK)) {
+ msgDebug("Shutdown of tape device - %s will be cleaned\n", dev->private);
+ if (file_readable(dev->private)) {
msgNotify("Cleaning up results of tape extract..");
(void)vsystem("rm -rf %s", (char *)dev->private);
}
diff --git a/usr.sbin/sysinstall/tcpip.c b/usr.sbin/sysinstall/tcpip.c
index eaab392..29499c4 100644
--- a/usr.sbin/sysinstall/tcpip.c
+++ b/usr.sbin/sysinstall/tcpip.c
@@ -1,5 +1,5 @@
/*
- * $Id: tcpip.c,v 1.30.2.1 1995/07/21 10:02:59 rgrimes Exp $
+ * $Id: tcpip.c,v 1.31 1995/09/18 16:52:38 peter Exp $
*
* Copyright (c) 1995
* Gary J Palmer. All rights reserved.
@@ -52,15 +52,14 @@
#include "dir.h"
#include "dialog.priv.h"
#include "colors.h"
-#include "rc.h"
#include "sysinstall.h"
/* These are nasty, but they make the layout structure a lot easier ... */
-static char hostname[HOSTNAME_FIELD_LEN], domainname[HOSTNAME_FIELD_LEN],
- gateway[IPADDR_FIELD_LEN], nameserver[IPADDR_FIELD_LEN];
-static int okbutton, cancelbutton;
-static char ipaddr[IPADDR_FIELD_LEN], netmask[IPADDR_FIELD_LEN], extras[EXTRAS_FIELD_LEN];
+static char hostname[HOSTNAME_FIELD_LEN], domainname[HOSTNAME_FIELD_LEN],
+ gateway[IPADDR_FIELD_LEN], nameserver[IPADDR_FIELD_LEN];
+static int okbutton, cancelbutton;
+static char ipaddr[IPADDR_FIELD_LEN], netmask[IPADDR_FIELD_LEN], extras[EXTRAS_FIELD_LEN];
/* What the screen size is meant to be */
#define TCP_DIALOG_Y 0
@@ -104,25 +103,25 @@ static Layout layout[] = {
"IP Address:",
"The IP address to be used for this interface",
ipaddr, STRINGOBJ, NULL },
-#define LAYOUT_IPADDR 5
+#define LAYOUT_IPADDR 4
{ 10, 35, 18, IPADDR_FIELD_LEN - 1,
"Netmask:",
- "The netmask for this interfaace, e.g. 0xffffff00 for a class C network",
+ "The netmask for this interface, e.g. 0xffffff00 for a class C network",
netmask, STRINGOBJ, NULL },
-#define LAYOUT_NETMASK 6
+#define LAYOUT_NETMASK 5
{ 14, 10, 37, HOSTNAME_FIELD_LEN - 1,
"Extra options to ifconfig:",
"Any interface-specific options to ifconfig you would like to use",
extras, STRINGOBJ, NULL },
-#define LAYOUT_EXTRAS 7
+#define LAYOUT_EXTRAS 6
{ 19, 15, 0, 0,
"OK", "Select this if you are happy with these settings",
&okbutton, BUTTONOBJ, NULL },
-#define LAYOUT_OKBUTTON 8
+#define LAYOUT_OKBUTTON 7
{ 19, 35, 0, 0,
"CANCEL", "Select this if you wish to cancel this screen",
&cancelbutton, BUTTONOBJ, NULL },
-#define LAYOUT_CANCELBUTTON 9
+#define LAYOUT_CANCELBUTTON 8
{ NULL },
};
@@ -171,6 +170,61 @@ verifySettings(void)
return 0;
}
+int
+tcpInstallDevice(char *str)
+{
+ Device **devs;
+ Device *dp = NULL;
+
+ /* Clip garbage off the ends */
+ string_prune(str);
+ str = string_skipwhite(str);
+ if (!*str)
+ return RET_FAIL;
+ devs = deviceFind(str, DEVICE_TYPE_NETWORK);
+ if (devs && (dp = devs[0])) {
+ char temp[512], ifn[255];
+
+ if (!dp->private) {
+ DevInfo *di;
+ char *ipaddr, *netmask, *extras;
+
+ di = dp->private = (DevInfo *)malloc(sizeof(DevInfo));
+
+ if ((ipaddr = variable_get(string_concat3(VAR_IPADDR, "_", dp->name))) == NULL)
+ ipaddr = variable_get(VAR_IPADDR);
+
+ if ((netmask = variable_get(string_concat3(VAR_NETMASK, "_", dp->name))) == NULL)
+ netmask = variable_get(VAR_NETMASK);
+
+ if ((extras = variable_get(string_concat3(VAR_EXTRAS, "_", dp->name))) == NULL)
+ extras = variable_get(VAR_EXTRAS);
+
+ string_copy(di->ipaddr, ipaddr);
+ string_copy(di->netmask, netmask);
+ string_copy(di->extras, extras);
+
+ if (ipaddr) {
+ char *ifaces;
+
+ sprintf(temp, "inet %s %s netmask %s", ipaddr, extras ? extras : "", netmask);
+ sprintf(ifn, "%s%s", VAR_IFCONFIG, dp->name);
+ variable_set2(ifn, temp);
+ ifaces = variable_get(VAR_INTERFACES);
+ if (!ifaces)
+ variable_set2(VAR_INTERFACES, ifaces = "lo0");
+ /* Only add it if it's not there already */
+ if (!strstr(ifaces, dp->name)) {
+ sprintf(ifn, "%s %s", dp->name, ifaces);
+ variable_set2(VAR_INTERFACES, ifn);
+ }
+ }
+ }
+ mediaDevice = dp;
+ }
+ return dp ? RET_SUCCESS : RET_FAIL;
+}
+
/* This is it - how to get TCP setup values */
int
tcpOpenDialog(Device *devp)
@@ -211,26 +265,45 @@ tcpOpenDialog(Device *devp)
strcpy(netmask, di->netmask);
strcpy(extras, di->extras);
}
- else
- ipaddr[0] = netmask[0] = extras[0] = '\0';
-
+ else { /* See if there are any defaults */
+ char *cp;
+
+ if (!ipaddr[0]) {
+ if ((cp = variable_get(VAR_IPADDR)) != NULL)
+ strcpy(ipaddr, cp);
+ else if ((cp = variable_get(string_concat3(devp->name, "_", VAR_IPADDR))) != NULL)
+ strcpy(ipaddr, cp);
+ }
+ if (!netmask[0]) {
+ if ((cp = variable_get(VAR_NETMASK)) != NULL)
+ strcpy(netmask, cp);
+ else if ((cp = variable_get(string_concat3(devp->name, "_", VAR_NETMASK))) != NULL)
+ strcpy(netmask, cp);
+ }
+ if (!extras[0]) {
+ if ((cp = variable_get(VAR_EXTRAS)) != NULL)
+ strcpy(extras, cp);
+ else if ((cp = variable_get(string_concat3(devp->name, "_", VAR_EXTRAS))) != NULL)
+ strcpy(extras, cp);
+ }
+ }
/* Look up values already recorded with the system, or blank the string variables ready to accept some new data */
- tmp = getenv(VAR_HOSTNAME);
+ tmp = variable_get(VAR_HOSTNAME);
if (tmp)
strcpy(hostname, tmp);
else
bzero(hostname, sizeof(hostname));
- tmp = getenv(VAR_DOMAINNAME);
+ tmp = variable_get(VAR_DOMAINNAME);
if (tmp)
strcpy(domainname, tmp);
else
bzero(domainname, sizeof(domainname));
- tmp = getenv(VAR_GATEWAY);
+ tmp = variable_get(VAR_GATEWAY);
if (tmp)
strcpy(gateway, tmp);
else
bzero(gateway, sizeof(gateway));
- tmp = getenv(VAR_NAMESERVER);
+ tmp = variable_get(VAR_NAMESERVER);
if (tmp)
strcpy(nameserver, tmp);
else
@@ -268,8 +341,7 @@ tcpOpenDialog(Device *devp)
/* Find the first object in the list */
first = obj;
- while (first->prev)
- first = first->prev;
+ for (first = obj; first->prev; first = first->prev);
/* Some more initialisation before we go into the main input loop */
n = 0;
@@ -290,15 +362,30 @@ tcpOpenDialog(Device *devp)
/* Ask for libdialog to do its stuff */
ret = PollObj(&obj);
- /* We are in the Hostname field - calculate the domainname */
- if (n == 0) {
+ if (n == LAYOUT_HOSTNAME) {
+ /* We are in the Hostname field - calculate the domainname */
if ((tmp = index(hostname, '.')) != NULL) {
strncpy(domainname, tmp + 1, strlen(tmp + 1));
domainname[strlen(tmp+1)] = '\0';
- RefreshStringObj(layout[1].obj);
+ RefreshStringObj(layout[LAYOUT_DOMAINNAME].obj);
+ }
+ }
+ else if (n == LAYOUT_IPADDR) {
+ /* Insert a default value for the netmask, 0xffffff00 is
+ the most appropriate one (entire class C, or subnetted
+ class A/B network). */
+ if(netmask[0] == '\0') {
+ strcpy(netmask, "255.255.255.0");
+ RefreshStringObj(layout[LAYOUT_NETMASK].obj);
+ }
+ }
+ else if (n == LAYOUT_DOMAINNAME) {
+ if (!index(hostname, '.') && domainname[0]) {
+ strcat(hostname, ".");
+ strcat(hostname, domainname);
+ RefreshStringObj(layout[LAYOUT_HOSTNAME].obj);
}
}
-
/* Handle special case stuff that libdialog misses. Sigh */
switch (ret) {
/* Bail out */
@@ -391,7 +478,7 @@ tcpOpenDialog(Device *devp)
if (!cancel) {
DevInfo *di;
- char temp[512], ifn[64];
+ char temp[512], ifn[255];
char *ifaces;
variable_set2(VAR_HOSTNAME, hostname);
@@ -412,7 +499,7 @@ tcpOpenDialog(Device *devp)
sprintf(temp, "inet %s %s netmask %s", ipaddr, extras, netmask);
sprintf(ifn, "%s%s", VAR_IFCONFIG, devp->name);
variable_set2(ifn, temp);
- ifaces = getenv(VAR_INTERFACES);
+ ifaces = variable_get(VAR_INTERFACES);
if (!ifaces)
variable_set2(VAR_INTERFACES, ifaces = "lo0");
/* Only add it if it's not there already */
@@ -422,9 +509,9 @@ tcpOpenDialog(Device *devp)
}
if (ipaddr[0])
variable_set2(VAR_IPADDR, ipaddr);
- return 0;
+ return RET_SUCCESS;
}
- return 1;
+ return RET_FAIL;
}
static int
@@ -436,13 +523,13 @@ netHook(char *str)
string_prune(str);
str = string_skipwhite(str);
if (!*str)
- return 0;
+ return RET_FAIL;
devs = deviceFind(str, DEVICE_TYPE_NETWORK);
if (devs) {
tcpOpenDialog(devs[0]);
mediaDevice = devs[0];
}
- return devs ? 1 : 0;
+ return devs ? RET_DONE : RET_FAIL;
}
/* Get a network device */
@@ -460,13 +547,14 @@ tcpDeviceSelect(void)
msgConfirm("No network devices available!");
status = FALSE;
}
- else if (cnt == 1) {
- tcpOpenDialog(devs[0]);
+ else if (cnt == 1 || !RunningAsInit) {
+ /* If we're running in user mode, assume network already up */
+ if (RunningAsInit)
+ tcpOpenDialog(devs[0]);
mediaDevice = devs[0];
status = TRUE;
}
else {
-
menu = deviceCreateMenu(&MenuNetworkDevice, DEVICE_TYPE_NETWORK, netHook);
if (!menu)
msgFatal("Unable to create network device menu! Argh!");
@@ -482,5 +570,5 @@ tcpMenuSelect(char *str)
{
(void)tcpDeviceSelect();
configResolv();
- return 0;
+ return RET_SUCCESS;
}
diff --git a/usr.sbin/sysinstall/ufs.c b/usr.sbin/sysinstall/ufs.c
index 5f68366..0176bac 100644
--- a/usr.sbin/sysinstall/ufs.c
+++ b/usr.sbin/sysinstall/ufs.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: ufs.c,v 1.4.2.2 1995/06/05 12:04:09 jkh Exp $
+ * $Id: ufs.c,v 1.5.2.4 1995/10/22 01:33:02 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -50,13 +50,20 @@
/* No init or shutdown routines necessary - all done in mediaSetUFS() */
int
-mediaGetUFS(Device *dev, char *file, Attribs *dist_attrs)
+mediaGetUFS(Device *dev, char *file, Boolean tentative)
{
char buf[PATH_MAX];
+ msgDebug("Request for %s from UFS\n", file);
snprintf(buf, PATH_MAX, "%s/%s", dev->private, file);
- if (!access(buf, R_OK))
+ if (file_readable(buf))
return open(buf, O_RDONLY);
snprintf(buf, PATH_MAX, "%s/dists/%s", dev->private, file);
+ if (file_readable(buf))
+ return open(buf, O_RDONLY);
+ snprintf(buf, PATH_MAX, "%s/%s/%s", dev->private, variable_get(VAR_RELNAME), file);
+ if (file_readable(buf))
+ return open(buf, O_RDONLY);
+ snprintf(buf, PATH_MAX, "%s/%s/dists/%s", dev->private, variable_get(VAR_RELNAME), file);
return open(buf, O_RDONLY);
}
diff --git a/usr.sbin/sysinstall/variable.c b/usr.sbin/sysinstall/variable.c
index 9cf6742..5cbaa84 100644
--- a/usr.sbin/sysinstall/variable.c
+++ b/usr.sbin/sysinstall/variable.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: variable.c,v 1.5.2.2 1995/06/01 21:04:03 jkh Exp $
+ * $Id: variable.c,v 1.6.2.7 1995/10/26 08:56:18 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -50,21 +50,23 @@ make_variable(char *var, char *value)
{
Variable *newvar;
- /* First search to see if it's already there */
+ /* Put it in the environment in any case */
+ setenv(var, value, 1);
+
+ /* Now search to see if it's already in the list */
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);
+
+ /* No? Create a new one */
newvar = (Variable *)safe_malloc(sizeof(Variable));
strncpy(newvar->name, var, VAR_NAME_MAX);
strncpy(newvar->value, value, VAR_VALUE_MAX);
newvar->next = VarHead;
VarHead = newvar;
- setenv(newvar->name, newvar->value, 1);
if (isDebug())
msgDebug("Setting variable %s to %s\n", newvar->name, newvar->value);
}
@@ -74,6 +76,10 @@ variable_set(char *var)
{
char tmp[VAR_NAME_MAX + VAR_VALUE_MAX], *cp;
+ if (!var)
+ msgFatal("NULL variable name & value passed.");
+ else if (!*var)
+ msgDebug("Warning: Zero length name & value passed to variable_set()\n");
strncpy(tmp, var, VAR_NAME_MAX + VAR_VALUE_MAX);
if ((cp = index(tmp, '=')) == NULL)
msgFatal("Invalid variable format: %s", var);
@@ -86,5 +92,55 @@ variable_set2(char *var, char *value)
{
if (!var || !value)
msgFatal("Null name or value passed to set_variable2!");
+ else if (!*var || !*value)
+ msgDebug("Warning: Zero length name or value passed to variable_set2()\n");
make_variable(var, value);
}
+
+char *
+variable_get(char *var)
+{
+ return getenv(var);
+}
+
+void
+variable_unset(char *var)
+{
+ Variable *vp;
+
+ unsetenv(var);
+
+ /* Now search to see if it's in our list, if we have one.. */
+ if (!VarHead)
+ return;
+ else if (!VarHead->next && !strcmp(VarHead->name, var)) {
+ free(VarHead);
+ VarHead = NULL;
+ }
+ else {
+ for (vp = VarHead; vp; vp = vp->next) {
+ if (!strcmp(vp->name, var)) {
+ Variable *save = vp->next;
+
+ *vp = *save;
+ safe_free(save);
+ break;
+ }
+ }
+ }
+}
+
+/* Prompt user for the name of a variable */
+char *
+variable_get_value(char *var, char *prompt)
+{
+ char *cp;
+
+ dialog_clear();
+ if ((cp = msgGetInput(variable_get(var), prompt)) != NULL)
+ variable_set2(var, cp);
+ else
+ cp = NULL;
+ dialog_clear();
+ return cp;
+}
diff --git a/usr.sbin/sysinstall/wizard.c b/usr.sbin/sysinstall/wizard.c
index be6f9ee..66e2233 100644
--- a/usr.sbin/sysinstall/wizard.c
+++ b/usr.sbin/sysinstall/wizard.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: wizard.c,v 1.5.2.1 1995/06/05 02:25:27 jkh Exp $
+ * $Id: wizard.c,v 1.6.2.1 1995/09/20 10:43:13 jkh Exp $
*
*/
@@ -155,7 +155,11 @@ slice_wizard(Disk *d)
continue;
}
if (!strcasecmp(*cmds,"allfreebsd")) {
- All_FreeBSD(d);
+ All_FreeBSD(d, 0);
+ continue;
+ }
+ if (!strcasecmp(*cmds,"dedicate")) {
+ All_FreeBSD(d, 1);
continue;
}
if (!strcasecmp(*cmds,"bios") && ncmd == 4) {
@@ -213,6 +217,7 @@ slice_wizard(Disk *d)
printf("\007ERROR\n");
printf("CMDS:\n");
printf("allfreebsd\t\t");
+ printf("dedicate\t\t");
printf("bios cyl hd sect\n");
printf("collapse [pointer]\t\t");
printf("create offset size enum subtype flags\n");
OpenPOWER on IntegriCloud