OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [Documentation/] [mkdev.ida] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1275 phoenix
#!/bin/sh
2
# Script to create device nodes for SMART array controllers
3
# Usage:
4
#       mkdev.ida [num controllers] [num log volumes] [num partitions]
5
#
6
# With no arguments, the script assumes 1 controller, 16 logical volumes,
7
# and 16 partitions/volume, which is adequate for most configurations.
8
#
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:
11
#
12
# mkdev.ida 5 4 8
13
#
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.
16
 
17
NR_CTLR=${1-1}
18
NR_VOL=${2-16}
19
NR_PART=${3-16}
20
 
21
if [ ! -d /dev/ida ]; then
22
        mkdir -p /dev/ida
23
fi
24
 
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
34
                        fi
35
                        P=`expr $P + 1`
36
                done
37
                D=`expr $D + 1`
38
        done
39
        C=`expr $C + 1`
40
done

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.