ia64/linux-2.6.18-xen.hg

annotate Documentation/aoe/mkdevs.sh @ 0:831230e53067

Import 2.6.18 from kernel.org tarball.
author Ian Campbell <ian.campbell@xensource.com>
date Wed Apr 11 14:15:44 2007 +0100 (2007-04-11)
parents
children
rev   line source
ian@0 1 #!/bin/sh
ian@0 2
ian@0 3 n_shelves=${n_shelves:-10}
ian@0 4 n_partitions=${n_partitions:-16}
ian@0 5
ian@0 6 if test "$#" != "1"; then
ian@0 7 echo "Usage: sh `basename $0` {dir}" 1>&2
ian@0 8 echo " n_partitions=16 sh `basename $0` {dir}" 1>&2
ian@0 9 exit 1
ian@0 10 fi
ian@0 11 dir=$1
ian@0 12
ian@0 13 MAJOR=152
ian@0 14
ian@0 15 echo "Creating AoE devnode files in $dir ..."
ian@0 16
ian@0 17 set -e
ian@0 18
ian@0 19 mkdir -p $dir
ian@0 20
ian@0 21 # (Status info is in sysfs. See status.sh.)
ian@0 22 # rm -f $dir/stat
ian@0 23 # mknod -m 0400 $dir/stat c $MAJOR 1
ian@0 24 rm -f $dir/err
ian@0 25 mknod -m 0400 $dir/err c $MAJOR 2
ian@0 26 rm -f $dir/discover
ian@0 27 mknod -m 0200 $dir/discover c $MAJOR 3
ian@0 28 rm -f $dir/interfaces
ian@0 29 mknod -m 0200 $dir/interfaces c $MAJOR 4
ian@0 30 rm -f $dir/revalidate
ian@0 31 mknod -m 0200 $dir/revalidate c $MAJOR 5
ian@0 32
ian@0 33 export n_partitions
ian@0 34 mkshelf=`echo $0 | sed 's!mkdevs!mkshelf!'`
ian@0 35 i=0
ian@0 36 while test $i -lt $n_shelves; do
ian@0 37 sh -xc "sh $mkshelf $dir $i"
ian@0 38 i=`expr $i + 1`
ian@0 39 done