The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/Documentation/mkdev.ida

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    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]
    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

Cache object: 4d8da38361186ab796bdcd188eff7b4e


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.