Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | n_shelves=${n_shelves:-10} |
| 4 | n_partitions=${n_partitions:-16} |
| 5 | |
| 6 | if test "$#" != "1"; then |
| 7 | echo "Usage: sh `basename $0` {dir}" 1>&2 |
ecashin@coraid.com | d098840 | 2005-04-18 22:00:20 -0700 | [diff] [blame] | 8 | echo " n_partitions=16 sh `basename $0` {dir}" 1>&2 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | exit 1 |
| 10 | fi |
| 11 | dir=$1 |
| 12 | |
| 13 | MAJOR=152 |
| 14 | |
| 15 | echo "Creating AoE devnode files in $dir ..." |
| 16 | |
| 17 | set -e |
| 18 | |
| 19 | mkdir -p $dir |
| 20 | |
| 21 | # (Status info is in sysfs. See status.sh.) |
| 22 | # rm -f $dir/stat |
| 23 | # mknod -m 0400 $dir/stat c $MAJOR 1 |
| 24 | rm -f $dir/err |
| 25 | mknod -m 0400 $dir/err c $MAJOR 2 |
| 26 | rm -f $dir/discover |
| 27 | mknod -m 0200 $dir/discover c $MAJOR 3 |
| 28 | rm -f $dir/interfaces |
| 29 | mknod -m 0200 $dir/interfaces c $MAJOR 4 |
Ed L. Cashin | 3ae1c24 | 2006-01-19 13:46:19 -0500 | [diff] [blame] | 30 | rm -f $dir/revalidate |
| 31 | mknod -m 0200 $dir/revalidate c $MAJOR 5 |
Ed L. Cashin | 262bf54 | 2008-02-08 04:20:03 -0800 | [diff] [blame^] | 32 | rm -f $dir/flush |
| 33 | mknod -m 0200 $dir/flush c $MAJOR 6 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | |
| 35 | export n_partitions |
| 36 | mkshelf=`echo $0 | sed 's!mkdevs!mkshelf!'` |
| 37 | i=0 |
| 38 | while test $i -lt $n_shelves; do |
| 39 | sh -xc "sh $mkshelf $dir $i" |
| 40 | i=`expr $i + 1` |
| 41 | done |