Bring in all my fixes to Poul's gripe list as of last night.

This commit is contained in:
Jordan K. Hubbard 1995-05-25 18:48:33 +00:00
parent fbd92ef8d5
commit 4537793804
32 changed files with 419 additions and 244 deletions

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: config.c,v 1.4 1995/05/24 09:00:08 jkh Exp $
* $Id: config.c,v 1.5 1995/05/24 18:52:47 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -65,6 +65,20 @@ chunk_compare(const void *p1, const void *p2)
return strcmp(((PartInfo *)c1->private)->mountpoint, ((PartInfo *)c2->private)->mountpoint);
}
static char *
nameof(Chunk *c1)
{
static char rootname[64];
/* Our boot blocks can't deal with root partitions on slices - need the compatbility name */
if (c1->type == part && c1->flags & CHUNK_IS_ROOT) {
sprintf(rootname, "%sa", c1->disk->name);
return rootname;
}
else
return c1->name;
}
static char *
mount_point(Chunk *c1)
{
@ -135,11 +149,16 @@ configFstab(void)
disk = (Disk *)devs[i]->private;
if (!disk->chunks)
msgFatal("No chunk list found for %s!", disk->name);
for (c1 = disk->chunks->part; c1; c1 = c1->next)
if (c1->type == freebsd)
for (c2 = c1->part; c2; c2 = c2->next)
if (c2->type == part || c2->type == fat)
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)
chunk_list[nchunks++] = c2;
}
}
else if (c1->type == fat)
chunk_list[nchunks++] = c1;
}
}
/* Sort them puppies! */
@ -154,7 +173,7 @@ configFstab(void)
/* Go for the burn */
msgNotify("Generating /etc/fstab file");
for (i = 0; i < nchunks; i++) {
fprintf(fstab, "/dev/%s\t\t\t%s\t\t%s %s %d %d\n", chunk_list[i]->name, mount_point(chunk_list[i]),
fprintf(fstab, "/dev/%s\t\t\t%s\t\t%s %s %d %d\n", nameof(chunk_list[i]), mount_point(chunk_list[i]),
fstype(chunk_list[i]), fstype_short(chunk_list[i]), seq_num(chunk_list[i]),
seq_num(chunk_list[i]));
}

View File

@ -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.26 1995/05/21 06:12:42 phk Exp $
* $Id: disks.c,v 1.27 1995/05/22 14:10:12 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -111,7 +111,7 @@ print_command_summary()
mvprintw(17, 0, "D = Delete Partition G = Set BIOS Geometry S = Set Bootable");
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);
attrset(A_REVERSE); addstr("reverse"); attrset(A_NORMAL); addstr(" video.");
mvprintw(21, 0, "Use F1 or ? to get more help, arrow keys to move.");
move(0, 0);
}
@ -142,6 +142,11 @@ diskPartition(Disk *d)
key = toupper(getch());
switch (key) {
case '\014': /* ^L */
clear();
continue;
case KEY_UP:
case '-':
if (current_chunk != 0)

View File

@ -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.18 1995/05/24 09:00:17 jkh Exp $
* $Id: dist.c,v 1.19 1995/05/24 17:49:12 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -51,6 +51,17 @@ unsigned int XF86FontDists;
static int distSetXF86(char *str);
int
distReset(char *str)
{
Dists = 0;
SrcDists = 0;
XF86Dists = 0;
XF86ServerDists = 0;
XF86FontDists = 0;
return 0;
}
int
distSetDeveloper(char *str)
{

View File

@ -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.6 1995/05/20 00:13:09 jkh Exp $
* $Id: globals.c,v 1.7 1995/05/24 22:37:41 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -48,7 +48,7 @@
* whatever values we feel are appropriate.
*/
int CpioFD; /* The file descriptor for our CPIO floppy */
int RootFD; /* The file descriptor for our ROOT floppy */
int DebugFD; /* Where diagnostic output goes */
Boolean OnCDROM; /* Are we running off of a CDROM? */
Boolean OnSerial; /* Are we on a serial console? */
@ -66,7 +66,7 @@ Device *mediaDevice; /* Where we're installing from */
void
globalsInit(void)
{
CpioFD = -1;
RootFD = -1;
DebugFD = -1;
OnCDROM = FALSE;
OnSerial = FALSE;

View File

@ -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.53 1995/05/25 01:22:15 jkh Exp $
* $Id: install.c,v 1.54 1995/05/25 01:52:02 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -44,6 +44,7 @@
#include "sysinstall.h"
#include <sys/disklabel.h>
#include <sys/errno.h>
#include <sys/ioctl.h>
#include <sys/fcntl.h>
#include <sys/wait.h>
#include <unistd.h>
@ -52,7 +53,7 @@ Boolean SystemWasInstalled;
static void make_filesystems(void);
static void copy_self(void);
static void cpio_extract(void);
static void root_extract(void);
static Disk *rootdisk;
static Chunk *rootdev;
@ -196,7 +197,20 @@ installInitial(void)
chroot("/mnt");
chdir("/");
variable_set2(RUNNING_ON_ROOT, "yes");
cpio_extract();
/* If we're running as init, stick a shell over on the 4th VTY */
if (RunningAsInit && !fork()) {
int i, fd;
for (i = 0; i < 64; i++)
close(i);
fd = open("/dev/ttyv3", O_RDWR);
ioctl(0, TIOCSCTTY, &fd);
dup2(0, 1);
dup2(0, 2);
execlp("sh", "-sh", 0);
exit(1);
}
root_extract();
alreadyDone = TRUE;
return TRUE;
}
@ -374,7 +388,7 @@ floppyChoiceHook(char *str)
}
static void
cpio_extract(void)
root_extract(void)
{
int i, j, zpid, cpid, pfd[2];
Boolean onCDROM = FALSE;
@ -382,9 +396,9 @@ cpio_extract(void)
if (mediaDevice && mediaDevice->type == DEVICE_TYPE_CDROM) {
if (mediaDevice->init) {
if ((*mediaDevice->init)(mediaDevice)) {
CpioFD = open("/cdrom/floppies/cpio.flp", O_RDONLY);
if (CpioFD != -1) {
msgNotify("Loading CPIO floppy from CDROM");
RootFD = open("/cdrom/floppies/root.flp", O_RDONLY);
if (RootFD != -1) {
msgNotify("Loading root floppy from CDROM");
onCDROM = TRUE;
}
}
@ -392,7 +406,7 @@ cpio_extract(void)
}
tryagain:
while (CpioFD == -1) {
while (RootFD == -1) {
if (!floppyDev) {
Device **devs;
int cnt;
@ -415,20 +429,20 @@ cpio_extract(void)
continue;
}
dialog_clear();
msgConfirm("Please Insert CPIO floppy in %s", floppyDev->description);
CpioFD = open(floppyDev->devname, O_RDONLY);
if (CpioFD >= 0)
msgConfirm("Please Insert ROOT floppy in %s", floppyDev->description);
RootFD = open(floppyDev->devname, O_RDONLY);
if (RootFD >= 0)
break;
msgDebug("Error on open of cpio floppy: %s (%d)\n", strerror(errno), errno);
msgDebug("Error on open of root floppy: %s (%d)\n", strerror(errno), errno);
}
j = fork();
if (!j) {
chdir("/");
msgWeHaveOutput("Extracting contents of CPIO floppy...");
msgWeHaveOutput("Extracting contents of root floppy...");
pipe(pfd);
zpid = fork();
if (!zpid) {
dup2(CpioFD, 0); close(CpioFD);
dup2(RootFD, 0); close(RootFD);
dup2(pfd[1], 1); close(pfd[1]);
if (DebugFD != -1)
dup2(DebugFD, 2);
@ -440,7 +454,7 @@ cpio_extract(void)
cpid = fork();
if (!cpid) {
dup2(pfd[0], 0); close(pfd[0]);
close(CpioFD);
close(RootFD);
close(pfd[1]);
if (DebugFD != -1) {
dup2(DebugFD, 1);
@ -456,7 +470,7 @@ cpio_extract(void)
}
close(pfd[0]);
close(pfd[1]);
close(CpioFD);
close(RootFD);
i = waitpid(zpid, &j, 0);
if (i < 0) { /* Don't check status - gunzip seems to return a bogus one! */
@ -476,13 +490,13 @@ cpio_extract(void)
i = wait(&j);
if (i < 0 || WEXITSTATUS(j) || access("/OK", R_OK) == -1) {
dialog_clear();
msgConfirm("CPIO floppy did not extract properly! Please verify\nthat your media is correct and try again.");
close(CpioFD);
CpioFD = -1;
msgConfirm("Root floppy did not extract properly! Please verify\nthat your media is correct and try again.");
close(RootFD);
RootFD = -1;
dialog_clear();
goto tryagain;
}
unlink("/OK");
if (!onCDROM)
msgConfirm("Please remove the CPIO floppy from the drive");
msgConfirm("Please remove all floppies in any drives at this time.\nThey are no longer needed.");
}

View File

@ -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.23 1995/05/24 09:00:32 jkh Exp $
* $Id: label.c,v 1.24 1995/05/25 01:22:16 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -67,7 +67,6 @@
/* All the chunks currently displayed on the screen */
static struct {
struct disk *d;
struct chunk *c;
PartType type;
} label_chunk_info[MAX_CHUNKS + 1];
@ -79,7 +78,7 @@ check_conflict(char *name)
{
int i;
for (i = 0; label_chunk_info[i].d; i++)
for (i = 0; label_chunk_info[i].c; i++)
if (label_chunk_info[i].type == PART_FILESYSTEM
&& label_chunk_info[i].c->private
&& !strcmp(((PartInfo *)label_chunk_info[i].c->private)->mountpoint, name))
@ -132,7 +131,6 @@ record_label_chunks()
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 = d;
label_chunk_info[j].c = c1;
++j;
}
@ -152,7 +150,6 @@ record_label_chunks()
label_chunk_info[j].type = PART_SWAP;
else
label_chunk_info[j].type = PART_FILESYSTEM;
label_chunk_info[j].d = d;
label_chunk_info[j].c = c2;
++j;
}
@ -160,13 +157,11 @@ record_label_chunks()
}
else if (c1->type == fat) {
label_chunk_info[j].type = PART_FAT;
label_chunk_info[j].d = d;
label_chunk_info[j].c = c1;
++j;
}
}
}
label_chunk_info[j].d = NULL;
label_chunk_info[j].c = NULL;
if (here >= j)
here = j ? j - 1 : 0;
@ -206,8 +201,15 @@ get_mountpoint(struct chunk *old)
val = msgGetInput(old && old->private ? ((PartInfo *)old->private)->mountpoint : NULL,
"Please specify a mount point for the partition");
if (!val)
if (!val) {
if (!old)
return NULL;
else {
free(old->private);
old->private = NULL;
}
return NULL;
}
/* Is it just the same value? */
if (old && old->private && !strcmp(((PartInfo *)old->private)->mountpoint, val))
@ -312,16 +314,14 @@ print_label_chunks(void)
prow = CHUNK_PART_START_ROW;
pcol = 0;
for (i = 0; label_chunk_info[i].d; i++) {
for (i = 0; label_chunk_info[i].c; i++) {
if (i == here)
attrset(A_REVERSE);
/* Is it a slice entry displayed at the top? */
if (label_chunk_info[i].type == PART_SLICE) {
sz = space_free(label_chunk_info[i].c);
mvprintw(srow++, 0,
"Disk: %s\tPartition name: %s\tFree: %d blocks (%dMB)",
label_chunk_info[i].d->name,
label_chunk_info[i].c->name, sz, (sz / ONE_MEG));
mvprintw(srow++, 0, "Disk: %s\tPartition name: %s\tFree: %d blocks (%dMB)",
label_chunk_info[i].c->disk->name, label_chunk_info[i].c->name, sz, (sz / ONE_MEG));
}
/* Otherwise it's a DOS, swap or filesystem entry, at the bottom */
else {
@ -392,8 +392,9 @@ print_command_summary()
mvprintw(21, 0, "The default target will be displayed in ");
attrset(A_REVERSE);
addstr("reverse video.");
addstr("reverse");
attrset(A_NORMAL);
addstr(" video.");
mvprintw(22, 0, "Use F1 or ? to get more help, arrow keys to move.");
move(0, 0);
}
@ -429,18 +430,26 @@ diskLabelEditor(char *str)
key = toupper(getch());
switch (key) {
case '\014': /* ^L */
continue;
case KEY_UP:
case '-':
if (here != 0)
--here;
else
while (label_chunk_info[here + 1].c)
++here;
break;
case KEY_DOWN:
case '+':
case '\r':
case '\n':
if (label_chunk_info[here + 1].d)
if (label_chunk_info[here + 1].c)
++here;
else
here = 0;
break;
case KEY_HOME:
@ -448,7 +457,7 @@ diskLabelEditor(char *str)
break;
case KEY_END:
while (label_chunk_info[here + 1].d)
while (label_chunk_info[here + 1].c)
++here;
break;
@ -473,7 +482,7 @@ diskLabelEditor(char *str)
struct chunk *tmp;
u_long flags = 0;
val = msgGetInput(NULL, "Please specify the size for new FreeBSD partition in blocks, or append\na trailing `M' for megabytes (e.g. 20M).\n\nSpace free: %d blocks (%dMB)", sz, sz / ONE_MEG);
val = msgGetInput(NULL, "Please specify the size for new FreeBSD partition in blocks, or\nappend a trailing `M' for megabytes (e.g. 20M), `C' for cylinders\nor `%%' for a percentage of remaining space.\n\nSpace free is %d blocks (%dMB)", sz, sz / ONE_MEG);
if (!val || (size = strtol(val, &cp, 0)) <= 0)
break;
@ -481,9 +490,14 @@ diskLabelEditor(char *str)
msgConfirm("The minimum filesystem size is %dMB", FS_MIN_SIZE / ONE_MEG);
break;
}
if (*cp && toupper(*cp) == 'M')
size *= ONE_MEG;
if (*cp) {
if (toupper(*cp) == 'M')
size *= ONE_MEG;
else if (toupper(*cp) == 'C')
size *= (label_chunk_info[here].c->disk->bios_hd * label_chunk_info[here].c->disk->bios_sect);
else if (*cp == '%')
size = sz * (size * 0.10);
}
type = get_partition_type();
if (type == PART_NONE)
break;
@ -506,7 +520,7 @@ diskLabelEditor(char *str)
if (size < ROOT_MIN_SIZE)
msgConfirm("Warning: This is smaller than the recommended size for a\nroot partition. For a variety of reasons, root\npartitions should usually be at least %dMB in size", ROOT_MIN_SIZE / ONE_MEG);
}
tmp = Create_Chunk_DWIM(label_chunk_info[here].d,
tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk,
label_chunk_info[here].c,
size, part,
(type == PART_SWAP) ? FS_SWAP : FS_BSDFFS,
@ -517,7 +531,7 @@ diskLabelEditor(char *str)
}
if ((flags & CHUNK_IS_ROOT) && (tmp->flags & CHUNK_PAST_1024)) {
msgConfirm("This region cannot be used for your root partition as it starts\nor extends past the 1024'th cylinder mark and is thus a\npoor location to boot from. Please choose another\nlocation for your root partition and try again!");
Delete_Chunk(label_chunk_info[here].d, tmp);
Delete_Chunk(label_chunk_info[here].c->disk, tmp);
break;
}
if (type != PART_SWAP) {
@ -541,7 +555,7 @@ diskLabelEditor(char *str)
msg = "Use the Disk Partition Editor to delete DOS partitions";
break;
}
Delete_Chunk(label_chunk_info[here].d, label_chunk_info[here].c);
Delete_Chunk(label_chunk_info[here].c->disk, label_chunk_info[here].c);
record_label_chunks();
break;

View File

@ -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_strategy.c,v 1.20 1995/05/24 22:37:42 jkh Exp $
* $Id: media_strategy.c,v 1.21 1995/05/25 06:15:38 phk Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -250,28 +250,51 @@ genericGetDist(char *path, struct attribs *dist_attrib, Boolean prompt)
dup2(pfd[1], 1); close(pfd[1]);
close(pfd[0]);
for (chunk = 0; chunk < numchunks; chunk++) {
int fd;
int fd;
unsigned long len, val;
retval = stat(buf, &sb);
if ((retval != 0) && (prompt != TRUE))
{
msgConfirm("Cannot find file(s) for distribution in ``%s''!\n", path);
return -1;
} else {
char *tmp = index(buf, '/');
tmp++;
while (retval != 0)
{
msgConfirm("Please insert the disk with the `%s' file on it\n", tmp);
retval = stat(buf, &sb);
}
}
snprintf(buf, 512, "%s.%c%c", path, (chunk / 26) + 'a', (chunk % 26) + 'a');
if ((fd = open(buf, O_RDONLY)) == -1)
msgFatal("Cannot find file `%s'!", buf);
if (prompt == TRUE)
{
crc(fd, &val, &len);
msgDebug("crc for %s is %lu %lu\n", buf, val, len);
}
fstat(fd, &sb);
msgDebug("mmap()ing %s (%d)\n", buf, fd);
memory = mmap(0, sb.st_size, PROT_READ, MAP_SHARED, fd, (off_t) 0);
if (memory == (caddr_t) -1)
msgFatal("mmap error: %s\n", strerror(errno));
retval = write(1, memory, sb.st_size);
retval = write(1, memory, sb.st_size);
if (retval != sb.st_size)
{
msgConfirm("write didn't write out the complete file!\n(wrote %d bytes of %d bytes)", retval,
sb.st_size);
exit(1);
}
retval = munmap(memory, sb.st_size);
if (retval != 0)
{
@ -391,6 +414,7 @@ int
mediaGetFloppy(char *dist)
{
char buf[PATH_MAX];
char *fname;
struct attribs *dist_attr;
int retval;
@ -403,7 +427,8 @@ mediaGetFloppy(char *dist)
return FALSE;
}
snprintf(buf, PATH_MAX, "/mnt/%s", dist);
fname = index(dist, '/') + 1;
snprintf(buf, PATH_MAX, "/mnt/%s", fname);
retval = genericGetDist(buf, dist_attr, TRUE);
free(dist_attr);

View File

@ -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.28 1995/05/24 17:49:20 jkh Exp $
* $Id: menus.c,v 1.29 1995/05/25 01:22:18 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -337,6 +337,8 @@ the list of distributions yourself, simply select \"custom\".",
DMENU_CALL, distSetEverything, 0, 0 },
{ "Custom", "Specify your own distribution set [?]",
DMENU_SUBMENU, &MenuDistributions, 0, 0 },
{ "Reset", "Reset selected distribution list to None",
DMENU_CALL, distReset, 0, 0 },
{ NULL } },
};
@ -582,11 +584,10 @@ DMenu MenuInstall = {
"Choose Installation Options", /* title */
"Before installation can continue, you need to specify a few\n\
details on the type of distribution you wish to have, where you wish\n\
to install it from, and how you wish to allocate disk storage to FreeBSD\n\
to install it from and how you wish to allocate disk storage to FreeBSD.\n\n\
None of the items in this menu will actually modify the contents of\n\
your disk until you select the \"Write\" menu item (and even then, only\n\
after a final confirmation). If you do not wish to install FreeBSD\n\
at this time then select Cancel to leave this menu.",
after a final confirmation). Select Cancel to leave this menu.",
"Press F1 to read the installation guide",
"install.hlp",
{ { "Distributions", "Choose the type of installation you want", /* T */

View File

@ -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.31 1995/05/24 22:37:43 jkh Exp $
* $Id: sysinstall.h,v 1.32 1995/05/25 01:22:20 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -187,7 +187,7 @@ typedef int (*commandFunc)(char *key, void *data);
/*** Externs ***/
extern int CpioFD; /* The file descriptor for our CPIO floppy */
extern int RootFD; /* The file descriptor for our root floppy */
extern int DebugFD; /* Where diagnostic output goes */
extern Boolean OnCDROM; /* Are we running off of a CDROM? */
extern Boolean OnSerial; /* Are we on a serial console? */
@ -268,6 +268,7 @@ extern Device *deviceRegister(char *name, char *desc, char *devname, DeviceType
extern int diskPartitionEditor(char *unused);
/* dist.c */
extern int distReset(char *str);
extern int distSetDeveloper(char *str);
extern int distSetXDeveloper(char *str);
extern int distSetUser(char *str);

View File

@ -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.32 1995/05/24 23:43:59 jkh Exp $
* $Id: system.c,v 1.33 1995/05/25 01:52:03 jkh Exp $
*
* Jordan Hubbard
*
@ -60,7 +60,7 @@ systemInitialize(int argc, char **argv)
close(0); open("/bootcd/dev/console", O_RDWR);
close(1); dup(0);
close(2); dup(0);
CpioFD = open("/floppies/cpio.flp", O_RDONLY);
RootFD = open("/floppies/root.flp", O_RDONLY);
OnCDROM = TRUE;
chroot("/bootcd");
} else {
@ -85,20 +85,6 @@ systemInitialize(int argc, char **argv)
exit(-1);
}
/* If we're running as init, stick a shell over on the 4th VTY */
if (RunningAsInit && !fork()) {
int i;
for (i = 0; i < 64; i++)
close(i);
open("/dev/ttyv3", O_RDWR);
ioctl(0, TIOCSCTTY, (char *)NULL);
dup2(0, 1);
dup2(0, 2);
execlp("sh", "-sh", 0);
exit(1);
}
/* XXX - libdialog has particularly bad return value checking */
init_dialog();
/* If we haven't crashed I guess dialog is running ! */

View File

@ -1,5 +1,5 @@
/*
* $Id: tcpip.c,v 1.12 1995/05/24 01:27:15 jkh Exp $
* $Id: tcpip.c,v 1.13 1995/05/25 01:52:04 jkh Exp $
*
* Copyright (c) 1995
* Gary J Palmer. All rights reserved.
@ -579,6 +579,7 @@ tcpStartPPP(void)
if (fd == -1)
return FALSE;
Mkdir("/var/log", NULL);
Mkdir("/var/spool/lock", NULL);
if (!fork()) {
dup2(fd, 0);
dup2(fd, 1);

View File

@ -63,8 +63,10 @@ set_termcap(void)
return -1;
}
}
if (DebugFD == -1)
if (DebugFD == -1) {
DebugFD = open("/dev/ttyv1", O_WRONLY);
ioctl(DebugFD, TIOCCONS, (char *)NULL);
}
OnVTY = TRUE;
}
return 0;

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: config.c,v 1.4 1995/05/24 09:00:08 jkh Exp $
* $Id: config.c,v 1.5 1995/05/24 18:52:47 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -65,6 +65,20 @@ chunk_compare(const void *p1, const void *p2)
return strcmp(((PartInfo *)c1->private)->mountpoint, ((PartInfo *)c2->private)->mountpoint);
}
static char *
nameof(Chunk *c1)
{
static char rootname[64];
/* Our boot blocks can't deal with root partitions on slices - need the compatbility name */
if (c1->type == part && c1->flags & CHUNK_IS_ROOT) {
sprintf(rootname, "%sa", c1->disk->name);
return rootname;
}
else
return c1->name;
}
static char *
mount_point(Chunk *c1)
{
@ -135,11 +149,16 @@ configFstab(void)
disk = (Disk *)devs[i]->private;
if (!disk->chunks)
msgFatal("No chunk list found for %s!", disk->name);
for (c1 = disk->chunks->part; c1; c1 = c1->next)
if (c1->type == freebsd)
for (c2 = c1->part; c2; c2 = c2->next)
if (c2->type == part || c2->type == fat)
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)
chunk_list[nchunks++] = c2;
}
}
else if (c1->type == fat)
chunk_list[nchunks++] = c1;
}
}
/* Sort them puppies! */
@ -154,7 +173,7 @@ configFstab(void)
/* Go for the burn */
msgNotify("Generating /etc/fstab file");
for (i = 0; i < nchunks; i++) {
fprintf(fstab, "/dev/%s\t\t\t%s\t\t%s %s %d %d\n", chunk_list[i]->name, mount_point(chunk_list[i]),
fprintf(fstab, "/dev/%s\t\t\t%s\t\t%s %s %d %d\n", nameof(chunk_list[i]), mount_point(chunk_list[i]),
fstype(chunk_list[i]), fstype_short(chunk_list[i]), seq_num(chunk_list[i]),
seq_num(chunk_list[i]));
}

View File

@ -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.26 1995/05/21 06:12:42 phk Exp $
* $Id: disks.c,v 1.27 1995/05/22 14:10:12 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -111,7 +111,7 @@ print_command_summary()
mvprintw(17, 0, "D = Delete Partition G = Set BIOS Geometry S = Set Bootable");
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);
attrset(A_REVERSE); addstr("reverse"); attrset(A_NORMAL); addstr(" video.");
mvprintw(21, 0, "Use F1 or ? to get more help, arrow keys to move.");
move(0, 0);
}
@ -142,6 +142,11 @@ diskPartition(Disk *d)
key = toupper(getch());
switch (key) {
case '\014': /* ^L */
clear();
continue;
case KEY_UP:
case '-':
if (current_chunk != 0)

View File

@ -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.6 1995/05/20 00:13:09 jkh Exp $
* $Id: globals.c,v 1.7 1995/05/24 22:37:41 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -48,7 +48,7 @@
* whatever values we feel are appropriate.
*/
int CpioFD; /* The file descriptor for our CPIO floppy */
int RootFD; /* The file descriptor for our ROOT floppy */
int DebugFD; /* Where diagnostic output goes */
Boolean OnCDROM; /* Are we running off of a CDROM? */
Boolean OnSerial; /* Are we on a serial console? */
@ -66,7 +66,7 @@ Device *mediaDevice; /* Where we're installing from */
void
globalsInit(void)
{
CpioFD = -1;
RootFD = -1;
DebugFD = -1;
OnCDROM = FALSE;
OnSerial = FALSE;

View File

@ -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.53 1995/05/25 01:22:15 jkh Exp $
* $Id: install.c,v 1.54 1995/05/25 01:52:02 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -44,6 +44,7 @@
#include "sysinstall.h"
#include <sys/disklabel.h>
#include <sys/errno.h>
#include <sys/ioctl.h>
#include <sys/fcntl.h>
#include <sys/wait.h>
#include <unistd.h>
@ -52,7 +53,7 @@ Boolean SystemWasInstalled;
static void make_filesystems(void);
static void copy_self(void);
static void cpio_extract(void);
static void root_extract(void);
static Disk *rootdisk;
static Chunk *rootdev;
@ -196,7 +197,20 @@ installInitial(void)
chroot("/mnt");
chdir("/");
variable_set2(RUNNING_ON_ROOT, "yes");
cpio_extract();
/* If we're running as init, stick a shell over on the 4th VTY */
if (RunningAsInit && !fork()) {
int i, fd;
for (i = 0; i < 64; i++)
close(i);
fd = open("/dev/ttyv3", O_RDWR);
ioctl(0, TIOCSCTTY, &fd);
dup2(0, 1);
dup2(0, 2);
execlp("sh", "-sh", 0);
exit(1);
}
root_extract();
alreadyDone = TRUE;
return TRUE;
}
@ -374,7 +388,7 @@ floppyChoiceHook(char *str)
}
static void
cpio_extract(void)
root_extract(void)
{
int i, j, zpid, cpid, pfd[2];
Boolean onCDROM = FALSE;
@ -382,9 +396,9 @@ cpio_extract(void)
if (mediaDevice && mediaDevice->type == DEVICE_TYPE_CDROM) {
if (mediaDevice->init) {
if ((*mediaDevice->init)(mediaDevice)) {
CpioFD = open("/cdrom/floppies/cpio.flp", O_RDONLY);
if (CpioFD != -1) {
msgNotify("Loading CPIO floppy from CDROM");
RootFD = open("/cdrom/floppies/root.flp", O_RDONLY);
if (RootFD != -1) {
msgNotify("Loading root floppy from CDROM");
onCDROM = TRUE;
}
}
@ -392,7 +406,7 @@ cpio_extract(void)
}
tryagain:
while (CpioFD == -1) {
while (RootFD == -1) {
if (!floppyDev) {
Device **devs;
int cnt;
@ -415,20 +429,20 @@ cpio_extract(void)
continue;
}
dialog_clear();
msgConfirm("Please Insert CPIO floppy in %s", floppyDev->description);
CpioFD = open(floppyDev->devname, O_RDONLY);
if (CpioFD >= 0)
msgConfirm("Please Insert ROOT floppy in %s", floppyDev->description);
RootFD = open(floppyDev->devname, O_RDONLY);
if (RootFD >= 0)
break;
msgDebug("Error on open of cpio floppy: %s (%d)\n", strerror(errno), errno);
msgDebug("Error on open of root floppy: %s (%d)\n", strerror(errno), errno);
}
j = fork();
if (!j) {
chdir("/");
msgWeHaveOutput("Extracting contents of CPIO floppy...");
msgWeHaveOutput("Extracting contents of root floppy...");
pipe(pfd);
zpid = fork();
if (!zpid) {
dup2(CpioFD, 0); close(CpioFD);
dup2(RootFD, 0); close(RootFD);
dup2(pfd[1], 1); close(pfd[1]);
if (DebugFD != -1)
dup2(DebugFD, 2);
@ -440,7 +454,7 @@ cpio_extract(void)
cpid = fork();
if (!cpid) {
dup2(pfd[0], 0); close(pfd[0]);
close(CpioFD);
close(RootFD);
close(pfd[1]);
if (DebugFD != -1) {
dup2(DebugFD, 1);
@ -456,7 +470,7 @@ cpio_extract(void)
}
close(pfd[0]);
close(pfd[1]);
close(CpioFD);
close(RootFD);
i = waitpid(zpid, &j, 0);
if (i < 0) { /* Don't check status - gunzip seems to return a bogus one! */
@ -476,13 +490,13 @@ cpio_extract(void)
i = wait(&j);
if (i < 0 || WEXITSTATUS(j) || access("/OK", R_OK) == -1) {
dialog_clear();
msgConfirm("CPIO floppy did not extract properly! Please verify\nthat your media is correct and try again.");
close(CpioFD);
CpioFD = -1;
msgConfirm("Root floppy did not extract properly! Please verify\nthat your media is correct and try again.");
close(RootFD);
RootFD = -1;
dialog_clear();
goto tryagain;
}
unlink("/OK");
if (!onCDROM)
msgConfirm("Please remove the CPIO floppy from the drive");
msgConfirm("Please remove all floppies in any drives at this time.\nThey are no longer needed.");
}

View File

@ -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.23 1995/05/24 09:00:32 jkh Exp $
* $Id: label.c,v 1.24 1995/05/25 01:22:16 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -67,7 +67,6 @@
/* All the chunks currently displayed on the screen */
static struct {
struct disk *d;
struct chunk *c;
PartType type;
} label_chunk_info[MAX_CHUNKS + 1];
@ -79,7 +78,7 @@ check_conflict(char *name)
{
int i;
for (i = 0; label_chunk_info[i].d; i++)
for (i = 0; label_chunk_info[i].c; i++)
if (label_chunk_info[i].type == PART_FILESYSTEM
&& label_chunk_info[i].c->private
&& !strcmp(((PartInfo *)label_chunk_info[i].c->private)->mountpoint, name))
@ -132,7 +131,6 @@ record_label_chunks()
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 = d;
label_chunk_info[j].c = c1;
++j;
}
@ -152,7 +150,6 @@ record_label_chunks()
label_chunk_info[j].type = PART_SWAP;
else
label_chunk_info[j].type = PART_FILESYSTEM;
label_chunk_info[j].d = d;
label_chunk_info[j].c = c2;
++j;
}
@ -160,13 +157,11 @@ record_label_chunks()
}
else if (c1->type == fat) {
label_chunk_info[j].type = PART_FAT;
label_chunk_info[j].d = d;
label_chunk_info[j].c = c1;
++j;
}
}
}
label_chunk_info[j].d = NULL;
label_chunk_info[j].c = NULL;
if (here >= j)
here = j ? j - 1 : 0;
@ -206,8 +201,15 @@ get_mountpoint(struct chunk *old)
val = msgGetInput(old && old->private ? ((PartInfo *)old->private)->mountpoint : NULL,
"Please specify a mount point for the partition");
if (!val)
if (!val) {
if (!old)
return NULL;
else {
free(old->private);
old->private = NULL;
}
return NULL;
}
/* Is it just the same value? */
if (old && old->private && !strcmp(((PartInfo *)old->private)->mountpoint, val))
@ -312,16 +314,14 @@ print_label_chunks(void)
prow = CHUNK_PART_START_ROW;
pcol = 0;
for (i = 0; label_chunk_info[i].d; i++) {
for (i = 0; label_chunk_info[i].c; i++) {
if (i == here)
attrset(A_REVERSE);
/* Is it a slice entry displayed at the top? */
if (label_chunk_info[i].type == PART_SLICE) {
sz = space_free(label_chunk_info[i].c);
mvprintw(srow++, 0,
"Disk: %s\tPartition name: %s\tFree: %d blocks (%dMB)",
label_chunk_info[i].d->name,
label_chunk_info[i].c->name, sz, (sz / ONE_MEG));
mvprintw(srow++, 0, "Disk: %s\tPartition name: %s\tFree: %d blocks (%dMB)",
label_chunk_info[i].c->disk->name, label_chunk_info[i].c->name, sz, (sz / ONE_MEG));
}
/* Otherwise it's a DOS, swap or filesystem entry, at the bottom */
else {
@ -392,8 +392,9 @@ print_command_summary()
mvprintw(21, 0, "The default target will be displayed in ");
attrset(A_REVERSE);
addstr("reverse video.");
addstr("reverse");
attrset(A_NORMAL);
addstr(" video.");
mvprintw(22, 0, "Use F1 or ? to get more help, arrow keys to move.");
move(0, 0);
}
@ -429,18 +430,26 @@ diskLabelEditor(char *str)
key = toupper(getch());
switch (key) {
case '\014': /* ^L */
continue;
case KEY_UP:
case '-':
if (here != 0)
--here;
else
while (label_chunk_info[here + 1].c)
++here;
break;
case KEY_DOWN:
case '+':
case '\r':
case '\n':
if (label_chunk_info[here + 1].d)
if (label_chunk_info[here + 1].c)
++here;
else
here = 0;
break;
case KEY_HOME:
@ -448,7 +457,7 @@ diskLabelEditor(char *str)
break;
case KEY_END:
while (label_chunk_info[here + 1].d)
while (label_chunk_info[here + 1].c)
++here;
break;
@ -473,7 +482,7 @@ diskLabelEditor(char *str)
struct chunk *tmp;
u_long flags = 0;
val = msgGetInput(NULL, "Please specify the size for new FreeBSD partition in blocks, or append\na trailing `M' for megabytes (e.g. 20M).\n\nSpace free: %d blocks (%dMB)", sz, sz / ONE_MEG);
val = msgGetInput(NULL, "Please specify the size for new FreeBSD partition in blocks, or\nappend a trailing `M' for megabytes (e.g. 20M), `C' for cylinders\nor `%%' for a percentage of remaining space.\n\nSpace free is %d blocks (%dMB)", sz, sz / ONE_MEG);
if (!val || (size = strtol(val, &cp, 0)) <= 0)
break;
@ -481,9 +490,14 @@ diskLabelEditor(char *str)
msgConfirm("The minimum filesystem size is %dMB", FS_MIN_SIZE / ONE_MEG);
break;
}
if (*cp && toupper(*cp) == 'M')
size *= ONE_MEG;
if (*cp) {
if (toupper(*cp) == 'M')
size *= ONE_MEG;
else if (toupper(*cp) == 'C')
size *= (label_chunk_info[here].c->disk->bios_hd * label_chunk_info[here].c->disk->bios_sect);
else if (*cp == '%')
size = sz * (size * 0.10);
}
type = get_partition_type();
if (type == PART_NONE)
break;
@ -506,7 +520,7 @@ diskLabelEditor(char *str)
if (size < ROOT_MIN_SIZE)
msgConfirm("Warning: This is smaller than the recommended size for a\nroot partition. For a variety of reasons, root\npartitions should usually be at least %dMB in size", ROOT_MIN_SIZE / ONE_MEG);
}
tmp = Create_Chunk_DWIM(label_chunk_info[here].d,
tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk,
label_chunk_info[here].c,
size, part,
(type == PART_SWAP) ? FS_SWAP : FS_BSDFFS,
@ -517,7 +531,7 @@ diskLabelEditor(char *str)
}
if ((flags & CHUNK_IS_ROOT) && (tmp->flags & CHUNK_PAST_1024)) {
msgConfirm("This region cannot be used for your root partition as it starts\nor extends past the 1024'th cylinder mark and is thus a\npoor location to boot from. Please choose another\nlocation for your root partition and try again!");
Delete_Chunk(label_chunk_info[here].d, tmp);
Delete_Chunk(label_chunk_info[here].c->disk, tmp);
break;
}
if (type != PART_SWAP) {
@ -541,7 +555,7 @@ diskLabelEditor(char *str)
msg = "Use the Disk Partition Editor to delete DOS partitions";
break;
}
Delete_Chunk(label_chunk_info[here].d, label_chunk_info[here].c);
Delete_Chunk(label_chunk_info[here].c->disk, label_chunk_info[here].c);
record_label_chunks();
break;

View File

@ -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.28 1995/05/24 17:49:20 jkh Exp $
* $Id: menus.c,v 1.29 1995/05/25 01:22:18 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -337,6 +337,8 @@ the list of distributions yourself, simply select \"custom\".",
DMENU_CALL, distSetEverything, 0, 0 },
{ "Custom", "Specify your own distribution set [?]",
DMENU_SUBMENU, &MenuDistributions, 0, 0 },
{ "Reset", "Reset selected distribution list to None",
DMENU_CALL, distReset, 0, 0 },
{ NULL } },
};
@ -582,11 +584,10 @@ DMenu MenuInstall = {
"Choose Installation Options", /* title */
"Before installation can continue, you need to specify a few\n\
details on the type of distribution you wish to have, where you wish\n\
to install it from, and how you wish to allocate disk storage to FreeBSD\n\
to install it from and how you wish to allocate disk storage to FreeBSD.\n\n\
None of the items in this menu will actually modify the contents of\n\
your disk until you select the \"Write\" menu item (and even then, only\n\
after a final confirmation). If you do not wish to install FreeBSD\n\
at this time then select Cancel to leave this menu.",
after a final confirmation). Select Cancel to leave this menu.",
"Press F1 to read the installation guide",
"install.hlp",
{ { "Distributions", "Choose the type of installation you want", /* T */

View File

@ -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.31 1995/05/24 22:37:43 jkh Exp $
* $Id: sysinstall.h,v 1.32 1995/05/25 01:22:20 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -187,7 +187,7 @@ typedef int (*commandFunc)(char *key, void *data);
/*** Externs ***/
extern int CpioFD; /* The file descriptor for our CPIO floppy */
extern int RootFD; /* The file descriptor for our root floppy */
extern int DebugFD; /* Where diagnostic output goes */
extern Boolean OnCDROM; /* Are we running off of a CDROM? */
extern Boolean OnSerial; /* Are we on a serial console? */
@ -268,6 +268,7 @@ extern Device *deviceRegister(char *name, char *desc, char *devname, DeviceType
extern int diskPartitionEditor(char *unused);
/* dist.c */
extern int distReset(char *str);
extern int distSetDeveloper(char *str);
extern int distSetXDeveloper(char *str);
extern int distSetUser(char *str);

View File

@ -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.32 1995/05/24 23:43:59 jkh Exp $
* $Id: system.c,v 1.33 1995/05/25 01:52:03 jkh Exp $
*
* Jordan Hubbard
*
@ -60,7 +60,7 @@ systemInitialize(int argc, char **argv)
close(0); open("/bootcd/dev/console", O_RDWR);
close(1); dup(0);
close(2); dup(0);
CpioFD = open("/floppies/cpio.flp", O_RDONLY);
RootFD = open("/floppies/root.flp", O_RDONLY);
OnCDROM = TRUE;
chroot("/bootcd");
} else {
@ -85,20 +85,6 @@ systemInitialize(int argc, char **argv)
exit(-1);
}
/* If we're running as init, stick a shell over on the 4th VTY */
if (RunningAsInit && !fork()) {
int i;
for (i = 0; i < 64; i++)
close(i);
open("/dev/ttyv3", O_RDWR);
ioctl(0, TIOCSCTTY, (char *)NULL);
dup2(0, 1);
dup2(0, 2);
execlp("sh", "-sh", 0);
exit(1);
}
/* XXX - libdialog has particularly bad return value checking */
init_dialog();
/* If we haven't crashed I guess dialog is running ! */

View File

@ -63,8 +63,10 @@ set_termcap(void)
return -1;
}
}
if (DebugFD == -1)
if (DebugFD == -1) {
DebugFD = open("/dev/ttyv1", O_WRONLY);
ioctl(DebugFD, TIOCCONS, (char *)NULL);
}
OnVTY = TRUE;
}
return 0;

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: config.c,v 1.4 1995/05/24 09:00:08 jkh Exp $
* $Id: config.c,v 1.5 1995/05/24 18:52:47 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -65,6 +65,20 @@ chunk_compare(const void *p1, const void *p2)
return strcmp(((PartInfo *)c1->private)->mountpoint, ((PartInfo *)c2->private)->mountpoint);
}
static char *
nameof(Chunk *c1)
{
static char rootname[64];
/* Our boot blocks can't deal with root partitions on slices - need the compatbility name */
if (c1->type == part && c1->flags & CHUNK_IS_ROOT) {
sprintf(rootname, "%sa", c1->disk->name);
return rootname;
}
else
return c1->name;
}
static char *
mount_point(Chunk *c1)
{
@ -135,11 +149,16 @@ configFstab(void)
disk = (Disk *)devs[i]->private;
if (!disk->chunks)
msgFatal("No chunk list found for %s!", disk->name);
for (c1 = disk->chunks->part; c1; c1 = c1->next)
if (c1->type == freebsd)
for (c2 = c1->part; c2; c2 = c2->next)
if (c2->type == part || c2->type == fat)
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)
chunk_list[nchunks++] = c2;
}
}
else if (c1->type == fat)
chunk_list[nchunks++] = c1;
}
}
/* Sort them puppies! */
@ -154,7 +173,7 @@ configFstab(void)
/* Go for the burn */
msgNotify("Generating /etc/fstab file");
for (i = 0; i < nchunks; i++) {
fprintf(fstab, "/dev/%s\t\t\t%s\t\t%s %s %d %d\n", chunk_list[i]->name, mount_point(chunk_list[i]),
fprintf(fstab, "/dev/%s\t\t\t%s\t\t%s %s %d %d\n", nameof(chunk_list[i]), mount_point(chunk_list[i]),
fstype(chunk_list[i]), fstype_short(chunk_list[i]), seq_num(chunk_list[i]),
seq_num(chunk_list[i]));
}

View File

@ -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.26 1995/05/21 06:12:42 phk Exp $
* $Id: disks.c,v 1.27 1995/05/22 14:10:12 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -111,7 +111,7 @@ print_command_summary()
mvprintw(17, 0, "D = Delete Partition G = Set BIOS Geometry S = Set Bootable");
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);
attrset(A_REVERSE); addstr("reverse"); attrset(A_NORMAL); addstr(" video.");
mvprintw(21, 0, "Use F1 or ? to get more help, arrow keys to move.");
move(0, 0);
}
@ -142,6 +142,11 @@ diskPartition(Disk *d)
key = toupper(getch());
switch (key) {
case '\014': /* ^L */
clear();
continue;
case KEY_UP:
case '-':
if (current_chunk != 0)

View File

@ -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.18 1995/05/24 09:00:17 jkh Exp $
* $Id: dist.c,v 1.19 1995/05/24 17:49:12 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -51,6 +51,17 @@ unsigned int XF86FontDists;
static int distSetXF86(char *str);
int
distReset(char *str)
{
Dists = 0;
SrcDists = 0;
XF86Dists = 0;
XF86ServerDists = 0;
XF86FontDists = 0;
return 0;
}
int
distSetDeveloper(char *str)
{

View File

@ -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.6 1995/05/20 00:13:09 jkh Exp $
* $Id: globals.c,v 1.7 1995/05/24 22:37:41 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -48,7 +48,7 @@
* whatever values we feel are appropriate.
*/
int CpioFD; /* The file descriptor for our CPIO floppy */
int RootFD; /* The file descriptor for our ROOT floppy */
int DebugFD; /* Where diagnostic output goes */
Boolean OnCDROM; /* Are we running off of a CDROM? */
Boolean OnSerial; /* Are we on a serial console? */
@ -66,7 +66,7 @@ Device *mediaDevice; /* Where we're installing from */
void
globalsInit(void)
{
CpioFD = -1;
RootFD = -1;
DebugFD = -1;
OnCDROM = FALSE;
OnSerial = FALSE;

View File

@ -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.53 1995/05/25 01:22:15 jkh Exp $
* $Id: install.c,v 1.54 1995/05/25 01:52:02 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -44,6 +44,7 @@
#include "sysinstall.h"
#include <sys/disklabel.h>
#include <sys/errno.h>
#include <sys/ioctl.h>
#include <sys/fcntl.h>
#include <sys/wait.h>
#include <unistd.h>
@ -52,7 +53,7 @@ Boolean SystemWasInstalled;
static void make_filesystems(void);
static void copy_self(void);
static void cpio_extract(void);
static void root_extract(void);
static Disk *rootdisk;
static Chunk *rootdev;
@ -196,7 +197,20 @@ installInitial(void)
chroot("/mnt");
chdir("/");
variable_set2(RUNNING_ON_ROOT, "yes");
cpio_extract();
/* If we're running as init, stick a shell over on the 4th VTY */
if (RunningAsInit && !fork()) {
int i, fd;
for (i = 0; i < 64; i++)
close(i);
fd = open("/dev/ttyv3", O_RDWR);
ioctl(0, TIOCSCTTY, &fd);
dup2(0, 1);
dup2(0, 2);
execlp("sh", "-sh", 0);
exit(1);
}
root_extract();
alreadyDone = TRUE;
return TRUE;
}
@ -374,7 +388,7 @@ floppyChoiceHook(char *str)
}
static void
cpio_extract(void)
root_extract(void)
{
int i, j, zpid, cpid, pfd[2];
Boolean onCDROM = FALSE;
@ -382,9 +396,9 @@ cpio_extract(void)
if (mediaDevice && mediaDevice->type == DEVICE_TYPE_CDROM) {
if (mediaDevice->init) {
if ((*mediaDevice->init)(mediaDevice)) {
CpioFD = open("/cdrom/floppies/cpio.flp", O_RDONLY);
if (CpioFD != -1) {
msgNotify("Loading CPIO floppy from CDROM");
RootFD = open("/cdrom/floppies/root.flp", O_RDONLY);
if (RootFD != -1) {
msgNotify("Loading root floppy from CDROM");
onCDROM = TRUE;
}
}
@ -392,7 +406,7 @@ cpio_extract(void)
}
tryagain:
while (CpioFD == -1) {
while (RootFD == -1) {
if (!floppyDev) {
Device **devs;
int cnt;
@ -415,20 +429,20 @@ cpio_extract(void)
continue;
}
dialog_clear();
msgConfirm("Please Insert CPIO floppy in %s", floppyDev->description);
CpioFD = open(floppyDev->devname, O_RDONLY);
if (CpioFD >= 0)
msgConfirm("Please Insert ROOT floppy in %s", floppyDev->description);
RootFD = open(floppyDev->devname, O_RDONLY);
if (RootFD >= 0)
break;
msgDebug("Error on open of cpio floppy: %s (%d)\n", strerror(errno), errno);
msgDebug("Error on open of root floppy: %s (%d)\n", strerror(errno), errno);
}
j = fork();
if (!j) {
chdir("/");
msgWeHaveOutput("Extracting contents of CPIO floppy...");
msgWeHaveOutput("Extracting contents of root floppy...");
pipe(pfd);
zpid = fork();
if (!zpid) {
dup2(CpioFD, 0); close(CpioFD);
dup2(RootFD, 0); close(RootFD);
dup2(pfd[1], 1); close(pfd[1]);
if (DebugFD != -1)
dup2(DebugFD, 2);
@ -440,7 +454,7 @@ cpio_extract(void)
cpid = fork();
if (!cpid) {
dup2(pfd[0], 0); close(pfd[0]);
close(CpioFD);
close(RootFD);
close(pfd[1]);
if (DebugFD != -1) {
dup2(DebugFD, 1);
@ -456,7 +470,7 @@ cpio_extract(void)
}
close(pfd[0]);
close(pfd[1]);
close(CpioFD);
close(RootFD);
i = waitpid(zpid, &j, 0);
if (i < 0) { /* Don't check status - gunzip seems to return a bogus one! */
@ -476,13 +490,13 @@ cpio_extract(void)
i = wait(&j);
if (i < 0 || WEXITSTATUS(j) || access("/OK", R_OK) == -1) {
dialog_clear();
msgConfirm("CPIO floppy did not extract properly! Please verify\nthat your media is correct and try again.");
close(CpioFD);
CpioFD = -1;
msgConfirm("Root floppy did not extract properly! Please verify\nthat your media is correct and try again.");
close(RootFD);
RootFD = -1;
dialog_clear();
goto tryagain;
}
unlink("/OK");
if (!onCDROM)
msgConfirm("Please remove the CPIO floppy from the drive");
msgConfirm("Please remove all floppies in any drives at this time.\nThey are no longer needed.");
}

View File

@ -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.23 1995/05/24 09:00:32 jkh Exp $
* $Id: label.c,v 1.24 1995/05/25 01:22:16 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -67,7 +67,6 @@
/* All the chunks currently displayed on the screen */
static struct {
struct disk *d;
struct chunk *c;
PartType type;
} label_chunk_info[MAX_CHUNKS + 1];
@ -79,7 +78,7 @@ check_conflict(char *name)
{
int i;
for (i = 0; label_chunk_info[i].d; i++)
for (i = 0; label_chunk_info[i].c; i++)
if (label_chunk_info[i].type == PART_FILESYSTEM
&& label_chunk_info[i].c->private
&& !strcmp(((PartInfo *)label_chunk_info[i].c->private)->mountpoint, name))
@ -132,7 +131,6 @@ record_label_chunks()
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 = d;
label_chunk_info[j].c = c1;
++j;
}
@ -152,7 +150,6 @@ record_label_chunks()
label_chunk_info[j].type = PART_SWAP;
else
label_chunk_info[j].type = PART_FILESYSTEM;
label_chunk_info[j].d = d;
label_chunk_info[j].c = c2;
++j;
}
@ -160,13 +157,11 @@ record_label_chunks()
}
else if (c1->type == fat) {
label_chunk_info[j].type = PART_FAT;
label_chunk_info[j].d = d;
label_chunk_info[j].c = c1;
++j;
}
}
}
label_chunk_info[j].d = NULL;
label_chunk_info[j].c = NULL;
if (here >= j)
here = j ? j - 1 : 0;
@ -206,8 +201,15 @@ get_mountpoint(struct chunk *old)
val = msgGetInput(old && old->private ? ((PartInfo *)old->private)->mountpoint : NULL,
"Please specify a mount point for the partition");
if (!val)
if (!val) {
if (!old)
return NULL;
else {
free(old->private);
old->private = NULL;
}
return NULL;
}
/* Is it just the same value? */
if (old && old->private && !strcmp(((PartInfo *)old->private)->mountpoint, val))
@ -312,16 +314,14 @@ print_label_chunks(void)
prow = CHUNK_PART_START_ROW;
pcol = 0;
for (i = 0; label_chunk_info[i].d; i++) {
for (i = 0; label_chunk_info[i].c; i++) {
if (i == here)
attrset(A_REVERSE);
/* Is it a slice entry displayed at the top? */
if (label_chunk_info[i].type == PART_SLICE) {
sz = space_free(label_chunk_info[i].c);
mvprintw(srow++, 0,
"Disk: %s\tPartition name: %s\tFree: %d blocks (%dMB)",
label_chunk_info[i].d->name,
label_chunk_info[i].c->name, sz, (sz / ONE_MEG));
mvprintw(srow++, 0, "Disk: %s\tPartition name: %s\tFree: %d blocks (%dMB)",
label_chunk_info[i].c->disk->name, label_chunk_info[i].c->name, sz, (sz / ONE_MEG));
}
/* Otherwise it's a DOS, swap or filesystem entry, at the bottom */
else {
@ -392,8 +392,9 @@ print_command_summary()
mvprintw(21, 0, "The default target will be displayed in ");
attrset(A_REVERSE);
addstr("reverse video.");
addstr("reverse");
attrset(A_NORMAL);
addstr(" video.");
mvprintw(22, 0, "Use F1 or ? to get more help, arrow keys to move.");
move(0, 0);
}
@ -429,18 +430,26 @@ diskLabelEditor(char *str)
key = toupper(getch());
switch (key) {
case '\014': /* ^L */
continue;
case KEY_UP:
case '-':
if (here != 0)
--here;
else
while (label_chunk_info[here + 1].c)
++here;
break;
case KEY_DOWN:
case '+':
case '\r':
case '\n':
if (label_chunk_info[here + 1].d)
if (label_chunk_info[here + 1].c)
++here;
else
here = 0;
break;
case KEY_HOME:
@ -448,7 +457,7 @@ diskLabelEditor(char *str)
break;
case KEY_END:
while (label_chunk_info[here + 1].d)
while (label_chunk_info[here + 1].c)
++here;
break;
@ -473,7 +482,7 @@ diskLabelEditor(char *str)
struct chunk *tmp;
u_long flags = 0;
val = msgGetInput(NULL, "Please specify the size for new FreeBSD partition in blocks, or append\na trailing `M' for megabytes (e.g. 20M).\n\nSpace free: %d blocks (%dMB)", sz, sz / ONE_MEG);
val = msgGetInput(NULL, "Please specify the size for new FreeBSD partition in blocks, or\nappend a trailing `M' for megabytes (e.g. 20M), `C' for cylinders\nor `%%' for a percentage of remaining space.\n\nSpace free is %d blocks (%dMB)", sz, sz / ONE_MEG);
if (!val || (size = strtol(val, &cp, 0)) <= 0)
break;
@ -481,9 +490,14 @@ diskLabelEditor(char *str)
msgConfirm("The minimum filesystem size is %dMB", FS_MIN_SIZE / ONE_MEG);
break;
}
if (*cp && toupper(*cp) == 'M')
size *= ONE_MEG;
if (*cp) {
if (toupper(*cp) == 'M')
size *= ONE_MEG;
else if (toupper(*cp) == 'C')
size *= (label_chunk_info[here].c->disk->bios_hd * label_chunk_info[here].c->disk->bios_sect);
else if (*cp == '%')
size = sz * (size * 0.10);
}
type = get_partition_type();
if (type == PART_NONE)
break;
@ -506,7 +520,7 @@ diskLabelEditor(char *str)
if (size < ROOT_MIN_SIZE)
msgConfirm("Warning: This is smaller than the recommended size for a\nroot partition. For a variety of reasons, root\npartitions should usually be at least %dMB in size", ROOT_MIN_SIZE / ONE_MEG);
}
tmp = Create_Chunk_DWIM(label_chunk_info[here].d,
tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk,
label_chunk_info[here].c,
size, part,
(type == PART_SWAP) ? FS_SWAP : FS_BSDFFS,
@ -517,7 +531,7 @@ diskLabelEditor(char *str)
}
if ((flags & CHUNK_IS_ROOT) && (tmp->flags & CHUNK_PAST_1024)) {
msgConfirm("This region cannot be used for your root partition as it starts\nor extends past the 1024'th cylinder mark and is thus a\npoor location to boot from. Please choose another\nlocation for your root partition and try again!");
Delete_Chunk(label_chunk_info[here].d, tmp);
Delete_Chunk(label_chunk_info[here].c->disk, tmp);
break;
}
if (type != PART_SWAP) {
@ -541,7 +555,7 @@ diskLabelEditor(char *str)
msg = "Use the Disk Partition Editor to delete DOS partitions";
break;
}
Delete_Chunk(label_chunk_info[here].d, label_chunk_info[here].c);
Delete_Chunk(label_chunk_info[here].c->disk, label_chunk_info[here].c);
record_label_chunks();
break;

View File

@ -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.28 1995/05/24 17:49:20 jkh Exp $
* $Id: menus.c,v 1.29 1995/05/25 01:22:18 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -337,6 +337,8 @@ the list of distributions yourself, simply select \"custom\".",
DMENU_CALL, distSetEverything, 0, 0 },
{ "Custom", "Specify your own distribution set [?]",
DMENU_SUBMENU, &MenuDistributions, 0, 0 },
{ "Reset", "Reset selected distribution list to None",
DMENU_CALL, distReset, 0, 0 },
{ NULL } },
};
@ -582,11 +584,10 @@ DMenu MenuInstall = {
"Choose Installation Options", /* title */
"Before installation can continue, you need to specify a few\n\
details on the type of distribution you wish to have, where you wish\n\
to install it from, and how you wish to allocate disk storage to FreeBSD\n\
to install it from and how you wish to allocate disk storage to FreeBSD.\n\n\
None of the items in this menu will actually modify the contents of\n\
your disk until you select the \"Write\" menu item (and even then, only\n\
after a final confirmation). If you do not wish to install FreeBSD\n\
at this time then select Cancel to leave this menu.",
after a final confirmation). Select Cancel to leave this menu.",
"Press F1 to read the installation guide",
"install.hlp",
{ { "Distributions", "Choose the type of installation you want", /* T */

View File

@ -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.31 1995/05/24 22:37:43 jkh Exp $
* $Id: sysinstall.h,v 1.32 1995/05/25 01:22:20 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -187,7 +187,7 @@ typedef int (*commandFunc)(char *key, void *data);
/*** Externs ***/
extern int CpioFD; /* The file descriptor for our CPIO floppy */
extern int RootFD; /* The file descriptor for our root floppy */
extern int DebugFD; /* Where diagnostic output goes */
extern Boolean OnCDROM; /* Are we running off of a CDROM? */
extern Boolean OnSerial; /* Are we on a serial console? */
@ -268,6 +268,7 @@ extern Device *deviceRegister(char *name, char *desc, char *devname, DeviceType
extern int diskPartitionEditor(char *unused);
/* dist.c */
extern int distReset(char *str);
extern int distSetDeveloper(char *str);
extern int distSetXDeveloper(char *str);
extern int distSetUser(char *str);

View File

@ -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.32 1995/05/24 23:43:59 jkh Exp $
* $Id: system.c,v 1.33 1995/05/25 01:52:03 jkh Exp $
*
* Jordan Hubbard
*
@ -60,7 +60,7 @@ systemInitialize(int argc, char **argv)
close(0); open("/bootcd/dev/console", O_RDWR);
close(1); dup(0);
close(2); dup(0);
CpioFD = open("/floppies/cpio.flp", O_RDONLY);
RootFD = open("/floppies/root.flp", O_RDONLY);
OnCDROM = TRUE;
chroot("/bootcd");
} else {
@ -85,20 +85,6 @@ systemInitialize(int argc, char **argv)
exit(-1);
}
/* If we're running as init, stick a shell over on the 4th VTY */
if (RunningAsInit && !fork()) {
int i;
for (i = 0; i < 64; i++)
close(i);
open("/dev/ttyv3", O_RDWR);
ioctl(0, TIOCSCTTY, (char *)NULL);
dup2(0, 1);
dup2(0, 2);
execlp("sh", "-sh", 0);
exit(1);
}
/* XXX - libdialog has particularly bad return value checking */
init_dialog();
/* If we haven't crashed I guess dialog is running ! */

View File

@ -1,5 +1,5 @@
/*
* $Id: tcpip.c,v 1.12 1995/05/24 01:27:15 jkh Exp $
* $Id: tcpip.c,v 1.13 1995/05/25 01:52:04 jkh Exp $
*
* Copyright (c) 1995
* Gary J Palmer. All rights reserved.
@ -579,6 +579,7 @@ tcpStartPPP(void)
if (fd == -1)
return FALSE;
Mkdir("/var/log", NULL);
Mkdir("/var/spool/lock", NULL);
if (!fork()) {
dup2(fd, 0);
dup2(fd, 1);

View File

@ -63,8 +63,10 @@ set_termcap(void)
return -1;
}
}
if (DebugFD == -1)
if (DebugFD == -1) {
DebugFD = open("/dev/ttyv1", O_WRONLY);
ioctl(DebugFD, TIOCCONS, (char *)NULL);
}
OnVTY = TRUE;
}
return 0;