summaryrefslogtreecommitdiff
path: root/Documentation/aoe/mkdevs.sh
blob: 6ce70703eb47f6d9242a0b91b9dc1029c76ecca3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh

n_shelves=${n_shelves:-10}
n_partitions=${n_partitions:-16}

if test "$#" != "1"; then
	echo "Usage: sh `basename $0` {dir}" 1>&2
	exit 1
fi
dir=$1

MAJOR=152

echo "Creating AoE devnode files in $dir ..."

set -e

mkdir -p $dir

# (Status info is in sysfs.  See status.sh.)
# rm -f $dir/stat
# mknod -m 0400 $dir/stat c $MAJOR 1
rm -f $dir/err
mknod -m 0400 $dir/err c $MAJOR 2
rm -f $dir/discover
mknod -m 0200 $dir/discover c $MAJOR 3
rm -f $dir/interfaces
mknod -m 0200 $dir/interfaces c $MAJOR 4

export n_partitions
mkshelf=`echo $0 | sed 's!mkdevs!mkshelf!'`
i=0
while test $i -lt $n_shelves; do
	sh -xc "sh $mkshelf $dir $i"
	i=`expr $i + 1`
done