blob: 44c0ab7024328d4229ef7609c2ae34aa4e730a1f [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#!/bin/sh
2
3n_shelves=${n_shelves:-10}
4n_partitions=${n_partitions:-16}
5
6if test "$#" != "1"; then
7 echo "Usage: sh `basename $0` {dir}" 1>&2
ecashin@coraid.comd0988402005-04-18 22:00:20 -07008 echo " n_partitions=16 sh `basename $0` {dir}" 1>&2
Linus Torvalds1da177e2005-04-16 15:20:36 -07009 exit 1
10fi
11dir=$1
12
13MAJOR=152
14
15echo "Creating AoE devnode files in $dir ..."
16
17set -e
18
19mkdir -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
24rm -f $dir/err
25mknod -m 0400 $dir/err c $MAJOR 2
26rm -f $dir/discover
27mknod -m 0200 $dir/discover c $MAJOR 3
28rm -f $dir/interfaces
29mknod -m 0200 $dir/interfaces c $MAJOR 4
Ed L. Cashin3ae1c242006-01-19 13:46:19 -050030rm -f $dir/revalidate
31mknod -m 0200 $dir/revalidate c $MAJOR 5
Ed L. Cashin262bf542008-02-08 04:20:03 -080032rm -f $dir/flush
33mknod -m 0200 $dir/flush c $MAJOR 6
Linus Torvalds1da177e2005-04-16 15:20:36 -070034
35export n_partitions
36mkshelf=`echo $0 | sed 's!mkdevs!mkshelf!'`
37i=0
38while test $i -lt $n_shelves; do
39 sh -xc "sh $mkshelf $dir $i"
40 i=`expr $i + 1`
41done