blob: 8bacf9f2c7cc971ef25aefb445f550815bb4fdf3 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#! /bin/sh
2
3if test "$#" != "2"; then
4 echo "Usage: sh `basename $0` {dir} {shelfaddress}" 1>&2
ecashin@coraid.comd0988402005-04-18 22:00:20 -07005 echo " n_partitions=16 sh `basename $0` {dir} {shelfaddress}" 1>&2
Linus Torvalds1da177e2005-04-16 15:20:36 -07006 exit 1
7fi
8n_partitions=${n_partitions:-16}
9dir=$1
10shelf=$2
11MAJOR=152
12
13set -e
14
15minor=`echo 10 \* $shelf \* $n_partitions | bc`
16endp=`echo $n_partitions - 1 | bc`
17for slot in `seq 0 9`; do
18 for part in `seq 0 $endp`; do
19 name=e$shelf.$slot
20 test "$part" != "0" && name=${name}p$part
21 rm -f $dir/$name
22 mknod -m 0660 $dir/$name b $MAJOR $minor
23
24 minor=`expr $minor + 1`
25 done
26done