Reworked partitioning issues for i386, closes PRs 4520, 4534, 4536.

Other tweeks to make install better.
This commit is contained in:
phil 1997-11-25 20:34:59 +00:00
parent e85ad99e57
commit 1e785c32c4
10 changed files with 139 additions and 103 deletions

View File

@ -7,8 +7,6 @@ Things we should try and do before 1.3 release....
jump back to disklabel edit if any overlaps found. jump back to disklabel edit if any overlaps found.
needs to skip getrawpartition() (and c on i386). needs to skip getrawpartition() (and c on i386).
-- Allow ^L to redraw the screen to get rid of error messages.
-- Also on error messages, do something to allow the user to -- Also on error messages, do something to allow the user to
see any errors from anything run by run_prog(). Ideas are: see any errors from anything run by run_prog(). Ideas are:
@ -46,8 +44,6 @@ Things we should try and do before 1.3 release....
distribution set from. Maybe just allowing the user to shell distribution set from. Maybe just allowing the user to shell
out and look around is good enough (this needs more thought). out and look around is good enough (this needs more thought).
-- Trap SIGINT and restore tty setting on exit.
-- check for already-mouned fileystems before install newfs. -- check for already-mouned fileystems before install newfs.
Abort with message. Abort with message.
@ -106,7 +102,6 @@ Things to do ....
-- check for disklabel edits changing active root partition. -- check for disklabel edits changing active root partition.
reject. reject.
-- remove any possibly-stale ld.so.cache files from the target -- remove any possibly-stale ld.so.cache files from the target
/etc after unpacking sets. Maybe just don't copy ld.so.cache /etc after unpacking sets. Maybe just don't copy ld.so.cache
from /etc.old? from /etc.old?
@ -118,7 +113,6 @@ Things to do ....
on the disk, maybe use that intsead of the compiled-in default on the disk, maybe use that intsead of the compiled-in default
label? label?
-- symlinks for /tmp (/tmp -> /var/tmp or some such) -- symlinks for /tmp (/tmp -> /var/tmp or some such)
Or configure tmp on mfs. Or configure tmp on mfs.

View File

