#!/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.
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
;;
-/* $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 $ */
/*
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;
{
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;