summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/sade/command.c17
-rw-r--r--usr.sbin/sade/disks.c9
-rw-r--r--usr.sbin/sade/install.c82
-rw-r--r--usr.sbin/sade/label.c64
-rw-r--r--usr.sbin/sade/menus.c8
-rw-r--r--usr.sbin/sade/system.c8
-rw-r--r--usr.sbin/sysinstall/command.c17
-rw-r--r--usr.sbin/sysinstall/disks.c9
-rw-r--r--usr.sbin/sysinstall/dist.c5
-rw-r--r--usr.sbin/sysinstall/install.c82
-rw-r--r--usr.sbin/sysinstall/label.c64
-rw-r--r--usr.sbin/sysinstall/menus.c8
-rw-r--r--usr.sbin/sysinstall/system.c8
-rw-r--r--usr.sbin/sysinstall/tcpip.c8
14 files changed, 223 insertions, 166 deletions
diff --git a/usr.sbin/sade/command.c b/usr.sbin/sade/command.c
index ee7ce78..ff29b4e 100644
--- a/usr.sbin/sade/command.c
+++ b/usr.sbin/sade/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.4 1995/05/16 11:37:07 jkh Exp $
+ * $Id: command.c,v 1.5 1995/05/18 02:42:31 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -137,7 +137,8 @@ command_func_add(char *key, commandFunc func, void *data)
strcpy(commandStack[numCommands]->key, key);
commandStack[numCommands]->ncmds = 1;
commandStack[numCommands]->cmds[0].type = CMD_FUNCTION;
- commandStack[numCommands++]->cmds[0].ptr = (void *)func;
+ commandStack[numCommands]->cmds[0].ptr = (void *)func;
+ commandStack[numCommands++]->cmds[0].data = data;
}
/* arg to sort */
@@ -164,20 +165,16 @@ command_execute(void)
for (j = 0; j < commandStack[i]->ncmds; j++) {
/* 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);
+ msgNotify("Executing command: %s", commandStack[i]->cmds[j].ptr);
ret = vsystem((char *)commandStack[i]->cmds[j].ptr);
- msgDebug("Command `%s' returns status %d\n",
- commandStack[i]->cmds[j].ptr, ret);
+ msgDebug("Command `%s' returns status %d\n", commandStack[i]->cmds[j].ptr, ret);
}
else {
/* 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]->key,
- commandStack[i]->cmds[j].data);
- msgDebug("Function @ %x returns status %d\n",
- commandStack[i]->cmds[j].ptr, ret);
+ 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/usr.sbin/sade/disks.c b/usr.sbin/sade/disks.c
index 22d7879..20f9f11 100644
--- a/usr.sbin/sade/disks.c
+++ b/usr.sbin/sade/disks.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: disks.c,v 1.20 1995/05/17 14:39:38 jkh Exp $
+ * $Id: disks.c,v 1.21 1995/05/17 16:16:07 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -79,7 +79,7 @@ print_chunks(Disk *d)
int row;
int i;
- dialog_clear();
+ clear();
attrset(A_NORMAL);
mvaddstr(0, 0, "Disk name:\t");
attrset(A_REVERSE); addstr(d->name); attrset(A_NORMAL);
@@ -179,7 +179,10 @@ diskPartition(Disk *d)
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?"))
- chunk_info[current_chunk]->flags |= CHUNK_BAD144;
+ 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':
diff --git a/usr.sbin/sade/install.c b/usr.sbin/sade/install.c
index 9ab1c3e..dcfba55 100644
--- a/usr.sbin/sade/install.c
+++ b/usr.sbin/sade/install.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: install.c,v 1.19 1995/05/17 14:39:43 jkh Exp $
+ * $Id: install.c,v 1.20 1995/05/17 16:16:08 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -54,31 +54,39 @@ static void cpio_extract(void);
static void install_configuration_files(void);
static void do_final_setup(void);
-int
-installCommit(char *str)
+static Boolean
+preInstallCheck(void)
{
- extern u_char boot1[], boot2[];
- extern u_char mbr[], bteasy17[];
- u_char *mbrContents;
- Device **devs;
- int i;
-
if (!getenv(DISK_PARTITIONED)) {
msgConfirm("You need to partition your disk before you can proceed with\nthe installation.");
- return 0;
+ return FALSE;
}
if (!getenv(DISK_LABELLED)) {
msgConfirm("You need to assign disk labels before you can proceed with\nthe installation.");
- return 0;
+ return FALSE;
}
if (!Dists) {
msgConfirm("You haven't told me what distributions to load yet!\nPlease select a distribution from the Distributions menu.");
- return 0;
+ return FALSE;
}
if (!mediaVerify())
- return 0;
- 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;
+ return TRUE;
+}
+
+int
+installCommit(char *str)
+{
+ extern u_char boot1[], boot2[];
+ extern u_char mbr[], bteasy17[];
+ u_char *mbrContents;
+ Device **devs;
+ int i;
+
+ /* If things aren't kosher, or we refuse to proceed, bail. */
+ if (!preInstallCheck()
+ || 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 0;
mbrContents = NULL;
@@ -89,6 +97,7 @@ installCommit(char *str)
devs = deviceFind(NULL, DEVICE_TYPE_DISK);
for (i = 0; devs[i]; i++) {
Disk *d = (Disk *)devs[i]->private;
+ Chunk *c1;
if (mbrContents) {
Set_Boot_Mgr(d, mbrContents);
@@ -97,9 +106,23 @@ installCommit(char *str)
Set_Boot_Blocks(d, boot1, boot2);
msgNotify("Writing partition information to drive %s", d->name);
Write_Disk(d);
+
+ /* Now scan for bad blocks, if necessary */
+ for (c1 = d->chunks; c1; c1->next) {
+ if (c1->flags & CHUNK_BAD144) {
+ int ret;
+
+ msgNotify("Running bad block scan on partition %s", c1->name);
+ ret = vsystem("bad144 -v -s /mnt/dev/%s", c1->name);
+ if (ret)
+ msgConfirm("Bad144 scan on %s returned status of %d!", c1->name, ret);
+ /* XXX do something else XXX */
+ }
+ }
}
make_filesystems();
cpio_extract();
+ distExtractAll();
install_configuration_files();
do_final_setup();
return 1;
@@ -135,8 +158,12 @@ make_filesystems(void)
continue;
sprintf(dname, "/dev/%sa", disk->name);
if (p->newfs) {
- if (vsystem("newfs %s", dname)) {
- msgConfirm("Unable to make new root filesystem!");
+ int i;
+
+ msgNotify("Making a new root filesystem on %s", dname);
+ i = vsystem("newfs %s", dname);
+ if (i) {
+ msgConfirm("Unable to make new root filesystem! Command returned status %d", i);
return;
}
}
@@ -146,15 +173,22 @@ make_filesystems(void)
msgConfirm("Unable to mount the root file system! Giving up.");
return;
}
- else
+ else {
+ extern int makedevs(void);
+
+ chdir("/mnt");
+ if (makedevs())
+ msgConfirm("Failed to make some of the devices in /mnt!");
+ chdir("/");
break;
+ }
}
}
}
}
}
- /* Now buzz through the rest of the devices and mount them too */
+ /* Now buzz through the rest of the partitions and mount them too */
for (i = 0; devs[i]; i++) {
disk = (Disk *)devs[i]->private;
if (!disk->chunks)
@@ -163,18 +197,6 @@ make_filesystems(void)
/* Make the proper device mount points in /mnt/dev */
MakeDevDisk(disk, "/mnt/dev");
- /* Now make all the other devices the first time around */
- if (i == 0) {
- extern int makedevs(void);
-
- chdir("/mnt");
- if (makedevs()) {
- if (msgYesNo("Failed to make some of the devices in /mnt! Continue?"))
- return;
- }
- chdir("/");
- }
-
for (c1 = disk->chunks->part; c1; c1 = c1->next) {
if (c1->type == freebsd) {
for (c2 = c1->part; c2; c2 = c2->next) {
diff --git a/usr.sbin/sade/label.c b/usr.sbin/sade/label.c
index ee4d204..d6bb124 100644
--- a/usr.sbin/sade/label.c
+++ b/usr.sbin/sade/label.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: label.c,v 1.4 1995/05/17 15:41:52 jkh Exp $
+ * $Id: label.c,v 1.5 1995/05/17 16:16:09 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -191,16 +191,16 @@ new_part(char *mpoint, Boolean newfs)
/* Get the mountpoint for a partition and save it away */
PartInfo *
-get_mountpoint(struct chunk *parent, struct chunk *me)
+get_mountpoint(struct chunk *old)
{
char *val;
PartInfo *tmp;
- val = msgGetInput(me && me->private ? ((PartInfo *)me->private)->mountpoint : NULL,
+ val = msgGetInput(old && old->private ? ((PartInfo *)old->private)->mountpoint : NULL,
"Please specify a mount point for the partition");
if (val) {
/* Is it just the same value? */
- if (me && me->private && !strcmp(((PartInfo *)me->private)->mountpoint, val))
+ if (old && old->private && !strcmp(((PartInfo *)old->private)->mountpoint, val))
return NULL;
if (check_conflict(val)) {
msgConfirm("You already have a mount point for %s assigned!", val);
@@ -211,28 +211,16 @@ get_mountpoint(struct chunk *parent, struct chunk *me)
return NULL;
}
else if (!strcmp(val, "/")) {
-#if 0
- if (parent) {
- if (parent->flags & CHUNK_PAST_1024) {
- msgConfirm("This region cannot be used for your root partition as\nit is past the 1024'th cylinder mark and the system would not be\nable to boot from it. Please pick another location for your\nroot partition and try again!");
- return NULL;
- }
- else if (!(parent->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 region. Please choose another partition for this.");
- return NULL;
- }
- }
-#endif
- if (me)
- me->flags |= CHUNK_IS_ROOT;
+ if (old)
+ old->flags |= CHUNK_IS_ROOT;
}
- else if (me)
- me->flags &= ~CHUNK_IS_ROOT;
- safe_free(me ? me->private : NULL);
+ else if (old)
+ old->flags &= ~CHUNK_IS_ROOT;
+ safe_free(old ? old->private : NULL);
tmp = new_part(val, TRUE);
- if (me) {
- me->private = tmp;
- me->private_free = safe_free;
+ if (old) {
+ old->private = tmp;
+ old->private_free = safe_free;
}
return tmp;
}
@@ -292,7 +280,7 @@ print_label_chunks(void)
int i, j, srow, prow, pcol;
int sz;
- dialog_clear();
+ clear();
attrset(A_REVERSE);
mvaddstr(0, 25, "FreeBSD Disklabel Editor");
attrset(A_NORMAL);
@@ -493,7 +481,7 @@ diskLabelEditor(char *str)
if (type == PART_NONE)
break;
else if (type == PART_FILESYSTEM) {
- if ((p = get_mountpoint(label_chunk_info[here].c, NULL)) == NULL)
+ if ((p = get_mountpoint(NULL)) == NULL)
break;
else if (!strcmp(p->mountpoint, "/"))
flags |= CHUNK_IS_ROOT;
@@ -508,13 +496,25 @@ diskLabelEditor(char *str)
size, part,
(type == PART_SWAP) ? FS_SWAP : FS_BSDFFS,
flags);
- if (!tmp)
+ if (!tmp) {
msgConfirm("Unable to create the partition. Too big?");
- else {
- tmp->private = p;
- tmp->private_free = safe_free;
- record_label_chunks();
+ break;
}
+ else if (flags & CHUNK_IS_ROOT) {
+ if (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!");
+ Delete_Chunk(label_chunk_info[here].d, tmp);
+ break;
+ }
+ else if (!(tmp->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!");
+ Delete_Chunk(label_chunk_info[here].d, tmp);
+ break;
+ }
+ }
+ tmp->private = p;
+ tmp->private_free = safe_free;
+ record_label_chunks();
}
}
break;
@@ -544,7 +544,7 @@ diskLabelEditor(char *str)
case PART_FAT:
case PART_FILESYSTEM:
- p = get_mountpoint(NULL, label_chunk_info[here].c);
+ p = get_mountpoint(label_chunk_info[here].c);
if (p) {
p->newfs = FALSE;
record_label_chunks();
diff --git a/usr.sbin/sade/menus.c b/usr.sbin/sade/menus.c
index a856919..bf51ef6 100644
--- a/usr.sbin/sade/menus.c
+++ b/usr.sbin/sade/menus.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: menus.c,v 1.14 1995/05/16 11:37:20 jkh Exp $
+ * $Id: menus.c,v 1.15 1995/05/17 14:39:54 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -546,7 +546,7 @@ 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:",
+to deal with it? You have several choices:",
NULL,
NULL,
{ { "Ftp Retry", "On transfer failure, retry same host",
@@ -577,9 +577,9 @@ at this time then select Cancel to leave this menu.",
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", "Allocate disk space for FreeBSD", /* P */
DMENU_CALL, (void *)diskPartitionEditor, 0, 0 },
- { "Label", "Label allocated disk partitions for FreeBSD", /* L */
+ { "Label", "Label allocated disk partitions", /* L */
DMENU_CALL, (void *)diskLabelEditor, 0, 0 },
{ "Networking", "Configure any network interfaces", /* N */
DMENU_CALL, (void *)tcpOpenDialog, 0, 0 },
diff --git a/usr.sbin/sade/system.c b/usr.sbin/sade/system.c
index cb620fe..713092f 100644
--- a/usr.sbin/sade/system.c
+++ b/usr.sbin/sade/system.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: system.c,v 1.12 1995/05/17 16:16:10 jkh Exp $
+ * $Id: system.c,v 1.13 1995/05/18 02:42:33 jkh Exp $
*
* Jordan Hubbard
*
@@ -286,6 +286,12 @@ vsystem(char *fmt, ...)
case 0: /* child */
(void)sigsetmask(omask);
+ if (DebugFD != -1) {
+ dup2(DebugFD, 0);
+ dup2(DebugFD, 1);
+ dup2(DebugFD, 2);
+ msgInfo("Command output is on debugging screen - type ALT-F2 to see it");
+ }
execl("/stand/sh", "sh", "-c", cmd, (char *)NULL);
i = 127;
}
diff --git a/usr.sbin/sysinstall/command.c b/usr.sbin/sysinstall/command.c
index ee7ce78..ff29b4e 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.4 1995/05/16 11:37:07 jkh Exp $
+ * $Id: command.c,v 1.5 1995/05/18 02:42:31 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -137,7 +137,8 @@ command_func_add(char *key, commandFunc func, void *data)
strcpy(commandStack[numCommands]->key, key);
commandStack[numCommands]->ncmds = 1;
commandStack[numCommands]->cmds[0].type = CMD_FUNCTION;
- commandStack[numCommands++]->cmds[0].ptr = (void *)func;
+ commandStack[numCommands]->cmds[0].ptr = (void *)func;
+ commandStack[numCommands++]->cmds[0].data = data;
}
/* arg to sort */
@@ -164,20 +165,16 @@ command_execute(void)
for (j = 0; j < commandStack[i]->ncmds; j++) {
/* 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);
+ msgNotify("Executing command: %s", commandStack[i]->cmds[j].ptr);
ret = vsystem((char *)commandStack[i]->cmds[j].ptr);
- msgDebug("Command `%s' returns status %d\n",
- commandStack[i]->cmds[j].ptr, ret);
+ msgDebug("Command `%s' returns status %d\n", commandStack[i]->cmds[j].ptr, ret);
}
else {
/* 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]->key,
- commandStack[i]->cmds[j].data);
- msgDebug("Function @ %x returns status %d\n",
- commandStack[i]->cmds[j].ptr, ret);
+ 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/usr.sbin/sysinstall/disks.c b/usr.sbin/sysinstall/disks.c
index 22d7879..20f9f11 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.20 1995/05/17 14:39:38 jkh Exp $
+ * $Id: disks.c,v 1.21 1995/05/17 16:16:07 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -79,7 +79,7 @@ print_chunks(Disk *d)
int row;
int i;
- dialog_clear();
+ clear();
attrset(A_NORMAL);
mvaddstr(0, 0, "Disk name:\t");
attrset(A_REVERSE); addstr(d->name); attrset(A_NORMAL);
@@ -179,7 +179,10 @@ diskPartition(Disk *d)
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?"))
- chunk_info[current_chunk]->flags |= CHUNK_BAD144;
+ 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':
diff --git a/usr.sbin/sysinstall/dist.c b/usr.sbin/sysinstall/dist.c
index 42f7db2..e4b1822 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.5 1995/05/16 11:37:11 jkh Exp $
+ * $Id: dist.c,v 1.6 1995/05/17 14:39:40 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -158,6 +158,7 @@ static Distribution SrcDistTable[] = {
{ "sys", &SrcDists, DIST_SRC_SYS, NULL },
{ "ubin", &SrcDists, DIST_SRC_UBIN, NULL },
{ "usbin", &SrcDists, DIST_SRC_USBIN, NULL },
+{ "xf86", &SrcDists, DIST_SRC_XF86, NULL },
{ NULL },
};
@@ -225,7 +226,7 @@ distExtract(char *parent, Distribution *me)
if (getenv(NO_CONFIRMATION))
status = 0;
else
- status = msgYesNo("Unable to retreive the %s distribution from %s.\nDo you want to retry that distribution later?");
+ status = msgYesNo("Unable to transfer the %s distribution from %s.\nDo you want to retry this distribution later?");
}
}
if (!status) {
diff --git a/usr.sbin/sysinstall/install.c b/usr.sbin/sysinstall/install.c
index 9ab1c3e..dcfba55 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.19 1995/05/17 14:39:43 jkh Exp $
+ * $Id: install.c,v 1.20 1995/05/17 16:16:08 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -54,31 +54,39 @@ static void cpio_extract(void);
static void install_configuration_files(void);
static void do_final_setup(void);
-int
-installCommit(char *str)
+static Boolean
+preInstallCheck(void)
{
- extern u_char boot1[], boot2[];
- extern u_char mbr[], bteasy17[];
- u_char *mbrContents;
- Device **devs;
- int i;
-
if (!getenv(DISK_PARTITIONED)) {
msgConfirm("You need to partition your disk before you can proceed with\nthe installation.");
- return 0;
+ return FALSE;
}
if (!getenv(DISK_LABELLED)) {
msgConfirm("You need to assign disk labels before you can proceed with\nthe installation.");
- return 0;
+ return FALSE;
}
if (!Dists) {
msgConfirm("You haven't told me what distributions to load yet!\nPlease select a distribution from the Distributions menu.");
- return 0;
+ return FALSE;
}
if (!mediaVerify())
- return 0;
- 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;
+ return TRUE;
+}
+
+int
+installCommit(char *str)
+{
+ extern u_char boot1[], boot2[];
+ extern u_char mbr[], bteasy17[];
+ u_char *mbrContents;
+ Device **devs;
+ int i;
+
+ /* If things aren't kosher, or we refuse to proceed, bail. */
+ if (!preInstallCheck()
+ || 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 0;
mbrContents = NULL;
@@ -89,6 +97,7 @@ installCommit(char *str)
devs = deviceFind(NULL, DEVICE_TYPE_DISK);
for (i = 0; devs[i]; i++) {
Disk *d = (Disk *)devs[i]->private;
+ Chunk *c1;
if (mbrContents) {
Set_Boot_Mgr(d, mbrContents);
@@ -97,9 +106,23 @@ installCommit(char *str)
Set_Boot_Blocks(d, boot1, boot2);
msgNotify("Writing partition information to drive %s", d->name);
Write_Disk(d);
+
+ /* Now scan for bad blocks, if necessary */
+ for (c1 = d->chunks; c1; c1->next) {
+ if (c1->flags & CHUNK_BAD144) {
+ int ret;
+
+ msgNotify("Running bad block scan on partition %s", c1->name);
+ ret = vsystem("bad144 -v -s /mnt/dev/%s", c1->name);
+ if (ret)
+ msgConfirm("Bad144 scan on %s returned status of %d!", c1->name, ret);
+ /* XXX do something else XXX */
+ }
+ }
}
make_filesystems();
cpio_extract();
+ distExtractAll();
install_configuration_files();
do_final_setup();
return 1;
@@ -135,8 +158,12 @@ make_filesystems(void)
continue;
sprintf(dname, "/dev/%sa", disk->name);
if (p->newfs) {
- if (vsystem("newfs %s", dname)) {
- msgConfirm("Unable to make new root filesystem!");
+ int i;
+
+ msgNotify("Making a new root filesystem on %s", dname);
+ i = vsystem("newfs %s", dname);
+ if (i) {
+ msgConfirm("Unable to make new root filesystem! Command returned status %d", i);
return;
}
}
@@ -146,15 +173,22 @@ make_filesystems(void)
msgConfirm("Unable to mount the root file system! Giving up.");
return;
}
- else
+ else {
+ extern int makedevs(void);
+
+ chdir("/mnt");
+ if (makedevs())
+ msgConfirm("Failed to make some of the devices in /mnt!");
+ chdir("/");
break;
+ }
}
}
}
}
}
- /* Now buzz through the rest of the devices and mount them too */
+ /* Now buzz through the rest of the partitions and mount them too */
for (i = 0; devs[i]; i++) {
disk = (Disk *)devs[i]->private;
if (!disk->chunks)
@@ -163,18 +197,6 @@ make_filesystems(void)
/* Make the proper device mount points in /mnt/dev */
MakeDevDisk(disk, "/mnt/dev");
- /* Now make all the other devices the first time around */
- if (i == 0) {
- extern int makedevs(void);
-
- chdir("/mnt");
- if (makedevs()) {
- if (msgYesNo("Failed to make some of the devices in /mnt! Continue?"))
- return;
- }
- chdir("/");
- }
-
for (c1 = disk->chunks->part; c1; c1 = c1->next) {
if (c1->type == freebsd) {
for (c2 = c1->part; c2; c2 = c2->next) {
diff --git a/usr.sbin/sysinstall/label.c b/usr.sbin/sysinstall/label.c
index ee4d204..d6bb124 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.4 1995/05/17 15:41:52 jkh Exp $
+ * $Id: label.c,v 1.5 1995/05/17 16:16:09 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -191,16 +191,16 @@ new_part(char *mpoint, Boolean newfs)
/* Get the mountpoint for a partition and save it away */
PartInfo *
-get_mountpoint(struct chunk *parent, struct chunk *me)
+get_mountpoint(struct chunk *old)
{
char *val;
PartInfo *tmp;
- val = msgGetInput(me && me->private ? ((PartInfo *)me->private)->mountpoint : NULL,
+ val = msgGetInput(old && old->private ? ((PartInfo *)old->private)->mountpoint : NULL,
"Please specify a mount point for the partition");
if (val) {
/* Is it just the same value? */
- if (me && me->private && !strcmp(((PartInfo *)me->private)->mountpoint, val))
+ if (old && old->private && !strcmp(((PartInfo *)old->private)->mountpoint, val))
return NULL;
if (check_conflict(val)) {
msgConfirm("You already have a mount point for %s assigned!", val);
@@ -211,28 +211,16 @@ get_mountpoint(struct chunk *parent, struct chunk *me)
return NULL;
}
else if (!strcmp(val, "/")) {
-#if 0
- if (parent) {
- if (parent->flags & CHUNK_PAST_1024) {
- msgConfirm("This region cannot be used for your root partition as\nit is past the 1024'th cylinder mark and the system would not be\nable to boot from it. Please pick another location for your\nroot partition and try again!");
- return NULL;
- }
- else if (!(parent->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 region. Please choose another partition for this.");
- return NULL;
- }
- }
-#endif
- if (me)
- me->flags |= CHUNK_IS_ROOT;
+ if (old)
+ old->flags |= CHUNK_IS_ROOT;
}
- else if (me)
- me->flags &= ~CHUNK_IS_ROOT;
- safe_free(me ? me->private : NULL);
+ else if (old)
+ old->flags &= ~CHUNK_IS_ROOT;
+ safe_free(old ? old->private : NULL);
tmp = new_part(val, TRUE);
- if (me) {
- me->private = tmp;
- me->private_free = safe_free;
+ if (old) {
+ old->private = tmp;
+ old->private_free = safe_free;
}
return tmp;
}
@@ -292,7 +280,7 @@ print_label_chunks(void)
int i, j, srow, prow, pcol;
int sz;
- dialog_clear();
+ clear();
attrset(A_REVERSE);
mvaddstr(0, 25, "FreeBSD Disklabel Editor");
attrset(A_NORMAL);
@@ -493,7 +481,7 @@ diskLabelEditor(char *str)
if (type == PART_NONE)
break;
else if (type == PART_FILESYSTEM) {
- if ((p = get_mountpoint(label_chunk_info[here].c, NULL)) == NULL)
+ if ((p = get_mountpoint(NULL)) == NULL)
break;
else if (!strcmp(p->mountpoint, "/"))
flags |= CHUNK_IS_ROOT;
@@ -508,13 +496,25 @@ diskLabelEditor(char *str)
size, part,
(type == PART_SWAP) ? FS_SWAP : FS_BSDFFS,
flags);
- if (!tmp)
+ if (!tmp) {
msgConfirm("Unable to create the partition. Too big?");
- else {
- tmp->private = p;
- tmp->private_free = safe_free;
- record_label_chunks();
+ break;
}
+ else if (flags & CHUNK_IS_ROOT) {
+ if (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!");
+ Delete_Chunk(label_chunk_info[here].d, tmp);
+ break;
+ }
+ else if (!(tmp->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!");
+ Delete_Chunk(label_chunk_info[here].d, tmp);
+ break;
+ }
+ }
+ tmp->private = p;
+ tmp->private_free = safe_free;
+ record_label_chunks();
}
}
break;
@@ -544,7 +544,7 @@ diskLabelEditor(char *str)
case PART_FAT:
case PART_FILESYSTEM:
- p = get_mountpoint(NULL, label_chunk_info[here].c);
+ p = get_mountpoint(label_chunk_info[here].c);
if (p) {
p->newfs = FALSE;
record_label_chunks();
diff --git a/usr.sbin/sysinstall/menus.c b/usr.sbin/sysinstall/menus.c
index a856919..bf51ef6 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.14 1995/05/16 11:37:20 jkh Exp $
+ * $Id: menus.c,v 1.15 1995/05/17 14:39:54 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -546,7 +546,7 @@ 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:",
+to deal with it? You have several choices:",
NULL,
NULL,
{ { "Ftp Retry", "On transfer failure, retry same host",
@@ -577,9 +577,9 @@ at this time then select Cancel to leave this menu.",
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", "Allocate disk space for FreeBSD", /* P */
DMENU_CALL, (void *)diskPartitionEditor, 0, 0 },
- { "Label", "Label allocated disk partitions for FreeBSD", /* L */
+ { "Label", "Label allocated disk partitions", /* L */
DMENU_CALL, (void *)diskLabelEditor, 0, 0 },
{ "Networking", "Configure any network interfaces", /* N */
DMENU_CALL, (void *)tcpOpenDialog, 0, 0 },
diff --git a/usr.sbin/sysinstall/system.c b/usr.sbin/sysinstall/system.c
index cb620fe..713092f 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.12 1995/05/17 16:16:10 jkh Exp $
+ * $Id: system.c,v 1.13 1995/05/18 02:42:33 jkh Exp $
*
* Jordan Hubbard
*
@@ -286,6 +286,12 @@ vsystem(char *fmt, ...)
case 0: /* child */
(void)sigsetmask(omask);
+ if (DebugFD != -1) {
+ dup2(DebugFD, 0);
+ dup2(DebugFD, 1);
+ dup2(DebugFD, 2);
+ msgInfo("Command output is on debugging screen - type ALT-F2 to see it");
+ }
execl("/stand/sh", "sh", "-c", cmd, (char *)NULL);
i = 127;
}
diff --git a/usr.sbin/sysinstall/tcpip.c b/usr.sbin/sysinstall/tcpip.c
index 34a16d0..8efc66c 100644
--- a/usr.sbin/sysinstall/tcpip.c
+++ b/usr.sbin/sysinstall/tcpip.c
@@ -1,5 +1,5 @@
/*
- * $Id: tcpip.c,v 1.4 1995/05/17 12:09:11 gpalmer Exp $
+ * $Id: tcpip.c,v 1.5 1995/05/17 14:39:58 jkh Exp $
*
* Copyright (c) 1995
* Gary J Palmer. All rights reserved.
@@ -113,17 +113,17 @@ static Layout layout[] = {
#define LAYOUT_IFACE 4
{ 10, 18, 18, 15,
"IP Address:",
- "The IP address to be used for your host - use 127.0.0.1 for loopback",
+ "The IP address to be used for this interface - use 127.0.0.1 for lo0",
ipaddr, STRINGOBJ, NULL },
#define LAYOUT_IPADDR 5
{ 10, 37, 18, 15,
"Netmask:",
- "The netmask for your network, e.g. 0xffffff00 for a class C network",
+ "The netmask for this interfaace, e.g. 0xffffff00 for a class C network",
netmask, STRINGOBJ, NULL },
#define LAYOUT_NETMASK 6
{ 14, 18, 37, 255,
"Extra options to ifconfig:",
- "Any options to ifconfig you'd like to specify manually",
+ "Any interface-specific options to ifconfig you'd like to use",
extras, STRINGOBJ, NULL },
#define LAYOUT_EXTRAS 7
{ 19, 10, 0, 0,
OpenPOWER on IntegriCloud