summaryrefslogtreecommitdiffstats
path: root/release/sysinstall
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1995-05-16 11:37:27 +0000
committerjkh <jkh@FreeBSD.org>1995-05-16 11:37:27 +0000
commit56016c7548b0eaa3e7190993e87b7b8d0a0bd02c (patch)
treeb37ec9f9cf4478f56803d142759b8dc671accdd9 /release/sysinstall
parent3f349e7ec85ac3affae816bfa10292b655d4eb44 (diff)
downloadFreeBSD-src-56016c7548b0eaa3e7190993e87b7b8d0a0bd02c.zip
FreeBSD-src-56016c7548b0eaa3e7190993e87b7b8d0a0bd02c.tar.gz
This will now compile and even scribble helpfully on your disks.
It remains to be seen how successfully. The distribution loading code is still not here yet, but the partition/newfs/mount/cpio-extract cycle is as complete as it's ever going to get, modulo possible bug fixes. The TCP/IP setup screen is also sort of here, albeit in a highly-changing state due to the fact that per-interface information isn't being kept right now but is being added (thanks, Gary!).
Diffstat (limited to 'release/sysinstall')
-rw-r--r--release/sysinstall/Makefile3
-rw-r--r--release/sysinstall/command.c16
-rw-r--r--release/sysinstall/devices.c154
-rw-r--r--release/sysinstall/disks.c19
-rw-r--r--release/sysinstall/dist.c110
-rw-r--r--release/sysinstall/globals.c4
-rw-r--r--release/sysinstall/install.c88
-rw-r--r--release/sysinstall/label.c42
-rw-r--r--release/sysinstall/main.c7
-rw-r--r--release/sysinstall/media.c96
-rw-r--r--release/sysinstall/menus.c128
-rw-r--r--release/sysinstall/misc.c71
-rw-r--r--release/sysinstall/msg.c19
-rw-r--r--release/sysinstall/sysinstall.h47
-rw-r--r--release/sysinstall/system.c21
-rw-r--r--release/sysinstall/tcpip.c160
16 files changed, 630 insertions, 355 deletions
diff --git a/release/sysinstall/Makefile b/release/sysinstall/Makefile
index ad6e00b..4b18445 100644
--- a/release/sysinstall/Makefile
+++ b/release/sysinstall/Makefile
@@ -11,7 +11,8 @@ SRCS= globals.c main.c dmenu.c menus.c \
disks.c command.c decode.c label.c \
tcpip.c
-CFLAGS += -Wall -g -I${.CURDIR}/../libdisk
+CFLAGS+= -Wall -g -I${.CURDIR}/../libdisk \
+ -I${.CURDIR}/../../gnu/lib/libdialog
LDADD= -ldialog -lncurses -lmytinfo
.if exists(${.CURDIR}/../libdisk/obj)
diff --git a/release/sysinstall/command.c b/release/sysinstall/command.c
index 5d59426..03989cc 100644
--- a/release/sysinstall/command.c
+++ b/release/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.2 1995/05/11 09:01:24 jkh Exp $
+ * $Id: command.c,v 1.3 1995/05/16 02:52:56 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -122,7 +122,7 @@ command_func_add(char *key, commandFunc func, void *data)
if (commandStack[i]->ncmds == MAX_NUM_COMMANDS)
msgFatal("More than %d commands stacked up behind %s??",
MAX_NUM_COMMANDS, key);
- commandStack[i]->cmds[commandStack[i]->ncmds].type = CMD_FUNC;
+ commandStack[i]->cmds[commandStack[i]->ncmds].type = CMD_FUNCTION;
commandStack[i]->cmds[commandStack[i]->ncmds].ptr = (void *)func;
commandStack[i]->cmds[commandStack[i]->ncmds].data = data;
++(commandStack[i]->ncmds);
@@ -136,7 +136,7 @@ command_func_add(char *key, commandFunc func, void *data)
commandStack[numCommands] = safe_malloc(sizeof(Command));
strcpy(commandStack[numCommands]->key, key);
commandStack[numCommands]->ncmds = 1;
- commandStack[numCommands]->cmds[0].type = CMD_FUNC;
+ commandStack[numCommands]->cmds[0].type = CMD_FUNCTION;
commandStack[numCommands++]->cmds[0].ptr = (void *)func;
}
@@ -162,7 +162,8 @@ command_execute(void)
for (i = 0; i < numCommands; i++) {
for (j = 0; j < commandStack[i]->ncmds; j++) {
- if (commandStack[i].type == CMD_SHELL) {
+ /* If it's a shell command, run system on it */
+ if (commandStack[i]->cmds[j].type == CMD_SHELL) {
msgNotify("Executing command: %s",
commandStack[i]->cmds[j].ptr);
ret = system((char *)commandStack[i]->cmds[j].ptr);
@@ -170,10 +171,11 @@ command_execute(void)
commandStack[i]->cmds[j].ptr, ret);
}
else {
- func = (commandFunc)commandStack[i]->cmds.ptr;
+ /* It's a function pointer - call it with the key and the data */
+ func = (commandFunc)commandStack[i]->cmds[j].ptr;
msgNotify("Executing internal command @ %0x", func);
- ret = (*func)(commandStack[i]->cmds.key,
- commandStack[i]->cmds.data);
+ ret = (*func)(commandStack[i]->key,
+ commandStack[i]->cmds[j].data);
msgDebug("Function @ %x returns status %d\n",
commandStack[i]->cmds[j].ptr, ret);
}
diff --git a/release/sysinstall/devices.c b/release/sysinstall/devices.c
index aa63d8d..893b1b1 100644
--- a/release/sysinstall/devices.c
+++ b/release/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.14 1995/05/11 06:47:42 jkh Exp $
+ * $Id: devices.c,v 1.15 1995/05/16 02:53:00 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -81,10 +81,10 @@ static struct {
{ DEVICE_TYPE_CDROM, "cd1a", "SCSI CDROM drive (2nd unit)" },
{ DEVICE_TYPE_CDROM, "mcd0a", "Mitsumi (old model) CDROM drive" },
{ DEVICE_TYPE_CDROM, "mcd1a", "Mitsumi (old model) CDROM drive (2nd unit)" },
- { DEVICE_TYPE_CDROM, "scd0a", "Sony CDROM drive - CDU31/33A type", }
+ { DEVICE_TYPE_CDROM, "scd0a", "Sony CDROM drive - CDU31/33A type", },
{ 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 ("sound blaster" type - 2nd unit)" },
+ { DEVICE_TYPE_CDROM, "matcd0a", "Matsushita CDROM ('sound blaster' type)" },
+ { DEVICE_TYPE_CDROM, "matcd1a", "Matsushita 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)" },
@@ -99,10 +99,10 @@ static struct {
{ DEVICE_TYPE_NETWORK, "ep", "3Com 3C509 interface card" },
{ DEVICE_TYPE_NETWORK, "el", "3Com 3C501 interface card" },
{ DEVICE_TYPE_NETWORK, "fe", "Fujitsu MB86960A/MB86965A Ethernet" },
- { DEVICE_TYPE_NETWORK, "ie", "AT&T StarLAN 10 and EN100; 3Com 3C507; unknown NI5210" },
+ { DEVICE_TYPE_NETWORK, "ie", "AT&T StarLAN 10 and EN100; 3Com 3C507; NI5210" },
{ DEVICE_TYPE_NETWORK, "le", "DEC EtherWorks 2 and 3" },
- { DEVICE_TYPE_NETWORK, "lnc", "Lance/PCnet cards (Isolan, Novell NE2100, NE32-VL)" },
- { DEVICE_TYPE_NETWORK, "ze", "IBM/National Semiconductor PCMCIA ethernet controller" },
+ { DEVICE_TYPE_NETWORK, "lnc", "Lance/PCnet cards (Isolan/Novell NE2100/NE32-VL)" },
+ { DEVICE_TYPE_NETWORK, "ze", "IBM/National Semiconductor PCMCIA ethernet" },
{ DEVICE_TYPE_NETWORK, "zp", "3Com PCMCIA Etherlink III" },
{ NULL },
};
@@ -124,6 +124,7 @@ static int
deviceTry(char *name)
{
char try[FILENAME_MAX];
+ int fd;
snprintf(try, FILENAME_MAX, "/dev/%s", name);
fd = open(try, O_RDWR);
@@ -137,44 +138,39 @@ deviceTry(char *name)
static void
deviceDiskFree(Device *dev)
{
- Disk_Close(dev->private);
+ Free_Disk(dev->private);
}
/* Get all device information for devices we have attached */
void
-deviceGetAll(Boolean disksOnly)
+deviceGetAll(void)
{
int i, fd, s;
struct ifconf ifc;
struct ifreq *ifptr, *end;
- int ifflags, selectflag = -1;
- char buffer[INTERFACES_MAX * sizeof(struct ifreq)];
+ int ifflags;
+ char buffer[INTERFACE_MAX * sizeof(struct ifreq)];
+ char **names;
- /* We do this at the very beginning */
- if (disksOnly) {
- char **names = Disk_names();
+ /* Try and get the disks first */
+ if ((names = Disk_Names()) != NULL) {
+ int i;
- if (names) {
- int i;
-
- for (i = 0; names[i]; i++) {
- CHECK_DEVS;
- Devices[numDevs] = new_device(names[i]);
- Devices[numDevs]->type = DEVICE_TYPE_DISK;
- Devices[numDevs]->ignore = TRUE;
- Devices[numDevs]->init = NULL;
- Devices[numDevs]->get = mediaUFSGet;
- Devices[numDevs]->close = deviceDiskFree;
- Devices[numDevs]->private = Open_Disk(names[i]);
- if (!Devices[numDevs]->private)
- msgFatal("Unable to open device for %s!", names[i]);
- msgDebug("Found a device of type disk named: %s\n",
- names[i]);
- ++numDevs;
- }
- free(names);
+ for (i = 0; names[i]; i++) {
+ CHECK_DEVS;
+ Devices[numDevs] = new_device(names[i]);
+ Devices[numDevs]->type = DEVICE_TYPE_DISK;
+ Devices[numDevs]->enabled = FALSE;
+ Devices[numDevs]->init = mediaInitUFS;
+ Devices[numDevs]->get = mediaGetUFS;
+ Devices[numDevs]->close = deviceDiskFree;
+ Devices[numDevs]->private = Open_Disk(names[i]);
+ if (!Devices[numDevs]->private)
+ msgFatal("Unable to open device for %s!", names[i]);
+ msgDebug("Found a device of type disk named: %s\n", names[i]);
+ ++numDevs;
}
- return;
+ free(names);
}
/*
@@ -188,16 +184,16 @@ deviceGetAll(Boolean disksOnly)
if (fd > 0) {
close(fd);
CHECK_DEVS;
- Devices[numDevs] = new_devices(device_names[i].name);
+ Devices[numDevs] = new_device(device_names[i].name);
Devices[numDevs]->type = DEVICE_TYPE_CDROM;
- Devices[numDevs]->description = devices_names[i].description;
- Devices[numDevs]->ignore = FALSE;
- Devices[numDevs]->init = NULL;
- Devices[numDevs]->get = mediaCDROMGet;
+ Devices[numDevs]->description = device_names[i].description;
+ Devices[numDevs]->enabled = TRUE; /* XXX check for FreeBSD disk later XXX */
+ Devices[numDevs]->init = mediaInitCDROM;
+ Devices[numDevs]->get = mediaGetCDROM;
Devices[numDevs]->close = NULL;
Devices[numDevs]->private = NULL;
msgDebug("Found a device of type CDROM named: %s\n",
- cdrom_table[i]);
+ device_names[i].name);
++numDevs;
}
break;
@@ -207,18 +203,22 @@ deviceGetAll(Boolean disksOnly)
if (fd > 0) {
close(fd);
CHECK_DEVS;
- Devices[numDevs] = new_devices(device_names[i].name);
+ Devices[numDevs] = new_device(device_names[i].name);
Devices[numDevs]->type = DEVICE_TYPE_TAPE;
- Devices[numDevs]->ignore = FALSE;
- Devices[numDevs]->init = mediaTapeInit;
- Devices[numDevs]->get = mediaTapeGet;
- Devices[numDevs]->close = mediaTapeClose;
+ Devices[numDevs]->enabled = TRUE;
+ Devices[numDevs]->init = mediaInitTape;
+ Devices[numDevs]->get = mediaGetTape;
+ Devices[numDevs]->close = mediaCloseTape;
Devices[numDevs]->private = NULL;
msgDebug("Found a device of type TAPE named: %s\n",
- tape_table[i]);
+ device_names[i].name);
++numDevs;
}
break;
+
+ case DEVICE_TYPE_FLOPPY:
+ default:
+ break;
}
}
@@ -240,28 +240,28 @@ deviceGetAll(Boolean disksOnly)
}
ifflags = ifc.ifc_req->ifr_flags;
end = (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len);
- ifptr = ifc.ifc_req;
- while (ifptr < end) {
+ for (ifptr = ifc.ifc_req; ifptr < end; ifptr++) {
+ if (ifptr->ifr_ifru.ifru_addr.sa_family != AF_LINK)
+ continue;
CHECK_DEVS;
- Devices[numDevs] = new_devices(ifptr->ifr_name);
+ Devices[numDevs] = new_device(ifptr->ifr_name);
Devices[numDevs]->type = DEVICE_TYPE_NETWORK;
- Devices[numDevs]->ignore = FALSE;
- Devices[numDevs]->init = mediaNetworkInit;
- Devices[numDevs]->get = mediaNetworkGet;
- Devices[numDevs]->close = mediaNetworkClose;
+ Devices[numDevs]->enabled = TRUE;
+ Devices[numDevs]->init = mediaInitNetwork;
+ Devices[numDevs]->get = mediaGetNetwork;
+ Devices[numDevs]->close = mediaCloseNetwork;
Devices[numDevs]->private = NULL;
msgDebug("Found a device of type network named: %s\n",
ifptr->ifr_name);
++numDevs;
close(s);
- if ((s = socket(af, SOCK_DGRAM, 0)) < 0) {
+ if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
msgConfirm("ifconfig: socket");
continue;
}
if (ifptr->ifr_addr.sa_len) /* Dohw! */
ifptr = (struct ifreq *)((caddr_t)ifptr + ifptr->ifr_addr.sa_len
- sizeof(struct sockaddr));
- ifptr++;
}
/* Terminate the devices array */
Devices[numDevs] = NULL;
@@ -295,30 +295,34 @@ DMenu *
deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)())
{
Device **devs;
+ int numdevs;
+ DMenu *tmp = NULL;
+ int i, j;
devs = deviceFind(NULL, type);
- if (devs) {
- DMenu *tmp;
- int i, j;
+ if (!devs)
+ return NULL;
- tmp = (DMenu *)safe_malloc(sizeof(DMenu) +
- (sizeof(DMenuItem) * (numdevs + 1)));
- bcopy(menu, tmp, sizeof(DMenu));
- for (i = 0; *devs; i++, devs++) {
- tmp->items[i].title = *devs->name;
- for (j = 0; device_names[j].name; j++) {
- if (!strncmp(*devs->name, device_names[j].name,
- strlen(device_names[j].name)))
- tmp->items[i].prompt = devices_names[j].description;
+ for (numdevs = 0; devs[numdevs]; numdevs++);
+ tmp = (DMenu *)safe_malloc(sizeof(DMenu) +
+ (sizeof(DMenuItem) * (numdevs + 1)));
+ bcopy(menu, tmp, sizeof(DMenu));
+ for (i = 0; devs[i]; i++) {
+ tmp->items[i].title = devs[i]->name;
+ for (j = 0; device_names[j].name; j++) {
+ if (!strncmp(devs[i]->name, device_names[j].name,
+ strlen(device_names[j].name))) {
+ tmp->items[i].prompt = device_names[j].description;
+ break;
}
- if (!device_names[j].name)
- tmp->items[i].prompt = "<unknown device type>";
- tmp->items[i].type = DMENU_CALL;
- tmp->items[i].ptr = hook;
- tmp->items[i].disabled = FALSE;
}
- tmp->items[i].type = DMENU_NOP;
- tmp->items[i].title = NULL;
- return tmp;
+ if (!device_names[j].name)
+ tmp->items[i].prompt = "<unknown device type>";
+ tmp->items[i].type = DMENU_CALL;
+ tmp->items[i].ptr = hook;
+ tmp->items[i].disabled = FALSE;
}
+ tmp->items[i].type = DMENU_NOP;
+ tmp->items[i].title = NULL;
+ return tmp;
}
diff --git a/release/sysinstall/disks.c b/release/sysinstall/disks.c
index dafaf37..0f21f60 100644
--- a/release/sysinstall/disks.c
+++ b/release/sysinstall/disks.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: disks.c,v 1.17 1995/05/11 09:01:28 jkh Exp $
+ * $Id: disks.c,v 1.18 1995/05/16 02:53:02 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -79,6 +79,7 @@ print_chunks(Disk *d)
int row;
int i;
+ clear();
attrset(A_NORMAL);
mvaddstr(0, 0, "Disk name:\t");
attrset(A_REVERSE); addstr(d->name); attrset(A_NORMAL);
@@ -108,7 +109,7 @@ print_command_summary()
mvprintw(14, 0, "The following commands are supported (in upper or lower case):");
mvprintw(16, 0, "A = Use Entire Disk B = Bad Block Scan C = Create Partition");
mvprintw(17, 0, "D = Delete Partition G = Set BIOS Geometry S = Set Bootable");
- mvprintw(18, 0, "U = Undo All Changes W = `Wizard' Mode ESC = Proceed to next screen");
+ mvprintw(18, 0, "U = Undo All Changes W = `Wizard' Mode ESC = Exit this screen");
mvprintw(20, 0, "The currently selected partition is displayed in ");
attrset(A_REVERSE); addstr("reverse video."); attrset(A_NORMAL);
mvprintw(21, 0, "Use F1 or ? to get more help, arrow keys to move.");
@@ -124,14 +125,12 @@ diskPartition(Disk *d)
char *msg = NULL;
char name[40];
- dialog_clear();
chunking = TRUE;
strncpy(name, d->name, 40);
keypad(stdscr, TRUE);
record_chunks(d);
while (chunking) {
- clear();
print_chunks(d);
print_command_summary();
if (msg) {
@@ -139,7 +138,6 @@ diskPartition(Disk *d)
beep();
msg = NULL;
}
- refresh();
key = toupper(getch());
switch (key) {
@@ -188,12 +186,14 @@ diskPartition(Disk *d)
if (chunk_info[current_chunk]->type != unused)
msg = "Partition in use, delete it first or move to an unused one.";
else {
- char *val, tmp[20];
+ char *val, tmp[20], *cp;
int size;
snprintf(tmp, 20, "%d", chunk_info[current_chunk]->size);
- val = msgGetInput(tmp, "Please specify size for new FreeBSD partition");
- if (val && (size = strtol(val, 0, 0)) > 0) {
+ val = msgGetInput(tmp, "Please specify the size for new FreeBSD partition in blocks, or append\na trailing `M' for megabytes (e.g. 20M).");
+ if (val && (size = strtol(val, &cp, 0)) > 0) {
+ if (*cp && toupper(*cp) == 'M')
+ size *= 2048;
Create_Chunk(d, chunk_info[current_chunk]->offset,
size,
freebsd,
@@ -282,7 +282,7 @@ diskPartition(Disk *d)
static int
partitionHook(char *str)
{
- Device *devs;
+ Device **devs = NULL;
/* Clip garbage off the ends */
string_prune(str);
@@ -306,6 +306,7 @@ partitionHook(char *str)
else if (devs[1])
msgConfirm("Bizarre multiple match for %s!", str);
devs[0]->private = diskPartition((Disk *)devs[0]->private);
+ devs[0]->enabled = TRUE;
str = cp;
}
return devs ? 1 : 0;
diff --git a/release/sysinstall/dist.c b/release/sysinstall/dist.c
index a2eee9a..e3951f3 100644
--- a/release/sysinstall/dist.c
+++ b/release/sysinstall/dist.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: dist.c,v 1.3 1995/05/10 07:44:55 jkh Exp $
+ * $Id: dist.c,v 1.4 1995/05/16 02:53:05 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -134,77 +134,77 @@ extern Distribution XF86ServerDistTable[];
/* The top-level distribution categories */
static Distribution DistTable[] = {
-{ "bin", &Dist, DIST_BIN, NULL },
-{ "games", &Dist, DIST_GAMES, NULL },
-{ "manpages", &Dist, DIST_MANPAGES, NULL },
-{ "proflibs", &Dist, DIST_PROFLIBS, NULL },
-{ "dict", &Dist, DIST_DICT, NULL },
-{ "src/", &Dist, DIST_SRC, &SrcDistTable },
-{ "des", &Dist, DIST_DES, NULL },
-{ "compat1x", &Dist, DIST_COMPAT1X, NULL },
-{ "xf86311/", &Dist, DIST_XF86, &XF86DistTable },
+{ "bin", &Dists, DIST_BIN, NULL },
+{ "games", &Dists, DIST_GAMES, NULL },
+{ "manpages", &Dists, DIST_MANPAGES, NULL },
+{ "proflibs", &Dists, DIST_PROFLIBS, NULL },
+{ "dict", &Dists, DIST_DICT, NULL },
+{ "src/", &Dists, DIST_SRC, SrcDistTable },
+{ "des", &Dists, DIST_DES, NULL },
+{ "compat1x", &Dists, DIST_COMPAT1X, NULL },
+{ "xf86311/", &Dists, DIST_XF86, XF86DistTable },
{ NULL },
};
/* The /usr/src distribution */
static Distribution SrcDistTable[] = {
-{ "base", &SrcDist, DIST_SRC_BASE, NULL },
-{ "gnu", &SrcDist, DIST_SRC_GNU, NULL },
-{ "etc", &SrcDist, DIST_SRC_ETC, NULL },
-{ "games", &SrcDist, DIST_SRC_GAMES, NULL },
-{ "include", &SrcDist, DIST_SRC_INCLUDE, NULL },
-{ "lib", &SrcDist, DIST_SRC_LIB, NULL },
-{ "libexec", &SrcDist, DIST_SRC_LIBEXEC, NULL },
-{ "lkm", &SrcDist, DIST_SRC_LKM, NULL },
-{ "release", &SrcDist, DIST_SRC_RELEASE, NULL },
-{ "sbin", &SrcDist, DIST_SRC_SBIN, NULL },
-{ "share", &SrcDist, DIST_SRC_SHARE, NULL },
-{ "sys", &SrcDist, DIST_SRC_SYS, NULL },
-{ "ubin", &SrcDist, DIST_SRC_UBIN, NULL },
-{ "usbin", &SrcDist, DIST_SRC_USBIN, NULL },
-{ NULL, 0 },
+{ "base", &SrcDists, DIST_SRC_BASE, NULL },
+{ "gnu", &SrcDists, DIST_SRC_GNU, NULL },
+{ "etc", &SrcDists, DIST_SRC_ETC, NULL },
+{ "games", &SrcDists, DIST_SRC_GAMES, NULL },
+{ "include", &SrcDists, DIST_SRC_INCLUDE, NULL },
+{ "lib", &SrcDists, DIST_SRC_LIB, NULL },
+{ "libexec", &SrcDists, DIST_SRC_LIBEXEC, NULL },
+{ "lkm", &SrcDists, DIST_SRC_LKM, NULL },
+{ "release", &SrcDists, DIST_SRC_RELEASE, NULL },
+{ "sbin", &SrcDists, DIST_SRC_SBIN, NULL },
+{ "share", &SrcDists, DIST_SRC_SHARE, NULL },
+{ "sys", &SrcDists, DIST_SRC_SYS, NULL },
+{ "ubin", &SrcDists, DIST_SRC_UBIN, NULL },
+{ "usbin", &SrcDists, DIST_SRC_USBIN, NULL },
+{ NULL },
};
/* The XFree86 distribution */
static Distribution XF86DistTable[] = {
-{ "bin", &XF86Dist, DIST_XF86_BIN, NULL },
-{ "lib", &XF86Dist, DIST_XF86_LIB, NULL },
-{ "doc", &XF86Dist, DIST_XF86_DOC, NULL },
-{ "xf86311/", &XF86Dist, DIST_XF86_FONTS, &XF86FontDistTable },
-{ "man", &XF86Dist, DIST_XF86_MAN, NULL },
-{ "prog", &XF86Dist, DIST_XF86_PROG, NULL },
-{ "link", &XF86Dist, DIST_XF86_LINK, NULL },
-{ "pex", &XF86Dist, DIST_XF86_PEX, NULL },
-{ "lbx", &XF86Dist, DIST_XF86_LBX, NULL },
-{ "xicf", &XF86Dist, DIST_XF86_XINIT, NULL },
-{ "xdmcf", &XF86Dist, DIST_XF86_XDMCF, NULL },
-{ "xf86311/", &XF86Dist, DIST_XF86_SERVER, &XF86ServerDistTable },
+{ "bin", &XF86Dists, DIST_XF86_BIN, NULL },
+{ "lib", &XF86Dists, DIST_XF86_LIB, NULL },
+{ "doc", &XF86Dists, DIST_XF86_DOC, NULL },
+{ "xf86311/", &XF86Dists, DIST_XF86_FONTS, XF86FontDistTable },
+{ "man", &XF86Dists, DIST_XF86_MAN, NULL },
+{ "prog", &XF86Dists, DIST_XF86_PROG, NULL },
+{ "link", &XF86Dists, DIST_XF86_LINK, NULL },
+{ "pex", &XF86Dists, DIST_XF86_PEX, NULL },
+{ "lbx", &XF86Dists, DIST_XF86_LBX, NULL },
+{ "xicf", &XF86Dists, DIST_XF86_XINIT, NULL },
+{ "xdmcf", &XF86Dists, DIST_XF86_XDMCF, NULL },
+{ "xf86311/", &XF86Dists, DIST_XF86_SERVER, XF86ServerDistTable },
{ NULL },
};
/* The XFree86 server distribution */
static Distribution XF86ServerDistTable[] = {
-{ "X3118514", &XF86ServerDist,DIST_XF86_SERVER_8514, NULL },
-{ "X311AGX", &XF86ServerDist,DIST_XF86_SERVER_AGX, NULL },
-{ "X311Mch3", &XF86ServerDist,DIST_XF86_SERVER_MACH32,NULL },
-{ "X311Mch8", &XF86ServerDist,DIST_XF86_SERVER_MACH8, NULL },
-{ "X311Mono", &XF86ServerDist,DIST_XF86_SERVER_MONO, NULL },
-{ "X311P9K", &XF86ServerDist,DIST_XF86_SERVER_P9000, NULL },
-{ "X311S3", &XF86ServerDist,DIST_XF86_SERVER_S3, NULL },
-{ "X311SVGA", &XF86ServerDist,DIST_XF86_SERVER_SVGA, NULL },
-{ "X311VGA16", &XF86ServerDist,DIST_XF86_SERVER_VGA16, NULL },
-{ "X311W32", &XF86ServerDist,DIST_XF86_SERVER_W32, NULL },
-{ "X311nest", &XF86ServerDist,DIST_XF86_SERVER_NEST, NULL },
+{ "X3118514", &XF86ServerDists, DIST_XF86_SERVER_8514, NULL },
+{ "X311AGX", &XF86ServerDists, DIST_XF86_SERVER_AGX, NULL },
+{ "X311Mch3", &XF86ServerDists, DIST_XF86_SERVER_MACH32,NULL },
+{ "X311Mch8", &XF86ServerDists, DIST_XF86_SERVER_MACH8, NULL },
+{ "X311Mono", &XF86ServerDists, DIST_XF86_SERVER_MONO, NULL },
+{ "X311P9K", &XF86ServerDists, DIST_XF86_SERVER_P9000, NULL },
+{ "X311S3", &XF86ServerDists, DIST_XF86_SERVER_S3, NULL },
+{ "X311SVGA", &XF86ServerDists, DIST_XF86_SERVER_SVGA, NULL },
+{ "X311VGA16", &XF86ServerDists, DIST_XF86_SERVER_VGA16, NULL },
+{ "X311W32", &XF86ServerDists, DIST_XF86_SERVER_W32, NULL },
+{ "X311nest", &XF86ServerDists, DIST_XF86_SERVER_NEST, NULL },
{ NULL },
};
/* The XFree86 font distribution */
static Distribution XF86FontDistTable[] = {
-{ "X311fnts", &XF86FontDist, DIST_XF86_FONTS_MISC, NULL },
-{ "X311f100", &XF86FontDist, DIST_XF86_FONTS_100, NULL },
-{ "X311fscl", &XF86FontDist, DIST_XF86_FONTS_SCALE, NULL },
-{ "X311fnon", &XF86FontDist, DIST_XF86_FONTS_NON, NULL },
-{ "X311fsrv", &XF86FontDist, DIST_XF86_FONTS_SERVER, NULL },
+{ "X311fnts", &XF86FontDists, DIST_XF86_FONTS_MISC, NULL },
+{ "X311f100", &XF86FontDists, DIST_XF86_FONTS_100, NULL },
+{ "X311fscl", &XF86FontDists, DIST_XF86_FONTS_SCALE, NULL },
+{ "X311fnon", &XF86FontDists, DIST_XF86_FONTS_NON, NULL },
+{ "X311fsrv", &XF86FontDists, DIST_XF86_FONTS_SERVER, NULL },
{ NULL },
};
@@ -222,8 +222,8 @@ distExtract(char *parent, Distribution *me)
else {
fp = mediaOpen(parent, me[i].my_name);
if (fp) {
- status = extract_dist(fp);
- close(fp);
+ status = mediaExtractDist(fp);
+ fclose(fp);
}
else {
if (getenv(NO_CONFIRMATION))
diff --git a/release/sysinstall/globals.c b/release/sysinstall/globals.c
index 81c75b0..a0713c5 100644
--- a/release/sysinstall/globals.c
+++ b/release/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.3 1995/05/08 21:39:36 jkh Exp $
+ * $Id: globals.c,v 1.4 1995/05/16 02:53:09 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -72,7 +72,5 @@ globalsInit(void)
OnVTY = FALSE;
DialogActive = FALSE;
VarHead = NULL;
- MediaType = DEVICE_TYPE_NONE;
- MediaDevice = NULL;
}
diff --git a/release/sysinstall/install.c b/release/sysinstall/install.c
index 7f531f7..8037234 100644
--- a/release/sysinstall/install.c
+++ b/release/sysinstall/install.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: install.c,v 1.16 1995/05/11 09:01:32 jkh Exp $
+ * $Id: install.c,v 1.17 1995/05/16 02:53:11 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -76,32 +76,31 @@ installCommit(char *str)
msgConfirm("You haven't told me what distributions to load yet!\nPlease select a distribution from the Distributions menu.");
return 0;
}
- if (mediaVerifyStatus()) {
+ if (mediaVerify()) {
msgConfirm("Please correct installation media problems and try again!");
return 0;
}
if (msgYesNo("Last Chance! Are you SURE you want continue the\ninstallation? If you're running this on an existing system, we STRONGLY\nencourage you to make proper backups before doing this.\nWe take no responsibility for lost disk contents!"))
return 0;
- dialog_clear();
+
mbrContents = NULL;
if (!msgYesNo("Would you like to install a boot manager?\n\nThis will allow you to easily select between other operating systems\non the first disk, or boot from a disk other than the first."))
mbrContents = bteasy17;
else {
- dialog_clear();
if (!msgYesNo("Would you like to remove an existing boot manager?"))
mbrContents = mbr;
}
- for (i = 0; Devices[i]; i++) {
- if (Devices[i]->type != DEVICE_TYPE_DISK)
- continue;
+ devs = deviceFind(NULL, DEVICE_TYPE_DISK);
+ for (i = 0; devs[i]; i++) {
+ Disk *d = (Disk *)devs[i]->private;
+
if (mbrContents) {
- Set_Boot_Mgr((Disk *)Devices[i]->private, mbrContents);
+ Set_Boot_Mgr(d, mbrContents);
mbrContents = NULL;
}
- Set_Boot_Blocks((Disk *)Devices[i]->private, boot1, boot2);
- msgNotify("Writing partition information to drive %s",
- Devices[i]->name);
- Write_Disk((Disk *)Devices[i]->private);
+ Set_Boot_Blocks(d, boot1, boot2);
+ msgNotify("Writing partition information to drive %s", d->name);
+ Write_Disk(d);
}
make_filesystems();
cpio_extract();
@@ -116,38 +115,73 @@ make_filesystems(void)
{
int i;
Disk *disk;
- Chunk *c1;
+ Chunk *c1, *c2;
+ Device **devs;
command_clear();
- for (i = 0; Devices[i]; i++) {
- if (Devices[i]->type != DEVICE_TYPE_DISK)
- continue;
+ devs = deviceFind(NULL, DEVICE_TYPE_DISK);
- disk = (Disk *)Devices[i]->private;
+ /* First look for the root device and mount it */
+ for (i = 0; devs[i]; i++) {
+ disk = (Disk *)devs[i]->private;
if (!disk->chunks)
msgFatal("No chunk list found for %s!", disk->name);
c1 = disk->chunks->part;
while (c1) {
if (c1->type == freebsd) {
- Chunk *c2 = c1->part;
-
- while (c2) {
+ for (c2 = c1->part; c2; c2 = c2->next) {
if (c2->type == part && c2->subtype != FS_SWAP &&
- c2->private) {
+ c2->private && c2->flags & CHUNK_IS_ROOT) {
+ char dname[40];
+ PartInfo *p = (PartInfo *)c2->private;
+
+ if (strcmp(p->mountpoint, "/"))
+ continue;
+ sprintf(dname, "/dev/%sa", disk->name);
+ if (p->newfs) {
+ msgDebug("newfs %s", dname);
+ if (vsystem("newfs %s", dname)) {
+ msgConfirm("Unable to make new root filesystem!");
+ return;
+ }
+ }
+ else
+ 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.");
+ if (Mount(dname, NULL)) {
+ msgConfirm("Unable to mount the root file system! Giving up.");
+ return;
+ }
+ else
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ /* Now buzz through the rest of the devices and mount them too */
+ for (i = 0; devs[i]; i++) {
+ disk = (Disk *)devs[i]->private;
+ if (!disk->chunks)
+ msgFatal("No chunk list found for %s!", disk->name);
+ /* Make the proper device mount points in /mnt/dev */
+ 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, "/"))
+ continue;
+
if (tmp->newfs)
command_shell_add(tmp->mountpoint,
- "%s %s", tmp->newfs_cmd,
- c2->name);
- if (strcmp(tmp->mountpoint, "/"))
- command_func_add(tmp->mountpoint, Mkdir, NULL);
+ "%s %s", tmp->newfs_cmd, c2->name);
command_func_add(tmp->mountpoint, Mount, c2->name);
}
- c2 = c2->next;
}
}
- c1 = c1->next;
}
}
command_sort();
diff --git a/release/sysinstall/label.c b/release/sysinstall/label.c
index 9d769a0..cbbe10e 100644
--- a/release/sysinstall/label.c
+++ b/release/sysinstall/label.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: disks.c,v 1.17 1995/05/11 09:01:28 jkh Exp $
+ * $Id: label.c,v 1.1 1995/05/16 02:53:13 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -116,6 +116,7 @@ record_label_chunks()
int i, j, p;
struct chunk *c1, *c2;
Device **devs;
+ Disk *d;
devs = deviceFind(NULL, DEVICE_TYPE_DISK);
if (!devs) {
@@ -124,23 +125,31 @@ record_label_chunks()
}
j = p = 0;
+ /* First buzz through and pick up the FreeBSD slices */
for (i = 0; devs[i]; i++) {
- if (!((Disk *)devs[i]->private)->chunks)
- msgFatal("No chunk list found for %s!", ((Disk *)devs[i]->private)->name);
-
- /* Put the freebsd chunks first */
- for (c1 = ((Disk *)devs[i]->private)->chunks->part; c1; c1 = c1->next) {
+ if (!devs[i]->enabled)
+ continue;
+ d = (Disk *)devs[i]->private;
+ if (!d->chunks)
+ msgFatal("No chunk list found for %s!", d->name);
+
+ /* Put the slice entries first */
+ for (c1 = d->chunks->part; c1; c1 = c1->next) {
if (c1->type == freebsd) {
label_chunk_info[j].type = PART_SLICE;
- label_chunk_info[j].d = ((Disk *)devs[i]->private);
+ label_chunk_info[j].d = d;
label_chunk_info[j].c = c1;
++j;
}
}
}
- for (i = 0; ((Disk *)devs[i]->private); i++) {
+ /* Now run through again and get the FreeBSD partition entries */
+ for (i = 0; devs[i]; i++) {
+ if (!devs[i]->enabled)
+ continue;
+ d = (Disk *)devs[i]->private;
/* Then buzz through and pick up the partitions */
- for (c1 = ((Disk *)devs[i]->private)->chunks->part; c1; c1 = c1->next) {
+ for (c1 = d->chunks->part; c1; c1 = c1->next) {
if (c1->type == freebsd) {
for (c2 = c1->part; c2; c2 = c2->next) {
if (c2->type == part) {
@@ -148,7 +157,7 @@ record_label_chunks()
label_chunk_info[j].type = PART_SWAP;
else
label_chunk_info[j].type = PART_FILESYSTEM;
- label_chunk_info[j].d = ((Disk *)devs[i]->private);
+ label_chunk_info[j].d = d;
label_chunk_info[j].c = c2;
++j;
}
@@ -156,7 +165,7 @@ record_label_chunks()
}
else if (c1->type == fat) {
label_chunk_info[j].type = PART_FAT;
- label_chunk_info[j].d = ((Disk *)devs[i]->private);
+ label_chunk_info[j].d = d;
label_chunk_info[j].c = c1;
}
}
@@ -281,6 +290,7 @@ print_label_chunks(void)
int i, j, srow, prow, pcol;
int sz;
+ clear();
attrset(A_REVERSE);
mvaddstr(0, 25, "FreeBSD Disklabel Editor");
attrset(A_NORMAL);
@@ -389,7 +399,7 @@ print_command_summary()
mvprintw(17, 0,
"The following commands are valid here (upper or lower case):");
mvprintw(19, 0, "C = Create Partition D = Delete Partition M = Mount Partition");
- mvprintw(20, 0, "N = Newfs Options T = Toggle Newfs ESC = Finish Partitioning");
+ mvprintw(20, 0, "N = Newfs Options T = Toggle Newfs ESC = Exit this screen");
mvprintw(21, 0, "The default target will be displayed in ");
attrset(A_REVERSE);
@@ -408,13 +418,11 @@ diskLabelEditor(char *str)
PartInfo *p;
PartType type;
- dialog_clear();
labeling = TRUE;
keypad(stdscr, TRUE);
record_label_chunks();
while (labeling) {
- clear();
print_label_chunks();
print_command_summary();
if (msg) {
@@ -528,7 +536,7 @@ diskLabelEditor(char *str)
msg = "You don't need to specify a mountpoint for a swap partition.";
break;
- case PART_DOS:
+ case PART_FAT:
case PART_FILESYSTEM:
p = get_mountpoint(NULL, label_chunk_info[here].c);
if (p) {
@@ -565,7 +573,6 @@ diskLabelEditor(char *str)
int i;
Device **devs;
- clear();
dialog_clear();
end_dialog();
DialogActive = FALSE;
@@ -576,7 +583,6 @@ diskLabelEditor(char *str)
}
for (i = 0; ((Disk *)devs[i]->private); i++)
slice_wizard(((Disk *)devs[i]->private));
- clear();
dialog_clear();
DialogActive = TRUE;
record_label_chunks();
@@ -596,6 +602,8 @@ diskLabelEditor(char *str)
}
}
variable_set2(DISK_LABELLED, "yes");
+ clear();
+ refresh();
}
diff --git a/release/sysinstall/main.c b/release/sysinstall/main.c
index ce9ce46..c32c6ed 100644
--- a/release/sysinstall/main.c
+++ b/release/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.5 1995/05/07 03:38:00 jkh Exp $
+ * $Id: main.c,v 1.6 1995/05/16 02:53:16 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -57,18 +57,19 @@ main(int argc, char **argv)
/* Set up whatever things need setting up */
systemInitialize(argc, argv);
+ /* Probe for all relevant devices on the system */
+ deviceGetAll();
+
/* Welcome user to FreeBSD */
systemWelcome();
/* Default to English */
/* lang_set_English(NULL); */
- /*
/* Begin user dialog at outer menu */
while (1) {
choice = scroll = curr = max = 0;
dmenuOpen(&MenuInitial, &choice, &scroll, &curr, &max);
- dialog_clear();
if (getpid() != 1 || !msgYesNo("Are you sure you wish to exit? System will reboot."))
break;
}
diff --git a/release/sysinstall/media.c b/release/sysinstall/media.c
index 1b360f5..da2fdd6 100644
--- a/release/sysinstall/media.c
+++ b/release/sysinstall/media.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: media.c,v 1.3 1995/05/01 21:56:23 jkh Exp $
+ * $Id: media.c,v 1.4 1995/05/16 02:53:18 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -41,6 +41,9 @@
*
*/
+#include <stdio.h>
+#include "sysinstall.h"
+
/*
* Return 1 if we successfully found and set the installation type to
* be a CD.
@@ -48,12 +51,14 @@
int
mediaSetCDROM(char *str)
{
+ extern DMenu MenuMediaCDROM;
+
if (OnCDROM == TRUE)
return 1;
else {
dmenuOpenSimple(&MenuMediaCDROM);
if (getenv(MEDIA_DEVICE)) {
- variable_set(MEDIA_TYPE, "cdrom");
+ variable_set2(MEDIA_TYPE, "cdrom");
return 1;
}
}
@@ -67,6 +72,8 @@ mediaSetCDROM(char *str)
int
mediaSetFloppy(char *str)
{
+ extern DMenu MenuMediaFloppy;
+
dmenuOpenSimple(&MenuMediaFloppy);
if (getenv(MEDIA_DEVICE)) {
variable_set2(MEDIA_TYPE, "floppy");
@@ -107,7 +114,9 @@ mediaSetTape(char *str)
int
mediaSetFTP(char *str)
{
- dmenuOpenSimple(&MenuMediaFtp);
+ extern DMenu MenuMediaFTP;
+
+ dmenuOpenSimple(&MenuMediaFTP);
if (getenv(MEDIA_DEVICE)) {
variable_set2(MEDIA_TYPE, "ftp");
return 1;
@@ -125,24 +134,10 @@ mediaSetFS(char *str)
return 0;
}
-Boolean
-mediaGetType(void)
-{
- extern DMenu MenuMedia;
- char *cp;
-
- dmenuOpenSimple(&MenuMedia);
- cp = getenv(MEDIA_TYPE);
- if (!cp)
- return FALSE;
- return TRUE;
-}
-
FILE *
-mediaOpen(char *parent, *char *me)
+mediaOpen(char *parent, char *me)
{
char fname[FILENAME_MAX];
- FILE *fp;
if (!getenv(MEDIA_TYPE)) {
if (!mediaGetType())
@@ -157,52 +152,99 @@ mediaOpen(char *parent, *char *me)
else
strncpy(fname, me, FILENAME_MAX);
/* XXX find a Device here XXX */
+ return NULL;
+}
+
+Boolean
+mediaExtractDist(FILE *fp)
+{
+ return TRUE;
+}
+
+Boolean
+mediaGetType(void)
+{
+ extern DMenu MenuMedia;
+ char *cp;
+
+ dmenuOpenSimple(&MenuMedia);
+ cp = getenv(MEDIA_TYPE);
+ if (!cp)
+ return FALSE;
+ return TRUE;
}
-/* Various media "get" routines */
+/* Various media "strategy" routines */
Boolean
-mediaUFSGet(char *dist)
+mediaInitUFS(Device *dev)
{
return TRUE;
}
Boolean
-mediaCDROMGet(char *dist)
+mediaGetUFS(char *dist)
{
return TRUE;
}
+/* UFS has no close routine since this is handled at the device level */
+
Boolean
-mediaTapeInit(void)
+mediaInitCDROM(Device *dev)
{
return TRUE;
}
Boolean
-mediaTapeGet(char *dist)
+mediaGetCDROM(char *dist)
{
return TRUE;
}
void
-mediaTapeClose(void)
+mediaCloseCDROM(Device *dev)
{
+ return;
}
Boolean
-mediaNetworkInit(void)
+mediaInitTape(Device *dev)
{
return TRUE;
}
Boolean
-mediaNetworkGet(char *dist)
+mediaGetTape(char *dist)
{
return TRUE;
}
void
-mediaNetworkClose(void)
+mediaCloseTape(Device *dev)
{
+ return;
+}
+
+Boolean
+mediaInitNetwork(Device *dev)
+{
+ return TRUE;
}
+Boolean
+mediaGetNetwork(char *dist)
+{
+ return TRUE;
+}
+
+void
+mediaCloseNetwork(Device *dev)
+{
+}
+
+/* Return TRUE if all the media variables are set up correctly */
+Boolean
+mediaVerify(void)
+{
+ return TRUE;
+}
diff --git a/release/sysinstall/menus.c b/release/sysinstall/menus.c
index f2da40b..1f4f0d0 100644
--- a/release/sysinstall/menus.c
+++ b/release/sysinstall/menus.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: menus.c,v 1.12 1995/05/11 06:47:46 jkh Exp $
+ * $Id: menus.c,v 1.13 1995/05/16 02:53:23 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -54,8 +54,10 @@
extern DMenu MenuDocumentation;
extern DMenu MenuOptions;
extern DMenu MenuOptionsLanguage;
-extern DMenu MenuOptionsFtp;
+extern DMenu MenuOptionsFTP;
extern DMenu MenuMedia;
+extern DMenu MenuMediaFloppy;
+extern DMenu MenuInstall;
extern DMenu MenuInstallType;
extern DMenu MenuInstallOptions;
extern DMenu MenuDistributions;
@@ -73,16 +75,16 @@ DMenu MenuInitial = {
select one of the options below by using the arrow keys or typing the\n\
first character of the option name you're interested in. Invoke an\n\
option by pressing enter. If you'd like a shell, press ESC", /* prompt */
- "Press F1 for usage instructions", /* help line */
- "usage.hlp", /* help file */
+ "Press F1 for usage instructions", /* help line */
+ "usage.hlp", /* help file */
{ { "Usage", "Quick start - How to use this menu system.", /* U */
DMENU_DISPLAY_FILE, (void *)"usage.hlp", 0, 0 },
- { "Doc", "More detailed documentation on FreeBSD.", /* D */
+ { "Doc", "More detailed documentation on FreeBSD.", /* D */
DMENU_SUBMENU, (void *)&MenuDocumentation, 0, 0 },
- { "Options", "Select options for this utility.", /* O */
+ { "Options", "Select various options for this utility.", /* O */
DMENU_SUBMENU, (void *)&MenuOptions, 0, 0 },
- { "Install", "Begin installation", /* I */
- DMENU_CALL, (void *)installCustom, 0, 0 },
+ { "Install", "Begin installation", /* I */
+ DMENU_SUBMENU, (void *)&MenuInstall, 0, 0 },
{ NULL } },
};
@@ -98,17 +100,17 @@ consult the README file. If you're having other problems, you may find\n\
answers in the FAQ.",
"Confused? Press F1 for help.",
"usage.hlp", /* help file */
- { { "README", "Read this for a general description of FreeBSD", /* R */
+ { { "README", "Read this for a general description of FreeBSD", /* R */
DMENU_DISPLAY_FILE, (void *)"README", 0, 0 },
- { "Hardware", "The FreeBSD survival guide for PC hardware.", /* H */
+ { "Hardware", "The FreeBSD survival guide for PC hardware.", /* H */
DMENU_DISPLAY_FILE, (void *)"hardware.hlp", 0, 0 },
- { "Install", "A step-by-step guide to installing FreeBSD.", /* I */
+ { "Install", "A step-by-step guide to installing FreeBSD.", /* I */
DMENU_DISPLAY_FILE, (void *)"install.hlp", 0, 0 },
{ "Copyright", "The FreeBSD Copyright notices.", /* C */
DMENU_DISPLAY_FILE, (void *)"COPYRIGHT", 0, 0 },
- { "Release", "The release notes for this version of FreeBSD.", /* R */
+ { "Release", "The release notes for this version of FreeBSD.", /* R */
DMENU_DISPLAY_FILE, (void *)"COPYRIGHT", 0, 0 },
- { "FAQ", "Frequently Asked Questions about FreeBSD.", /* F */
+ { "FAQ", "Frequently Asked Questions about FreeBSD.", /* F */
DMENU_DISPLAY_FILE, (void *)"faq.hlp", 0, 0 },
{ NULL } },
};
@@ -132,27 +134,27 @@ of the english versions. This feature is nonetheless considered\n\
to be in experimental status at this time.", /* prompt */
"Press F1 for more information", /* help line */
"language.hlp", /* help file */
- { { "Danish", "Danish language and character set (ISO-8859-1)", /* D */
+ { { "Danish", "Danish language and character set (ISO-8859-1)", /* D */
DMENU_CALL, (void *)lang_set_Danish, 0, 0 },
- { "Dutch", "Dutch language and character set (ISO-8859-1)", /* D */
+ { "Dutch", "Dutch language and character set (ISO-8859-1)", /* D */
DMENU_CALL, (void *)lang_set_Dutch, 0, 0 },
- { "English", "English language (system default)", /* E */
+ { "English", "English language (system default)", /* E */
DMENU_CALL, (void *)lang_set_English, 0, 0 },
- { "French", "French language and character set (ISO-8859-1)", /* F */
+ { "French", "French language and character set (ISO-8859-1)", /* F */
DMENU_CALL, (void *)lang_set_French, 0, 0 },
- { "German", "German language and character set (ISO-8859-1)", /* G */
+ { "German", "German language and character set (ISO-8859-1)", /* G */
DMENU_CALL, (void *)lang_set_German, 0, 0 },
- { "Italian", "Italian language and character set (ISO-8859-1)", /* I */
+ { "Italian", "Italian language and character set (ISO-8859-1)", /* I */
DMENU_CALL, (void *)lang_set_Italian, 0, 0 },
- { "Japanese", "Japanese language and default character set (romaji)",/* J */
+ { "Japanese", "Japanese language and default character set (romaji)", /* J */
DMENU_CALL, (void *)lang_set_Japanese, 0, 0 },
{ "Norwegian", "Norwegian language and character set (ISO-8859-1)", /* N */
DMENU_CALL, (void *)lang_set_Norwegian, 0, 0 },
- { "Russian", "Russian language and character set (cp866-8x14)", /* R */
+ { "Russian", "Russian language and character set (cp866-8x14)", /* R */
DMENU_CALL, (void *)lang_set_Russian, 0, 0 },
- { "Spanish", "Spanish language and character set (ISO-8859-1)", /* S */
+ { "Spanish", "Spanish language and character set (ISO-8859-1)", /* S */
DMENU_CALL, (void *)lang_set_Spanish, 0, 0 },
- { "Swedish", "Swedish language and character set (ISO-8859-1)", /* S */
+ { "Swedish", "Swedish language and character set (ISO-8859-1)", /* S */
DMENU_CALL, (void *)lang_set_Swedish, 0, 0 },
{ NULL } },
};
@@ -161,33 +163,53 @@ DMenu MenuMediaCDROM = {
DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"Choose a CDROM type",
"FreeBSD can be installed directly from a CDROM containing a valid\n\
-FreeBSD 2.0.5 distribution. If you're seeing this menu, it's because\n\
-your CDROM drive was not properly auto-detected, or you did not launch\n\
-this installation from the CD under DOS or Windows. If you think you are\n
-seeing this dialog in error, you may wish to reboot FreeBSD with the\n\
--c boot flag (.. boot: /kernel -c) and check that your hardware and\n\
-the kernel agree on reasonable values.",
+FreeBSD 2.0.5 distribution. If you are seeing this menu, it's either\n\
+because you haven't booted directly from the CDROM in DOS/Windows or\n\
+your CDROM was not detected. If you feel that you are seeing this dialog\n\
+in error, you may wish to reboot FreeBSD with the -c boot flag (see the\n\
+hardware guide in the Documentation menu for more info) and check that your\n\
+CDROM controller and the kernel agree on reasonable values. Please also note\n\
+that FreeBSD does NOT currently support IDE CDROM drives!",
"Press F1 for more information on CDROM support",
"media_cdrom.hlp",
- { { "Matsushita", "Panasonic \"Sound Blaster\" CDROM.",
+ { { "Matsushita", "Panasonic \"Sound Blaster\" CDROM.", /* M */
DMENU_SET_VARIABLE, (void *)"mediaDevice=/dev/matcd0a", 0, 0 },
- { "Mitsumi", "Mitsumi FX-001 series drive (not IDE)",
+ { "Mitsumi", "Mitsumi FX-001 series drive (not IDE)", /* M */
DMENU_SET_VARIABLE, (void *)"mediaDevice=/dev/mcd0a", 0, 0 },
- { "SCSI", "SCSI CDROM drive attached to supported SCSI controller",
+ { "SCSI", "SCSI CDROM drive attached to supported SCSI controller", /* S */
DMENU_SET_VARIABLE, (void *)"mediaDevice=/dev/cd0a", 0, 0 },
- { "Sony", "Sony CDU31/33A or compatible CDROM drive",
+ { "Sony", "Sony CDU31/33A or compatible CDROM drive", /* S */
DMENU_SET_VARIABLE, (void *)"mediaDevice=/dev/scd0a", 0, 0 },
{ NULL } },
};
+DMenu MenuMediaFloppy = {
+ DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
+ "Choose a Floppy drive",
+ "FreeBSD can also be installed from floppy disk media,\n\
+though not without some pain. You should have prepared your\n\
+floppy distribution media using the DOS floppy install-set\n\
+construction procedure or have otherwise prepared a set of\n\
+diskettes for each distribution that properly contains all the\n\
+components of the distribution plus the extraction and checksumming\n\
+scripts.",
+ "Please select the floppy drive you want to use",
+ NULL,
+ { { "A", "Floppy drive A", /* M */
+ DMENU_SET_VARIABLE, (void *)"mediaDevice=/dev/fd0a", 0, 0 },
+ { "B", "Floppy drive B", /* M */
+ DMENU_SET_VARIABLE, (void *)"mediaDevice=/dev/fd1a", 0, 0 },
+ { 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.\n\
-Please select the site closest to you or \"other\" if you'd like\n\
-to specify another choice. Also note that not all sites carry\n\
-every possible distribution! Distributions other than the basic\n\
-binary set are only guaranteed to be available from the Primary site.\n\
+ "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 available\n\
+from the Primary site.\n\n\
If the first site selected doesn't respond, try one of the alternates.",
"Select a site that's close!",
"media_ftp.hlp",
@@ -304,7 +326,9 @@ the list of distributions yourself, simply select `custom'.",
DMenu MenuDistributions = {
DMENU_MULTIPLE_TYPE | DMENU_SELECTION_RETURNS,
"Select the distributions you wish to install.",
- "Please check off the distributions you wish to install.",
+ "Please check off the distributions you wish to install. Some\n
+of the most generally useful distributions are already checked, and\n\
+selecting OK at this stage will chose them as defaults.",
"Press F1 for a more complete description of these distributions.",
"distribution_types.hlp",
{ { "*bin", "Binary base distribution (required)",
@@ -518,9 +542,9 @@ user, will be prompted for options.",
NULL,
NULL,
{ { "Ftp Options", "Ftp options menu",
- DMENU_SUBMENU, (void *)&MenuOptionsFtp, 0, 0 },
+ DMENU_SUBMENU, (void *)&MenuOptionsFTP, 0, 0 },
{ "Language", "Select your preferred language",
- DMENU_SUBMENU, (void *)&MenuOptionsLanguage, 0, 0 }
+ DMENU_SUBMENU, (void *)&MenuOptionsLanguage, 0, 0 },
{ "NFS Secure", "NFS server talks only on a secure port",
DMENU_SET_VARIABLE, (void *)"nfsServerSecure=yes", 0, 0 },
{ "NFS Slow", "User is using a slow PC or ethernet card",
@@ -532,19 +556,21 @@ user, will be prompted for options.",
{ NULL } },
};
-DMenu MenuInstallFtpOptions = {
- DMENU_RADIO_TYPE | DMENU_SELECTION_RETURNS,
- "Choose Ftp Options",
+DMenu MenuOptionsFTP = {
+ DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
+ "Choose FTP Options",
"In case of ftp failure, how would you like this installation\n\
to deal with it? You have one of several choices:",
NULL,
NULL,
- { { "*Ftp Retry", "On transfer failure, retry same host",
+ { { "Ftp Retry", "On transfer failure, retry same host",
DMENU_SET_VARIABLE, (void *)"ftpRetryType=loop", 0, 0 },
{ "Ftp Reselect", "On transfer failure, ask for another host",
DMENU_SET_VARIABLE, (void *)"ftpRetryType=reselect", 0, 0 },
{ "Ftp Abort", "On transfer failure, abort installation",
DMENU_SET_VARIABLE, (void *)"ftpRetryType=abort", 0, 0 },
+ { "Ftp passive", "Use \"passive mode\" for firewalled ftp",
+ DMENU_SET_VARIABLE, (void *)"ftpPassive=yes", 0, 0 },
{ NULL } },
};
@@ -558,18 +584,20 @@ and from where you wish to install it. There are also a number\n\
of options you can specify in the Options menu which will determine\n\
how. You may choose install FreeBSD at this time, you may\n\
select Cancel to leave this menu.",
- "You may also wish to read the install guide - press F1 to do so",
+ "Press F1 to read the installation guide",
"install.hlp",
{ { "Distributions", "Choose the type of installation you want", /* T */
DMENU_SUBMENU, (void *)&MenuInstallType, 0, 0 },
{ "Media", "Choose the installation media type", /* M */
DMENU_SUBMENU, (void *)&MenuMedia, 0, 0 },
- { "Partition", "Go to the Disk Partition Editor", /* P */
+ { "Partition", "Go to the Disk Partition Editor", /* P */
DMENU_CALL, (void *)diskPartitionEditor, 0, 0 },
- { "Label", "Label the contents of disk partitions", /* L */
+ { "Label", "Label allocated disk partitions for FreeBSD", /* L */
DMENU_CALL, (void *)diskLabelEditor, 0, 0 },
- { "GO!", "Start the whole show and go out for coffee!", /* P */
- DMENU_CANCEL, (void *)NULL, 0, 0 },
+ { "Networking", "Configure any network interfaces", /* N */
+ DMENU_CALL, (void *)tcpOpenDialog, 0, 0 },
+ { "GO!", "Start the whole show and go out for coffee!", /* P */
+ DMENU_CALL, (void *)installCommit, 0, 0 },
{ "Options", "Set special installation options", /* O */
DMENU_SUBMENU, (void *)&MenuOptions, 0, 0},
{ NULL } },
diff --git a/release/sysinstall/misc.c b/release/sysinstall/misc.c
index 500b454..5084c88 100644
--- a/release/sysinstall/misc.c
+++ b/release/sysinstall/misc.c
@@ -1,7 +1,7 @@
/*
* Miscellaneous support routines..
*
- * $Id: misc.c,v 1.3 1995/05/01 21:56:27 jkh Exp $
+ * $Id: misc.c,v 1.4 1995/05/08 21:39:39 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -40,6 +40,16 @@
#include "sysinstall.h"
#include <ctype.h>
+#include <sys/stat.h>
+#include <sys/errno.h>
+#include <sys/file.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <sys/param.h>
+#include <sys/mount.h>
+#include <sys/reboot.h>
+#include <sys/dkbad.h>
+#include <sys/disklabel.h>
/* Quick check to see if a file is readable */
Boolean
@@ -161,3 +171,62 @@ items_free(char **list, int *curr, int *max)
*curr = *max = 0;
}
+int
+Mkdir(char *ipath, void *data)
+{
+ struct stat sb;
+ int final=0;
+ char *p, *path = strdup(ipath);
+
+ msgDebug("mkdir(%s)\n", path);
+ p = path;
+ if (p[0] == '/') /* Skip leading '/'. */
+ ++p;
+ for (;!final; ++p) {
+ if (p[0] == '\0' || (p[0] == '/' && p[1] == '\0'))
+ final++;
+ else if (p[0] != '/')
+ continue;
+ *p = '\0';
+ if (stat(path, &sb)) {
+ if (errno != ENOENT) {
+ msgConfirm("Couldn't stat directory %s: %s", path, strerror(errno));
+ return 1;
+ }
+ msgDebug("mkdir(%s..)\n", path);
+ if (mkdir(path, S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
+ msgConfirm("Couldn't create directory %s: %s", path,strerror(errno));
+ return 1;
+ }
+ }
+ *p = '/';
+ }
+ free(path);
+ return 0;
+}
+
+int
+Mount(char *device, void *data)
+{
+ struct ufs_args ufsargs;
+ char mountpoint[FILENAME_MAX];
+
+ strcpy(mountpoint, "/mnt");
+ if (data)
+ sprintf(mountpoint + 4, "/%s", (char *)data);
+
+ memset(&ufsargs,0,sizeof ufsargs);
+
+ if (access(mountpoint, R_OK))
+ Mkdir(mountpoint, NULL);
+
+ msgDebug("mount %s %s\n", device, mountpoint);
+ 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;
+ }
+ return 0;
+}
+
diff --git a/release/sysinstall/msg.c b/release/sysinstall/msg.c
index 8e2a797..b861f12 100644
--- a/release/sysinstall/msg.c
+++ b/release/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.9 1995/05/08 06:06:26 jkh Exp $
+ * $Id: msg.c,v 1.10 1995/05/11 06:10:56 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -171,7 +171,7 @@ msgConfirm(char *fmt, ...)
va_end(args);
use_helpline(NULL);
use_helpfile(NULL);
- dialog_mesgbox("User Attention Requested", errstr, -1, -1);
+ dialog_notify(errstr);
free(errstr);
}
@@ -181,6 +181,7 @@ msgNotify(char *fmt, ...)
{
va_list args;
char *errstr;
+ WINDOW *w;
errstr = (char *)safe_malloc(FILENAME_MAX);
va_start(args, fmt);
@@ -188,7 +189,11 @@ msgNotify(char *fmt, ...)
va_end(args);
use_helpline(NULL);
use_helpfile(NULL);
+ w = dupwin(newscr);
dialog_msgbox("Information Dialog", errstr, -1, -1, 0);
+ touchwin(w);
+ wrefresh(w);
+ delwin(w);
free(errstr);
}
@@ -199,6 +204,7 @@ msgYesNo(char *fmt, ...)
va_list args;
char *errstr;
int ret;
+ WINDOW *w;
errstr = (char *)safe_malloc(FILENAME_MAX);
va_start(args, fmt);
@@ -206,7 +212,11 @@ msgYesNo(char *fmt, ...)
va_end(args);
use_helpline(NULL);
use_helpfile(NULL);
+ w = dupwin(newscr);
ret = dialog_yesno("User Confirmation Requested", errstr, -1, -1);
+ touchwin(w);
+ wrefresh(w);
+ delwin(w);
free(errstr);
return ret;
}
@@ -219,6 +229,7 @@ msgGetInput(char *buf, char *fmt, ...)
char *errstr;
static char input_buffer[256];
int rval;
+ WINDOW *w;
errstr = (char *)safe_malloc(FILENAME_MAX);
va_start(args, fmt);
@@ -230,7 +241,11 @@ msgGetInput(char *buf, char *fmt, ...)
strcpy(input_buffer, buf);
else
input_buffer[0] = '\0';
+ w = dupwin(newscr);
rval = dialog_inputbox("Value Required", errstr, -1, -1, input_buffer);
+ touchwin(w);
+ wrefresh(w);
+ delwin(w);
free(errstr);
if (!rval)
return input_buffer;
diff --git a/release/sysinstall/sysinstall.h b/release/sysinstall/sysinstall.h
index 73579e3..5a86272 100644
--- a/release/sysinstall/sysinstall.h
+++ b/release/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.15 1995/05/10 07:45:00 jkh Exp $
+ * $Id: sysinstall.h,v 1.16 1995/05/16 02:53:26 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -81,12 +81,13 @@
#define VAR_HOSTNAME "hostname"
#define VAR_DOMAINNAME "domainname"
-#define VAR_IPADDR "ip_addr"
#define VAR_NAMESERVER "nameserver"
+#define VAR_GATEWAY "gateway"
+/* per-interface flags */
#define VAR_IFCONFIG_ARGS "if_flags"
#define VAR_NETMASK "netmask"
-#define VAR_GATEWAY "gateway"
+#define VAR_IPADDR "ip_addr"
/*** Types ***/
@@ -145,12 +146,13 @@ typedef enum {
/* A "device" from sysinstall's point of view */
typedef struct _device {
char name[DEV_NAME_MAX];
+ char *description;
DeviceType type;
Boolean enabled;
- int (*deviceInit)(void);
- int (*deviceGet)(char *fname);
- int (*deviceClose)(void);
- void *devicePrivate;
+ Boolean (*init)(struct _device *);
+ Boolean (*get)(char *fname);
+ void (*close)(struct _device *);
+ void *private;
} Device;
/* Some internal representations of partitions */
@@ -189,7 +191,6 @@ 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 Device *Devices[]; /* The devices we have to work with */
/*** Prototypes ***/
@@ -207,10 +208,11 @@ extern Boolean decode_and_dispatch_multiple(DMenu *menu, char *names);
/* devices.c */
extern DMenu *deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)());
-extern Device *deviceGetInfo(DeviceType which);
+extern void deviceGetAll(void);
+extern Device **deviceFind(char *name, DeviceType type);
/* disks.c */
-extern int diskPartitionEditor(Disk *disk);
+extern int diskPartitionEditor(char *unused);
/* dist.c */
extern int distSetDeveloper(char *str);
@@ -231,9 +233,7 @@ extern void dmenuOpenSimple(DMenu *menu);
extern void globalsInit(void);
/* install.c */
-extern int installCustom(char *str);
-extern int installExpress(char *str);
-extern int installMaint(char *str);
+extern int installCommit(char *str);
/* lang.c */
extern void lang_set_Danish(char *str);
@@ -271,6 +271,22 @@ extern int mediaSetDOS(char *str);
extern int mediaSetTape(char *str);
extern int mediaSetFTP(char *str);
extern int mediaSetFS(char *str);
+extern FILE *mediaOpen(char *parent, char *me);
+extern Boolean mediaGetType(void);
+extern Boolean mediaExtractDist(FILE *fp);
+extern Boolean mediaVerify(void);
+extern Boolean mediaInitUFS(Device *dev);
+extern Boolean mediaGetUFS(char *dist);
+extern Boolean mediaInitCDROM(Device *dev);
+extern Boolean mediaGetCDROM(char *dist);
+extern Boolean mediaInitTape(Device *dev);
+extern Boolean mediaGetTape(char *dist);
+extern Boolean mediaInitNetwork(Device *dev);
+extern Boolean mediaGetNetwork(char *dist);
+extern void mediaCloseTape(Device *dev);
+extern void mediaCloseCDROM(Device *dev);
+extern void mediaCloseNetwork(Device *dev);
+
/* misc.c */
extern Boolean file_readable(char *fname);
@@ -285,6 +301,8 @@ extern char **item_add(char **list, char *item, int *curr, int *max);
extern char **item_add_pair(char **list, char *item1, char *item2,
int *curr, int *max);
extern void items_free(char **list, int *curr, int *max);
+extern int Mkdir(char *, void *data);
+extern int Mount(char *, void *data);
/* msg.c */
extern void msgInfo(char *fmt, ...);
@@ -313,6 +331,9 @@ extern void systemChangeTerminal(char *color, const u_char c_termcap[],
extern void systemChangeScreenmap(const u_char newmap[]);
extern int vsystem(char *fmt, ...);
+/* tcpip.c */
+extern int tcpOpenDialog(char *);
+
/* termcap.c */
extern int set_termcap(void);
diff --git a/release/sysinstall/system.c b/release/sysinstall/system.c
index 7344ac6..667012b 100644
--- a/release/sysinstall/system.c
+++ b/release/sysinstall/system.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: system.c,v 1.9 1995/05/10 18:59:51 jkh Exp $
+ * $Id: system.c,v 1.10 1995/05/11 09:01:35 jkh Exp $
*
* Jordan Hubbard
*
@@ -31,15 +31,8 @@
static void
handle_intr(int sig)
{
- dialog_clear();
- clear();
if (!msgYesNo("Are you sure you want to abort the installation?"))
systemShutdown();
- else {
- dialog_clear();
- clear();
- refresh();
- }
}
/* Welcome the user to the system */
@@ -166,22 +159,28 @@ systemDisplayFile(char *file)
{
char *fname = NULL;
char buf[FILENAME_MAX];
+ WINDOW *w;
fname = systemHelpFile(file, buf);
if (!fname) {
snprintf(buf, FILENAME_MAX, "The %s file is not provided on this particular floppy image.", file);
use_helpfile(NULL);
use_helpline(NULL);
+ w = dupwin(newscr);
dialog_mesgbox("Sorry!", buf, -1, -1);
- dialog_clear_norefresh();
+ touchwin(w);
+ wrefresh(w);
+ delwin(w);
return 1;
}
else {
- dialog_clear_norefresh();
use_helpfile(NULL);
use_helpline(NULL);
+ w = dupwin(newscr);
dialog_textbox(file, fname, LINES, COLS);
- dialog_clear_norefresh();
+ touchwin(w);
+ wrefresh(w);
+ delwin(w);
}
return 0;
}
diff --git a/release/sysinstall/tcpip.c b/release/sysinstall/tcpip.c
index 0c8ab34..808757a 100644
--- a/release/sysinstall/tcpip.c
+++ b/release/sysinstall/tcpip.c
@@ -1,5 +1,5 @@
/*
- * $Id$
+ * $Id: tcpip.c,v 1.1 1995/05/16 02:53:28 jkh Exp $
*
* Copyright (c) 1995
* Gary J Palmer. All rights reserved.
@@ -47,10 +47,11 @@
#include "dialog.priv.h"
#include "colors.h"
#include "rc.h"
+#include "sysinstall.h"
static char hostname[256], domainname[256],
ipaddr[32], netmask[32], gateway[32],
- dns[32], extras[256];
+ nameserver[32], extras[256], iface[4];
static int okbutton, cancelbutton;
#define TCP_DIALOG_Y 0
@@ -59,30 +60,32 @@ static int okbutton, cancelbutton;
#define TCP_DIALOG_HEIGHT LINES - 2
/* The names of the available interfaces, for the list */
-char *iface_names[MAX_INTERFACE];
+char *iface_names[INTERFACE_MAX];
typedef struct _interface {
- char *name;
+
+ char netmask[32];
+ char ifconfig_extras[256];
Device *dev;
} Interface;
typedef struct _layout {
- int y;
- int x;
- int len;
- int maxlen;
- char *prompt;
- char *help;
- void *var;
- int type;
- void *obj;
+ int y;
+ int x;
+ int len;
+ int maxlen;
+ char *prompt;
+ char *help;
+ void *var;
+ int type;
+ void *obj;
} Layout;
static Layout layout[] = {
-{ 2, 2, 25, 255,
+{ 1, 2, 25, 255,
"Host name:", "The name of your machine on a network, e.g. foo.bar.com",
hostname, STRINGOBJ, NULL },
-{ 2, 35, 20, 255,
+{ 1, 35, 20, 255,
"Domain name:",
"The name of the domain that your machine is in, e.g. bar.com",
domainname, STRINGOBJ, NULL },
@@ -92,26 +95,26 @@ static Layout layout[] = {
gateway, STRINGOBJ, NULL },
{ 5, 35, 18, 15,
"Name server:", "IP address of your local DNS server",
- dns, STRINGOBJ, NULL },
-{ 8, 2, 10, 6,
+ nameserver, STRINGOBJ, NULL },
+{ 9, 2, 9, 6,
"Interface:", "One of potentially several network interfaces",
- ifaces, LISTOBJ, NULL },
-{ 14, 2, 18, 15,
+ iface, LISTOBJ, NULL },
+{ 10, 18, 18, 15,
"IP Address:",
"The IP address to be used for your host - use 127.0.0.1 for loopback",
ipaddr, STRINGOBJ, NULL },
-{ 14, 35, 18, 15,
+{ 10, 37, 18, 15,
"Netmask:",
"The netmask for your network, e.g. 0xffffff00 for a class C network",
netmask, STRINGOBJ, NULL },
-{ 16, 2, 50, 255,
- "Extra options:",
+{ 14, 18, 37, 255,
+ "Extra options to ifconfig:",
"Any options to ifconfig you'd like to specify manually",
extras, STRINGOBJ, NULL },
-{ 18, 2, 0, 0,
+{ 19, 10, 0, 0,
"OK", "Select this if you are happy with these settings",
&okbutton, BUTTONOBJ, NULL },
-{ 18, 15, 0, 0,
+{ 19, 30, 0, 0,
"CANCEL", "Select this if you wish to cancel this screen",
&cancelbutton, BUTTONOBJ, NULL },
{ NULL },
@@ -123,9 +126,7 @@ static void
feepout(char *msg)
{
beep();
- msgConfirm(msg);
- dialog_clear();
- refresh();
+ dialog_notify(msg);
}
static int
@@ -150,7 +151,7 @@ verifySettings(void)
feepout("Invalid or missing value for IP address");
else if (gateway[0] && !verifyIP(gateway))
feepout("Invalid gateway IP address specified");
- else if (dns[0] && !verifyIP(dns))
+ else if (nameserver[0] && !verifyIP(nameserver))
feepout("Invalid name server IP address specified");
else if (netmask[0] < '0' || netmask[0] > '9')
feepout("Invalid or missing netmask");
@@ -159,30 +160,48 @@ verifySettings(void)
return 0;
}
-/* Call this to initialize the TCP dialog */
-void
/* This is it - how to get TCP setup values */
-void
-tcpOpenDialog(void)
+int
+tcpOpenDialog(char *str)
{
WINDOW *ds_win;
ComposeObj *obj = NULL;
ComposeObj *first, *last;
int n=0, quit=FALSE, cancel=FALSE, ret,
- max;
+ max, n_iface;
char *tmp;
+ Device **devs;
+ char old_iface[4];
ds_win = newwin(LINES, COLS, 0, 0);
- if (ds_win == 0) {
+ if (ds_win == 0)
msgFatal("Cannot open TCP/IP dialog window!!");
- exit(1);
+
+ devs = deviceFind(NULL, DEVICE_TYPE_NETWORK);
+ if (!devs) {
+ msgConfirm("Couldn't find any potential network devices!");
+ return 0;
}
+
+ while (devs[n] != NULL) {
+ iface_names[n] = (devs[n])->name;
+ ++n;
+ }
+ n_iface = --n;
+
draw_box(ds_win, TCP_DIALOG_Y, TCP_DIALOG_X,
TCP_DIALOG_HEIGHT, TCP_DIALOG_WIDTH,
dialog_attr, border_attr);
wattrset(ds_win, dialog_attr);
mvwaddstr(ds_win, TCP_DIALOG_Y, TCP_DIALOG_X + 20,
" Network Configuration ");
+ draw_box(ds_win, TCP_DIALOG_Y + 9, TCP_DIALOG_X + 16,
+ TCP_DIALOG_HEIGHT - 13, TCP_DIALOG_WIDTH - 21,
+ dialog_attr, border_attr);
+ wattrset(ds_win, dialog_attr);
+ mvwaddstr(ds_win, TCP_DIALOG_Y + 9, TCP_DIALOG_X + 24,
+ " Per Interface Configuration ");
+
bzero(ipaddr, sizeof(ipaddr));
bzero(netmask, sizeof(netmask));
@@ -205,10 +224,11 @@ tcpOpenDialog(void)
bzero(gateway, sizeof(gateway));
tmp = getenv(VAR_NAMESERVER);
if (tmp)
- strcpy(dns, tmp);
+ strcpy(nameserver, tmp);
else
- bzero(dns, sizeof(dns));
+ bzero(nameserver, sizeof(nameserver));
+ n=0;
#define lt layout[n]
while (lt.help != NULL) {
switch (lt.type) {
@@ -224,13 +244,12 @@ tcpOpenDialog(void)
break;
case LISTOBJ:
- lt.obj = NewListObj(ds_win, lt.prompt, lt.var, "lo0",
- lt.y + TCP_DIALOG_Y, lt.x + TCP_DIALOG_X,
- 4, 12, 1);
+ lt.obj = NewListObj(ds_win, lt.prompt, (char **) iface_names,
+ lt.var, lt.y + TCP_DIALOG_Y,
+ lt.x + TCP_DIALOG_X, lt.len, 12, n_iface);
+ break;
default:
- printf("Don't support this object yet!\n");
- end_dialog();
- exit(1);
+ msgFatal("Don't support this object yet!");
}
AddObj(&obj, lt.type, (void *) lt.obj);
n++;
@@ -245,9 +264,12 @@ tcpOpenDialog(void)
first = obj;
while (first->prev)
first = first->prev;
-
+
n = 0;
- while (quit != TRUE) {
+ cancelbutton = okbutton = 0;
+ strcpy(old_iface, iface);
+
+ while (!quit) {
char help_line[80];
int i, len = strlen(lt.help);
@@ -261,8 +283,7 @@ tcpOpenDialog(void)
switch (ret) {
case SEL_ESC:
- quit=TRUE;
- cancel=TRUE;
+ quit = TRUE, cancel=TRUE;
break;
case KEY_UP:
@@ -283,17 +304,38 @@ tcpOpenDialog(void)
}
else {
obj = first;
- n=0;
+ n = 0;
}
break;
case SEL_BUTTON:
- if (verifySettings())
- quit=TRUE;
+ if (cancelbutton) {
+ cancel = TRUE, quit = TRUE;
+ }
+ else {
+ if (verifySettings())
+ quit = TRUE;
+ }
break;
case SEL_CR:
case SEL_TAB:
+ if (strcmp(old_iface, iface)) {
+ n_iface=0;
+ while(strcmp(iface, iface_names[n_iface]) &&
+ iface_names[n_iface])
+ n_iface++;
+
+ if (iface_names[n_iface]) {
+ msgFatal("Erk - run off the end of the list of interfaces!");
+ exit(1);
+ }
+
+ strcpy(ipaddr,
+
+ strcpy(old_iface, iface);
+ }
+
if (n < max)
++n;
else
@@ -318,9 +360,19 @@ tcpOpenDialog(void)
}
}
}
+
+ dialog_clear();
+ refresh();
+
if (!cancel) {
- variable_set2("hostname", hostname);
- variable_set2("domainname", domainname);
- variable_set2("ip_addr", ipaddr);
- variable_set2("ip_gateway", gateway);
+ variable_set2(VAR_HOSTNAME, hostname);
+ variable_set2(VAR_DOMAINNAME, domainname);
+ if (gateway[0])
+ variable_set2(VAR_GATEWAY, gateway);
+ if (nameserver[0])
+ variable_set2(VAR_NAMESERVER, nameserver);
+ return 1;
+ }
+
+ return 0;
}
OpenPOWER on IntegriCloud