| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 | #!/bin/sh# aoe-mkdevs - make static device nodes on systems without udev# Copyright 2009, CORAID, Inc., and licensed under GPL v.2.n_shelves=${n_shelves:-10}n_partitions=${n_partitions:-16}if test "$#" != "1"; then	echo "Usage: `basename $0` {dir}" 1>&2	echo "       n_partitions=16 `basename $0` {dir}" 1>&2	exit 1fidir=$1zero="`basename $0`"MAJOR=152dyn=/sys/module/aoe/parameters/aoe_dyndevsif test -r "$dyn" && test "`cat $dyn`" = 1; then	cat 1>&2 <<EOF$zero Error: aoe module is using dynamic devices.$zero: Please see the aoe-mkdevs manpage.$zero: Exiting.EOF	exit 1fiif test "`ps axwwww | grep 'udev[d]'`" || test -d "/dev/.udev"; then	cat 1>&2 <<EOF$zero Error: udev detected.  You shouldn't need to use $zero.$zero: Please see the aoe-mkdevs manpage.$zero: Exiting.EOF	exit 1fiset -emkdir -p $dir# (Status info is in sysfs.  See status.sh.)# rm -f $dir/stat# mknod -m 0400 $dir/stat c $MAJOR 1rm -f $dir/errmknod -m 0400 $dir/err c $MAJOR 2rm -f $dir/discovermknod -m 0200 $dir/discover c $MAJOR 3rm -f $dir/interfacesmknod -m 0200 $dir/interfaces c $MAJOR 4rm -f $dir/revalidatemknod -m 0200 $dir/revalidate c $MAJOR 5rm -f $dir/flushmknod -m 0200 $dir/flush c $MAJOR 6# pass along the env var to aoe-mkshelfexport n_partitionsmkshelf=`echo $0 | sed 's!mkdevs!mkshelf!'`i=0while test $i -lt $n_shelves; do	sh $mkshelf $dir $i	i=`expr $i + 1`done
 |