@ -1,4 +1,4 @@
/* $NetBSD: fdisk.c,v 1.2 1997/10/17 21:10:56 phil Exp $ */ /* $NetBSD: fdisk.c,v 1.3 1997/11/25 20:35:05 phil Exp $ */
/* /*
* Copyright 1997 Piermont Information Systems Inc. * Copyright 1997 Piermont Information Systems Inc.
@ -55,19 +55,19 @@ struct lookfor fdiskbuf[] = {
{"PART0ID", "PART0ID=%d", "a $0", &part[0][ID], NULL}, {"PART0ID", "PART0ID=%d", "a $0", &part[0][ID], NULL},
{"PART0SIZE", "PART0SIZE=%d", "a $0", &part[0][SIZE], NULL}, {"PART0SIZE", "PART0SIZE=%d", "a $0", &part[0][SIZE], NULL},
{"PART0START", "PART0START=%d", "a $0", &part[0][START], NULL}, {"PART0START", "PART0START=%d", "a $0", &part[0][START], NULL},
{"PART0FLAG", "PART0FLAG=%d", "a $0", &part[0][FLAG], NULL}, {"PART0FLAG", "PART0FLAG=0x%d", "a $0", &part[0][FLAG], NULL},
{"PART1ID", "PART1ID=%d", "a $0", &part[1][ID], NULL}, {"PART1ID", "PART1ID=%d", "a $0", &part[1][ID], NULL},
{"PART1SIZE", "PART1SIZE=%d", "a $0", &part[1][SIZE], NULL}, {"PART1SIZE", "PART1SIZE=%d", "a $0", &part[1][SIZE], NULL},
{"PART1START", "PART1START=%d", "a $0", &part[1][START], NULL}, {"PART1START", "PART1START=%d", "a $0", &part[1][START], NULL},
{"PART1FLAG", "PART1FLAG=%d", "a $0", &part[1][FLAG], NULL}, {"PART1FLAG", "PART1FLAG=0x%d", "a $0", &part[1][FLAG], NULL},
{"PART2ID", "PART2ID=%d", "a $0", &part[2][ID], NULL}, {"PART2ID", "PART2ID=%d", "a $0", &part[2][ID], NULL},
{"PART2SIZE", "PART2SIZE=%d", "a $0", &part[2][SIZE], NULL}, {"PART2SIZE", "PART2SIZE=%d", "a $0", &part[2][SIZE], NULL},
{"PART2START", "PART2START=%d", "a $0", &part[2][START], NULL}, {"PART2START", "PART2START=%d", "a $0", &part[2][START], NULL},
{"PART2FLAG", "PART2FLAG=%d", "a $0", &part[2][FLAG], NULL}, {"PART2FLAG", "PART2FLAG=0x%d", "a $0", &part[2][FLAG], NULL},
{"PART3ID", "PART3ID=%d", "a $0", &part[3][ID], NULL}, {"PART3ID", "PART3ID=%d", "a $0", &part[3][ID], NULL},
{"PART3SIZE", "PART3SIZE=%d", "a $0", &part[3][SIZE], NULL}, {"PART3SIZE", "PART3SIZE=%d", "a $0", &part[3][SIZE], NULL},
{"PART3START", "PART3START=%d", "a $0", &part[3][START], NULL}, {"PART3START", "PART3START=%d", "a $0", &part[3][START], NULL},
{"PART3FLAG", "PART3FLAG=%d", "a $0", &part[3][FLAG], NULL} {"PART3FLAG", "PART3FLAG=0x%d", "a $0", &part[3][FLAG], NULL}
}; };
int numfdiskbuf = sizeof(fdiskbuf) / sizeof(struct lookfor); int numfdiskbuf = sizeof(fdiskbuf) / sizeof(struct lookfor);
@ -158,6 +158,7 @@ void get_fdisk_info (void)
{ {
char *textbuf; char *textbuf;
int textsize; int textsize;
int t1, t2;
/* Get Fdisk information */ /* Get Fdisk information */
textsize = collect (T_OUTPUT, &textbuf, textsize = collect (T_OUTPUT, &textbuf,
@ -169,5 +170,20 @@ void get_fdisk_info (void)
} }
walk (textbuf, textsize, fdiskbuf, numfdiskbuf); walk (textbuf, textsize, fdiskbuf, numfdiskbuf);
free (textbuf); free (textbuf);
/* A common failure of fdisk is to get the number of cylinders
wrong and the number of sectors and heads right. This makes
a disk look very big. In this case, we can just recompute
the number of cylinders and things should work just fine. */
if (bcyl > 1023 && bsec < 64) {
t1 = disk->geom[0] * disk->geom[1] * disk->geom[2];
t2 = bhead * bsec;
if (bcyl * t2 > t1) {
t2 = t1 / t2;
if (t2 < 1024)
bcyl = t2;
}
}
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.6 1997/11/09 16:07:56 phil Exp $ */ /* $NetBSD: md.c,v 1.7 1997/11/25 20:35:07 phil Exp $ */
/* /*
* Copyright 1997 Piermont Information Systems Inc. * Copyright 1997 Piermont Information Systems Inc.
@ -51,10 +51,18 @@ int md_get_info()
int i, j; int i, j;
get_fdisk_info (); get_fdisk_info ();
/* Check fdisk information */
if (bsec <= 0 || bcyl <= 0 || bsec <= 0 || bcyl > 1024 || bsec > 63)
process_menu (MENU_biosgeom);
/* Ask about disk type ... */ /* Ask about disk type ... */
if (strncmp(disk->name, "wd", 2) == 0) { if (strncmp(disk->name, "wd", 2) == 0) {
process_menu (MENU_wdtype); process_menu (MENU_wdtype);
disktype = "ST506"; disktype = "ST506";
/* Check against disk geometry. */
if (disk->geom[0] != dlcyl || disk->geom[1] != dlhead
|| disk->geom[2] != dlsec)
process_menu (MENU_dlgeom);
} else { } else {
disktype = "SCSI"; disktype = "SCSI";
if (disk->geom[0]*disk->geom[1]*disk->geom[2] != disk->geom[4]) if (disk->geom[0]*disk->geom[1]*disk->geom[2] != disk->geom[4])
@ -65,14 +73,6 @@ int md_get_info()
process_menu (MENU_scsigeom2); process_menu (MENU_scsigeom2);
} }
/* Check against disk geometry. */
if (disk->geom[0] != dlcyl || disk->geom[1] != dlhead
|| disk->geom[2] != dlsec)
process_menu (MENU_dlgeom);
/* Check fdisk information */
if (bsec <= 0 || bcyl <= 0 || bsec <= 0 || bcyl > 1024 || bsec > 63)
process_menu (MENU_biosgeom);
/* Compute the full sizes ... */ /* Compute the full sizes ... */
dlcylsize = dlhead*dlsec; dlcylsize = dlhead*dlsec;
@ -87,10 +87,10 @@ int md_get_info()
/* DOS fdisk label checking and value setting. */ /* DOS fdisk label checking and value setting. */
if (usefull) { if (usefull) {
/* Ask if we really want to blow away non-BSD stuff */ /* Ask if we really want to blow away non-BSD stuff */
if (!(part[0][ID] == 0 || part[0][ID] == 165 || if ((part[0][ID] != 0 && part[0][ID] != 165) ||
part[1][ID] == 0 || part[1][ID] == 165 || (part[1][ID] != 0 && part[1][ID] != 165) ||
part[2][ID] == 0 || part[2][ID] == 165 || (part[2][ID] != 0 && part[2][ID] != 165) ||
part[3][ID] == 0 || part[3][ID] == 165)) { (part[3][ID] != 0 && part[3][ID] != 165)) {
msg_display (MSG_ovrwrite); msg_display (MSG_ovrwrite);
process_menu (MENU_noyes); process_menu (MENU_noyes);
if (!yesno) { if (!yesno) {
@ -100,12 +100,16 @@ int md_get_info()
} }
/* Set the partition information for full disk usage. */ /* Set the partition information for full disk usage. */
part[0][ID] = part[0][SIZE] = 0; part[0][ID] = part[0][SIZE] = 0;
part[0][SET] = 1;
part[1][ID] = part[1][SIZE] = 0; part[1][ID] = part[1][SIZE] = 0;
part[1][SET] = 1;
part[2][ID] = part[2][SIZE] = 0; part[2][ID] = part[2][SIZE] = 0;
part[2][SET] = 1;
part[3][ID] = 165; part[3][ID] = 165;
part[3][SIZE] = bsize - bsec; part[3][SIZE] = bsize - bsec;
part[3][START] = bsec; part[3][START] = bsec;
part[3][FLAG] = 0x80; part[3][FLAG] = 0x80;
part[3][SET] = 1;
ptstart = bsec; ptstart = bsec;
ptsize = bsize - bsec; ptsize = bsize - bsec;
@ -158,7 +162,7 @@ int md_get_info()
ptsize = part[bsdpart][SIZE]; ptsize = part[bsdpart][SIZE];
fsdsize = dlsize; fsdsize = dlsize;
if (ptstart + ptsize < bsize) if (ptstart + ptsize < bsize)
fsptsize = part[bsdpart][SIZE]; fsptsize = ptsize;
else else
fsptsize = dlsize - ptstart; fsptsize = dlsize - ptstart;
fsdmb = fsdsize / MEG; fsdmb = fsdsize / MEG;
@ -186,12 +190,14 @@ void md_pre_disklabel()
bcyl, bhead, bsec, diskdev); bcyl, bhead, bsec, diskdev);
for (i=0; i<4; i++) for (i=0; i<4; i++)
run_prog ("/sbin/fdisk -u -f -%d -s %d/%d/%d /dev/r%sd", if (part[i][SET])
i, part[i][ID], part[i][START], part[i][SIZE], run_prog("/sbin/fdisk -u -f -%d -s %d/%d/%d /dev/r%sd",
diskdev); i, part[i][ID], part[i][START],
part[i][SIZE], diskdev);
if (activepart >= 0) if (activepart >= 0)
run_prog ("/sbin/fdisk -a -%d -f", activepart); run_prog ("/sbin/fdisk -a -%d -f /dev/r%s",
activepart, diskdev);
} }
@ -258,7 +264,7 @@ void md_make_bsd_partitions (void)
/* Standard fstypes */ /* Standard fstypes */
bsdlabel[A][D_FSTYPE] = T_42BSD; bsdlabel[A][D_FSTYPE] = T_42BSD;
bsdlabel[B][D_FSTYPE] = T_SWAP; bsdlabel[B][D_FSTYPE] = T_SWAP;
bsdlabel[E][D_FSTYPE] = T_42BSD; bsdlabel[E][D_FSTYPE] = T_UNUSED;
bsdlabel[F][D_FSTYPE] = T_UNUSED; bsdlabel[F][D_FSTYPE] = T_UNUSED;
bsdlabel[G][D_FSTYPE] = T_UNUSED; bsdlabel[G][D_FSTYPE] = T_UNUSED;
bsdlabel[H][D_FSTYPE] = T_UNUSED; bsdlabel[H][D_FSTYPE] = T_UNUSED;
@ -289,7 +295,7 @@ void md_make_bsd_partitions (void)
partstart += partsize; partstart += partsize;
/* /usr */ /* /usr */
partsize = fsdsize - partstart; partsize = fsptsize - (partstart - ptstart);
bsdlabel[E][D_OFFSET] = partstart; bsdlabel[E][D_OFFSET] = partstart;
bsdlabel[E][D_SIZE] = partsize; bsdlabel[E][D_SIZE] = partsize;
bsdlabel[E][D_BSIZE] = 8192; bsdlabel[E][D_BSIZE] = 8192;
@ -303,9 +309,10 @@ void md_make_bsd_partitions (void)
case 3: /* custom: ask user for all sizes */ case 3: /* custom: ask user for all sizes */
ask_sizemult(); ask_sizemult();
/* root */
partstart = ptstart; partstart = ptstart;
remain = fsdsize - partstart; remain = fsptsize;
/* root */
i = NUMSEC(20+2*rammb, MEG/sectorsize, dlcylsize) + partstart; i = NUMSEC(20+2*rammb, MEG/sectorsize, dlcylsize) + partstart;
partsize = NUMSEC (i/(MEG/sectorsize)+1, MEG/sectorsize, partsize = NUMSEC (i/(MEG/sectorsize)+1, MEG/sectorsize,
dlcylsize) - partstart; dlcylsize) - partstart;
@ -319,9 +326,9 @@ void md_make_bsd_partitions (void)
bsdlabel[A][D_FSIZE] = 1024; bsdlabel[A][D_FSIZE] = 1024;
strcpy (fsmount[A], "/"); strcpy (fsmount[A], "/");
partstart += partsize; partstart += partsize;
remain -= partsize;
/* swap */ /* swap */
remain = fsdsize - partstart;
i = NUMSEC( 2 * (rammb < 16 ? 16 : rammb), i = NUMSEC( 2 * (rammb < 16 ? 16 : rammb),
MEG/sectorsize, dlcylsize) + partstart; MEG/sectorsize, dlcylsize) + partstart;
partsize = NUMSEC (i/(MEG/sectorsize)+1, MEG/sectorsize, partsize = NUMSEC (i/(MEG/sectorsize)+1, MEG/sectorsize,
@ -333,46 +340,34 @@ void md_make_bsd_partitions (void)
bsdlabel[B][D_OFFSET] = partstart; bsdlabel[B][D_OFFSET] = partstart;
bsdlabel[B][D_SIZE] = partsize; bsdlabel[B][D_SIZE] = partsize;
partstart += partsize; partstart += partsize;
remain -= partsize;
/* /usr */ /* Others E, F, G, H */
remain = fsdsize - partstart; part = E;
partsize = fsdsize - partstart;
snprintf (isize, 20, "%d", partsize/sizemult);
msg_prompt_add (MSG_askfsusr, isize, isize, 20,
remain/sizemult, multname);
partsize = NUMSEC(atoi(isize),sizemult, dlcylsize);
if (remain - partsize < sizemult)
partsize = remain;
bsdlabel[E][D_OFFSET] = partstart;
bsdlabel[E][D_SIZE] = partsize;
bsdlabel[E][D_BSIZE] = 8192;
bsdlabel[E][D_FSIZE] = 1024;
strcpy (fsmount[E], "/usr");
partstart += partsize;
/* Others ... */
remain = fsdsize - partstart;
part = F;
if (remain > 0) if (remain > 0)
msg_display (MSG_otherparts); msg_display (MSG_otherparts);
while (remain > 0 && part <= H) { while (remain > 0 && part <= H) {
partsize = fsdsize - partstart; partsize = remain;
snprintf (isize, 20, "%d", partsize/sizemult); snprintf (isize, 20, "%d", partsize/sizemult);
msg_prompt_add (MSG_askfspart, isize, isize, 20, msg_prompt_add (MSG_askfspart, isize, isize, 20,
diskdev, partname[part], diskdev, partname[part],
remain/sizemult, multname); remain/sizemult, multname);
partsize = NUMSEC(atoi(isize),sizemult, dlcylsize); partsize = NUMSEC(atoi(isize),sizemult, dlcylsize);
if (remain - partsize < sizemult) if (partsize > 0) {
partsize = remain; if (remain - partsize < sizemult)
bsdlabel[part][D_FSTYPE] = T_42BSD; partsize = remain;
bsdlabel[part][D_OFFSET] = partstart; bsdlabel[part][D_FSTYPE] = T_42BSD;
bsdlabel[part][D_SIZE] = partsize; bsdlabel[part][D_OFFSET] = partstart;
bsdlabel[part][D_BSIZE] = 8192; bsdlabel[part][D_SIZE] = partsize;
bsdlabel[part][D_FSIZE] = 1024; bsdlabel[part][D_BSIZE] = 8192;
msg_prompt_add (MSG_mountpoint, NULL, bsdlabel[part][D_FSIZE] = 1024;
fsmount[part], 20); if (part == E)
partstart += partsize; strcpy (fsmount[E], "/usr");
remain = fsdsize - partstart; msg_prompt_add (MSG_mountpoint, fsmount[part],
fsmount[part], 20);
partstart += partsize;
remain -= partsize;
}
part++; part++;
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.h,v 1.7 1997/11/25 06:53:19 thorpej Exp $ */ /* $NetBSD: md.h,v 1.8 1997/11/25 20:35:08 phil Exp $ */
/* /*
* Copyright 1997 Piermont Information Systems Inc. * Copyright 1997 Piermont Information Systems Inc.
@ -47,8 +47,8 @@
EXTERN int bcyl, bhead, bsec, bsize, bcylsize; EXTERN int bcyl, bhead, bsec, bsize, bcylsize;
EXTERN int bstuffset INIT(0); EXTERN int bstuffset INIT(0);
enum info {ID,SIZE,START,FLAG}; enum info {ID,SIZE,START,FLAG,SET};
EXTERN int part[4][4] INIT({{0}}); EXTERN int part[4][5] INIT({{0}});
EXTERN int activepart; EXTERN int activepart;
EXTERN int bsdpart; EXTERN int bsdpart;
EXTERN int usefull; EXTERN int usefull;
@ -61,6 +61,9 @@ EXTERN int usefull;
* *
* i386 has the MD set kern first, because generic kernels are too * i386 has the MD set kern first, because generic kernels are too
* big to fit on install floppies. i386 does not yet include the x sets. * big to fit on install floppies. i386 does not yet include the x sets.
*
* Third entry is the last extension name in the split sets for loading
* from floppy.
*/ */
EXTERN distinfo dist_list[] EXTERN distinfo dist_list[]
#ifdef MAIN #ifdef MAIN
@ -121,7 +124,6 @@ EXTERN char *fdtype INIT("msdos");
/* /*
* prototypes for MD code. * prototypes for MD code.
*/ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: menus.md.eng,v 1.7 1997/11/13 04:23:41 simonb Exp $ */ /* $NetBSD: menus.md.eng,v 1.8 1997/11/25 20:35:10 phil Exp $ */
/* /*
* Copyright 1997 Piermont Information Systems Inc. * Copyright 1997 Piermont Information Systems Inc.
@ -79,8 +79,8 @@ menu biosgeom, title " Choose an option", y=16;
display action { msg_display (MSG_biosgeom, diskdev); display action { msg_display (MSG_biosgeom, diskdev);
disp_cur_geom (); disp_cur_geom ();
}; };
option "Abort install, halt machine", option "Abort install",
action (endwin) { system ("/sbin/halt"); exit(1); }; action (endwin) { exit(1); };
option "Enter geometry", option "Enter geometry",
action { msg_clear(); set_fdisk_geom(); }, action { msg_clear(); set_fdisk_geom(); },
next menu confirmbios; next menu confirmbios;
@ -112,6 +112,8 @@ menu editparttable, title " Choose your partition", exit;
action { editpart = 2; }; action { editpart = 2; };
option "Edit partition 3", sub menu editpart, option "Edit partition 3", sub menu editpart,
action { editpart = 3; }; action { editpart = 3; };
option "Reselect size specification",
action { reask_sizemult(); };
menu editpart, title " Select to change"; menu editpart, title " Select to change";
display action { msg_display (MSG_editpart, editpart); display action { msg_display (MSG_editpart, editpart);
@ -137,6 +139,7 @@ menu editpart, title " Select to change";
} }
part[editpart][START] = start; part[editpart][START] = start;
part[editpart][SIZE] = size; part[editpart][SIZE] = size;
part[editpart][SET] = 1;
}; };
option "Set active", action { activepart = editpart; }; option "Set active", action { activepart = editpart; };
option "Partition OK", exit; option "Partition OK", exit;

View File

@ -1,4 +1,4 @@
/* $NetBSD: msg.md.eng,v 1.2 1997/10/17 21:11:02 phil Exp $ */ /* $NetBSD: msg.md.eng,v 1.3 1997/11/25 20:35:11 phil Exp $ */
/* /*
* Copyright 1997 Piermont Information Systems Inc. * Copyright 1997 Piermont Information Systems Inc.
@ -60,16 +60,16 @@ real geom: %d cylinders, %d heads, %d sectors
} }
message biosgeom message biosgeom
{It appears that your disk, %s, did not have a FDISK label on the disk. {It appears that your disk, %s, did not have a valid Master Boot
NetBSD is using the true geometry which is incompatible with the Record (MBR). That is, NetBSD is using a geometry which is
BIOS. This install program gets the BIOS fake geometry of your disk incompatible with the BIOS. This "sysinst" program gets the BIOS
by reading the FDISK label. Your options are: fake geometry of your disk by reading the MBR. Your options are:
-- Abort the install, have DOS/Windows/? put on a FDISK label -- Abort the install and initialize the MBR from some other OS
-- Choose your own gemoetry and then tell the BIOS about it -- Enter the BIOS fake geometry and sysinst will initialize the MBR
-- Find out what the BIOS uses and set it
Note: Entering new geometry will cause this program to initialize your WARNING: Entering new geometry will cause this program to initialize
master boot record. your master boot record (MBR) and destroy any boot program you may
have installed.
} }
@ -143,7 +143,7 @@ message dobootblks
} }
message askfsroot message askfsroot
{I will be asking for partition sizes and on some, mount points. {I will be asking for partition information.
First the root partition. You have %d %s left on your disk. First the root partition. You have %d %s left on your disk.
Root partition size? } Root partition size? }
@ -153,11 +153,6 @@ message askfsswap
Next the swap partition. You have %d %s left on your disk. Next the swap partition. You have %d %s left on your disk.
Swap partition size? } Swap partition size? }
message askfsusr
{
Next the /usr partition. You have %d %s left on your disk.
/usr partition size? }
message otherparts message otherparts
{You still have some space remaining unallocated on your disk. Please {You still have some space remaining unallocated on your disk. Please
give sizes and mount points for the following partitions. give sizes and mount points for the following partitions.

View File

@ -1,4 +1,4 @@
/* $NetBSD: fdisk.c,v 1.2 1997/10/17 21:10:56 phil Exp $ */ /* $NetBSD: fdisk.c,v 1.3 1997/11/25 20:35:05 phil Exp $ */
/* /*
* Copyright 1997 Piermont Information Systems Inc. * Copyright 1997 Piermont Information Systems Inc.
@ -55,19 +55,19 @@ struct lookfor fdiskbuf[] = {
{"PART0ID", "PART0ID=%d", "a $0", &part[0][ID], NULL}, {"PART0ID", "PART0ID=%d", "a $0", &part[0][ID], NULL},
{"PART0SIZE", "PART0SIZE=%d", "a $0", &part[0][SIZE], NULL}, {"PART0SIZE", "PART0SIZE=%d", "a $0", &part[0][SIZE], NULL},
{"PART0START", "PART0START=%d", "a $0", &part[0][START], NULL}, {"PART0START", "PART0START=%d", "a $0", &part[0][START], NULL},
{"PART0FLAG", "PART0FLAG=%d", "a $0", &part[0][FLAG], NULL}, {"PART0FLAG", "PART0FLAG=0x%d", "a $0", &part[0][FLAG], NULL},
{"PART1ID", "PART1ID=%d", "a $0", &part[1][ID], NULL}, {"PART1ID", "PART1ID=%d", "a $0", &part[1][ID], NULL},
{"PART1SIZE", "PART1SIZE=%d", "a $0", &part[1][SIZE], NULL}, {"PART1SIZE", "PART1SIZE=%d", "a $0", &part[1][SIZE], NULL},
{"PART1START", "PART1START=%d", "a $0", &part[1][START], NULL}, {"PART1START", "PART1START=%d", "a $0", &part[1][START], NULL},
{"PART1FLAG", "PART1FLAG=%d", "a $0", &part[1][FLAG], NULL}, {"PART1FLAG", "PART1FLAG=0x%d", "a $0", &part[1][FLAG], NULL},
{"PART2ID", "PART2ID=%d", "a $0", &part[2][ID], NULL}, {"PART2ID", "PART2ID=%d", "a $0", &part[2][ID], NULL},
{"PART2SIZE", "PART2SIZE=%d", "a $0", &part[2][SIZE], NULL}, {"PART2SIZE", "PART2SIZE=%d", "a $0", &part[2][SIZE], NULL},
{"PART2START", "PART2START=%d", "a $0", &part[2][START], NULL}, {"PART2START", "PART2START=%d", "a $0", &part[2][START], NULL},
{"PART2FLAG", "PART2FLAG=%d", "a $0", &part[2][FLAG], NULL}, {"PART2FLAG", "PART2FLAG=0x%d", "a $0", &part[2][FLAG], NULL},
{"PART3ID", "PART3ID=%d", "a $0", &part[3][ID], NULL}, {"PART3ID", "PART3ID=%d", "a $0", &part[3][ID], NULL},
{"PART3SIZE", "PART3SIZE=%d", "a $0", &part[3][SIZE], NULL}, {"PART3SIZE", "PART3SIZE=%d", "a $0", &part[3][SIZE], NULL},
{"PART3START", "PART3START=%d", "a $0", &part[3][START], NULL}, {"PART3START", "PART3START=%d", "a $0", &part[3][START], NULL},
{"PART3FLAG", "PART3FLAG=%d", "a $0", &part[3][FLAG], NULL} {"PART3FLAG", "PART3FLAG=0x%d", "a $0", &part[3][FLAG], NULL}
}; };
int numfdiskbuf = sizeof(fdiskbuf) / sizeof(struct lookfor); int numfdiskbuf = sizeof(fdiskbuf) / sizeof(struct lookfor);
@ -158,6 +158,7 @@ void get_fdisk_info (void)
{ {
char *textbuf; char *textbuf;
int textsize; int textsize;
int t1, t2;
/* Get Fdisk information */ /* Get Fdisk information */
textsize = collect (T_OUTPUT, &textbuf, textsize = collect (T_OUTPUT, &textbuf,
@ -169,5 +170,20 @@ void get_fdisk_info (void)
} }
walk (textbuf, textsize, fdiskbuf, numfdiskbuf); walk (textbuf, textsize, fdiskbuf, numfdiskbuf);
free (textbuf); free (textbuf);
/* A common failure of fdisk is to get the number of cylinders
wrong and the number of sectors and heads right. This makes
a disk look very big. In this case, we can just recompute
the number of cylinders and things should work just fine. */
if (bcyl > 1023 && bsec < 64) {
t1 = disk->geom[0] * disk->geom[1] * disk->geom[2];
t2 = bhead * bsec;
if (bcyl * t2 > t1) {
t2 = t1 / t2;
if (t2 < 1024)
bcyl = t2;
}
}
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: mbr.c,v 1.2 1997/10/17 21:10:56 phil Exp $ */ /* $NetBSD: mbr.c,v 1.3 1997/11/25 20:35:05 phil Exp $ */
/* /*
* Copyright 1997 Piermont Information Systems Inc. * Copyright 1997 Piermont Information Systems Inc.
@ -55,19 +55,19 @@ struct lookfor fdiskbuf[] = {
{"PART0ID", "PART0ID=%d", "a $0", &part[0][ID], NULL}, {"PART0ID", "PART0ID=%d", "a $0", &part[0][ID], NULL},
{"PART0SIZE", "PART0SIZE=%d", "a $0", &part[0][SIZE], NULL}, {"PART0SIZE", "PART0SIZE=%d", "a $0", &part[0][SIZE], NULL},
{"PART0START", "PART0START=%d", "a $0", &part[0][START], NULL}, {"PART0START", "PART0START=%d", "a $0", &part[0][START], NULL},
{"PART0FLAG", "PART0FLAG=%d", "a $0", &part[0][FLAG], NULL}, {"PART0FLAG", "PART0FLAG=0x%d", "a $0", &part[0][FLAG], NULL},
{"PART1ID", "PART1ID=%d", "a $0", &part[1][ID], NULL}, {"PART1ID", "PART1ID=%d", "a $0", &part[1][ID], NULL},
{"PART1SIZE", "PART1SIZE=%d", "a $0", &part[1][SIZE], NULL}, {"PART1SIZE", "PART1SIZE=%d", "a $0", &part[1][SIZE], NULL},
{"PART1START", "PART1START=%d", "a $0", &part[1][START], NULL}, {"PART1START", "PART1START=%d", "a $0", &part[1][START], NULL},
{"PART1FLAG", "PART1FLAG=%d", "a $0", &part[1][FLAG], NULL}, {"PART1FLAG", "PART1FLAG=0x%d", "a $0", &part[1][FLAG], NULL},
{"PART2ID", "PART2ID=%d", "a $0", &part[2][ID], NULL}, {"PART2ID", "PART2ID=%d", "a $0", &part[2][ID], NULL},
{"PART2SIZE", "PART2SIZE=%d", "a $0", &part[2][SIZE], NULL}, {"PART2SIZE", "PART2SIZE=%d", "a $0", &part[2][SIZE], NULL},
{"PART2START", "PART2START=%d", "a $0", &part[2][START], NULL}, {"PART2START", "PART2START=%d", "a $0", &part[2][START], NULL},
{"PART2FLAG", "PART2FLAG=%d", "a $0", &part[2][FLAG], NULL}, {"PART2FLAG", "PART2FLAG=0x%d", "a $0", &part[2][FLAG], NULL},
{"PART3ID", "PART3ID=%d", "a $0", &part[3][ID], NULL}, {"PART3ID", "PART3ID=%d", "a $0", &part[3][ID], NULL},
{"PART3SIZE", "PART3SIZE=%d", "a $0", &part[3][SIZE], NULL}, {"PART3SIZE", "PART3SIZE=%d", "a $0", &part[3][SIZE], NULL},
{"PART3START", "PART3START=%d", "a $0", &part[3][START], NULL}, {"PART3START", "PART3START=%d", "a $0", &part[3][START], NULL},
{"PART3FLAG", "PART3FLAG=%d", "a $0", &part[3][FLAG], NULL} {"PART3FLAG", "PART3FLAG=0x%d", "a $0", &part[3][FLAG], NULL}
}; };
int numfdiskbuf = sizeof(fdiskbuf) / sizeof(struct lookfor); int numfdiskbuf = sizeof(fdiskbuf) / sizeof(struct lookfor);
@ -158,6 +158,7 @@ void get_fdisk_info (void)
{ {
char *textbuf; char *textbuf;
int textsize; int textsize;
int t1, t2;
/* Get Fdisk information */ /* Get Fdisk information */
textsize = collect (T_OUTPUT, &textbuf, textsize = collect (T_OUTPUT, &textbuf,
@ -169,5 +170,20 @@ void get_fdisk_info (void)
} }
walk (textbuf, textsize, fdiskbuf, numfdiskbuf); walk (textbuf, textsize, fdiskbuf, numfdiskbuf);
free (textbuf); free (textbuf);
/* A common failure of fdisk is to get the number of cylinders
wrong and the number of sectors and heads right. This makes
a disk look very big. In this case, we can just recompute
the number of cylinders and things should work just fine. */
if (bcyl > 1023 && bsec < 64) {
t1 = disk->geom[0] * disk->geom[1] * disk->geom[2];
t2 = bhead * bsec;
if (bcyl * t2 > t1) {
t2 = t1 / t2;
if (t2 < 1024)
bcyl = t2;
}
}
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: menus.mi.eng,v 1.13 1997/11/05 22:45:59 mhitch Exp $ */ /* $NetBSD: menus.mi.eng,v 1.14 1997/11/25 20:35:02 phil Exp $ */
/* /*
* Copyright 1997 Piermont Information Systems Inc. * Copyright 1997 Piermont Information Systems Inc.
@ -70,7 +70,7 @@ menu netbsd, title " NetBSD-@@VERSION@@ Install System";
menu utility, title " NetBSD-@@VERSION@@ Utility", exit; menu utility, title " NetBSD-@@VERSION@@ Utility", exit;
option "Run /bin/sh", option "Run /bin/sh",
action (endwin) { system("/bin/sh"); puts(CL); }; action (endwin) { system("/bin/sh"); };
option "Configure network", option "Configure network",
action { config_network(); }; action { config_network(); };
/* option "Partition a disk"; XXX add later. */ /* option "Partition a disk"; XXX add later. */

View File

@ -1,4 +1,4 @@
/* $NetBSD: target.c,v 1.10 1997/11/13 17:26:25 phil Exp $ */ /* $NetBSD: target.c,v 1.11 1997/11/25 20:35:02 phil Exp $ */
/* /*
* Copyright 1997 Jonathan Stone * Copyright 1997 Jonathan Stone
@ -37,7 +37,7 @@
#include <sys/cdefs.h> #include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: target.c,v 1.10 1997/11/13 17:26:25 phil Exp $"); __RCSID("$NetBSD: target.c,v 1.11 1997/11/25 20:35:02 phil Exp $");
#endif #endif
@ -96,7 +96,6 @@ void backtowin(void)
getchar(); /* wait for user to press return */ getchar(); /* wait for user to press return */
puts (CL);
wrefresh(stdscr); wrefresh(stdscr);
} }