Reduce the number of global variables slightly, use the ones that are
left consistently. Make the i386 install let you partition a disk beyond the CHS limit if the system bios doesn't support LBA reads (the checks aren't ideal yet). Make the bsddislabel.c code usable onan i386 system - but don't use it yet.
This commit is contained in:
parent
dd522b0702
commit
6fb33c4537
@ -1,8 +1,12 @@
|
||||
# $NetBSD: Makefile,v 1.2 1997/10/22 02:17:11 lukem Exp $
|
||||
# $NetBSD: Makefile,v 1.3 2003/05/21 10:05:20 dsl Exp $
|
||||
#
|
||||
# can't make here due to crunchgen
|
||||
#
|
||||
|
||||
SUBDIR = arch/${MACHINE}
|
||||
|
||||
.if ALL_MACHINES
|
||||
SUBDIR = arch/acorn26 arch/acorn32 arch/alpha arch/amd64 arch/amiga arch/arc arch/atari arch/bebox arch/cats arch/evbarm arch/evbppc arch/hp300 arch/hpcmips arch/i386 arch/mac68k arch/macppc arch/mipsco arch/mvme68k arch/news68k arch/newsmips arch/pc532 arch/playstation2 arch/pmax arch/prep arch/sandpoint arch/sgimips arch/shark arch/sparc arch/sparc64 arch/vax arch/x68k
|
||||
.endif
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.c,v 1.5 2003/01/11 19:44:07 christos Exp $ */
|
||||
/* $NetBSD: md.c,v 1.6 2003/05/21 10:05:21 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -308,21 +308,11 @@ int md_make_bsd_partitions (void)
|
||||
* Standard 4.3BSD 8-partition labels always cover whole disk.
|
||||
*/
|
||||
ptsize = dlsize - ptstart;
|
||||
fsdsize = dlsize; /* actually means `whole disk' */
|
||||
fsptsize = dlsize - ptstart; /* netbsd partition -- same as above */
|
||||
fsdmb = fsdsize / MEG;
|
||||
|
||||
/* endwin();
|
||||
printf("ptsize=%d\n", ptsize);
|
||||
printf("fsdsize=%d\n", fsdsize);
|
||||
printf("fsptsize=%d\n", fsptsize);
|
||||
printf("fsdmb=%d\n", fsdmb);
|
||||
backtowin();*/
|
||||
|
||||
/*editlab:*/
|
||||
/* Ask for layout type -- standard or special */
|
||||
msg_display (MSG_layout,
|
||||
(1.0*fsptsize*sectorsize)/MEG,
|
||||
(1.0*ptsize*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG+rammb+XNEEDMB);
|
||||
process_menu(MENU_layout);
|
||||
@ -386,7 +376,7 @@ int md_make_bsd_partitions (void)
|
||||
partstart += partsize;
|
||||
|
||||
/* /usr */
|
||||
partsize = fsptsize - (partstart - ptstart);
|
||||
partsize = ptsize - (partstart - ptstart);
|
||||
bsdlabel[E].pi_fstype = FS_BSDFFS;
|
||||
bsdlabel[E].pi_offset = partstart;
|
||||
bsdlabel[E].pi_size = partsize;
|
||||
@ -399,7 +389,7 @@ int md_make_bsd_partitions (void)
|
||||
case 3: /* custom: ask user for all sizes */
|
||||
ask_sizemult(dlcylsize);
|
||||
partstart = ptstart;
|
||||
remain = fsptsize;
|
||||
remain = ptsize;
|
||||
|
||||
/* root */
|
||||
i = NUMSEC(24+2*rammb, MEG/sectorsize, dlcylsize) + partstart;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.h,v 1.2 2003/04/06 16:12:37 jmmv Exp $ */
|
||||
/* $NetBSD: md.h,v 1.3 2003/05/21 10:05:21 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -91,15 +91,6 @@ EXTERN char *disk_names[]
|
||||
#endif
|
||||
;
|
||||
|
||||
/*
|
||||
* Legal start character for a disk for checking input.
|
||||
* this must return 1 for a character that matches the first
|
||||
* characters of each member of disk_names.
|
||||
*
|
||||
* On acorn26, that means matching 'w' for ide and 's' for sd.
|
||||
*/
|
||||
#define ISDISKSTART(dn) (dn == 'w' || dn == 's')
|
||||
|
||||
/*
|
||||
* Machine-specific command to write a new label to a disk.
|
||||
* For example, acorn32 uses "/sbin/disklabel -w -r", just like acorn32
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.c,v 1.6 2003/01/11 19:44:07 christos Exp $ */
|
||||
/* $NetBSD: md.c,v 1.7 2003/05/21 10:05:22 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -308,21 +308,11 @@ int md_make_bsd_partitions (void)
|
||||
* Standard 4.3BSD 8-partition labels always cover whole disk.
|
||||
*/
|
||||
ptsize = dlsize - ptstart;
|
||||
fsdsize = dlsize; /* actually means `whole disk' */
|
||||
fsptsize = dlsize - ptstart; /* netbsd partition -- same as above */
|
||||
fsdmb = fsdsize / MEG;
|
||||
|
||||
/* endwin();
|
||||
printf("ptsize=%d\n", ptsize);
|
||||
printf("fsdsize=%d\n", fsdsize);
|
||||
printf("fsptsize=%d\n", fsptsize);
|
||||
printf("fsdmb=%d\n", fsdmb);
|
||||
backtowin();*/
|
||||
|
||||
/*editlab:*/
|
||||
/* Ask for layout type -- standard or special */
|
||||
msg_display (MSG_layout,
|
||||
(1.0*fsptsize*sectorsize)/MEG,
|
||||
(1.0*ptsize*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG+rammb+XNEEDMB);
|
||||
process_menu(MENU_layout);
|
||||
@ -386,7 +376,7 @@ int md_make_bsd_partitions (void)
|
||||
partstart += partsize;
|
||||
|
||||
/* /usr */
|
||||
partsize = fsptsize - (partstart - ptstart);
|
||||
partsize = ptsize - (partstart - ptstart);
|
||||
bsdlabel[E].pi_fstype = FS_BSDFFS;
|
||||
bsdlabel[E].pi_offset = partstart;
|
||||
bsdlabel[E].pi_size = partsize;
|
||||
@ -399,7 +389,7 @@ int md_make_bsd_partitions (void)
|
||||
case 3: /* custom: ask user for all sizes */
|
||||
ask_sizemult(dlcylsize);
|
||||
partstart = ptstart;
|
||||
remain = fsptsize;
|
||||
remain = ptsize;
|
||||
|
||||
/* root */
|
||||
i = NUMSEC(24+2*rammb, MEG/sectorsize, dlcylsize) + partstart;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.h,v 1.5 2003/04/06 16:12:37 jmmv Exp $ */
|
||||
/* $NetBSD: md.h,v 1.6 2003/05/21 10:05:22 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -93,15 +93,6 @@ EXTERN char *disk_names[]
|
||||
#endif
|
||||
;
|
||||
|
||||
/*
|
||||
* Legal start character for a disk for checking input.
|
||||
* this must return 1 for a character that matches the first
|
||||
* characters of each member of disk_names.
|
||||
*
|
||||
* On acorn32, that means matching 'w' for ide and 's' for sd.
|
||||
*/
|
||||
#define ISDISKSTART(dn) (dn == 'w' || dn == 's')
|
||||
|
||||
/*
|
||||
* Machine-specific command to write a new label to a disk.
|
||||
* For example, acorn32 uses "/sbin/disklabel -w -r", just like acorn32
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.c,v 1.28 2002/08/02 05:11:30 grant Exp $ */
|
||||
/* $NetBSD: md.c,v 1.29 2003/05/21 10:05:22 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -151,19 +151,18 @@ int md_make_bsd_partitions (void)
|
||||
int remain;
|
||||
char isize[20];
|
||||
int maxpart = getmaxpartitions();
|
||||
int ptend;
|
||||
|
||||
/*
|
||||
* Initialize global variables that track space used on this disk.
|
||||
* Standard 4.3BSD 8-partition labels always cover whole disk.
|
||||
*/
|
||||
ptsize = dlsize - ptstart;
|
||||
fsdsize = dlsize; /* actually means `whole disk' */
|
||||
fsptsize = dlsize - ptstart; /* netbsd partition -- same as above */
|
||||
fsdmb = fsdsize / MEG;
|
||||
ptend = dlsize;
|
||||
|
||||
/* Ask for layout type -- standard or special */
|
||||
msg_display (MSG_layout,
|
||||
(1.0*fsptsize*sectorsize)/MEG,
|
||||
(1.0*ptsize*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG+rammb+XNEEDMB);
|
||||
process_menu (MENU_layout);
|
||||
@ -223,7 +222,7 @@ int md_make_bsd_partitions (void)
|
||||
partstart += partsize;
|
||||
|
||||
/* /usr */
|
||||
partsize = fsdsize - partstart;
|
||||
partsize = ptend - partstart;
|
||||
bsdlabel[PART_USR].pi_fstype = FS_BSDFFS;
|
||||
bsdlabel[PART_USR].pi_offset = partstart;
|
||||
bsdlabel[PART_USR].pi_size = partsize;
|
||||
@ -237,7 +236,7 @@ int md_make_bsd_partitions (void)
|
||||
ask_sizemult(dlcylsize);
|
||||
/* root */
|
||||
partstart = ptstart;
|
||||
remain = fsdsize - partstart;
|
||||
remain = ptend - partstart;
|
||||
/* By convention, NetBSD/alpha uses a 128Mbyte root */
|
||||
partsize = NUMSEC (128, MEG/sectorsize, dlcylsize);
|
||||
snprintf (isize, 20, "%d", partsize/sizemult);
|
||||
@ -252,7 +251,7 @@ int md_make_bsd_partitions (void)
|
||||
partstart += partsize;
|
||||
|
||||
/* swap */
|
||||
remain = fsdsize - partstart;
|
||||
remain = ptend - partstart;
|
||||
i = NUMSEC(2 * (rammb < 32 ? 32 : rammb),
|
||||
MEG/sectorsize, dlcylsize) + partstart;
|
||||
partsize = NUMSEC (i/(MEG/sectorsize)+1, MEG/sectorsize,
|
||||
@ -266,9 +265,9 @@ int md_make_bsd_partitions (void)
|
||||
partstart += partsize;
|
||||
|
||||
/* /usr */
|
||||
remain = fsdsize - partstart;
|
||||
remain = ptend - partstart;
|
||||
if (remain > 0) {
|
||||
partsize = fsdsize - partstart;
|
||||
partsize = ptend - partstart;
|
||||
snprintf (isize, 20, "%d", partsize/sizemult);
|
||||
msg_prompt_add (MSG_askfsusr, isize, isize, 20,
|
||||
remain/sizemult, multname);
|
||||
@ -285,12 +284,12 @@ int md_make_bsd_partitions (void)
|
||||
}
|
||||
|
||||
/* Others ... */
|
||||
remain = fsdsize - partstart;
|
||||
remain = ptend - partstart;
|
||||
part = F;
|
||||
if (remain > 0)
|
||||
msg_display (MSG_otherparts);
|
||||
while (remain > 0 && part <= H) {
|
||||
partsize = fsdsize - partstart;
|
||||
partsize = ptend - partstart;
|
||||
snprintf (isize, 20, "%d", partsize/sizemult);
|
||||
msg_prompt_add (MSG_askfspart, isize, isize, 20,
|
||||
diskdev, partition_name(part),
|
||||
@ -306,7 +305,7 @@ int md_make_bsd_partitions (void)
|
||||
msg_prompt_add (MSG_mountpoint, NULL,
|
||||
fsmount[part], 20);
|
||||
partstart += partsize;
|
||||
remain = fsdsize - partstart;
|
||||
remain = ptend - partstart;
|
||||
part++;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.h,v 1.10 2003/04/06 16:12:38 jmmv Exp $ */
|
||||
/* $NetBSD: md.h,v 1.11 2003/05/21 10:05:22 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -82,13 +82,6 @@ EXTERN char *disk_names[]
|
||||
#endif
|
||||
;
|
||||
|
||||
/*
|
||||
* Legal start character for a disk for checking input.
|
||||
* this must return 1 for a character that matches the first
|
||||
* characters of each member of disk_names.
|
||||
*/
|
||||
#define ISDISKSTART(dn) (dn == 'w' || dn == 's' || dn == 'l')
|
||||
|
||||
/*
|
||||
* Machine-specific command to write a new label to a disk.
|
||||
* If not defined, we assume the port does not support disklabels and
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile,v 1.3 2003/05/18 07:56:30 dsl Exp $
|
||||
# $NetBSD: Makefile,v 1.4 2003/05/21 10:05:22 dsl Exp $
|
||||
#
|
||||
# Makefile for amd64
|
||||
#
|
||||
@ -8,6 +8,7 @@
|
||||
SRCS= menu_defs.c msg_defs.c main.c install.c upgrade.c \
|
||||
txtwalk.c run.c factor.c net.c disks.c disks_lfs.c util.c geom.c \
|
||||
label.c target.c md.c mbr.c aout2elf.c sizemultname.c
|
||||
#SRCS+= bsddisklabel.c savenewlabel.c
|
||||
|
||||
fdisk.o md.o: menu_defs.h msg_defs.h
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.h,v 1.4 2003/05/18 07:57:28 dsl Exp $ */
|
||||
/* $NetBSD: md.h,v 1.5 2003/05/21 10:05:22 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -103,16 +103,6 @@ EXTERN char *disk_names[]
|
||||
/* Bootblock type */
|
||||
EXTERN char *boottype INIT("");
|
||||
|
||||
/*
|
||||
* Legal start character for a disk for checking input.
|
||||
* this must return 1 for a character that matches the first
|
||||
* characters of each member of disk_names.
|
||||
*
|
||||
* On i386, that means matching 'w' for st-506/ide, 's' for sd and 'l' for ld,
|
||||
* 'e' for ed.
|
||||
*/
|
||||
#define ISDISKSTART(dn) (dn == 'w' || dn == 's' || dn == 'l' || dn == 'e')
|
||||
|
||||
/*
|
||||
* Machine-specific command to write a new label to a disk.
|
||||
* For example, i386 uses "/sbin/disklabel -w -r", just like i386
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.h,v 1.6 2003/04/06 16:12:38 jmmv Exp $ */
|
||||
/* $NetBSD: md.h,v 1.7 2003/05/21 10:05:22 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -98,15 +98,6 @@ EXTERN char *disk_names[]
|
||||
;
|
||||
|
||||
|
||||
/*
|
||||
* Legal start character for a disk for checking input.
|
||||
* this must return 1 for a character that matches the first
|
||||
* characters of each member of disk_names.
|
||||
*
|
||||
* On amiga, that means matching 's' for sd.
|
||||
*/
|
||||
#define ISDISKSTART(dn) (dn == 's')
|
||||
|
||||
/*
|
||||
* Machine-specific command to write a new label to a disk.
|
||||
* For example, i386 uses "/sbin/disklabel -w -r", just like i386
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.c,v 1.8 2003/05/18 07:44:41 dsl Exp $ */
|
||||
/* $NetBSD: md.c,v 1.9 2003/05/21 10:05:23 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -138,7 +138,7 @@ md_make_bsd_partitions(void)
|
||||
|
||||
/* Ask for layout type -- standard or special */
|
||||
msg_display(MSG_layout,
|
||||
(1.0*fsptsize*sectorsize)/MEG,
|
||||
(1.0*ptsize*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG+rammb+XNEEDMB);
|
||||
process_menu(MENU_layout);
|
||||
@ -157,11 +157,11 @@ md_make_bsd_partitions(void)
|
||||
/* Partitions C and D are predefined. */
|
||||
bsdlabel[C].pi_fstype = FS_UNUSED;
|
||||
bsdlabel[C].pi_offset = ptstart;
|
||||
bsdlabel[C].pi_size = fsptsize;
|
||||
bsdlabel[C].pi_size = ptsize;
|
||||
|
||||
bsdlabel[D].pi_fstype = FS_UNUSED;
|
||||
bsdlabel[D].pi_offset = 0;
|
||||
bsdlabel[D].pi_size = fsdsize;
|
||||
bsdlabel[D].pi_size = dlsize;
|
||||
|
||||
/* Standard fstypes */
|
||||
bsdlabel[A].pi_fstype = FS_BSDFFS;
|
||||
@ -182,7 +182,7 @@ md_make_bsd_partitions(void)
|
||||
i = NUMSEC(20+2*rammb, MEG/sectorsize, dlcylsize);
|
||||
i += NUMSEC(layoutkind * 2 * (rammb < 16 ? 16 : rammb),
|
||||
MEG/sectorsize, dlcylsize);
|
||||
if ( i > fsptsize) {
|
||||
if ( i > ptsize) {
|
||||
msg_display(MSG_disktoosmall);
|
||||
process_menu(MENU_ok);
|
||||
goto custom;
|
||||
@ -208,7 +208,7 @@ md_make_bsd_partitions(void)
|
||||
partstart += partsize;
|
||||
|
||||
/* /usr */
|
||||
partsize = fsptsize - (partstart - ptstart);
|
||||
partsize = ptsize - (partstart - ptstart);
|
||||
bsdlabel[E].pi_fstype = FS_BSDFFS;
|
||||
bsdlabel[E].pi_offset = partstart;
|
||||
bsdlabel[E].pi_size = partsize;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.h,v 1.3 2003/04/06 16:12:38 jmmv Exp $ */
|
||||
/* $NetBSD: md.h,v 1.4 2003/05/21 10:05:23 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -100,15 +100,6 @@ EXTERN char *disk_names[]
|
||||
#endif
|
||||
;
|
||||
|
||||
/*
|
||||
* Legal start character for a disk for checking input.
|
||||
* this must return 1 for a character that matches the first
|
||||
* characters of each member of disk_names.
|
||||
*
|
||||
* On arc, that means matching 'w' for st-506/ide, 's' for sd and 'l' for ld.
|
||||
*/
|
||||
#define ISDISKSTART(dn) (dn == 'w' || dn == 's' || dn == 'l')
|
||||
|
||||
/*
|
||||
* Machine-specific command to write a new label to a disk.
|
||||
* For example, arc uses "/sbin/disklabel -w -r", just like i386
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.c,v 1.6 2003/05/18 18:54:06 dsl Exp $ */
|
||||
/* $NetBSD: md.c,v 1.7 2003/05/21 10:05:23 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -71,22 +71,21 @@ make_bsd_partitions(void)
|
||||
int maxpart = getmaxpartitions();
|
||||
struct disklabel l;
|
||||
int varsz = 0, swapsz = 0;
|
||||
int ptend;
|
||||
|
||||
/*
|
||||
* Initialize global variables that track space used on this disk.
|
||||
* Standard 4.4BSD 8-partition labels always cover whole disk.
|
||||
*/
|
||||
ptsize = dlsize - ptstart;
|
||||
fsdsize = dlsize; /* actually means `whole disk' */
|
||||
fsptsize = dlsize - ptstart; /* netbsd partition -- same as above */
|
||||
fsdmb = fsdsize / MEG;
|
||||
ptend = ptstart + ptsize;
|
||||
|
||||
rammb = (ramsize + MEG - 1) / MEG;
|
||||
minfsdmb = (80 + 4*rammb) * (MEG / sectorsize);
|
||||
|
||||
/* Ask for layout type -- standard or special */
|
||||
msg_display(MSG_md_layout,
|
||||
(1.0*fsptsize*sectorsize)/MEG,
|
||||
(1.0*ptsize*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG+rammb+XNEEDMB);
|
||||
process_menu(MENU_md_layout);
|
||||
@ -114,7 +113,7 @@ make_bsd_partitions(void)
|
||||
|
||||
#ifdef PART_BSDRAW /* BSD area of the disk - only on some (i386) ports */
|
||||
bsdlabel[PART_BSDRAW].pi_offset = ptstart;
|
||||
bsdlabel[PART_BSDRAW].pi_size = fsptsize;
|
||||
bsdlabel[PART_BSDRAW].pi_size = ptsize;
|
||||
#endif
|
||||
|
||||
switch (layoutkind) {
|
||||
@ -223,7 +222,7 @@ make_bsd_partitions(void)
|
||||
partsize = NUMSEC(DEFUSRSIZE,
|
||||
MEG/sectorsize, dlcylsize);
|
||||
} else
|
||||
partsize = fsdsize - partstart;
|
||||
partsize = ptend - partstart;
|
||||
bsdlabel[PART_USR].pi_fstype = FS_BSDFFS;
|
||||
bsdlabel[PART_USR].pi_offset = partstart;
|
||||
bsdlabel[PART_USR].pi_size = partsize;
|
||||
@ -239,7 +238,7 @@ make_bsd_partitions(void)
|
||||
|
||||
/* home */
|
||||
if (layout_home) {
|
||||
partsize = fsdsize - partstart;
|
||||
partsize = ptend - partstart;
|
||||
bsdlabel[freepart].pi_fstype = FS_BSDFFS;
|
||||
bsdlabel[freepart].pi_offset = partstart;
|
||||
bsdlabel[freepart].pi_size = partsize;
|
||||
@ -261,7 +260,7 @@ make_bsd_partitions(void)
|
||||
ask_sizemult(dlcylsize);
|
||||
/* root */
|
||||
partstart = ptstart;
|
||||
remain = fsdsize - partstart;
|
||||
remain = ptend - partstart;
|
||||
partsize = NUMSEC(DEFROOTSIZE, MEG/sectorsize, dlcylsize);
|
||||
snprintf(isize, 20, "%d", partsize/sizemult);
|
||||
msg_prompt(MSG_askfsroot, isize, isize, 20,
|
||||
@ -278,7 +277,7 @@ make_bsd_partitions(void)
|
||||
partstart += partsize;
|
||||
|
||||
/* swap */
|
||||
remain = fsdsize - partstart;
|
||||
remain = ptend - partstart;
|
||||
if (remain > 0) {
|
||||
i = NUMSEC(2 *
|
||||
(rammb < DEFSWAPRAM ? DEFSWAPRAM : rammb),
|
||||
@ -303,7 +302,7 @@ make_bsd_partitions(void)
|
||||
}
|
||||
|
||||
/* /usr */
|
||||
remain = fsdsize - partstart;
|
||||
remain = ptend - partstart;
|
||||
if (remain > 0) {
|
||||
partsize = remain;
|
||||
snprintf(isize, 20, "%d", partsize/sizemult);
|
||||
@ -325,14 +324,14 @@ make_bsd_partitions(void)
|
||||
}
|
||||
|
||||
/* Others ... */
|
||||
remain = fsdsize - partstart;
|
||||
remain = ptend - partstart;
|
||||
if (remain > 0)
|
||||
msg_display(MSG_otherparts);
|
||||
part = PART_FIRST_FREE;
|
||||
for (; remain > 0 && part < maxpart; ++part ) {
|
||||
if (bsdlabel[part].pi_fstype != FS_UNUSED)
|
||||
continue;
|
||||
partsize = fsdsize - partstart;
|
||||
partsize = ptend - partstart;
|
||||
snprintf(isize, 20, "%d", partsize/sizemult);
|
||||
msg_prompt_add(MSG_askfspart, isize, isize, 20,
|
||||
diskdev, partition_name(part),
|
||||
@ -349,7 +348,7 @@ make_bsd_partitions(void)
|
||||
msg_prompt_add(MSG_mountpoint, NULL, fsmount[part],
|
||||
20);
|
||||
partstart += partsize;
|
||||
remain = fsdsize - partstart;
|
||||
remain = ptend - partstart;
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.h,v 1.5 2003/04/06 16:12:38 jmmv Exp $ */
|
||||
/* $NetBSD: md.h,v 1.6 2003/05/21 10:05:23 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -108,15 +108,6 @@ EXTERN char *disk_names[]
|
||||
;
|
||||
|
||||
|
||||
/*
|
||||
* Legal start character for a disk for checking input.
|
||||
* this must return 1 for a character that matches the first
|
||||
* characters of each member of disk_names.
|
||||
*
|
||||
* On atari, that means matching 's' or 'w'
|
||||
*/
|
||||
#define ISDISKSTART(dn) (dn == 'w' || dn == 's')
|
||||
|
||||
/*
|
||||
* Machine-specific command to write a new label to a disk.
|
||||
* For example, i386 uses "/sbin/disklabel -w -r", just like i386
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.c,v 1.30 2003/05/18 07:48:28 dsl Exp $ */
|
||||
/* $NetBSD: md.c,v 1.31 2003/05/21 10:05:23 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -128,7 +128,7 @@ int md_make_bsd_partitions (void)
|
||||
editlab:
|
||||
/* Ask for layout type -- standard or special */
|
||||
msg_display (MSG_layout,
|
||||
(1.0*fsptsize*sectorsize)/MEG,
|
||||
(1.0*ptsize*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG+rammb+XNEEDMB);
|
||||
process_menu (MENU_layout);
|
||||
@ -147,11 +147,11 @@ editlab:
|
||||
/* Partitions C and D are predefined. */
|
||||
bsdlabel[C].pi_fstype = FS_UNUSED;
|
||||
bsdlabel[C].pi_offset = ptstart;
|
||||
bsdlabel[C].pi_size = fsptsize;
|
||||
bsdlabel[C].pi_size = ptsize;
|
||||
|
||||
bsdlabel[D].pi_fstype = FS_UNUSED;
|
||||
bsdlabel[D].pi_offset = 0;
|
||||
bsdlabel[D].pi_size = fsdsize;
|
||||
bsdlabel[D].pi_size = dlsize;
|
||||
|
||||
/* Standard fstypes */
|
||||
bsdlabel[A].pi_fstype = FS_BSDFFS;
|
||||
@ -189,7 +189,7 @@ editlab:
|
||||
partstart += partsize;
|
||||
|
||||
/* /usr */
|
||||
partsize = fsptsize - (partstart - ptstart);
|
||||
partsize = ptsize - (partstart - ptstart);
|
||||
bsdlabel[E].pi_fstype = FS_BSDFFS;
|
||||
bsdlabel[E].pi_offset = partstart;
|
||||
bsdlabel[E].pi_size = partsize;
|
||||
@ -202,7 +202,7 @@ editlab:
|
||||
case 3: /* custom: ask user for all sizes */
|
||||
ask_sizemult(dlcylsize);
|
||||
partstart = ptstart;
|
||||
remain = fsptsize;
|
||||
remain = ptsize;
|
||||
|
||||
/* root */
|
||||
i = NUMSEC(20+2*rammb, MEG/sectorsize, dlcylsize) + partstart;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.h,v 1.7 2003/04/06 16:12:39 jmmv Exp $ */
|
||||
/* $NetBSD: md.h,v 1.8 2003/05/21 10:05:23 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -97,15 +97,6 @@ EXTERN char *disk_names[]
|
||||
;
|
||||
|
||||
|
||||
/*
|
||||
* Legal start character for a disk for checking input.
|
||||
* this must return 1 for a character that matches the first
|
||||
* characters of each member of disk_names.
|
||||
*
|
||||
* On bebox, that means matching 'w' for st-506/ide and 's' for sd.
|
||||
*/
|
||||
#define ISDISKSTART(dn) (dn == 'w' || dn == 's')
|
||||
|
||||
/*
|
||||
* Machine-specific command to write a new label to a disk.
|
||||
* For example, bebox uses "/sbin/disklabel -w -r", just like bebox
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.c,v 1.4 2002/12/05 01:17:21 fvdl Exp $ */
|
||||
/* $NetBSD: md.c,v 1.5 2003/05/21 10:05:24 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -159,21 +159,11 @@ int md_make_bsd_partitions (void)
|
||||
* Standard 4.3BSD 8-partition labels always cover whole disk.
|
||||
*/
|
||||
ptsize = dlsize - ptstart;
|
||||
fsdsize = dlsize; /* actually means `whole disk' */
|
||||
fsptsize = dlsize - ptstart; /* netbsd partition -- same as above */
|
||||
fsdmb = fsdsize / MEG;
|
||||
|
||||
/* endwin();
|
||||
printf("ptsize=%d\n", ptsize);
|
||||
printf("fsdsize=%d\n", fsdsize);
|
||||
printf("fsptsize=%d\n", fsptsize);
|
||||
printf("fsdmb=%d\n", fsdmb);
|
||||
backtowin();*/
|
||||
|
||||
/*editlab:*/
|
||||
/* Ask for layout type -- standard or special */
|
||||
msg_display (MSG_layout,
|
||||
(1.0*fsptsize*sectorsize)/MEG,
|
||||
(1.0*ptsize*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG+rammb+XNEEDMB);
|
||||
process_menu(MENU_layout);
|
||||
@ -239,7 +229,7 @@ int md_make_bsd_partitions (void)
|
||||
partstart += partsize;
|
||||
|
||||
/* /usr */
|
||||
partsize = fsptsize - (partstart - ptstart);
|
||||
partsize = ptsize - (partstart - ptstart);
|
||||
bsdlabel[E].pi_fstype = FS_BSDFFS;
|
||||
bsdlabel[E].pi_offset = partstart;
|
||||
bsdlabel[E].pi_size = partsize;
|
||||
@ -252,7 +242,7 @@ int md_make_bsd_partitions (void)
|
||||
case 3: /* custom: ask user for all sizes */
|
||||
ask_sizemult(dlcylsize);
|
||||
partstart = ptstart;
|
||||
remain = fsptsize;
|
||||
remain = ptsize;
|
||||
|
||||
/* root */
|
||||
i = NUMSEC(24+2*rammb, MEG/sectorsize, dlcylsize) + partstart;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.h,v 1.3 2003/04/06 16:12:39 jmmv Exp $ */
|
||||
/* $NetBSD: md.h,v 1.4 2003/05/21 10:05:24 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -90,15 +90,6 @@ EXTERN char *disk_names[]
|
||||
#endif
|
||||
;
|
||||
|
||||
/*
|
||||
* Legal start character for a disk for checking input.
|
||||
* this must return 1 for a character that matches the first
|
||||
* characters of each member of disk_names.
|
||||
*
|
||||
* On cats, that means matching 'w' for ide and 's' for sd.
|
||||
*/
|
||||
#define ISDISKSTART(dn) (dn == 'w' || dn == 's')
|
||||
|
||||
/*
|
||||
* Machine-specific command to write a new label to a disk.
|
||||
* For example, cats uses "/sbin/disklabel -w -r", just like cats
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.c,v 1.5 2003/04/10 17:05:25 thorpej Exp $ */
|
||||
/* $NetBSD: md.c,v 1.6 2003/05/21 10:05:24 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -140,13 +140,10 @@ md_make_bsd_partitions(void)
|
||||
* Standard 4.3BSD 8-partition labels always cover whole disk.
|
||||
*/
|
||||
ptsize = dlsize - ptstart;
|
||||
fsdsize = dlsize; /* actually means `whole disk' */
|
||||
fsptsize = dlsize - ptstart; /* netbsd partition -- same as above */
|
||||
fsdmb = fsdsize / MEG;
|
||||
|
||||
/* Ask for layout type -- standard or special */
|
||||
msg_display (MSG_layout,
|
||||
(1.0*fsptsize*sectorsize)/MEG,
|
||||
(1.0*ptsize*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG+rammb+XNEEDMB);
|
||||
process_menu(MENU_layout);
|
||||
@ -206,7 +203,7 @@ md_make_bsd_partitions(void)
|
||||
partstart += partsize;
|
||||
|
||||
/* /usr */
|
||||
partsize = fsptsize - (partstart - ptstart);
|
||||
partsize = ptsize - (partstart - ptstart);
|
||||
bsdlabel[D].pi_fstype = FS_BSDFFS;
|
||||
bsdlabel[D].pi_offset = partstart;
|
||||
bsdlabel[D].pi_size = partsize;
|
||||
@ -219,7 +216,7 @@ md_make_bsd_partitions(void)
|
||||
case 3: /* custom: ask user for all sizes */
|
||||
ask_sizemult(dlcylsize);
|
||||
partstart = ptstart;
|
||||
remain = fsptsize;
|
||||
remain = ptsize;
|
||||
|
||||
/* root */
|
||||
i = NUMSEC(24+2*rammb, MEG/sectorsize, dlcylsize) + partstart;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.h,v 1.4 2003/04/10 17:05:25 thorpej Exp $ */
|
||||
/* $NetBSD: md.h,v 1.5 2003/05/21 10:05:24 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -92,15 +92,6 @@ EXTERN char *disk_names[]
|
||||
#endif
|
||||
;
|
||||
|
||||
/*
|
||||
* Legal start character for a disk for checking input.
|
||||
* this must return 1 for a character that matches the first
|
||||
* characters of each member of disk_names.
|
||||
*
|
||||
* On shark, that means matching 'w' for ide and 's' for sd.
|
||||
*/
|
||||
#define ISDISKSTART(dn) (dn == 'w' || dn == 's')
|
||||
|
||||
/*
|
||||
* Machine-specific command to write a new label to a disk.
|
||||
* For example, shark uses "/sbin/disklabel -w -r".
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.c,v 1.5 2003/05/07 10:20:21 dsl Exp $ */
|
||||
/* $NetBSD: md.c,v 1.6 2003/05/21 10:05:24 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997,2002 Piermont Information Systems Inc.
|
||||
@ -131,7 +131,7 @@ int md_make_bsd_partitions (void)
|
||||
editlab:
|
||||
/* Ask for layout type -- standard or special */
|
||||
msg_display (MSG_layout,
|
||||
(1.0*fsptsize*sectorsize)/MEG,
|
||||
(1.0*ptsize*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG+rammb+XNEEDMB);
|
||||
process_menu (MENU_layout);
|
||||
@ -150,11 +150,11 @@ editlab:
|
||||
/* Partitions C and D are predefined. */
|
||||
bsdlabel[C].pi_fstype = FS_UNUSED;
|
||||
bsdlabel[C].pi_offset = ptstart;
|
||||
bsdlabel[C].pi_size = fsptsize;
|
||||
bsdlabel[C].pi_size = ptsize;
|
||||
|
||||
bsdlabel[D].pi_fstype = FS_UNUSED;
|
||||
bsdlabel[D].pi_offset = 0;
|
||||
bsdlabel[D].pi_size = fsdsize;
|
||||
bsdlabel[D].pi_size = dlsize;
|
||||
|
||||
/* Standard fstypes */
|
||||
bsdlabel[A].pi_fstype = FS_BSDFFS;
|
||||
@ -192,7 +192,7 @@ editlab:
|
||||
partstart += partsize;
|
||||
|
||||
/* /usr */
|
||||
partsize = fsptsize - (partstart - ptstart);
|
||||
partsize = ptsize - (partstart - ptstart);
|
||||
bsdlabel[E].pi_fstype = FS_BSDFFS;
|
||||
bsdlabel[E].pi_offset = partstart;
|
||||
bsdlabel[E].pi_size = partsize;
|
||||
@ -205,7 +205,7 @@ editlab:
|
||||
case 3: /* custom: ask user for all sizes */
|
||||
ask_sizemult(dlcylsize);
|
||||
partstart = ptstart;
|
||||
remain = fsptsize;
|
||||
remain = ptsize;
|
||||
|
||||
/* root */
|
||||
i = NUMSEC(20+2*rammb, MEG/sectorsize, dlcylsize) + partstart;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.h,v 1.2 2003/04/06 16:12:39 jmmv Exp $ */
|
||||
/* $NetBSD: md.h,v 1.3 2003/05/21 10:05:24 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -97,15 +97,6 @@ EXTERN char *disk_names[]
|
||||
;
|
||||
|
||||
|
||||
/*
|
||||
* Legal start character for a disk for checking input.
|
||||
* this must return 1 for a character that matches the first
|
||||
* characters of each member of disk_names.
|
||||
*
|
||||
* On bebox, that means matching 'w' for st-506/ide and 's' for sd.
|
||||
*/
|
||||
#define ISDISKSTART(dn) (dn == 'w' || dn == 's')
|
||||
|
||||
/*
|
||||
* Machine-specific command to write a new label to a disk.
|
||||
* For example, bebox uses "/sbin/disklabel -w -r", just like bebox
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.h,v 1.2 2003/04/06 16:12:39 jmmv Exp $ */
|
||||
/* $NetBSD: md.h,v 1.3 2003/05/21 10:05:24 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -112,15 +112,6 @@ EXTERN char *disk_names[]
|
||||
;
|
||||
;
|
||||
|
||||
/*
|
||||
* Legal start character for a disk for checking input.
|
||||
* this must return 1 for a character that matches the first
|
||||
* characters of each member of disk_names.
|
||||
*
|
||||
* On hp300, that means matching 'r' for rd anad 's' for sd.
|
||||
*/
|
||||
#define ISDISKSTART(dn) (dn == 'r' || dn == 's')
|
||||
|
||||
|
||||
/*
|
||||
* Machine-specific command to write a new label to a disk.
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.c,v 1.22 2003/05/15 08:09:51 dsl Exp $ */
|
||||
/* $NetBSD: md.c,v 1.23 2003/05/21 10:05:24 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -142,7 +142,7 @@ md_make_bsd_partitions(void)
|
||||
|
||||
/* Ask for layout type -- standard or special */
|
||||
msg_display(MSG_layout,
|
||||
(1.0*fsptsize*sectorsize)/MEG,
|
||||
(1.0*ptsize*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG+rammb+XNEEDMB);
|
||||
process_menu(MENU_layout);
|
||||
@ -161,11 +161,11 @@ md_make_bsd_partitions(void)
|
||||
/* Partitions C and D are predefined. */
|
||||
bsdlabel[C].pi_fstype = FS_UNUSED;
|
||||
bsdlabel[C].pi_offset = ptstart;
|
||||
bsdlabel[C].pi_size = fsptsize;
|
||||
bsdlabel[C].pi_size = ptsize;
|
||||
|
||||
bsdlabel[D].pi_fstype = FS_UNUSED;
|
||||
bsdlabel[D].pi_offset = 0;
|
||||
bsdlabel[D].pi_size = fsdsize;
|
||||
bsdlabel[D].pi_size = dlsize;
|
||||
|
||||
/* Standard fstypes */
|
||||
bsdlabel[A].pi_fstype = FS_BSDFFS;
|
||||
@ -186,7 +186,7 @@ md_make_bsd_partitions(void)
|
||||
i = NUMSEC(20+2*rammb, MEG/sectorsize, dlcylsize);
|
||||
i += NUMSEC(layoutkind * 2 * (rammb < 16 ? 16 : rammb),
|
||||
MEG/sectorsize, dlcylsize);
|
||||
if ( i > fsptsize) {
|
||||
if ( i > ptsize) {
|
||||
msg_display(MSG_disktoosmall);
|
||||
process_menu(MENU_ok);
|
||||
goto custom;
|
||||
@ -212,7 +212,7 @@ md_make_bsd_partitions(void)
|
||||
partstart += partsize;
|
||||
|
||||
/* /usr */
|
||||
partsize = fsptsize - (partstart - ptstart);
|
||||
partsize = ptsize - (partstart - ptstart);
|
||||
bsdlabel[E].pi_fstype = FS_BSDFFS;
|
||||
bsdlabel[E].pi_offset = partstart;
|
||||
bsdlabel[E].pi_size = partsize;
|
||||
@ -225,7 +225,7 @@ md_make_bsd_partitions(void)
|
||||
custom: ask_sizemult(dlcylsize);
|
||||
msg_display(MSG_defaultunit, multname);
|
||||
partstart = ptstart;
|
||||
remain = fsptsize;
|
||||
remain = ptsize;
|
||||
|
||||
/* root */
|
||||
i = NUMSEC(20+2*rammb, MEG/sectorsize, dlcylsize) + partstart;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.h,v 1.15 2003/05/18 18:54:07 dsl Exp $ */
|
||||
/* $NetBSD: md.h,v 1.16 2003/05/21 10:05:25 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -104,15 +104,6 @@ EXTERN char *disk_names[]
|
||||
;
|
||||
|
||||
|
||||
/*
|
||||
* Legal start character for a disk for checking input.
|
||||
* this must return 1 for a character that matches the first
|
||||
* characters of each member of disk_names.
|
||||
*
|
||||
* On i386, that means matching 'w' for st-506/ide and 's' for sd.
|
||||
*/
|
||||
#define ISDISKSTART(dn) (dn == 'w' || dn == 's')
|
||||
|
||||
/*
|
||||
* Machine-specific command to write a new label to a disk.
|
||||
* For example, i386 uses "/sbin/disklabel -w -r", just like i386
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile,v 1.12 2003/05/16 19:48:29 dsl Exp $
|
||||
# $NetBSD: Makefile,v 1.13 2003/05/21 10:05:25 dsl Exp $
|
||||
#
|
||||
# Makefile for i386
|
||||
#
|
||||
@ -7,7 +7,8 @@
|
||||
|
||||
SRCS= menu_defs.c msg_defs.c main.c install.c upgrade.c \
|
||||
txtwalk.c run.c factor.c net.c disks.c disks_lfs.c util.c geom.c \
|
||||
label.c target.c md.c mbr.c aout2elf.c
|
||||
label.c target.c md.c mbr.c aout2elf.c sizemultname.c
|
||||
#SRCS+= bsddisklabel.c savenewlabel.c
|
||||
|
||||
fdisk.o md.o: menu_defs.h msg_defs.h
|
||||
|
||||
@ -16,5 +17,6 @@ MSG_MD= msg.md.${SYSINSTLANG} msg.mbr.${SYSINSTLANG}
|
||||
MD_OPTIONS= BOOTSEL
|
||||
|
||||
CPPFLAGS+= -DBOOTSEL
|
||||
# CPPFLAGS+= -DNO_LBA_READS
|
||||
|
||||
.include "../../Makefile.inc"
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.c,v 1.77 2003/05/18 07:52:57 dsl Exp $ */
|
||||
/* $NetBSD: md.c,v 1.78 2003/05/21 10:05:25 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -55,6 +55,10 @@
|
||||
#include "msg_defs.h"
|
||||
#include "menu_defs.h"
|
||||
|
||||
#ifdef NO_LBA_READS /* for testing */
|
||||
#undef BIFLAG_EXTINT13
|
||||
#define BIFLAG_EXTINT13 0
|
||||
#endif
|
||||
|
||||
mbr_sector_t mbr;
|
||||
int mbr_len;
|
||||
@ -236,6 +240,10 @@ md_copy_filesystem(void)
|
||||
int
|
||||
md_make_bsd_partitions(void)
|
||||
{
|
||||
|
||||
#if 0
|
||||
return make_bsd_partitions();
|
||||
#else
|
||||
FILE *f;
|
||||
int i;
|
||||
int maxpart = getmaxpartitions();
|
||||
@ -244,7 +252,7 @@ md_make_bsd_partitions(void)
|
||||
editlab:
|
||||
/* Ask for layout type -- standard or special */
|
||||
msg_display(MSG_layout,
|
||||
(1.0*fsptsize*sectorsize)/MEG,
|
||||
(1.0*ptsize*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG+rammb+XNEEDMB);
|
||||
process_menu(MENU_layout);
|
||||
@ -263,11 +271,11 @@ editlab:
|
||||
/* Partitions C and D are predefined. */
|
||||
bsdlabel[C].pi_fstype = FS_UNUSED;
|
||||
bsdlabel[C].pi_offset = ptstart;
|
||||
bsdlabel[C].pi_size = fsptsize;
|
||||
bsdlabel[C].pi_size = ptsize;
|
||||
|
||||
bsdlabel[D].pi_fstype = FS_UNUSED;
|
||||
bsdlabel[D].pi_offset = 0;
|
||||
bsdlabel[D].pi_size = fsdsize;
|
||||
bsdlabel[D].pi_size = dlsize;
|
||||
|
||||
/* Standard fstypes */
|
||||
bsdlabel[A].pi_fstype = FS_BSDFFS;
|
||||
@ -296,7 +304,7 @@ editlab:
|
||||
i = NUMSEC(20+2*rammb, MEG/sectorsize, dlcylsize);
|
||||
i += NUMSEC(layoutkind * 2 * (rammb < 16 ? 16 : rammb),
|
||||
MEG/sectorsize, dlcylsize);
|
||||
if ( i > fsptsize) {
|
||||
if ( i > ptsize) {
|
||||
msg_display(MSG_disktoosmall);
|
||||
process_menu(MENU_ok);
|
||||
goto custom;
|
||||
@ -320,7 +328,7 @@ editlab:
|
||||
partstart += partsize;
|
||||
|
||||
/* /usr */
|
||||
partsize = fsptsize - (partstart - ptstart);
|
||||
partsize = ptsize - (partstart - ptstart);
|
||||
bsdlabel[E].pi_fstype = FS_BSDFFS;
|
||||
bsdlabel[E].pi_offset = partstart;
|
||||
bsdlabel[E].pi_size = partsize;
|
||||
@ -387,7 +395,7 @@ custom:
|
||||
}
|
||||
|
||||
/* Disk name */
|
||||
msg_prompt (MSG_packname, "mydisk", bsddiskname, DISKNAME_SIZE);
|
||||
msg_prompt(MSG_packname, "mydisk", bsddiskname, DISKNAME_SIZE);
|
||||
|
||||
/* Create the disktab.preinstall */
|
||||
#ifdef DEBUG
|
||||
@ -423,6 +431,7 @@ custom:
|
||||
|
||||
/* Everything looks OK. */
|
||||
return (1);
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
@ -433,6 +442,15 @@ md_pre_update(void)
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* any additional partition validation
|
||||
*/
|
||||
int
|
||||
md_check_partitions(void)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/* Upgrade support */
|
||||
int
|
||||
@ -655,14 +673,12 @@ md_init(void)
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef notdef
|
||||
void
|
||||
md_set_sizemultname(void)
|
||||
{
|
||||
|
||||
set_sizemultname_meg();
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
md_set_no_x(void)
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.h,v 1.38 2003/05/16 19:48:29 dsl Exp $ */
|
||||
/* $NetBSD: md.h,v 1.39 2003/05/21 10:05:25 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -108,16 +108,6 @@ EXTERN char *disk_names[]
|
||||
/* Bootblock type */
|
||||
EXTERN char *boottype INIT("");
|
||||
|
||||
/*
|
||||
* Legal start character for a disk for checking input.
|
||||
* this must return 1 for a character that matches the first
|
||||
* characters of each member of disk_names.
|
||||
*
|
||||
* On i386, that means matching 'w' for st-506/ide, 's' for sd and 'l' for ld,
|
||||
* 'e' for ed.
|
||||
*/
|
||||
#define ISDISKSTART(dn) (dn == 'w' || dn == 's' || dn == 'l' || dn == 'e')
|
||||
|
||||
/*
|
||||
* Machine-specific command to write a new label to a disk.
|
||||
* For example, i386 uses "/sbin/disklabel -w -r", just like i386
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: msg.md.en,v 1.29 2003/05/16 19:48:29 dsl Exp $ */
|
||||
/* $NetBSD: msg.md.en,v 1.30 2003/05/21 10:05:25 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -97,7 +97,7 @@ message dobootblks
|
||||
{Installing boot blocks on %s....
|
||||
}
|
||||
|
||||
message askfsroot1
|
||||
message askfsroot
|
||||
{I will be asking for partition information.
|
||||
|
||||
First the root partition. You have %d %s left on your disk.
|
||||
@ -106,21 +106,26 @@ First the root partition. You have %d %s left on your disk.
|
||||
message askfsroot2
|
||||
{Root partition size? }
|
||||
|
||||
message askfsswap1
|
||||
message askfsswap
|
||||
{
|
||||
Next the swap partition. You have %d %s left on your disk.
|
||||
}
|
||||
Swap partition size? }
|
||||
|
||||
message askfsswap2
|
||||
{Swap partition size? }
|
||||
|
||||
message askfsusr
|
||||
{
|
||||
Next the /usr partition. You have %d %s left on your disk.
|
||||
/usr partition size? }
|
||||
|
||||
message otherparts
|
||||
{You still have some space remaining unallocated on your disk. Please
|
||||
give sizes and mount points for the following partitions.
|
||||
|
||||
}
|
||||
|
||||
message askfspart1
|
||||
message askfspart
|
||||
{The next partition is /dev/%s%c. You have %d %s left on your disk.
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.c,v 1.29 2003/01/12 21:49:52 christos Exp $ */
|
||||
/* $NetBSD: md.c,v 1.30 2003/05/21 10:05:25 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -49,6 +49,8 @@
|
||||
#include "msg_defs.h"
|
||||
#include "menu_defs.h"
|
||||
|
||||
int blk_size;
|
||||
|
||||
/*
|
||||
* Compare lexigraphically two strings
|
||||
*/
|
||||
@ -258,7 +260,7 @@ getName(part, len_name, name)
|
||||
*/
|
||||
if ((fd = open(devname, O_RDONLY, 0)) >= 0) {
|
||||
seek = (off_t)part->pmPyPartStart + (off_t)2;
|
||||
seek *= (off_t)bsize;
|
||||
seek *= (off_t)blk_size;
|
||||
lseek(fd, seek, SEEK_SET);
|
||||
read(fd, &macosblk, sizeof(macosblk));
|
||||
macosblk[37+32] = '\0';
|
||||
@ -678,7 +680,7 @@ md_get_info()
|
||||
* Get the disk parameters from the disk driver. It should have
|
||||
* obained them by querying the disk itself.
|
||||
*/
|
||||
bsize = disklabel.d_secsize;
|
||||
blk_size = disklabel.d_secsize;
|
||||
dlcyl = disklabel.d_ncylinders;
|
||||
dlhead = disklabel.d_ntracks;
|
||||
dlsec = disklabel.d_nsectors;
|
||||
@ -701,7 +703,7 @@ md_get_info()
|
||||
}
|
||||
dlsize = disklabel.d_secperunit;
|
||||
#if 0
|
||||
msg_display(MSG_dldebug, bsize, dlcyl, dlhead, dlsec, dlsize);
|
||||
msg_display(MSG_dldebug, blk_size, dlcyl, dlhead, dlsec, dlsize);
|
||||
process_menu(MENU_ok);
|
||||
#endif
|
||||
map.size = 0;
|
||||
@ -709,7 +711,7 @@ md_get_info()
|
||||
* Verify the disk has been initialized for MacOS use by checking
|
||||
* to see if the disk have a Boot Block
|
||||
*/
|
||||
if (lseek(fd, (off_t)0 * bsize, SEEK_SET) < 0 ||
|
||||
if (lseek(fd, (off_t)0 * blk_size, SEEK_SET) < 0 ||
|
||||
read(fd, &block, sizeof(block)) < sizeof(block) ||
|
||||
block.pmSig != 0x4552) {
|
||||
process_menu(MENU_nodiskmap);
|
||||
@ -721,17 +723,17 @@ md_get_info()
|
||||
* to it and the number currently in use.
|
||||
*/
|
||||
for (i=0;i<MAXMAXPARTITIONS;i++) {
|
||||
lseek(fd, (off_t)(i+1) * bsize, SEEK_SET);
|
||||
lseek(fd, (off_t)(i+1) * blk_size, SEEK_SET);
|
||||
read(fd, &block, sizeof(block));
|
||||
if (stricmp("Apple_partition_map", block.pmPartType) == 0) {
|
||||
map.size = block.pmPartBlkCnt;
|
||||
map.in_use_cnt = block.pmMapBlkCnt;
|
||||
map.blk = (struct apple_part_map_entry *)malloc(map.size * bsize);
|
||||
map.blk = (struct apple_part_map_entry *)malloc(map.size * blk_size);
|
||||
break;
|
||||
}
|
||||
}
|
||||
lseek(fd, (off_t)1 * bsize, SEEK_SET);
|
||||
read(fd, map.blk, map.size * bsize);
|
||||
lseek(fd, (off_t)1 * blk_size, SEEK_SET);
|
||||
read(fd, map.blk, map.size * blk_size);
|
||||
}
|
||||
close(fd);
|
||||
/*
|
||||
@ -776,14 +778,14 @@ md_pre_disklabel()
|
||||
* we need to write out Block0 too.
|
||||
*/
|
||||
if (map.blk[0].pmSigPad == 0xa5a5) {
|
||||
if (lseek (fd, (off_t)0 * bsize, SEEK_SET) < 0) {
|
||||
if (lseek (fd, (off_t)0 * blk_size, SEEK_SET) < 0) {
|
||||
endwin();
|
||||
fprintf (stderr, "Can't position to write Block0\n");
|
||||
close (fd);
|
||||
exit (1);
|
||||
}
|
||||
new_block0.sbBlkCount = dlsize; /* Set disk size */
|
||||
if (write (fd, &new_block0, bsize) != bsize) {
|
||||
if (write (fd, &new_block0, blk_size) != blk_size) {
|
||||
endwin();
|
||||
fprintf (stderr, "I/O error writing Block0\n");
|
||||
close (fd);
|
||||
@ -791,13 +793,13 @@ md_pre_disklabel()
|
||||
}
|
||||
map.blk[0].pmSigPad = 0;
|
||||
}
|
||||
if (lseek (fd, (off_t)1 * bsize, SEEK_SET) < 0) {
|
||||
if (lseek (fd, (off_t)1 * blk_size, SEEK_SET) < 0) {
|
||||
endwin();
|
||||
fprintf (stderr, "Can't position disk to rewrite Disk Map\n");
|
||||
close (fd);
|
||||
exit (1);
|
||||
}
|
||||
if (write (fd, map.blk, map.size * bsize) != (map.size * bsize)) {
|
||||
if (write (fd, map.blk, map.size * blk_size) != (map.size * blk_size)) {
|
||||
endwin();
|
||||
fprintf(stderr, "I/O error writing Disk Map\n");
|
||||
close (fd);
|
||||
@ -1045,7 +1047,7 @@ md_make_bsd_partitions(void)
|
||||
(void)fprintf (f, "\t:dt=%s:ty=winchester:\\\n", disktype);
|
||||
(void)fprintf (f, "\t:nc#%d:nt#%d:ns#%d:\\\n", dlcyl, dlhead, dlsec);
|
||||
(void)fprintf (f, "\t:sc#%d:su#%d:\\\n", dlhead*dlsec, dlsize);
|
||||
(void)fprintf (f, "\t:se#%d:%s\\\n", bsize, doessf);
|
||||
(void)fprintf (f, "\t:se#%d:%s\\\n", blk_size, doessf);
|
||||
for (i=0; i<8; i++) {
|
||||
if (bsdlabel[i].pi_fstype == FS_HFS)
|
||||
(void)fprintf (f, "\t:p%c#%d:o%c#%d:t%c=macos:",
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.h,v 1.14 2003/04/06 16:12:40 jmmv Exp $ */
|
||||
/* $NetBSD: md.h,v 1.15 2003/05/21 10:05:25 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -94,9 +94,6 @@ EXTERN MAP_TYPE map_types[]
|
||||
#define HFS_PART 4
|
||||
#define SCRATCH_PART 5
|
||||
|
||||
EXTERN int bcyl, bhead, bsec, bsize, bcylsize;
|
||||
EXTERN int part[4][5] INIT({{0}});
|
||||
EXTERN int bsdpart; /* partition in use by NetBSD */
|
||||
EXTERN int usefull; /* on install, clobber entire disk */
|
||||
|
||||
typedef struct {
|
||||
@ -231,9 +228,6 @@ EXTERN char *disk_names[]
|
||||
#endif
|
||||
;
|
||||
|
||||
/* Legal start character for a disk for checking input. */
|
||||
#define ISDISKSTART(dn) (dn == 'w' || dn == 's')
|
||||
|
||||
/*
|
||||
* Machine-specific command to write a new label to a disk.
|
||||
* For example, i386 uses "/sbin/disklabel -w -r", just like i386
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.c,v 1.23 2002/08/02 05:11:33 grant Exp $ */
|
||||
/* $NetBSD: md.c,v 1.24 2003/05/21 10:05:26 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -162,19 +162,18 @@ md_make_bsd_partitions()
|
||||
int remain;
|
||||
char isize[20];
|
||||
int maxpart = getmaxpartitions();
|
||||
int ptend;
|
||||
|
||||
/*
|
||||
* Initialize global variables that track space used on this disk.
|
||||
* Standard 4.3BSD 8-partition labels always cover whole disk.
|
||||
*/
|
||||
ptsize = dlsize - ptstart;
|
||||
fsdsize = dlsize; /* actually means `whole disk' */
|
||||
fsptsize = dlsize - ptstart; /* netbsd partition -- same as above */
|
||||
fsdmb = fsdsize / MEG;
|
||||
ptend = dlsize;
|
||||
|
||||
/* Ask for layout type -- standard or special */
|
||||
msg_display (MSG_layout,
|
||||
(1.0*fsptsize*sectorsize)/MEG,
|
||||
(1.0*ptsize*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG+rammb+XNEEDMB);
|
||||
process_menu (MENU_layout);
|
||||
@ -234,7 +233,7 @@ md_make_bsd_partitions()
|
||||
partstart += partsize;
|
||||
|
||||
/* /usr */
|
||||
partsize = fsdsize - partstart;
|
||||
partsize = ptend - partstart;
|
||||
bsdlabel[PART_USR].pi_fstype = FS_BSDFFS;
|
||||
bsdlabel[PART_USR].pi_offset = partstart;
|
||||
bsdlabel[PART_USR].pi_size = partsize;
|
||||
@ -248,7 +247,7 @@ md_make_bsd_partitions()
|
||||
ask_sizemult(dlcylsize);
|
||||
/* root */
|
||||
partstart = ptstart;
|
||||
remain = fsdsize - partstart;
|
||||
remain = ptend - partstart;
|
||||
/* By convention, NetBSD/macppc uses a 32Mbyte root */
|
||||
partsize = NUMSEC (32, MEG/sectorsize, dlcylsize);
|
||||
snprintf (isize, 20, "%d", partsize/sizemult);
|
||||
@ -263,7 +262,7 @@ md_make_bsd_partitions()
|
||||
partstart += partsize;
|
||||
|
||||
/* swap */
|
||||
remain = fsdsize - partstart;
|
||||
remain = ptend - partstart;
|
||||
i = NUMSEC(2 * (rammb < 32 ? 32 : rammb),
|
||||
MEG/sectorsize, dlcylsize) + partstart;
|
||||
partsize = NUMSEC (i/(MEG/sectorsize)+1, MEG/sectorsize,
|
||||
@ -277,9 +276,9 @@ md_make_bsd_partitions()
|
||||
partstart += partsize;
|
||||
|
||||
/* /usr */
|
||||
remain = fsdsize - partstart;
|
||||
remain = ptend - partstart;
|
||||
if (remain > 0) {
|
||||
partsize = fsdsize - partstart;
|
||||
partsize = ptend - partstart;
|
||||
snprintf (isize, 20, "%d", partsize/sizemult);
|
||||
msg_prompt_add (MSG_askfsusr, isize, isize, 20,
|
||||
remain/sizemult, multname);
|
||||
@ -296,12 +295,12 @@ md_make_bsd_partitions()
|
||||
}
|
||||
|
||||
/* Others ... */
|
||||
remain = fsdsize - partstart;
|
||||
remain = ptend - partstart;
|
||||
part = F;
|
||||
if (remain > 0)
|
||||
msg_display (MSG_otherparts);
|
||||
while (remain > 0 && part <= H) {
|
||||
partsize = fsdsize - partstart;
|
||||
partsize = ptend - partstart;
|
||||
snprintf (isize, 20, "%d", partsize/sizemult);
|
||||
msg_prompt_add (MSG_askfspart, isize, isize, 20,
|
||||
diskdev, partition_name(part),
|
||||
@ -317,7 +316,7 @@ md_make_bsd_partitions()
|
||||
msg_prompt_add (MSG_mountpoint, NULL,
|
||||
fsmount[part], 20);
|
||||
partstart += partsize;
|
||||
remain = fsdsize - partstart;
|
||||
remain = ptend - partstart;
|
||||
part++;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.h,v 1.8 2003/04/06 16:12:40 jmmv Exp $ */
|
||||
/* $NetBSD: md.h,v 1.9 2003/05/21 10:05:26 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -80,13 +80,6 @@ EXTERN char *disk_names[]
|
||||
#endif
|
||||
;
|
||||
|
||||
/*
|
||||
* Legal start character for a disk for checking input.
|
||||
* this must return 1 for a character that matches the first
|
||||
* characters of each member of disk_names.
|
||||
*/
|
||||
#define ISDISKSTART(dn) (dn == 's' || dn == 'w')
|
||||
|
||||
/*
|
||||
* Machine-specific command to write a new label to a disk.
|
||||
* If not defined, we assume the port does not support disklabels and
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.h,v 1.3 2003/04/06 16:12:40 jmmv Exp $ */
|
||||
/* $NetBSD: md.h,v 1.4 2003/05/21 10:05:26 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -98,13 +98,6 @@ EXTERN char *disk_names[]
|
||||
#endif
|
||||
;
|
||||
|
||||
/*
|
||||
* Legal start character for a disk for checking input.
|
||||
* this must return 1 for a character that matches the first
|
||||
* characters of each member of disk_names.
|
||||
*/
|
||||
#define ISDISKSTART(dn) (dn == 's')
|
||||
|
||||
/*
|
||||
* Machine-specific command to write a new label to a disk.
|
||||
* If not defined, we assume the port does not support disklabels and
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.h,v 1.2 2003/04/06 16:12:41 jmmv Exp $ */
|
||||
/* $NetBSD: md.h,v 1.3 2003/05/21 10:05:26 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -112,15 +112,6 @@ EXTERN char *disk_names[]
|
||||
;
|
||||
;
|
||||
|
||||
/*
|
||||
* Legal start character for a disk for checking input.
|
||||
* this must return 1 for a character that matches the first
|
||||
* characters of each member of disk_names.
|
||||
*
|
||||
* On mvme68k, that means matching 's' for sd.
|
||||
*/
|
||||
#define ISDISKSTART(dn) (dn == 's')
|
||||
|
||||
|
||||
/*
|
||||
* Machine-specific command to write a new label to a disk.
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.h,v 1.11 2003/04/06 16:12:41 jmmv Exp $ */
|
||||
/* $NetBSD: md.h,v 1.12 2003/05/21 10:05:26 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -94,13 +94,6 @@ EXTERN char *disk_names[]
|
||||
#endif
|
||||
;
|
||||
|
||||
/*
|
||||
* Legal start character for a disk for checking input.
|
||||
* this must return 1 for a character that matches the first
|
||||
* characters of each member of disk_names.
|
||||
*/
|
||||
#define ISDISKSTART(dn) (dn == 's')
|
||||
|
||||
/*
|
||||
* Machine-specific command to write a new label to a disk.
|
||||
* If not defined, we assume the port does not support disklabels and
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.h,v 1.2 2003/04/06 16:12:41 jmmv Exp $ */
|
||||
/* $NetBSD: md.h,v 1.3 2003/05/21 10:05:26 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -93,13 +93,6 @@ EXTERN char *disk_names[]
|
||||
#endif
|
||||
;
|
||||
|
||||
/*
|
||||
* Legal start character for a disk for checking input.
|
||||
* this must return 1 for a character that matches the first
|
||||
* characters of each member of disk_names.
|
||||
*/
|
||||
#define ISDISKSTART(dn) (dn == 's')
|
||||
|
||||
/*
|
||||
* Machine-specific command to write a new label to a disk.
|
||||
* If not defined, we assume the port does not support disklabels and
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.c,v 1.24 2002/12/05 01:17:27 fvdl Exp $ */
|
||||
/* $NetBSD: md.c,v 1.25 2003/05/21 10:05:27 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -86,8 +86,6 @@ int md_get_info (void)
|
||||
dlhead = disk->dd_head;
|
||||
dlsec = disk->dd_sec;
|
||||
dlsize = dlcyl*dlhead*dlsec;
|
||||
fsdsize = dlsize;
|
||||
fsdmb = fsdsize / MEG;
|
||||
|
||||
/* Compute minimum NetBSD partition sizes (in sectors). */
|
||||
minfsdmb = (80 + 4*rammb) * (MEG / sectorsize);
|
||||
@ -130,10 +128,11 @@ int md_make_bsd_partitions (void)
|
||||
int part, partsize, partstart, remain;
|
||||
char isize[SSTRSIZE];
|
||||
int maxpart = getmaxpartitions();
|
||||
int ptend;
|
||||
|
||||
/* Ask for layout type -- standard or special */
|
||||
msg_display (MSG_layout,
|
||||
(1.0*fsptsize*sectorsize)/MEG,
|
||||
(1.0*ptsize*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG+rammb+XNEEDMB);
|
||||
process_menu (MENU_layout);
|
||||
@ -148,6 +147,7 @@ int md_make_bsd_partitions (void)
|
||||
|
||||
/* Build standard partitions */
|
||||
emptylabel(bsdlabel);
|
||||
ptend = dlsize;
|
||||
|
||||
/* Partitions C and D are predefined. */
|
||||
bsdlabel[C].pi_fstype = FS_UNUSED;
|
||||
@ -167,7 +167,7 @@ int md_make_bsd_partitions (void)
|
||||
bsdlabel[F].pi_fstype = FS_UNUSED;
|
||||
bsdlabel[G].pi_fstype = FS_UNUSED;
|
||||
bsdlabel[H].pi_fstype = FS_UNUSED;
|
||||
fsdsize -= BOOT_SIZE;
|
||||
ptend -= BOOT_SIZE;
|
||||
partstart = 0;
|
||||
|
||||
switch (layoutkind) {
|
||||
@ -194,7 +194,7 @@ int md_make_bsd_partitions (void)
|
||||
partstart += partsize;
|
||||
|
||||
/* /usr */
|
||||
partsize = fsdsize - partstart;
|
||||
partsize = ptend - partstart;
|
||||
bsdlabel[E].pi_fstype = FS_BSDFFS;
|
||||
bsdlabel[E].pi_offset = partstart;
|
||||
bsdlabel[E].pi_size = partsize;
|
||||
@ -206,7 +206,7 @@ int md_make_bsd_partitions (void)
|
||||
|
||||
case 3: /* custom: ask user for all sizes */
|
||||
ask_sizemult(dlcylsize);
|
||||
remain = fsdsize;
|
||||
remain = ptend;
|
||||
|
||||
/* root */
|
||||
i = NUMSEC(20+2*rammb, MEG/sectorsize, dlcylsize) + partstart;
|
||||
@ -224,7 +224,7 @@ int md_make_bsd_partitions (void)
|
||||
partstart += partsize;
|
||||
|
||||
/* swap */
|
||||
remain = fsdsize - partstart;
|
||||
remain = ptend - partstart;
|
||||
i = NUMSEC( 2 * (rammb < 16 ? 16 : rammb),
|
||||
MEG/sectorsize, dlcylsize) + partstart;
|
||||
partsize = NUMSEC (i/(MEG/sectorsize)+1, MEG/sectorsize,
|
||||
@ -238,9 +238,9 @@ int md_make_bsd_partitions (void)
|
||||
partstart += partsize;
|
||||
|
||||
/* /usr */
|
||||
remain = fsdsize - partstart;
|
||||
remain = ptend - partstart;
|
||||
if (remain > 0) {
|
||||
partsize = fsdsize - partstart;
|
||||
partsize = ptend - partstart;
|
||||
snprintf (isize, SSTRSIZE, "%d", partsize/sizemult);
|
||||
msg_prompt_add (MSG_askfsusr, isize, isize, SSTRSIZE,
|
||||
remain/sizemult, multname);
|
||||
@ -257,13 +257,13 @@ int md_make_bsd_partitions (void)
|
||||
}
|
||||
|
||||
/* Others ... */
|
||||
remain = fsdsize - partstart;
|
||||
remain = ptend - partstart;
|
||||
part = D;
|
||||
if (remain > 0)
|
||||
msg_display (MSG_otherparts);
|
||||
while (remain > 0 && part <= H) {
|
||||
if (bsdlabel[part].pi_fstype == FS_UNUSED) {
|
||||
partsize = fsdsize - partstart;
|
||||
partsize = ptend - partstart;
|
||||
snprintf (isize, SSTRSIZE, "%d",
|
||||
partsize/sizemult);
|
||||
msg_prompt_add (MSG_askfspart, isize, isize,
|
||||
@ -282,7 +282,7 @@ int md_make_bsd_partitions (void)
|
||||
msg_prompt_add (MSG_mountpoint, NULL,
|
||||
fsmount[part], 20);
|
||||
partstart += partsize;
|
||||
remain = fsdsize - partstart;
|
||||
remain = ptend - partstart;
|
||||
}
|
||||
part++;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.h,v 1.11 2003/04/06 16:12:41 jmmv Exp $ */
|
||||
/* $NetBSD: md.h,v 1.12 2003/05/21 10:05:27 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -67,9 +67,6 @@ EXTERN char *disk_names[]
|
||||
#define DISKLABEL_CMD "disklabel -w -r"
|
||||
|
||||
|
||||
/* Legal start character for a disk for checking input. */
|
||||
#define ISDISKSTART(dn) (dn == 's')
|
||||
|
||||
/* Definition of files to retrieve from ftp. */
|
||||
EXTERN distinfo dist_list[]
|
||||
#ifdef MAIN
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.h,v 1.5 2003/05/07 03:34:23 shin Exp $ */
|
||||
/* $NetBSD: md.h,v 1.6 2003/05/21 10:05:27 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -92,15 +92,6 @@ EXTERN char *disk_names[]
|
||||
#endif
|
||||
;
|
||||
|
||||
/*
|
||||
* Legal start character for a disk for checking input.
|
||||
* this must return 1 for a character that matches the first
|
||||
* characters of each member of disk_names.
|
||||
*
|
||||
* On playstation2, that means matching 'w' for IDE disk.
|
||||
*/
|
||||
#define ISDISKSTART(dn) (dn == 'w')
|
||||
|
||||
/*
|
||||
* Machine-specific command to write a new label to a disk.
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.h,v 1.21 2003/04/06 16:12:42 jmmv Exp $ */
|
||||
/* $NetBSD: md.h,v 1.22 2003/05/21 10:05:27 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -65,13 +65,6 @@ EXTERN char *disk_names[]
|
||||
#endif
|
||||
;
|
||||
|
||||
/*
|
||||
* Legal start character for a disk for checking input.
|
||||
* this must return 1 for a character that matches the first
|
||||
* characters of each member of disk_names.
|
||||
*/
|
||||
#define ISDISKSTART(dn) (dn == 'r' || dn == 's')
|
||||
|
||||
/*
|
||||
* Machine-specific command to write a new label to a disk.
|
||||
* If not defined, we assume the port does not support disklabels and
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.c,v 1.7 2003/05/07 10:20:24 dsl Exp $ */
|
||||
/* $NetBSD: md.c,v 1.8 2003/05/21 10:05:27 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -140,7 +140,7 @@ md_make_bsd_partitions(void)
|
||||
|
||||
/* Ask for layout type -- standard or special */
|
||||
msg_display(MSG_layout,
|
||||
(1.0*fsptsize*sectorsize)/MEG,
|
||||
(1.0*ptsize*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG+rammb+XNEEDMB);
|
||||
process_menu(MENU_layout);
|
||||
@ -158,7 +158,7 @@ md_make_bsd_partitions(void)
|
||||
/* Partitions C is predefined. */
|
||||
bsdlabel[D].pi_fstype = FS_UNUSED;
|
||||
bsdlabel[D].pi_offset = 0;
|
||||
bsdlabel[D].pi_size = fsdsize;
|
||||
bsdlabel[D].pi_size = dlsize;
|
||||
|
||||
/* Standard fstypes */
|
||||
bsdlabel[A].pi_fstype = FS_BSDFFS;
|
||||
@ -180,7 +180,7 @@ md_make_bsd_partitions(void)
|
||||
i = NUMSEC(20+2*rammb, MEG/sectorsize, dlcylsize);
|
||||
i += NUMSEC(layoutkind * 2 * (rammb < 16 ? 16 : rammb),
|
||||
MEG/sectorsize, dlcylsize);
|
||||
if ( i > fsptsize) {
|
||||
if ( i > ptsize) {
|
||||
msg_display(MSG_disktoosmall);
|
||||
process_menu(MENU_ok);
|
||||
goto custom;
|
||||
@ -206,7 +206,7 @@ md_make_bsd_partitions(void)
|
||||
partstart += partsize;
|
||||
|
||||
/* /usr */
|
||||
partsize = fsptsize - (partstart - ptstart);
|
||||
partsize = ptsize - (partstart - ptstart);
|
||||
bsdlabel[D].pi_fstype = FS_BSDFFS;
|
||||
bsdlabel[D].pi_offset = partstart;
|
||||
bsdlabel[D].pi_size = partsize;
|
||||
@ -219,7 +219,7 @@ md_make_bsd_partitions(void)
|
||||
custom: ask_sizemult(dlcylsize);
|
||||
msg_display(MSG_defaultunit, multname);
|
||||
partstart = ptstart;
|
||||
remain = fsptsize;
|
||||
remain = ptsize;
|
||||
|
||||
/* root */
|
||||
i = NUMSEC(20+2*rammb, MEG/sectorsize, dlcylsize) + partstart;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.h,v 1.3 2003/04/06 16:12:42 jmmv Exp $ */
|
||||
/* $NetBSD: md.h,v 1.4 2003/05/21 10:05:27 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -111,15 +111,6 @@ EXTERN char *disk_names[]
|
||||
;
|
||||
|
||||
|
||||
/*
|
||||
* Legal start character for a disk for checking input.
|
||||
* this must return 1 for a character that matches the first
|
||||
* characters of each member of disk_names.
|
||||
*
|
||||
* On prep, that means matching 'w' for st-506/ide and 's' for sd.
|
||||
*/
|
||||
#define ISDISKSTART(dn) (dn == 'w' || dn == 's')
|
||||
|
||||
/*
|
||||
* Machine-specific command to write a new label to a disk.
|
||||
* For example, i386 uses "/sbin/disklabel -w -r", just like i386
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.c,v 1.7 2003/05/07 10:20:24 dsl Exp $ */
|
||||
/* $NetBSD: md.c,v 1.8 2003/05/21 10:05:27 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -128,7 +128,7 @@ int md_make_bsd_partitions (void)
|
||||
editlab:
|
||||
/* Ask for layout type -- standard or special */
|
||||
msg_display (MSG_layout,
|
||||
(1.0*fsptsize*sectorsize)/MEG,
|
||||
(1.0*ptsize*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG+rammb+XNEEDMB);
|
||||
process_menu (MENU_layout);
|
||||
@ -147,11 +147,11 @@ editlab:
|
||||
/* Partitions C and D are predefined. */
|
||||
bsdlabel[C].pi_fstype = FS_UNUSED;
|
||||
bsdlabel[C].pi_offset = ptstart;
|
||||
bsdlabel[C].pi_size = fsptsize;
|
||||
bsdlabel[C].pi_size = ptsize;
|
||||
|
||||
bsdlabel[D].pi_fstype = FS_UNUSED;
|
||||
bsdlabel[D].pi_offset = 0;
|
||||
bsdlabel[D].pi_size = fsdsize;
|
||||
bsdlabel[D].pi_size = dlsize;
|
||||
|
||||
/* Standard fstypes */
|
||||
bsdlabel[A].pi_fstype = FS_BSDFFS;
|
||||
@ -189,7 +189,7 @@ editlab:
|
||||
partstart += partsize;
|
||||
|
||||
/* /usr */
|
||||
partsize = fsptsize - (partstart - ptstart);
|
||||
partsize = ptsize - (partstart - ptstart);
|
||||
bsdlabel[E].pi_fstype = FS_BSDFFS;
|
||||
bsdlabel[E].pi_offset = partstart;
|
||||
bsdlabel[E].pi_size = partsize;
|
||||
@ -202,7 +202,7 @@ editlab:
|
||||
case 3: /* custom: ask user for all sizes */
|
||||
ask_sizemult(dlcylsize);
|
||||
partstart = ptstart;
|
||||
remain = fsptsize;
|
||||
remain = ptsize;
|
||||
|
||||
/* root */
|
||||
i = NUMSEC(20+2*rammb, MEG/sectorsize, dlcylsize) + partstart;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.h,v 1.3 2003/04/06 16:12:42 jmmv Exp $ */
|
||||
/* $NetBSD: md.h,v 1.4 2003/05/21 10:05:28 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -97,15 +97,6 @@ EXTERN char *disk_names[]
|
||||
;
|
||||
|
||||
|
||||
/*
|
||||
* Legal start character for a disk for checking input.
|
||||
* this must return 1 for a character that matches the first
|
||||
* characters of each member of disk_names.
|
||||
*
|
||||
* On bebox, that means matching 'w' for st-506/ide and 's' for sd.
|
||||
*/
|
||||
#define ISDISKSTART(dn) (dn == 'w' || dn == 's')
|
||||
|
||||
/*
|
||||
* Machine-specific command to write a new label to a disk.
|
||||
* For example, bebox uses "/sbin/disklabel -w -r", just like bebox
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.c,v 1.4 2003/02/12 11:10:08 bouyer Exp $ */
|
||||
/* $NetBSD: md.c,v 1.5 2003/05/21 10:05:28 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -74,8 +74,6 @@ md_get_info(void)
|
||||
dlcyl = disk->dd_cyl;
|
||||
dlhead = disk->dd_head;
|
||||
dlsec = disk->dd_sec;
|
||||
fsdsize = dlsize;
|
||||
fsdmb = fsdsize / MEG;
|
||||
|
||||
/* Compute minimum NetBSD partition sizes (in sectors). */
|
||||
minfsdmb = STDNEEDMB * (MEG / sectorsize);
|
||||
@ -116,10 +114,11 @@ md_make_bsd_partitions(void)
|
||||
char isize[SSTRSIZE];
|
||||
int maxpart = getmaxpartitions();
|
||||
struct disklabel l;
|
||||
int ptend;
|
||||
|
||||
/* Ask for layout type -- standard or special */
|
||||
msg_display(MSG_layout,
|
||||
(1.0*fsptsize*sectorsize)/MEG,
|
||||
(1.0*ptsize*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG+rammb+XNEEDMB);
|
||||
process_menu(MENU_layout);
|
||||
@ -134,6 +133,7 @@ md_make_bsd_partitions(void)
|
||||
|
||||
/* Build standard partitions */
|
||||
emptylabel(bsdlabel);
|
||||
ptend = dlsize;
|
||||
|
||||
/* Partitions C and D are predefined. */
|
||||
bsdlabel[C].pi_fstype = FS_UNUSED;
|
||||
@ -156,7 +156,6 @@ md_make_bsd_partitions(void)
|
||||
bsdlabel[F].pi_fstype = FS_UNUSED;
|
||||
bsdlabel[G].pi_fstype = FS_UNUSED;
|
||||
bsdlabel[H].pi_fstype = FS_UNUSED;
|
||||
fsdsize -= BOOT_SIZE;
|
||||
partstart = BOOT_SIZE;
|
||||
|
||||
switch (layoutkind) {
|
||||
@ -183,7 +182,7 @@ md_make_bsd_partitions(void)
|
||||
partstart += partsize;
|
||||
|
||||
/* /usr */
|
||||
partsize = fsdsize - partstart;
|
||||
partsize = ptend - partstart;
|
||||
bsdlabel[E].pi_fstype = FS_BSDFFS;
|
||||
bsdlabel[E].pi_offset = partstart;
|
||||
bsdlabel[E].pi_size = partsize;
|
||||
@ -195,7 +194,7 @@ md_make_bsd_partitions(void)
|
||||
|
||||
case 3: /* custom: ask user for all sizes */
|
||||
ask_sizemult(dlcylsize);
|
||||
remain = fsdsize;
|
||||
remain = ptend;
|
||||
|
||||
/* root */
|
||||
i = NUMSEC(20+2*rammb, MEG/sectorsize, dlcylsize) + partstart;
|
||||
@ -213,7 +212,7 @@ md_make_bsd_partitions(void)
|
||||
partstart += partsize;
|
||||
|
||||
/* swap */
|
||||
remain = fsdsize - partstart;
|
||||
remain = ptend - partstart;
|
||||
i = NUMSEC( 2 * (rammb < 16 ? 16 : rammb),
|
||||
MEG/sectorsize, dlcylsize) + partstart;
|
||||
partsize = NUMSEC(i/(MEG/sectorsize)+1, MEG/sectorsize,
|
||||
@ -227,9 +226,9 @@ md_make_bsd_partitions(void)
|
||||
partstart += partsize;
|
||||
|
||||
/* /usr */
|
||||
remain = fsdsize - partstart;
|
||||
remain = ptend - partstart;
|
||||
if (remain > 0) {
|
||||
partsize = fsdsize - partstart;
|
||||
partsize = ptend - partstart;
|
||||
snprintf(isize, SSTRSIZE, "%d", partsize/sizemult);
|
||||
msg_prompt_add(MSG_askfsusr, isize, isize, SSTRSIZE,
|
||||
remain/sizemult, multname);
|
||||
@ -246,13 +245,13 @@ md_make_bsd_partitions(void)
|
||||
}
|
||||
|
||||
/* Others ... */
|
||||
remain = fsdsize - partstart;
|
||||
remain = ptend - partstart;
|
||||
part = D;
|
||||
if (remain > 0)
|
||||
msg_display(MSG_otherparts);
|
||||
while (remain > 0 && part <= H) {
|
||||
if (bsdlabel[part].pi_fstype == FS_UNUSED) {
|
||||
partsize = fsdsize - partstart;
|
||||
partsize = ptend - partstart;
|
||||
snprintf(isize, SSTRSIZE, "%d",
|
||||
partsize/sizemult);
|
||||
msg_prompt_add(MSG_askfspart, isize, isize,
|
||||
@ -271,7 +270,7 @@ md_make_bsd_partitions(void)
|
||||
msg_prompt_add(MSG_mountpoint, NULL,
|
||||
fsmount[part], 20);
|
||||
partstart += partsize;
|
||||
remain = fsdsize - partstart;
|
||||
remain = ptend - partstart;
|
||||
}
|
||||
part++;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.h,v 1.7 2003/04/06 16:12:42 jmmv Exp $ */
|
||||
/* $NetBSD: md.h,v 1.8 2003/05/21 10:05:28 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -66,13 +66,6 @@ EXTERN char *disk_names[]
|
||||
#endif
|
||||
;
|
||||
|
||||
/*
|
||||
* Legal start character for a disk for checking input.
|
||||
* this must return 1 for a character that matches the first
|
||||
* characters of each member of disk_names.
|
||||
*/
|
||||
#define ISDISKSTART(dn) (dn == 'r' || dn == 's')
|
||||
|
||||
/*
|
||||
* Machine-specific command to write a new label to a disk.
|
||||
* If not defined, we assume the port does not support disklabels and
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.c,v 1.5 2002/12/05 01:17:29 fvdl Exp $ */
|
||||
/* $NetBSD: md.c,v 1.6 2003/05/21 10:05:28 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -140,13 +140,10 @@ md_make_bsd_partitions(void)
|
||||
* Standard 4.3BSD 8-partition labels always cover whole disk.
|
||||
*/
|
||||
ptsize = dlsize - ptstart;
|
||||
fsdsize = dlsize; /* actually means `whole disk' */
|
||||
fsptsize = dlsize - ptstart; /* netbsd partition -- same as above */
|
||||
fsdmb = fsdsize / MEG;
|
||||
|
||||
/* Ask for layout type -- standard or special */
|
||||
msg_display (MSG_layout,
|
||||
(1.0*fsptsize*sectorsize)/MEG,
|
||||
(1.0*ptsize*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG+rammb+XNEEDMB);
|
||||
process_menu(MENU_layout);
|
||||
@ -206,7 +203,7 @@ md_make_bsd_partitions(void)
|
||||
partstart += partsize;
|
||||
|
||||
/* /usr */
|
||||
partsize = fsptsize - (partstart - ptstart);
|
||||
partsize = ptsize - (partstart - ptstart);
|
||||
bsdlabel[D].pi_fstype = FS_BSDFFS;
|
||||
bsdlabel[D].pi_offset = partstart;
|
||||
bsdlabel[D].pi_size = partsize;
|
||||
@ -219,7 +216,7 @@ md_make_bsd_partitions(void)
|
||||
case 3: /* custom: ask user for all sizes */
|
||||
ask_sizemult(dlcylsize);
|
||||
partstart = ptstart;
|
||||
remain = fsptsize;
|
||||
remain = ptsize;
|
||||
|
||||
/* root */
|
||||
i = NUMSEC(24+2*rammb, MEG/sectorsize, dlcylsize) + partstart;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.h,v 1.4 2003/04/06 16:12:43 jmmv Exp $ */
|
||||
/* $NetBSD: md.h,v 1.5 2003/05/21 10:05:28 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -87,15 +87,6 @@ EXTERN char *disk_names[]
|
||||
#endif
|
||||
;
|
||||
|
||||
/*
|
||||
* Legal start character for a disk for checking input.
|
||||
* this must return 1 for a character that matches the first
|
||||
* characters of each member of disk_names.
|
||||
*
|
||||
* On shark, that means matching 'w' for ide and 's' for sd.
|
||||
*/
|
||||
#define ISDISKSTART(dn) (dn == 'w' || dn == 's')
|
||||
|
||||
/*
|
||||
* Machine-specific command to write a new label to a disk.
|
||||
* For example, shark uses "/sbin/disklabel -w -r".
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.h,v 1.13 2003/04/06 16:12:43 jmmv Exp $ */
|
||||
/* $NetBSD: md.h,v 1.14 2003/05/21 10:05:28 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -98,13 +98,6 @@ EXTERN char *disk_names[]
|
||||
#endif
|
||||
;
|
||||
|
||||
/*
|
||||
* Legal start character for a disk for checking input.
|
||||
* this must return 1 for a character that matches the first
|
||||
* characters of each member of disk_names.
|
||||
*/
|
||||
#define ISDISKSTART(dn) (dn == 'x' || dn == 's')
|
||||
|
||||
/*
|
||||
* Machine-specific command to write a new label to a disk.
|
||||
* If not defined, we assume the port does not support disklabels and
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.h,v 1.5 2003/04/06 16:12:43 jmmv Exp $ */
|
||||
/* $NetBSD: md.h,v 1.6 2003/05/21 10:05:28 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -93,13 +93,6 @@ EXTERN char *disk_names[]
|
||||
#endif
|
||||
;
|
||||
|
||||
/*
|
||||
* Legal start character for a disk for checking input.
|
||||
* this must return 1 for a character that matches the first
|
||||
* characters of each member of disk_names.
|
||||
*/
|
||||
#define ISDISKSTART(dn) (dn == 'w' || dn == 's')
|
||||
|
||||
/*
|
||||
* Machine-specific command to write a new label to a disk.
|
||||
* If not defined, we assume the port does not support disklabels and
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.h,v 1.10 2003/04/06 16:12:43 jmmv Exp $ */
|
||||
/* $NetBSD: md.h,v 1.11 2003/05/21 10:05:29 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -93,13 +93,6 @@ EXTERN char *disk_names[]
|
||||
#endif
|
||||
;
|
||||
|
||||
/*
|
||||
* Legal start character for a disk for checking input.
|
||||
* this must return 1 for a character that matches the first
|
||||
* characters of each member of disk_names.
|
||||
*/
|
||||
#define ISDISKSTART(dn) (dn == 's' || dn == 'r' || dn == 'h')
|
||||
|
||||
/*
|
||||
* Machine-specific command to write a new label to a disk.
|
||||
* If not defined, we assume the port does not support disklabels and
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: md.h,v 1.8 2003/04/06 16:12:43 jmmv Exp $ */
|
||||
/* $NetBSD: md.h,v 1.9 2003/05/21 10:05:29 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -112,15 +112,6 @@ EXTERN char *disk_names[]
|
||||
#endif
|
||||
;
|
||||
|
||||
/*
|
||||
* Legal start character for a disk for checking input.
|
||||
* this must return 1 for a character that matches the first
|
||||
* characters of each member of disk_names.
|
||||
*
|
||||
* On x68k, that means matching 's' for sd.
|
||||
*/
|
||||
#define ISDISKSTART(dn) (dn == 's')
|
||||
|
||||
/*
|
||||
* Machine-specific command to write a new label to a disk.
|
||||
* For example, i386 uses "/sbin/disklabel -w -r", just like i386
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: bsddisklabel.c,v 1.6 2002/08/02 05:11:29 grant Exp $ */
|
||||
/* $NetBSD: bsddisklabel.c,v 1.7 2003/05/21 10:05:20 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -39,36 +39,121 @@
|
||||
/* bsddisklabel.c -- generate standard BSD disklabel */
|
||||
/* Included by appropriate arch/XXXX/md.c */
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <sys/exec.h>
|
||||
#include <sys/utsname.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <machine/cpu.h>
|
||||
#include <stdio.h>
|
||||
#include <stddef.h>
|
||||
#include <util.h>
|
||||
#include <dirent.h>
|
||||
#include "defs.h"
|
||||
#include "md.h"
|
||||
#include "endian.h"
|
||||
#include "msg_defs.h"
|
||||
#include "menu_defs.h"
|
||||
|
||||
/* For the current state of this file blame abs@netbsd.org */
|
||||
/* Even though he wasn't the last to hack it, but he did admit doing so :-) */
|
||||
|
||||
/* Defaults for things that might be defined in md.h */
|
||||
#ifndef PART_ROOT
|
||||
#define PART_ROOT A
|
||||
#endif
|
||||
#ifndef PART_SWAP
|
||||
#define PART_SWAP B
|
||||
#endif
|
||||
#ifndef PART_USR
|
||||
#define PART_USR -1
|
||||
#endif
|
||||
|
||||
#ifndef DEFSWAPRAM
|
||||
#define DEFSWAPRAM 32
|
||||
#endif
|
||||
|
||||
#ifndef DEFVARSIZE
|
||||
#define DEFVARSIZE 32
|
||||
#endif
|
||||
#ifndef DEFROOTSIZE
|
||||
#define DEFROOTSIZE 32
|
||||
#endif
|
||||
#ifndef DEFUSRSIZE
|
||||
#define DEFUSRSIZE 128
|
||||
#endif
|
||||
#ifndef STDNEEDMB
|
||||
#define STDNEEDMB 100
|
||||
#endif
|
||||
|
||||
int make_bsd_partitions (void);
|
||||
|
||||
static int
|
||||
save_ptn(int ptn, int start, int size, int fstype, const char *mountpt)
|
||||
{
|
||||
int maxptn;
|
||||
|
||||
if (ptn == -1) {
|
||||
maxptn = getmaxpartitions();
|
||||
ptn = getrawpartition() + 1;
|
||||
#ifdef PART_FIRST_FREE
|
||||
if (ptn < PART_FIRST_FREE)
|
||||
ptn = PART_FIRST_FREE;
|
||||
#endif
|
||||
for (;; ptn++) {
|
||||
if (ptn >= maxptn)
|
||||
return -1;
|
||||
if (ptn == PART_USR)
|
||||
continue;
|
||||
if (bsdlabel[ptn].pi_fstype == FS_UNUSED)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (fstype == FS_UNUSED)
|
||||
return ptn;
|
||||
|
||||
bsdlabel[ptn].pi_fstype = fstype;
|
||||
bsdlabel[ptn].pi_offset = start;
|
||||
bsdlabel[ptn].pi_size = size;
|
||||
if (fstype == FS_BSDFFS) {
|
||||
bsdlabel[ptn].pi_bsize = 8192;
|
||||
bsdlabel[ptn].pi_fsize = 1024;
|
||||
}
|
||||
if (mountpt)
|
||||
strlcpy(fsmount[ptn], mountpt, sizeof fsmount[0]);
|
||||
|
||||
return ptn;
|
||||
}
|
||||
|
||||
/*
|
||||
* md back-end code for menu-driven BSD disklabel editor.
|
||||
*/
|
||||
int
|
||||
make_bsd_partitions(void)
|
||||
{
|
||||
int i, part;
|
||||
int freepart;
|
||||
int i;
|
||||
int part;
|
||||
int remain;
|
||||
char isize[20];
|
||||
int maxpart = getmaxpartitions();
|
||||
struct disklabel l;
|
||||
int varsz = 0, swapsz = 0;
|
||||
int part_raw, part_bsd;
|
||||
int ptend;
|
||||
|
||||
/*
|
||||
* Initialize global variables that track space used on this disk.
|
||||
* Standard 4.4BSD 8-partition labels always cover whole disk.
|
||||
*/
|
||||
ptsize = dlsize - ptstart;
|
||||
fsdsize = dlsize; /* actually means `whole disk' */
|
||||
fsptsize = dlsize - ptstart; /* netbsd partition -- same as above */
|
||||
fsdmb = fsdsize / MEG;
|
||||
if (ptsize == 0)
|
||||
ptsize = dlsize - ptstart;
|
||||
ptend = ptstart + ptsize;
|
||||
|
||||
/* Ask for layout type -- standard or special */
|
||||
msg_display(MSG_layout,
|
||||
(1.0*fsptsize*sectorsize)/MEG,
|
||||
(1.0*ptsize*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG,
|
||||
(1.0*minfsdmb*sectorsize)/MEG+rammb+XNEEDMB);
|
||||
process_menu(MENU_layout);
|
||||
@ -85,19 +170,19 @@ make_bsd_partitions(void)
|
||||
for (part = 0 ; part < maxpart ; ++part)
|
||||
bsdlabel[part].pi_fstype = FS_UNUSED;
|
||||
|
||||
/* We _always_ have a root partition */
|
||||
bsdlabel[PART_ROOT].pi_fstype = FS_BSDFFS;
|
||||
bsdlabel[PART_ROOT].pi_bsize = 8192;
|
||||
bsdlabel[PART_ROOT].pi_fsize = 1024;
|
||||
|
||||
/* Whole disk partition */
|
||||
bsdlabel[PART_RAW].pi_offset = 0;
|
||||
bsdlabel[PART_RAW].pi_size = dlsize;
|
||||
part_raw = getrawpartition();
|
||||
if (part_raw == -1)
|
||||
part_raw = C; /* for sanity... */
|
||||
bsdlabel[part_raw].pi_offset = 0;
|
||||
bsdlabel[part_raw].pi_size = dlsize;
|
||||
|
||||
#ifdef PART_BSDRAW /* BSD area of the disk - only on some (i386) ports */
|
||||
bsdlabel[PART_BSDRAW].pi_offset = ptstart;
|
||||
bsdlabel[PART_BSDRAW].pi_size = fsptsize;
|
||||
#endif
|
||||
if (part_raw == D) {
|
||||
part_bsd = C;
|
||||
bsdlabel[C].pi_offset = ptstart;
|
||||
bsdlabel[C].pi_size = ptsize;
|
||||
} else
|
||||
part_bsd = part_raw;
|
||||
|
||||
switch (layoutkind) {
|
||||
case 1: /* standard: a root, b swap, c "unused", PART_USR /usr */
|
||||
@ -116,7 +201,6 @@ make_bsd_partitions(void)
|
||||
*/
|
||||
layout_swap = layout_usr = 1;
|
||||
layout_var = layout_home = layout_tmp = 0;
|
||||
freepart = PART_FIRST_FREE;
|
||||
process_menu(MENU_layoutparts);
|
||||
|
||||
/* Root */
|
||||
@ -141,14 +225,10 @@ make_bsd_partitions(void)
|
||||
else
|
||||
partsize = NUMSEC(STDNEEDMB, MEG/sectorsize, dlcylsize);
|
||||
|
||||
bsdlabel[PART_ROOT].pi_offset = partstart;
|
||||
bsdlabel[PART_ROOT].pi_size = partsize;
|
||||
bsdlabel[PART_ROOT].pi_bsize = 8192;
|
||||
bsdlabel[PART_ROOT].pi_fsize = 1024;
|
||||
strcpy(fsmount[PART_ROOT], "/");
|
||||
save_ptn(PART_ROOT, partstart, partsize, FS_BSDFFS, "/");
|
||||
partstart += partsize;
|
||||
#if notyet
|
||||
if (partstart > ptsize)
|
||||
if (partstart > ptend)
|
||||
error ...
|
||||
#endif
|
||||
|
||||
@ -163,12 +243,10 @@ make_bsd_partitions(void)
|
||||
partsize = NUMSEC(i/(MEG/sectorsize)+1,
|
||||
MEG/sectorsize, dlcylsize) - partstart;
|
||||
}
|
||||
bsdlabel[PART_SWAP].pi_fstype = FS_SWAP;
|
||||
bsdlabel[PART_SWAP].pi_offset = partstart;
|
||||
bsdlabel[PART_SWAP].pi_size = partsize;
|
||||
save_ptn(PART_SWAP, partstart, partsize, FS_SWAP, 0);
|
||||
partstart += partsize;
|
||||
#if notyet
|
||||
if (partstart > ptsize)
|
||||
if (partstart > ptend)
|
||||
error ...
|
||||
#endif
|
||||
}
|
||||
@ -180,17 +258,10 @@ make_bsd_partitions(void)
|
||||
else
|
||||
partsize = NUMSEC(DEFVARSIZE, MEG/sectorsize,
|
||||
dlcylsize);
|
||||
bsdlabel[freepart].pi_fstype = FS_BSDFFS;
|
||||
bsdlabel[freepart].pi_offset = partstart;
|
||||
bsdlabel[freepart].pi_size = partsize;
|
||||
bsdlabel[freepart].pi_bsize = 8192;
|
||||
bsdlabel[freepart].pi_fsize = 1024;
|
||||
strcpy(fsmount[freepart++], "/var");
|
||||
if (freepart == PART_USR)
|
||||
freepart++;
|
||||
save_ptn(-1, partstart, partsize, FS_BSDFFS, "/var");
|
||||
partstart += partsize;
|
||||
#if notyet
|
||||
if (partstart > ptsize)
|
||||
if (partstart > ptend)
|
||||
error ...
|
||||
#endif
|
||||
}
|
||||
@ -205,34 +276,22 @@ make_bsd_partitions(void)
|
||||
partsize = NUMSEC(DEFUSRSIZE,
|
||||
MEG/sectorsize, dlcylsize);
|
||||
} else
|
||||
partsize = fsdsize - partstart;
|
||||
bsdlabel[PART_USR].pi_fstype = FS_BSDFFS;
|
||||
bsdlabel[PART_USR].pi_offset = partstart;
|
||||
bsdlabel[PART_USR].pi_size = partsize;
|
||||
bsdlabel[PART_USR].pi_bsize = 8192;
|
||||
bsdlabel[PART_USR].pi_fsize = 1024;
|
||||
strcpy(fsmount[PART_USR], "/usr");
|
||||
partsize = ptend - partstart;
|
||||
save_ptn(PART_USR, partstart, partsize, FS_BSDFFS, "/usr");
|
||||
partstart += partsize;
|
||||
#if notyet
|
||||
if (partstart > ptsize)
|
||||
if (partstart > ptend)
|
||||
error ...
|
||||
#endif
|
||||
}
|
||||
|
||||
/* home */
|
||||
if (layout_home) {
|
||||
partsize = fsdsize - partstart;
|
||||
bsdlabel[freepart].pi_fstype = FS_BSDFFS;
|
||||
bsdlabel[freepart].pi_offset = partstart;
|
||||
bsdlabel[freepart].pi_size = partsize;
|
||||
bsdlabel[freepart].pi_bsize = 8192;
|
||||
bsdlabel[freepart].pi_fsize = 1024;
|
||||
strcpy(fsmount[freepart++], "/home");
|
||||
if (freepart == PART_USR)
|
||||
freepart++;
|
||||
partsize = ptend - partstart;
|
||||
save_ptn(-1, partstart, partsize, FS_BSDFFS, "/home");
|
||||
partstart += partsize;
|
||||
#if notyet
|
||||
if (partstart > ptsize)
|
||||
if (partstart > ptend)
|
||||
error ...
|
||||
#endif
|
||||
}
|
||||
@ -243,24 +302,20 @@ make_bsd_partitions(void)
|
||||
ask_sizemult(dlcylsize);
|
||||
/* root */
|
||||
partstart = ptstart;
|
||||
remain = fsdsize - partstart;
|
||||
remain = ptend - partstart;
|
||||
partsize = NUMSEC(DEFROOTSIZE, MEG/sectorsize, dlcylsize);
|
||||
snprintf(isize, 20, "%d", partsize/sizemult);
|
||||
msg_prompt(MSG_askfsroot, isize, isize, 20,
|
||||
remain/sizemult, multname);
|
||||
partsize = NUMSEC(atoi(isize),sizemult, dlcylsize);
|
||||
partsize = NUMSEC(atoi(isize), sizemult, dlcylsize);
|
||||
/* If less than a 'unit' left, also use it */
|
||||
if (remain - partsize < sizemult)
|
||||
partsize = remain;
|
||||
bsdlabel[PART_ROOT].pi_offset = partstart;
|
||||
bsdlabel[PART_ROOT].pi_size = partsize;
|
||||
bsdlabel[PART_ROOT].pi_bsize = 8192;
|
||||
bsdlabel[PART_ROOT].pi_fsize = 1024;
|
||||
strcpy(fsmount[PART_ROOT], "/");
|
||||
save_ptn(PART_ROOT, partstart, partsize, FS_BSDFFS, "/");
|
||||
partstart += partsize;
|
||||
|
||||
/* swap */
|
||||
remain = fsdsize - partstart;
|
||||
remain = ptend - partstart;
|
||||
if (remain > 0) {
|
||||
i = NUMSEC(2 *
|
||||
(rammb < DEFSWAPRAM ? DEFSWAPRAM : rammb),
|
||||
@ -272,66 +327,54 @@ make_bsd_partitions(void)
|
||||
snprintf(isize, 20, "%d", partsize/sizemult);
|
||||
msg_prompt_add(MSG_askfsswap, isize, isize, 20,
|
||||
remain/sizemult, multname);
|
||||
partsize = NUMSEC(atoi(isize),sizemult, dlcylsize);
|
||||
partsize = NUMSEC(atoi(isize), sizemult, dlcylsize);
|
||||
if (partsize) {
|
||||
/* If less than a 'unit' left, also use it */
|
||||
if (remain - partsize < sizemult)
|
||||
partsize = remain;
|
||||
bsdlabel[PART_SWAP].pi_fstype = FS_SWAP;
|
||||
bsdlabel[PART_SWAP].pi_offset = partstart;
|
||||
bsdlabel[PART_SWAP].pi_size = partsize;
|
||||
save_ptn(PART_SWAP, partstart, partsize, FS_SWAP, 0);
|
||||
partstart += partsize;
|
||||
}
|
||||
}
|
||||
|
||||
/* /usr */
|
||||
remain = fsdsize - partstart;
|
||||
remain = ptend - partstart;
|
||||
if (remain > 0) {
|
||||
partsize = remain;
|
||||
snprintf(isize, 20, "%d", partsize/sizemult);
|
||||
msg_prompt_add(MSG_askfsusr, isize, isize, 20,
|
||||
remain/sizemult, multname);
|
||||
partsize = NUMSEC(atoi(isize),sizemult, dlcylsize);
|
||||
partsize = NUMSEC(atoi(isize), sizemult, dlcylsize);
|
||||
if (partsize) {
|
||||
/* If less than a 'unit' left, also use it */
|
||||
if (remain - partsize < sizemult)
|
||||
partsize = remain;
|
||||
bsdlabel[PART_USR].pi_fstype = FS_BSDFFS;
|
||||
bsdlabel[PART_USR].pi_offset = partstart;
|
||||
bsdlabel[PART_USR].pi_size = partsize;
|
||||
bsdlabel[PART_USR].pi_bsize = 8192;
|
||||
bsdlabel[PART_USR].pi_fsize = 1024;
|
||||
strcpy(fsmount[PART_USR], "/usr");
|
||||
save_ptn(PART_USR, partstart, partsize, FS_BSDFFS, "/usr");
|
||||
partstart += partsize;
|
||||
}
|
||||
}
|
||||
|
||||
/* Others ... */
|
||||
remain = fsdsize - partstart;
|
||||
remain = ptend - partstart;
|
||||
if (remain > 0)
|
||||
msg_display(MSG_otherparts);
|
||||
part = PART_FIRST_FREE;
|
||||
for (; remain > 0 && part < maxpart; ++part ) {
|
||||
part = save_ptn(-1, 0, 0, FS_UNUSED, 0);
|
||||
for (; remain > 0 && part < maxpart; ++part) {
|
||||
if (bsdlabel[part].pi_fstype != FS_UNUSED)
|
||||
continue;
|
||||
partsize = fsdsize - partstart;
|
||||
partsize = ptend - partstart;
|
||||
snprintf(isize, 20, "%d", partsize/sizemult);
|
||||
msg_prompt_add(MSG_askfspart, isize, isize, 20,
|
||||
diskdev, partition_name(part),
|
||||
remain/sizemult, multname);
|
||||
partsize = NUMSEC(atoi(isize),sizemult, dlcylsize);
|
||||
partsize = NUMSEC(atoi(isize), sizemult, dlcylsize);
|
||||
/* If less than a 'unit' left, also use it */
|
||||
if (remain - partsize < sizemult)
|
||||
partsize = remain;
|
||||
bsdlabel[part].pi_fstype = FS_BSDFFS;
|
||||
bsdlabel[part].pi_offset = partstart;
|
||||
bsdlabel[part].pi_size = partsize;
|
||||
bsdlabel[part].pi_bsize = 8192;
|
||||
bsdlabel[part].pi_fsize = 1024;
|
||||
msg_prompt_add(MSG_mountpoint, NULL, fsmount[part],
|
||||
20);
|
||||
save_ptn(-1, partstart, partsize, FS_BSDFFS, 0);
|
||||
msg_prompt_add(MSG_mountpoint, NULL, fsmount[part], 20);
|
||||
partstart += partsize;
|
||||
remain = fsdsize - partstart;
|
||||
remain = ptend - partstart;
|
||||
}
|
||||
|
||||
break;
|
||||
@ -347,7 +390,7 @@ make_bsd_partitions(void)
|
||||
#define p l.d_partitions[i]
|
||||
bsdlabel[i].pi_size = p.p_size;
|
||||
bsdlabel[i].pi_offset = p.p_offset;
|
||||
if (i != RAW_PART) {
|
||||
if (i != part_raw) {
|
||||
bsdlabel[i].pi_fstype = p.p_fstype;
|
||||
bsdlabel[i].pi_bsize = p.p_fsize * p.p_frag;
|
||||
bsdlabel[i].pi_fsize = p.p_fsize;
|
||||
@ -366,7 +409,7 @@ make_bsd_partitions(void)
|
||||
* edit it and verify it's OK, or abort altogether.
|
||||
*/
|
||||
edit_check:
|
||||
if (edit_and_check_label(bsdlabel, maxpart, RAW_PART, RAW_PART) == 0) {
|
||||
if (edit_and_check_label(bsdlabel, maxpart, part_raw, part_bsd) == 0) {
|
||||
msg_display(MSG_abort);
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: defs.h,v 1.77 2003/05/18 20:40:09 dsl Exp $ */
|
||||
/* $NetBSD: defs.h,v 1.78 2003/05/21 10:05:20 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -163,22 +163,17 @@ EXTERN char swapdev[SSTRSIZE] INIT("");
|
||||
/* Used in editing partitions ... BSD disklabel and others */
|
||||
EXTERN int editpart;
|
||||
|
||||
/* Partition start and size in disk sectors. */
|
||||
/* Area of disk we can allocate, start and size in disk sectors. */
|
||||
EXTERN int ptstart, ptsize;
|
||||
|
||||
/* File system disk size. File system partition size. May not include
|
||||
full disk size. */
|
||||
EXTERN int fsdsize, fsptsize;
|
||||
|
||||
|
||||
EXTERN int fsdmb;
|
||||
EXTERN int minfsdmb;
|
||||
EXTERN int partstart;
|
||||
EXTERN int partsize;
|
||||
|
||||
/* set by md_get_info() */
|
||||
/* Actual values for current disk - set by md_get_info() */
|
||||
EXTERN int dlcyl, dlhead, dlsec, dlsize, dlcylsize;
|
||||
EXTERN int current_cylsize;
|
||||
|
||||
/* Information for the NetBSD disklabel */
|
||||
enum DLTR {A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z};
|
||||
#define partition_name(x) ('a' + (x))
|
||||
@ -403,6 +398,7 @@ void unwind_mounts(void);
|
||||
/* from bsddisklabel.c */
|
||||
void show_cur_filesystems(void);
|
||||
extern int layout_swap, layout_usr, layout_tmp, layout_var, layout_home;
|
||||
int make_bsd_partitions(void);
|
||||
|
||||
/* from aout2elf.c */
|
||||
int move_aout_libs(void);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: label.c,v 1.25 2003/01/11 19:44:04 christos Exp $ */
|
||||
/* $NetBSD: label.c,v 1.26 2003/05/21 10:05:20 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Jonathan Stone
|
||||
@ -36,7 +36,7 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
__RCSID("$NetBSD: label.c,v 1.25 2003/01/11 19:44:04 christos Exp $");
|
||||
__RCSID("$NetBSD: label.c,v 1.26 2003/05/21 10:05:20 dsl Exp $");
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
@ -307,7 +307,7 @@ getpartoff(msg_no, defpartstart)
|
||||
(i > ptstart && (i - ptstart) < localsizemult)) {
|
||||
i = ptstart;
|
||||
}
|
||||
if (i > fsdsize) {
|
||||
if (i > dlsize) {
|
||||
msg_display(MSG_startoutsidedisk);
|
||||
continue;
|
||||
}
|
||||
@ -326,7 +326,7 @@ getpartsize(msg_no, partstart, defpartsize)
|
||||
{
|
||||
char isize[20], maxpartc;
|
||||
int i, partend, localsizemult;
|
||||
int fsptend = ptstart + fsptsize;
|
||||
int fsptend = ptstart + ptsize;
|
||||
int partn;
|
||||
|
||||
maxpartc = 'a' + getmaxpartitions() - 1;
|
||||
@ -354,13 +354,13 @@ getpartsize(msg_no, partstart, defpartsize)
|
||||
partend = NUMSEC((partstart + i) / localsizemult,
|
||||
localsizemult, dlcylsize);
|
||||
/* Align to end-of-disk or end-of-slice if close enough */
|
||||
if (fsdsize > partend && (fsdsize - partend) < localsizemult)
|
||||
partend = fsdsize;
|
||||
if (dlsize > partend && (dlsize - partend) < localsizemult)
|
||||
partend = dlsize;
|
||||
if (fsptend > partend && (fsptend - partend) < localsizemult)
|
||||
partend = fsptend;
|
||||
/* sanity checks */
|
||||
if (partend > fsdsize) {
|
||||
partend = fsdsize;
|
||||
if (partend > dlsize) {
|
||||
partend = dlsize;
|
||||
msg_display(MSG_endoutsidedisk,
|
||||
(partend - partstart) / sizemult, multname);
|
||||
process_menu(MENU_ok);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: mbr.c,v 1.34 2003/05/16 19:44:23 dsl Exp $ */
|
||||
/* $NetBSD: mbr.c,v 1.35 2003/05/21 10:05:21 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -228,15 +228,12 @@ edit_mbr(mbr)
|
||||
part[2].mbrp_typ = part[0].mbrp_flag = 0;
|
||||
part[2].mbrp_start = part[0].mbrp_size = 0;
|
||||
part[3].mbrp_typ = dosptyp_nbsd;
|
||||
part[3].mbrp_size = bsize - bsec;
|
||||
part[3].mbrp_size = dlsize - bsec;
|
||||
part[3].mbrp_start = bsec;
|
||||
part[3].mbrp_flag = 0x80;
|
||||
|
||||
ptstart = bsec;
|
||||
ptsize = bsize - bsec;
|
||||
fsdsize = dlsize;
|
||||
fsptsize = dlsize - bsec;
|
||||
fsdmb = fsdsize / MEG;
|
||||
ptsize = dlsize - bsec;
|
||||
activepart = 3;
|
||||
} else {
|
||||
int numbsd, overlap;
|
||||
@ -246,13 +243,14 @@ edit_mbr(mbr)
|
||||
ask_sizemult(bcylsize);
|
||||
bsdpart = freebsdpart = -1;
|
||||
activepart = -1;
|
||||
for (i = 0; i < NMBRPART; i++)
|
||||
for (i = 0; i < NMBRPART; i++) {
|
||||
if (part[i].mbrp_flag != 0) {
|
||||
activepart = i;
|
||||
part[i].mbrp_flag = 0;
|
||||
}
|
||||
}
|
||||
do {
|
||||
process_menu (MENU_editparttable);
|
||||
process_menu(MENU_editparttable);
|
||||
numbsd = 0;
|
||||
bsdpart = -1;
|
||||
freebsdpart = -1;
|
||||
@ -319,12 +317,6 @@ edit_mbr(mbr)
|
||||
|
||||
ptstart = part[bsdpart].mbrp_start;
|
||||
ptsize = part[bsdpart].mbrp_size;
|
||||
fsdsize = dlsize;
|
||||
if (ptstart + ptsize < bsize)
|
||||
fsptsize = ptsize;
|
||||
else
|
||||
fsptsize = dlsize - ptstart;
|
||||
fsdmb = fsdsize / MEG;
|
||||
|
||||
/* Ask if a boot selector is wanted. XXXX */
|
||||
}
|
||||
@ -373,8 +365,8 @@ edit_ptn_bounds(void)
|
||||
size = NUMSEC(inp, sizemult, dlcylsize);
|
||||
if (sizemult > 1 && start == bsec)
|
||||
size -= bsec;
|
||||
if (start + size > bsize)
|
||||
size = bsize - start;
|
||||
if (start + size > dlsize)
|
||||
size = dlsize - start;
|
||||
if (size < 0) {
|
||||
size = 0;
|
||||
start = 0;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: msg.mi.en,v 1.96 2003/04/06 16:12:37 jmmv Exp $ */
|
||||
/* $NetBSD: msg.mi.en,v 1.97 2003/05/21 10:05:21 dsl Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1997 Piermont Information Systems Inc.
|
||||
@ -210,6 +210,29 @@ message defaultunit
|
||||
at the end of input, sizes and offsets are in %s.
|
||||
}
|
||||
|
||||
.if 0
|
||||
message askfsroot
|
||||
{I will be asking for partition sizes and on some, mount points.
|
||||
|
||||
First the root partition. You have %d %s left on your disk.
|
||||
Root partition size? }
|
||||
|
||||
message askfsswap
|
||||
{
|
||||
Next the swap partition. You have %d %s left on your disk.
|
||||
Swap partition size? }
|
||||
|
||||
message askfsusr
|
||||
{
|
||||
Next the /usr partition. You have %d %s left on your disk.
|
||||
/usr partition size? }
|
||||
|
||||
message askfspart
|
||||
{The next partition is /dev/%s%c. You have %d %s left on your disk.
|
||||
Partition size? }
|
||||
.endif
|
||||
|
||||
|
||||
message startoutsidedisk
|
||||
{The start value you specified is beyond the end of the disk.
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user