mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-14 22:32:30 +01:00
Add support for sliced disk devices ssd*, svn*, swd*. The `s' at the start
of these names is so that they can be distinguished in MAKEDEV until the non-sliced devices go away.
This commit is contained in:
parent
d71494d323
commit
6216a129da
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=5123
67
etc/MAKEDEV
67
etc/MAKEDEV
@ -70,12 +70,29 @@
|
||||
# socksys iBCS2 socket system driver
|
||||
# vat VAT compatibility audio driver (requires snd*)
|
||||
#
|
||||
# $Id: MAKEDEV,v 1.58 1994/12/06 23:06:10 ache Exp $
|
||||
# $Id: MAKEDEV,v 1.59 1994/12/08 00:44:55 ache Exp $
|
||||
#
|
||||
|
||||
PATH=/sbin:/bin/:/usr/bin:/usr/sbin:
|
||||
umask 77
|
||||
|
||||
# Convert integer to partition number
|
||||
dkitop() {
|
||||
local p
|
||||
|
||||
case $1 in
|
||||
0) p=a;; 1) p=b;; 2) p=c;; 3) p=d;; 4) p=e;; 5) p=f;; 6) p=g;; 7) p=h;;
|
||||
default) p="?";;
|
||||
esac
|
||||
echo $p
|
||||
}
|
||||
|
||||
# Convert disk (type, unit, slice, partition) to minor number
|
||||
dkminor()
|
||||
{
|
||||
echo $((32 * 65536 * $1 + 8 * $2 + 65536 * $3 + $4))
|
||||
}
|
||||
|
||||
# Convert the last character of a tty name to a minor number.
|
||||
ttyminor()
|
||||
{
|
||||
@ -90,6 +107,12 @@ ttyminor()
|
||||
echo $m
|
||||
}
|
||||
|
||||
# Raw partition for disks
|
||||
dkrawpart=2
|
||||
|
||||
# Raw slice for disks
|
||||
dkrawslice=0
|
||||
|
||||
for i
|
||||
do
|
||||
case $i in
|
||||
@ -314,6 +337,48 @@ sd*|vn*|wd*)
|
||||
umask 77
|
||||
;;
|
||||
|
||||
# Sliced disks.
|
||||
ssd*|svn*|swd*)
|
||||
umask 37
|
||||
case $i in
|
||||
ssd*) name=sd; blk=4; chr=13;;
|
||||
swd*) name=wd; blk=0; chr=3;;
|
||||
svn*) name=vn; blk=15; chr=43;;
|
||||
esac
|
||||
unit=`expr $i : '...\(.*\)'`
|
||||
rm -f $name$unit* r$name$unit*
|
||||
case $unit in
|
||||
0|1|2|3|4|5|6)
|
||||
# Whole disk is on (non-)slice 0, (non-)partition C.
|
||||
minor=`dkminor 0 $unit $dkrawslice $dkrawpart`
|
||||
mknod ${name}${unit} b $blk $minor
|
||||
mknod r${name}${unit} c $chr $minor
|
||||
for slice in 1 2 3 4
|
||||
do
|
||||
for part in 0 1 2 3 4 5 6 7
|
||||
do
|
||||
minor=`dkminor 0 $unit $slice $part`
|
||||
partname=`dkitop $part`
|
||||
mknod ${name}${unit}s${slice}${partname} \
|
||||
b $blk $minor
|
||||
mknod r${name}${unit}s${slice}${partname} \
|
||||
c $chr $minor
|
||||
done
|
||||
partname=`dkitop $dkrawpart`
|
||||
ln ${name}${unit}s${slice}${partname} \
|
||||
${name}${unit}s${slice}
|
||||
ln r${name}${unit}s${slice}${partname} \
|
||||
r${name}${unit}s${slice}
|
||||
done
|
||||
chgrp operator ${name}${unit}* r${name}${unit}*
|
||||
;;
|
||||
*)
|
||||
echo bad unit for disk in: $i
|
||||
;;
|
||||
esac
|
||||
umask 77
|
||||
;;
|
||||
|
||||
uk*)
|
||||
unit=`expr $i : 'uk\(.*\)'`
|
||||
rm -f uk$unit
|
||||
|
@ -70,12 +70,29 @@
|
||||
# socksys iBCS2 socket system driver
|
||||
# vat VAT compatibility audio driver (requires snd*)
|
||||
#
|
||||
# $Id: MAKEDEV,v 1.58 1994/12/06 23:06:10 ache Exp $
|
||||
# $Id: MAKEDEV,v 1.59 1994/12/08 00:44:55 ache Exp $
|
||||
#
|
||||
|
||||
PATH=/sbin:/bin/:/usr/bin:/usr/sbin:
|
||||
umask 77
|
||||
|
||||
# Convert integer to partition number
|
||||
dkitop() {
|
||||
local p
|
||||
|
||||
case $1 in
|
||||
0) p=a;; 1) p=b;; 2) p=c;; 3) p=d;; 4) p=e;; 5) p=f;; 6) p=g;; 7) p=h;;
|
||||
default) p="?";;
|
||||
esac
|
||||
echo $p
|
||||
}
|
||||
|
||||
# Convert disk (type, unit, slice, partition) to minor number
|
||||
dkminor()
|
||||
{
|
||||
echo $((32 * 65536 * $1 + 8 * $2 + 65536 * $3 + $4))
|
||||
}
|
||||
|
||||
# Convert the last character of a tty name to a minor number.
|
||||
ttyminor()
|
||||
{
|
||||
@ -90,6 +107,12 @@ ttyminor()
|
||||
echo $m
|
||||
}
|
||||
|
||||
# Raw partition for disks
|
||||
dkrawpart=2
|
||||
|
||||
# Raw slice for disks
|
||||
dkrawslice=0
|
||||
|
||||
for i
|
||||
do
|
||||
case $i in
|
||||
@ -314,6 +337,48 @@ sd*|vn*|wd*)
|
||||
umask 77
|
||||
;;
|
||||
|
||||
# Sliced disks.
|
||||
ssd*|svn*|swd*)
|
||||
umask 37
|
||||
case $i in
|
||||
ssd*) name=sd; blk=4; chr=13;;
|
||||
swd*) name=wd; blk=0; chr=3;;
|
||||
svn*) name=vn; blk=15; chr=43;;
|
||||
esac
|
||||
unit=`expr $i : '...\(.*\)'`
|
||||
rm -f $name$unit* r$name$unit*
|
||||
case $unit in
|
||||
0|1|2|3|4|5|6)
|
||||
# Whole disk is on (non-)slice 0, (non-)partition C.
|
||||
minor=`dkminor 0 $unit $dkrawslice $dkrawpart`
|
||||
mknod ${name}${unit} b $blk $minor
|
||||
mknod r${name}${unit} c $chr $minor
|
||||
for slice in 1 2 3 4
|
||||
do
|
||||
for part in 0 1 2 3 4 5 6 7
|
||||
do
|
||||
minor=`dkminor 0 $unit $slice $part`
|
||||
partname=`dkitop $part`
|
||||
mknod ${name}${unit}s${slice}${partname} \
|
||||
b $blk $minor
|
||||
mknod r${name}${unit}s${slice}${partname} \
|
||||
c $chr $minor
|
||||
done
|
||||
partname=`dkitop $dkrawpart`
|
||||
ln ${name}${unit}s${slice}${partname} \
|
||||
${name}${unit}s${slice}
|
||||
ln r${name}${unit}s${slice}${partname} \
|
||||
r${name}${unit}s${slice}
|
||||
done
|
||||
chgrp operator ${name}${unit}* r${name}${unit}*
|
||||
;;
|
||||
*)
|
||||
echo bad unit for disk in: $i
|
||||
;;
|
||||
esac
|
||||
umask 77
|
||||
;;
|
||||
|
||||
uk*)
|
||||
unit=`expr $i : 'uk\(.*\)'`
|
||||
rm -f uk$unit
|
||||
|
Loading…
Reference in New Issue
Block a user