aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/aoe
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-22 10:38:37 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-22 10:38:37 -0500
commitfcc9d2e5a6c89d22b8b773a64fb4ad21ac318446 (patch)
treea57612d1888735a2ec7972891b68c1ac5ec8faea /Documentation/aoe
parent8dea78da5cee153b8af9c07a2745f6c55057fe12 (diff)
Added missing tegra files.HEADmaster
Diffstat (limited to 'Documentation/aoe')
-rw-r--r--Documentation/aoe/mkdevs.sh41
-rw-r--r--Documentation/aoe/mkshelf.sh28
2 files changed, 69 insertions, 0 deletions
diff --git a/Documentation/aoe/mkdevs.sh b/Documentation/aoe/mkdevs.sh
new file mode 100644
index 00000000000..44c0ab70243
--- /dev/null
+++ b/Documentation/aoe/mkdevs.sh
@@ -0,0 +1,41 @@
1#!/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
8 echo " n_partitions=16 sh `basename $0` {dir}" 1>&2
9 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
30rm -f $dir/revalidate
31mknod -m 0200 $dir/revalidate c $MAJOR 5
32rm -f $dir/flush
33mknod -m 0200 $dir/flush c $MAJOR 6
34
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
diff --git a/Documentation/aoe/mkshelf.sh b/Documentation/aoe/mkshelf.sh
new file mode 100644
index 00000000000..32615814271
--- /dev/null
+++ b/Documentation/aoe/mkshelf.sh
@@ -0,0 +1,28 @@
1#! /bin/sh
2
3if test "$#" != "2"; then
4 echo "Usage: sh `basename $0` {dir} {shelfaddress}" 1>&2
5 echo " n_partitions=16 sh `basename $0` {dir} {shelfaddress}" 1>&2
6 exit 1
7fi
8n_partitions=${n_partitions:-16}
9dir=$1
10shelf=$2
11nslots=16
12maxslot=`echo $nslots 1 - p | dc`
13MAJOR=152
14
15set -e
16
17minor=`echo $nslots \* $shelf \* $n_partitions | bc`
18endp=`echo $n_partitions - 1 | bc`
19for slot in `seq 0 $maxslot`; do
20 for part in `seq 0 $endp`; do
21 name=e$shelf.$slot
22 test "$part" != "0" && name=${name}p$part
23 rm -f $dir/$name
24 mknod -m 0660 $dir/$name b $MAJOR $minor
25
26 minor=`expr $minor + 1`
27 done
28done