From 23c5c40e062a121af315d21533d54641b173364b Mon Sep 17 00:00:00 2001 From: millert Date: Mon, 7 Apr 1997 06:19:48 +0000 Subject: [PATCH] 16 partitions --- etc/etc.alpha/MAKEDEV | 72 +++++++++++++++++++++--------- sys/arch/alpha/alpha/disksubr.c | 16 ++++--- sys/arch/alpha/include/disklabel.h | 9 +++- 3 files changed, 69 insertions(+), 28 deletions(-) diff --git a/etc/etc.alpha/MAKEDEV b/etc/etc.alpha/MAKEDEV index c776dd7cfe4..dd84da0b99e 100644 --- a/etc/etc.alpha/MAKEDEV +++ b/etc/etc.alpha/MAKEDEV @@ -1,5 +1,5 @@ #!/bin/sh - -# $OpenBSD: MAKEDEV,v 1.12 1996/12/14 18:23:49 millert Exp $ +# $OpenBSD: MAKEDEV,v 1.13 1997/04/07 06:19:48 millert Exp $ # $NetBSD: MAKEDEV,v 1.8.4.1 1996/06/18 00:41:56 cgd Exp $ # # Copyright (c) 1990 The Regents of the University of California. @@ -116,33 +116,63 @@ fd) chmod 666 fd/* ;; -cd*|sd*|vnd*|ccd*) +sd*|vnd*|ccd*) umask 2 ; unit=`expr $i : '.*d\(.*\)'` case $i in - cd*) name=cd; blk=3; chr=13;; sd*) name=sd; blk=8; chr=8;; vnd*) name=vnd; blk=9; chr=9;; ccd*) name=ccd; blk=7; chr=27;; esac rm -f $name$unit? r$name$unit? - mknod ${name}${unit}a b $blk `expr $unit '*' 8 + 0` - mknod ${name}${unit}b b $blk `expr $unit '*' 8 + 1` - mknod ${name}${unit}c b $blk `expr $unit '*' 8 + 2` - mknod ${name}${unit}d b $blk `expr $unit '*' 8 + 3` - mknod ${name}${unit}e b $blk `expr $unit '*' 8 + 4` - mknod ${name}${unit}f b $blk `expr $unit '*' 8 + 5` - mknod ${name}${unit}g b $blk `expr $unit '*' 8 + 6` - mknod ${name}${unit}h b $blk `expr $unit '*' 8 + 7` - mknod r${name}${unit}a c $chr `expr $unit '*' 8 + 0` - mknod r${name}${unit}b c $chr `expr $unit '*' 8 + 1` - mknod r${name}${unit}c c $chr `expr $unit '*' 8 + 2` - mknod r${name}${unit}d c $chr `expr $unit '*' 8 + 3` - mknod r${name}${unit}e c $chr `expr $unit '*' 8 + 4` - mknod r${name}${unit}f c $chr `expr $unit '*' 8 + 5` - mknod r${name}${unit}g c $chr `expr $unit '*' 8 + 6` - mknod r${name}${unit}h c $chr `expr $unit '*' 8 + 7` - chown root.operator ${name}${unit}[a-h] r${name}${unit}[a-h] - chmod 640 ${name}${unit}[a-h] r${name}${unit}[a-h] + mknod ${name}${unit}a b $blk `expr $unit '*' 16 + 0` + mknod ${name}${unit}b b $blk `expr $unit '*' 16 + 1` + mknod ${name}${unit}c b $blk `expr $unit '*' 16 + 2` + mknod ${name}${unit}d b $blk `expr $unit '*' 16 + 3` + mknod ${name}${unit}e b $blk `expr $unit '*' 16 + 4` + mknod ${name}${unit}f b $blk `expr $unit '*' 16 + 5` + mknod ${name}${unit}g b $blk `expr $unit '*' 16 + 6` + mknod ${name}${unit}h b $blk `expr $unit '*' 16 + 7` + mknod ${name}${unit}i b $blk `expr $unit '*' 16 + 8` + mknod ${name}${unit}j b $blk `expr $unit '*' 16 + 9` + mknod ${name}${unit}k b $blk `expr $unit '*' 16 + 10` + mknod ${name}${unit}l b $blk `expr $unit '*' 16 + 11` + mknod ${name}${unit}m b $blk `expr $unit '*' 16 + 12` + mknod ${name}${unit}n b $blk `expr $unit '*' 16 + 13` + mknod ${name}${unit}o b $blk `expr $unit '*' 16 + 14` + mknod ${name}${unit}p b $blk `expr $unit '*' 16 + 15` + mknod r${name}${unit}a c $chr `expr $unit '*' 16 + 0` + mknod r${name}${unit}b c $chr `expr $unit '*' 16 + 1` + mknod r${name}${unit}c c $chr `expr $unit '*' 16 + 2` + mknod r${name}${unit}d c $chr `expr $unit '*' 16 + 3` + mknod r${name}${unit}e c $chr `expr $unit '*' 16 + 4` + mknod r${name}${unit}f c $chr `expr $unit '*' 16 + 5` + mknod r${name}${unit}g c $chr `expr $unit '*' 16 + 6` + mknod r${name}${unit}h c $chr `expr $unit '*' 16 + 7` + mknod r${name}${unit}i c $chr `expr $unit '*' 16 + 8` + mknod r${name}${unit}j c $chr `expr $unit '*' 16 + 9` + mknod r${name}${unit}k c $chr `expr $unit '*' 16 + 10` + mknod r${name}${unit}l c $chr `expr $unit '*' 16 + 11` + mknod r${name}${unit}m c $chr `expr $unit '*' 16 + 12` + mknod r${name}${unit}n c $chr `expr $unit '*' 16 + 13` + mknod r${name}${unit}o c $chr `expr $unit '*' 16 + 14` + mknod r${name}${unit}p c $chr `expr $unit '*' 16 + 15` + chown root.operator ${name}${unit}[a-p] r${name}${unit}[a-p] + chmod 640 ${name}${unit}[a-p] r${name}${unit}[a-p] + umask 77 + ;; + +cd*) + umask 2 ; unit=`expr $i : '.*cd\(.*\)'` + case $i in + cd*) name=cd; blk=3; chr=13;; + esac + rm -f $name$unit? r$name$unit? + mknod ${name}${unit}a b $blk `expr $unit '*' 16 + 0` + mknod ${name}${unit}c b $blk `expr $unit '*' 16 + 2` + mknod r${name}${unit}a c $chr `expr $unit '*' 16 + 0` + mknod r${name}${unit}c c $chr `expr $unit '*' 16 + 2` + chown root.operator ${name}${unit}[a-p] r${name}${unit}[a-p] + chmod 640 ${name}${unit}[a-p] r${name}${unit}[a-p] umask 77 ;; diff --git a/sys/arch/alpha/alpha/disksubr.c b/sys/arch/alpha/alpha/disksubr.c index 43a2e32e3bb..823538c037a 100644 --- a/sys/arch/alpha/alpha/disksubr.c +++ b/sys/arch/alpha/alpha/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.7 1997/04/06 06:03:44 deraadt Exp $ */ +/* $OpenBSD: disksubr.c,v 1.8 1997/04/07 06:21:39 millert Exp $ */ /* $NetBSD: disksubr.c,v 1.9 1996/11/13 21:13:05 cgd Exp $ */ /* @@ -170,9 +170,9 @@ setdisklabel(olp, nlp, openmask, clp) if (npp->p_offset != opp->p_offset || npp->p_size < opp->p_size) return (EBUSY); /* - * Copy internally-set partition information - * if new label doesn't include it. XXX - */ + * Copy internally-set partition information + * if new label doesn't include it. XXX + */ if (npp->p_fstype == FS_UNUSED && opp->p_fstype != FS_UNUSED) { npp->p_fstype = opp->p_fstype; npp->p_fsize = opp->p_fsize; @@ -200,10 +200,16 @@ writedisklabel(dev, strat, lp, clp) { struct buf *bp; struct disklabel *dlp; + int labelpart; int error = 0; + labelpart = DISKPART(dev); + if (lp->d_partitions[labelpart].p_offset != 0) { + if (lp->d_partitions[0].p_offset != 0) + return (EXDEV); /* not quite right */ + } bp = geteblk((int)lp->d_secsize); - bp->b_dev = dev; + bp->b_dev = MAKEDISKDEV(major(dev), DISKUNIT(dev), labelpart); bp->b_blkno = LABELSECTOR; bp->b_resid = 0; /* was b_cylin */ bp->b_bcount = lp->d_secsize; diff --git a/sys/arch/alpha/include/disklabel.h b/sys/arch/alpha/include/disklabel.h index 0bdfb430483..c15f1e71dee 100644 --- a/sys/arch/alpha/include/disklabel.h +++ b/sys/arch/alpha/include/disklabel.h @@ -1,4 +1,4 @@ -/* $OpenBSD: disklabel.h,v 1.3 1996/10/30 22:38:59 niklas Exp $ */ +/* $OpenBSD: disklabel.h,v 1.4 1997/04/07 06:21:37 millert Exp $ */ /* $NetBSD: disklabel.h,v 1.1 1995/02/13 23:07:34 cgd Exp $ */ /* @@ -36,7 +36,7 @@ #define LABELSECTOR 0 /* sector containing label */ #define LABELOFFSET 64 /* offset of label in sector */ -#define MAXPARTITIONS 8 /* number of partitions */ +#define MAXPARTITIONS 16 /* number of partitions */ #define RAW_PART 2 /* raw partition: xx?c */ /* Just a dummy */ @@ -44,4 +44,9 @@ struct cpu_disklabel { int cd_dummy; /* must have one element. */ }; +#ifdef _KERNEL +struct disklabel; +int bounds_check_with_label __P((struct buf *, struct disklabel *, int)); +#endif + #endif /* _MACHINE_DISKLABEL_H_ */ -- 2.20.1