- Kai Germaschewski: ymfpci cleanups and resource leak fixes
[davej-history.git] / Documentation / mkdev.ida
blobd2764899d6013e33fffdb4f365da270586dff70e
1 #!/bin/sh
2 # Script to create device nodes for SMART array controllers
3 # Usage:
4 # mkdev.ida [num controllers] [num log volumes] [num partitions]
6 # With no arguments, the script assumes 1 controller, 16 logical volumes,
7 # and 16 partitions/volume, which is adequate for most configurations.
9 # If you had 5 controllers and were planning on no more than 4 logical volumes
10 # each, using a maximum of 8 partitions per volume, you could say:
12 # mkdev.ida 5 4 8
14 # Of course, this has no real benefit over "mkdev.ida 5" except that it
15 # doesn't create so many device nodes in /dev/ida.
17 NR_CTLR=${1-1}
18 NR_VOL=${2-16}
19 NR_PART=${3-16}
21 if [ ! -d /dev/ida ]; then
22 mkdir -p /dev/ida
25 C=0; while [ $C -lt $NR_CTLR ]; do
26 MAJ=`expr $C + 72`
27 D=0; while [ $D -lt $NR_VOL ]; do
28 P=0; while [ $P -lt $NR_PART ]; do
29 MIN=`expr $D \* 16 + $P`
30 if [ $P -eq 0 ]; then
31 mknod /dev/ida/c${C}d${D} b $MAJ $MIN
32 else
33 mknod /dev/ida/c${C}d${D}p${P} b $MAJ $MIN
35 P=`expr $P + 1`
36 done
37 D=`expr $D + 1`
38 done
39 C=`expr $C + 1`
40 done