summaryrefslogtreecommitdiffstats
path: root/lib/libdisk/rules.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1995-05-03 06:30:59 +0000
committerphk <phk@FreeBSD.org>1995-05-03 06:30:59 +0000
commitaf83fa703c134aa38db0de2662d3a56819a501f9 (patch)
tree85625b62bb713949dc08bb262bb93941e5c861bb /lib/libdisk/rules.c
parent8f856ffcfd3b5de2138f01c117f1b30a60e0cf7d (diff)
downloadFreeBSD-src-af83fa703c134aa38db0de2662d3a56819a501f9.zip
FreeBSD-src-af83fa703c134aa38db0de2662d3a56819a501f9.tar.gz
Make the target for tst01 more sensible.
Remove bogus targets. Allocate partition letters as follows: lowest offset "flags & CHUNK_IS_ROOT" gets 'a', lowest offset "subtype==FS_SWAP" gets 'b' the rest is allocated in offset order from this sequence "defghab". This will generally make sense. Added rules to complain if more than one CHUNK_IS_ROOT or more than one FS_SWAP per FreeBSD chunk. Set CHUNK_IS_ROOT on the 'a' partition in Open_Disk. Run Fixup_Names in Open_Disk.
Diffstat (limited to 'lib/libdisk/rules.c')
-rw-r--r--lib/libdisk/rules.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/lib/libdisk/rules.c b/lib/libdisk/rules.c
index ef50415..04bdfd8 100644
--- a/lib/libdisk/rules.c
+++ b/lib/libdisk/rules.c
@@ -6,7 +6,7 @@
* this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
* ----------------------------------------------------------------------------
*
- * $Id: rules.c,v 1.3 1995/04/29 07:21:12 phk Exp $
+ * $Id: rules.c,v 1.4 1995/04/30 06:09:27 phk Exp $
*
*/
@@ -180,19 +180,31 @@ Rule_003(struct disk *d, struct chunk *c, char *msg)
void
Rule_004(struct disk *d, struct chunk *c, char *msg)
{
- int i;
+ int i=0,j=0,k=0;
struct chunk *c1;
if (c->type != freebsd)
return;
- for (i=0, c1=c->part; c1; c1=c1->next) {
+ for (c1=c->part; c1; c1=c1->next) {
if (c1->type != part)
continue;
+ if (c1->subtype == FS_SWAP)
+ j++;
+ if (c1->flags & CHUNK_IS_ROOT)
+ k++;
i++;
}
if (i > 7) {
sprintf(msg+strlen(msg),
- "Max seven 'part' allowed as child of 'freebsd'\n");
+ "Max seven 'part' per 'freebsd' chunk\n");
+ }
+ if (j > 1) {
+ sprintf(msg+strlen(msg),
+ "Max one subtype=FS_SWAP child per 'freebsd' chunk\n");
+ }
+ if (k > 1) {
+ sprintf(msg+strlen(msg),
+ "Max one CHUNK_IS_ROOT child per 'freebsd' chunk\n");
}
}
OpenPOWER on IntegriCloud